From 65b3f5a8a004fe3d9156de7f036f76baf57b1ff3 Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Thu, 4 Apr 2024 10:36:11 -0700 Subject: [PATCH] phasicFlow core changes for boundary condition addition. - Exit boundry condition, checked. - periodic boundary condition added, checked. to be done: - messaging events - reflective - wall-particle interaction for periodic bc. --- src/phasicFlow/CMakeLists.txt | 14 ++--- src/phasicFlow/Kokkos/KokkosTypes.hpp | 13 +++++ src/phasicFlow/Timer/Timer.hpp | 38 ++++++++++---- src/phasicFlow/containers/Field/Fields.cpp | 6 +-- src/phasicFlow/containers/Field/Fields.hpp | 23 -------- .../containers/VectorHD/VectorSingles.cpp | 3 -- .../{ => boundaryField}/boundaryField.cpp | 0 .../{ => boundaryField}/boundaryField.hpp | 19 +++++++ .../{ => boundaryField}/boundaryFieldList.hpp | 2 +- .../boundaryField/createBoundaryFields.hpp | 2 +- .../exitBoundaryField.cpp | 0 .../exitBoundaryField.hpp | 0 .../boundaryField/generalBoundary.cpp | 21 -------- .../generalBoundary/generalBoundary.cpp | 41 +++++++++++++++ .../{ => generalBoundary}/generalBoundary.hpp | 16 +++++- .../periodicBoundaryField.cpp | 1 - .../periodicBoundaryField.hpp | 2 +- .../{ => internalField}/internalField.cpp | 1 - .../{ => internalField}/internalField.hpp | 2 +- .../internalFieldAlgorithms.hpp | 1 - .../{ => pointField}/pointField copy.hpp | 0 .../{ => pointField}/pointField.cpp | 1 - .../{ => pointField}/pointField.hpp | 11 +++- .../{ => pointField}/pointFieldAlgorithms.hpp | 1 - .../{ => pointField}/pointField_old.hpp | 0 .../{ => pointField}/pointFields.cpp | 24 +++------ .../{ => pointField}/pointFields.hpp | 8 --- .../triSurfaceField/triSurfaceFields.cpp | 11 +--- .../boundaries/boundaryBase/boundaryBase.cpp | 4 +- .../boundaries/boundaryBase/boundaryBase.hpp | 7 ++- .../boundaryBase/scatteredFieldAccess.hpp | 44 ++++++++++++++-- .../boundaries/boundaryList.cpp | 52 +++++++++++++------ .../boundaries/boundaryList.hpp | 19 ++++++- .../boundaryPeriodic/boundaryPeriodic.cpp | 17 +++--- .../boundaryPeriodic/boundaryPeriodic.hpp | 5 +- src/phasicFlow/structuredData/box/box.hpp | 19 +++++-- .../structuredData/domain/domain.hpp | 50 ++++++++++++------ .../domain/regularSimulationDomain.cpp | 20 +++++++ .../domain/regularSimulationDomain.hpp | 19 +++++++ .../domain/simulationDomain.cpp | 4 +- src/phasicFlow/structuredData/plane/plane.hpp | 2 +- .../{ => internalPoints}/internalPoints.cpp | 0 .../{ => internalPoints}/internalPoints.hpp | 0 .../internalPointsKernels.cpp | 0 .../internalPointsKernels.hpp | 0 .../{ => internalPoints}/pointFlag.hpp | 0 .../{ => internalPoints}/pointFlagKernels.hpp | 0 .../{ => pointStructure}/mortonIndexing.cpp | 0 .../{ => pointStructure}/mortonIndexing.hpp | 0 .../{ => pointStructure}/pStcutold.txt | 0 .../{ => pointStructure}/pointStructure.cpp | 0 .../{ => pointStructure}/pointStructure.hpp | 0 .../pointStructureKernels.hpp | 0 src/phasicFlow/triSurface/subSurface.hpp | 5 ++ src/phasicFlow/triSurface/triSurface.hpp | 8 +-- src/phasicFlow/typeSelection/typeInfo.hpp | 7 +++ 56 files changed, 360 insertions(+), 183 deletions(-) rename src/phasicFlow/containers/pointField/boundaryField/{ => boundaryField}/boundaryField.cpp (100%) rename src/phasicFlow/containers/pointField/boundaryField/{ => boundaryField}/boundaryField.hpp (86%) rename src/phasicFlow/containers/pointField/{ => boundaryField}/boundaryFieldList.hpp (100%) rename src/phasicFlow/containers/pointField/boundaryField/{ => exitBoundaryField}/exitBoundaryField.cpp (100%) rename src/phasicFlow/containers/pointField/boundaryField/{ => exitBoundaryField}/exitBoundaryField.hpp (100%) delete mode 100644 src/phasicFlow/containers/pointField/boundaryField/generalBoundary.cpp create mode 100644 src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.cpp rename src/phasicFlow/containers/pointField/boundaryField/{ => generalBoundary}/generalBoundary.hpp (92%) rename src/phasicFlow/containers/pointField/boundaryField/{ => periodicBoundaryField}/periodicBoundaryField.cpp (99%) rename src/phasicFlow/containers/pointField/boundaryField/{ => periodicBoundaryField}/periodicBoundaryField.hpp (100%) rename src/phasicFlow/containers/pointField/{ => internalField}/internalField.cpp (99%) rename src/phasicFlow/containers/pointField/{ => internalField}/internalField.hpp (100%) rename src/phasicFlow/containers/pointField/{ => internalField}/internalFieldAlgorithms.hpp (99%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointField copy.hpp (100%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointField.cpp (99%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointField.hpp (96%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointFieldAlgorithms.hpp (99%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointField_old.hpp (100%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointFields.cpp (84%) rename src/phasicFlow/containers/pointField/{ => pointField}/pointFields.hpp (86%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/internalPoints.cpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/internalPoints.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/internalPointsKernels.cpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/internalPointsKernels.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/pointFlag.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => internalPoints}/pointFlagKernels.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/mortonIndexing.cpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/mortonIndexing.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/pStcutold.txt (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/pointStructure.cpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/pointStructure.hpp (100%) rename src/phasicFlow/structuredData/pointStructure/{ => pointStructure}/pointStructureKernels.hpp (100%) diff --git a/src/phasicFlow/CMakeLists.txt b/src/phasicFlow/CMakeLists.txt index eee28785..3efe0d7e 100644 --- a/src/phasicFlow/CMakeLists.txt +++ b/src/phasicFlow/CMakeLists.txt @@ -62,8 +62,8 @@ containers/Field/Fields.cpp containers/symArrayHD/symArrays.cpp containers/List/anyList/anyList.cpp -structuredData/pointStructure/internalPointsKernels.cpp -structuredData/pointStructure/internalPoints.cpp +structuredData/pointStructure/internalPoints/internalPointsKernels.cpp +structuredData/pointStructure/internalPoints/internalPoints.cpp structuredData/zAxis/zAxis.cpp structuredData/box/box.cpp @@ -79,28 +79,24 @@ structuredData/boundaries/boundaryExit/boundaryExit.cpp structuredData/boundaries/boundaryNone/boundaryNone.cpp structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp structuredData/boundaries/boundaryList.cpp -structuredData/pointStructure/pointStructure.cpp +structuredData/pointStructure/pointStructure/pointStructure.cpp structuredData/pointStructure/selectors/pStructSelector/pStructSelector.cpp structuredData/pointStructure/selectors/selectBox/selectBox.cpp structuredData/pointStructure/selectors/selectRange/selectRange.cpp structuredData/pointStructure/selectors/selectRandom/selectRandom.cpp - triSurface/subSurface.cpp triSurface/triSurface.cpp triSurface/multiTriSurface.cpp -containers/pointField/boundaryField/generalBoundary.cpp -containers/pointField/pointFields.cpp +containers/pointField/boundaryField/generalBoundary/generalBoundary.cpp +containers/pointField/pointField/pointFields.cpp containers/triSurfaceField/triSurfaceFields.cpp setFieldList/setFieldList.cpp setFieldList/setFieldEntry.cpp - - - ) set(link_libs) diff --git a/src/phasicFlow/Kokkos/KokkosTypes.hpp b/src/phasicFlow/Kokkos/KokkosTypes.hpp index d58df4cb..6597b5b7 100644 --- a/src/phasicFlow/Kokkos/KokkosTypes.hpp +++ b/src/phasicFlow/Kokkos/KokkosTypes.hpp @@ -77,6 +77,19 @@ using hostRPolicyStatic = Kokkos::Schedule, Kokkos::IndexType >; +using deviceRPolicyDynamic = + Kokkos::RangePolicy< + Kokkos::DefaultExecutionSpace, + Kokkos::Schedule, + Kokkos::IndexType >; + + +using hostRPolicyDynamic = + Kokkos::RangePolicy< + Kokkos::DefaultExecutionSpace, + Kokkos::Schedule, + Kokkos::IndexType >; + /// Pair of two variables template diff --git a/src/phasicFlow/Timer/Timer.hpp b/src/phasicFlow/Timer/Timer.hpp index ac32ba35..54c5d118 100644 --- a/src/phasicFlow/Timer/Timer.hpp +++ b/src/phasicFlow/Timer/Timer.hpp @@ -42,21 +42,25 @@ protected: using timer = std::chrono::high_resolution_clock; - // - name for the timer - word name_ = "noNameTimer"; - - // start time + /// start time timer::time_point start_; - // number of times start() and end() are called + /// number of times start() and end() are called int32 numIteration_ = 0; - // sum of time duratios (in seconds) between all start() and end() calls + /// sum of time duratios (in seconds) between all start() and end() calls real accTime_ = 0.0; - // + /// last time duration real lastTime_ = 0.0; + /// @brief Accumulative duration for multiple steps between start() and end() + real stepAccTime_ = 0.0; + + /// name for the timer + word name_ = "noNameTimer"; + + /// @brief parrent of timer Timers* parrent_ = nullptr; public: @@ -95,16 +99,28 @@ public: } void start() + { + start_ = timer::now(); + stepAccTime_ = 0; + } + + void pause() + { + auto end = timer::now(); + stepAccTime_ += std::chrono::duration_cast + < std::chrono::duration >(end - start_).count(); + } + + void resume() { start_ = timer::now(); } void end() { - auto end = timer::now(); - lastTime_ = std::chrono::duration_cast - < std::chrono::duration >(end - start_).count(); - + pause(); + lastTime_ = stepAccTime_; + numIteration_++; accTime_ += lastTime_; } diff --git a/src/phasicFlow/containers/Field/Fields.cpp b/src/phasicFlow/containers/Field/Fields.cpp index 55337632..b0cbad75 100644 --- a/src/phasicFlow/containers/Field/Fields.cpp +++ b/src/phasicFlow/containers/Field/Fields.cpp @@ -21,14 +21,12 @@ Licence: #include "Fields.hpp" -template class pFlow::Field; - template class pFlow::Field; -template class pFlow::Field; - template class pFlow::Field; +template class pFlow::Field; + template class pFlow::Field; template class pFlow::Field; diff --git a/src/phasicFlow/containers/Field/Fields.hpp b/src/phasicFlow/containers/Field/Fields.hpp index a0b8d192..65d5ac7e 100644 --- a/src/phasicFlow/containers/Field/Fields.hpp +++ b/src/phasicFlow/containers/Field/Fields.hpp @@ -74,29 +74,6 @@ using realx3x3Field_H = Field; using wordField_H = Field; -// host device fields -/*using int8Field_HD = Field; - -using int32Field_HD = Field; - -using int64Field_HD = Field; - -using uint32Field_HD = Field; - -using labelField_HD = Field; - -using realField_HD = Field; - -using realx3Field_HD = Field; - -using uint32x3Field_HD = Field; - -using int32x3Field_HD = Field; - -using int64x3Field_HD = Field; - -using realx3x3Field_HD = Field;*/ - } diff --git a/src/phasicFlow/containers/VectorHD/VectorSingles.cpp b/src/phasicFlow/containers/VectorHD/VectorSingles.cpp index c856b7c1..59a58468 100644 --- a/src/phasicFlow/containers/VectorHD/VectorSingles.cpp +++ b/src/phasicFlow/containers/VectorHD/VectorSingles.cpp @@ -24,9 +24,6 @@ Licence: template class Kokkos::View; template class pFlow::VectorSingle; -template class Kokkos::View; -template class pFlow::VectorSingle; - template class Kokkos::View; template class pFlow::VectorSingle; diff --git a/src/phasicFlow/containers/pointField/boundaryField/boundaryField.cpp b/src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.cpp similarity index 100% rename from src/phasicFlow/containers/pointField/boundaryField/boundaryField.cpp rename to src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.cpp diff --git a/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp b/src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.hpp similarity index 86% rename from src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp rename to src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.hpp index 8294d96a..7e1935a5 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/boundaryField/boundaryField.hpp @@ -41,6 +41,8 @@ public: using execution_space = typename InternalFieldType::execution_space; + using FieldAccessType = scatteredFieldAccess; + protected: /// @brief a ref to the internal field @@ -98,6 +100,23 @@ public: return true; } + + FieldAccessType thisField()const + { + return FieldAccessType( + this->size(), + this->indexList().deviceViewAll(), + internal_.deviceViewAll()); + } + + FieldAccessType mirrorField()const + { + return FieldAccessType( + this->mirrorBoundary().size(), + this->mirrorBoundary().indexList().deviceViewAll(), + internal_.deviceViewAll()); + } + void fill(const std::any& val)override { return; diff --git a/src/phasicFlow/containers/pointField/boundaryFieldList.hpp b/src/phasicFlow/containers/pointField/boundaryField/boundaryFieldList.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/boundaryFieldList.hpp rename to src/phasicFlow/containers/pointField/boundaryField/boundaryFieldList.hpp index 61a396da..e4179bc2 100644 --- a/src/phasicFlow/containers/pointField/boundaryFieldList.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/boundaryFieldList.hpp @@ -15,8 +15,8 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ + #ifndef __boundaryFieldList_hpp__ #define __boundaryFieldList_hpp__ diff --git a/src/phasicFlow/containers/pointField/boundaryField/createBoundaryFields.hpp b/src/phasicFlow/containers/pointField/boundaryField/createBoundaryFields.hpp index 3403149d..8167a6ef 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/createBoundaryFields.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/createBoundaryFields.hpp @@ -15,9 +15,9 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ + #ifndef __createBoundaryFields_hpp__ #define __createBoundaryFields_hpp__ diff --git a/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp b/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField/exitBoundaryField.cpp similarity index 100% rename from src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp rename to src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField/exitBoundaryField.cpp diff --git a/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.hpp b/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField/exitBoundaryField.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.hpp rename to src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField/exitBoundaryField.hpp diff --git a/src/phasicFlow/containers/pointField/boundaryField/generalBoundary.cpp b/src/phasicFlow/containers/pointField/boundaryField/generalBoundary.cpp deleted file mode 100644 index 52a61e87..00000000 --- a/src/phasicFlow/containers/pointField/boundaryField/generalBoundary.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "generalBoundary.hpp" -#include "pointStructure.hpp" - -pFlow::generalBoundary::generalBoundary -( - const boundaryBase& boundary, - const pointStructure& pStruct, - const word& dataType, - const word& option -) -: - observer(&boundary, defaultMessage_), - boundary_(boundary), - pStruct_(pStruct) -{} - - -pFlow::Time const& pFlow::generalBoundary::time() const -{ - return pStruct_.time(); -} \ No newline at end of file diff --git a/src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.cpp b/src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.cpp new file mode 100644 index 00000000..3e2f0141 --- /dev/null +++ b/src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.cpp @@ -0,0 +1,41 @@ +/*------------------------------- phasicFlow --------------------------------- + O C enter of + O O E ngineering and + O O M ultiscale modeling of + OOOOOOO F luid flow +------------------------------------------------------------------------------ + Copyright (C): www.cemf.ir + email: hamid.r.norouzi AT gmail.com +------------------------------------------------------------------------------ +Licence: + This file is part of phasicFlow code. It is a free software for simulating + granular and multiphase flows. You can redistribute it and/or modify it under + the terms of GNU General Public License v3 or any other later versions. + + phasicFlow is distributed to help others in their research in the field of + granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +-----------------------------------------------------------------------------*/ + +#include "generalBoundary.hpp" +#include "pointStructure.hpp" + +pFlow::generalBoundary::generalBoundary +( + const boundaryBase& boundary, + const pointStructure& pStruct, + const word& dataType, + const word& option +) +: + observer(&boundary, defaultMessage_), + boundary_(boundary), + pStruct_(pStruct) +{} + + +pFlow::Time const& pFlow::generalBoundary::time() const +{ + return pStruct_.time(); +} \ No newline at end of file diff --git a/src/phasicFlow/containers/pointField/boundaryField/generalBoundary.hpp b/src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.hpp similarity index 92% rename from src/phasicFlow/containers/pointField/boundaryField/generalBoundary.hpp rename to src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.hpp index 380f95b3..18105542 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/generalBoundary.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/generalBoundary/generalBoundary.hpp @@ -99,6 +99,18 @@ public: return boundary_; } + inline + const auto& indexList()const + { + return boundary_.indexList(); + } + + inline + const auto& mirrorBoundary()const + { + return boundary_.mirrorBoundary(); + } + inline const word& name()const { @@ -122,7 +134,7 @@ public: virtual void fill(const std::any& val)=0; - template + /*template BoundaryFieldType& thisField() { return static_cast(*this); @@ -132,7 +144,7 @@ public: const BoundaryFieldType& thisField()const { return static_cast(*this); - } + }*/ }; diff --git a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.cpp similarity index 99% rename from src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp rename to src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.cpp index f850ce06..28177b23 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp +++ b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.cpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ template diff --git a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp rename to src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.hpp index 90a7f70d..712a5a07 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField/periodicBoundaryField.hpp @@ -15,8 +15,8 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ + #ifndef __periodicBoundaryField_hpp__ #define __periodicBoundaryField_hpp__ diff --git a/src/phasicFlow/containers/pointField/internalField.cpp b/src/phasicFlow/containers/pointField/internalField/internalField.cpp similarity index 99% rename from src/phasicFlow/containers/pointField/internalField.cpp rename to src/phasicFlow/containers/pointField/internalField/internalField.cpp index 99bd7860..df0f0756 100644 --- a/src/phasicFlow/containers/pointField/internalField.cpp +++ b/src/phasicFlow/containers/pointField/internalField/internalField.cpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ template diff --git a/src/phasicFlow/containers/pointField/internalField.hpp b/src/phasicFlow/containers/pointField/internalField/internalField.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/internalField.hpp rename to src/phasicFlow/containers/pointField/internalField/internalField.hpp index 92ba1bf6..07ad006a 100644 --- a/src/phasicFlow/containers/pointField/internalField.hpp +++ b/src/phasicFlow/containers/pointField/internalField/internalField.hpp @@ -15,8 +15,8 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ + #ifndef __internalField_hpp__ #define __internalField_hpp__ diff --git a/src/phasicFlow/containers/pointField/internalFieldAlgorithms.hpp b/src/phasicFlow/containers/pointField/internalField/internalFieldAlgorithms.hpp similarity index 99% rename from src/phasicFlow/containers/pointField/internalFieldAlgorithms.hpp rename to src/phasicFlow/containers/pointField/internalField/internalFieldAlgorithms.hpp index 118fb21c..cb098ce3 100644 --- a/src/phasicFlow/containers/pointField/internalFieldAlgorithms.hpp +++ b/src/phasicFlow/containers/pointField/internalField/internalFieldAlgorithms.hpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ #ifndef __internalFieldAlgorithms_hpp__ diff --git a/src/phasicFlow/containers/pointField/pointField copy.hpp b/src/phasicFlow/containers/pointField/pointField/pointField copy.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/pointField copy.hpp rename to src/phasicFlow/containers/pointField/pointField/pointField copy.hpp diff --git a/src/phasicFlow/containers/pointField/pointField.cpp b/src/phasicFlow/containers/pointField/pointField/pointField.cpp similarity index 99% rename from src/phasicFlow/containers/pointField/pointField.cpp rename to src/phasicFlow/containers/pointField/pointField/pointField.cpp index 0a6315ab..0c1c44fd 100644 --- a/src/phasicFlow/containers/pointField/pointField.cpp +++ b/src/phasicFlow/containers/pointField/pointField/pointField.cpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ template diff --git a/src/phasicFlow/containers/pointField/pointField.hpp b/src/phasicFlow/containers/pointField/pointField/pointField.hpp similarity index 96% rename from src/phasicFlow/containers/pointField/pointField.hpp rename to src/phasicFlow/containers/pointField/pointField/pointField.hpp index c6191dc8..6977563e 100644 --- a/src/phasicFlow/containers/pointField/pointField.hpp +++ b/src/phasicFlow/containers/pointField/pointField/pointField.hpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ #ifndef __pointField_hpp__ @@ -102,6 +101,16 @@ public: return static_cast(*this); } + const auto& boundaryFields()const + { + return boundaryFieldList_; + } + + const auto& BoundaryField(uint32 i)const + { + return boundaryFieldList_[i]; + } + // - reference to pointStructure inline const pointStructure& pStruct()const { return pStruct_; diff --git a/src/phasicFlow/containers/pointField/pointFieldAlgorithms.hpp b/src/phasicFlow/containers/pointField/pointField/pointFieldAlgorithms.hpp similarity index 99% rename from src/phasicFlow/containers/pointField/pointFieldAlgorithms.hpp rename to src/phasicFlow/containers/pointField/pointField/pointFieldAlgorithms.hpp index ce3765d2..061025aa 100644 --- a/src/phasicFlow/containers/pointField/pointFieldAlgorithms.hpp +++ b/src/phasicFlow/containers/pointField/pointField/pointFieldAlgorithms.hpp @@ -15,7 +15,6 @@ Licence: phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -----------------------------------------------------------------------------*/ diff --git a/src/phasicFlow/containers/pointField/pointField_old.hpp b/src/phasicFlow/containers/pointField/pointField/pointField_old.hpp similarity index 100% rename from src/phasicFlow/containers/pointField/pointField_old.hpp rename to src/phasicFlow/containers/pointField/pointField/pointField_old.hpp diff --git a/src/phasicFlow/containers/pointField/pointFields.cpp b/src/phasicFlow/containers/pointField/pointField/pointFields.cpp similarity index 84% rename from src/phasicFlow/containers/pointField/pointFields.cpp rename to src/phasicFlow/containers/pointField/pointField/pointFields.cpp index f116e5ee..6f3cf375 100644 --- a/src/phasicFlow/containers/pointField/pointFields.cpp +++ b/src/phasicFlow/containers/pointField/pointField/pointFields.cpp @@ -27,15 +27,9 @@ Licence: template class pFlow::exitBoundaryField; \ template class pFlow::periodicBoundaryField; -template class pFlow::pointField; -createBaseBoundary(pFlow::int8, pFlow::HostSpace); -createAllBoundary(pFlow::int8, pFlow::HostSpace); - -template class pFlow::pointField; -createBaseBoundary(pFlow::int8, void); -createAllBoundary(pFlow::int8, void); +// uint8 template class pFlow::pointField; createBaseBoundary(pFlow::uint8, pFlow::HostSpace); createAllBoundary(pFlow::uint8, pFlow::HostSpace); @@ -44,14 +38,7 @@ template class pFlow::pointField; createBaseBoundary(pFlow::uint8, void); createAllBoundary(pFlow::uint8, void); -template class pFlow::pointField; -createBaseBoundary(pFlow::int32, pFlow::HostSpace); -createAllBoundary(pFlow::int32, pFlow::HostSpace); - -template class pFlow::pointField; -createBaseBoundary(pFlow::int32, void); -createAllBoundary(pFlow::int32, void); - +/// uint32 template class pFlow::pointField; createBaseBoundary(pFlow::uint32, pFlow::HostSpace); createAllBoundary(pFlow::uint32, pFlow::HostSpace); @@ -60,6 +47,7 @@ template class pFlow::pointField; createBaseBoundary(pFlow::uint32, void); createAllBoundary(pFlow::uint32, void); +/// uint64 template class pFlow::pointField; createBaseBoundary(pFlow::uint64, pFlow::HostSpace); createAllBoundary(pFlow::uint64, pFlow::HostSpace); @@ -68,15 +56,16 @@ template class pFlow::pointField; createBaseBoundary(pFlow::uint64, void); createAllBoundary(pFlow::uint64, void); +/// real template class pFlow::pointField; createBaseBoundary(pFlow::real, pFlow::HostSpace); createAllBoundary(pFlow::real, pFlow::HostSpace); - template class pFlow::pointField; createBaseBoundary(pFlow::real, void); createAllBoundary(pFlow::real, void); +/// realx3 template class pFlow::pointField; createBaseBoundary(pFlow::realx3, pFlow::HostSpace); createAllBoundary(pFlow::realx3, pFlow::HostSpace); @@ -87,6 +76,7 @@ createBaseBoundary(pFlow::realx3, void); createAllBoundary(pFlow::realx3, void); +/// realx4 template class pFlow::pointField; createBaseBoundary(pFlow::realx4, pFlow::HostSpace); createAllBoundary(pFlow::realx4, pFlow::HostSpace); @@ -96,6 +86,8 @@ template class pFlow::pointField; createBaseBoundary(pFlow::realx4, void); createAllBoundary(pFlow::realx4, void); + +/// word template class pFlow::pointField; createBaseBoundary(pFlow::word, pFlow::HostSpace); createAllBoundary(pFlow::word, pFlow::HostSpace); \ No newline at end of file diff --git a/src/phasicFlow/containers/pointField/pointFields.hpp b/src/phasicFlow/containers/pointField/pointField/pointFields.hpp similarity index 86% rename from src/phasicFlow/containers/pointField/pointFields.hpp rename to src/phasicFlow/containers/pointField/pointField/pointFields.hpp index 26e0d52a..3b1e41fc 100644 --- a/src/phasicFlow/containers/pointField/pointFields.hpp +++ b/src/phasicFlow/containers/pointField/pointField/pointFields.hpp @@ -36,21 +36,13 @@ template using pointField_D = pointField; -using int8PointField_D = pointField_D; -using int8PointField_H = pointField_H; using uint8PointField_D = pointField_D; using uint8PointField_H = pointField_H; -using int32PointField_D = pointField_D; -using int32PointField_H = pointField_H; - using uint32PointField_D = pointField_D; using uint32PointField_H = pointField_H; -using int64PointField_D = pointField_D; -using int64PointField_H = pointField_H; - using uint64PointField_D = pointField_D; using uint64PointField_H = pointField_H; diff --git a/src/phasicFlow/containers/triSurfaceField/triSurfaceFields.cpp b/src/phasicFlow/containers/triSurfaceField/triSurfaceFields.cpp index 95b75805..88850464 100644 --- a/src/phasicFlow/containers/triSurfaceField/triSurfaceFields.cpp +++ b/src/phasicFlow/containers/triSurfaceField/triSurfaceFields.cpp @@ -21,14 +21,5 @@ Licence: #include "triSurfaceFields.hpp" -template class pFlow::triSurfaceField; +template class pFlow::triSurfaceField; -/*template class pFlow::triSurfaceField; - -template class pFlow::triSurfaceField; - -template class pFlow::triSurfaceField; - -template class pFlow::triSurfaceField; - -template class pFlow::triSurfaceField;*/ \ No newline at end of file diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp index d2d41e7f..a7f6c96d 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp @@ -208,7 +208,7 @@ const pFlow::boundaryBase &pFlow::boundaryBase::mirrorBoundary() const } typename pFlow::boundaryBase::pointFieldAccessType -pFlow::boundaryBase::thisPoints() +pFlow::boundaryBase::thisPoints()const { return pointFieldAccessType @@ -221,7 +221,7 @@ pFlow::boundaryBase::thisPoints() } typename pFlow::boundaryBase::pointFieldAccessType - pFlow::boundaryBase::neighborPoints() + pFlow::boundaryBase::neighborPoints()const { notImplementedFunction; return pointFieldAccessType(); diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp index 485ad270..261b7f94 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp @@ -234,13 +234,12 @@ public: const boundaryBase& mirrorBoundary()const; - virtual const plane& boundaryPlane()const { return boundaryPlane_; } - /// @brief displacement vector that transfers points from + /// @brief displacement vector that transfers points /// to a distance that is equal to the distance between /// this plane and the mirror plane, the vector points from /// this plane to mirror plane @@ -257,10 +256,10 @@ public: virtual bool afterIteration(uint32 iterNum, real t, real dt) = 0; - pointFieldAccessType thisPoints(); + pointFieldAccessType thisPoints()const; virtual - pointFieldAccessType neighborPoints(); + pointFieldAccessType neighborPoints()const; /// - static create static diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/scatteredFieldAccess.hpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/scatteredFieldAccess.hpp index 19c9caa7..f26438db 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/scatteredFieldAccess.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/scatteredFieldAccess.hpp @@ -1,3 +1,22 @@ +/*------------------------------- phasicFlow --------------------------------- + O C enter of + O O E ngineering and + O O M ultiscale modeling of + OOOOOOO F luid flow +------------------------------------------------------------------------------ + Copyright (C): www.cemf.ir + email: hamid.r.norouzi AT gmail.com +------------------------------------------------------------------------------ +Licence: + This file is part of phasicFlow code. It is a free software for simulating + granular and multiphase flows. You can redistribute it and/or modify it under + the terms of GNU General Public License v3 or any other later versions. + + phasicFlow is distributed to help others in their research in the field of + granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +-----------------------------------------------------------------------------*/ #ifndef __scatteredFieldAccess_hpp__ #define __scatteredFieldAccess_hpp__ @@ -39,8 +58,8 @@ public: scatteredFieldAccess( uint32 sz, - ViewType1D ind, - ViewType1D fVals) + const ViewType1D& ind, + const ViewType1D& fVals) : size_(sz), indices_(ind), @@ -74,13 +93,30 @@ public: INLINE_FUNCTION_HD T& operator[](uint32 i) { - return fieldVals_(indices_(i)); + return fieldVals_[indices_[i]]; } INLINE_FUNCTION_HD const T& operator[](uint32 i)const { - return fieldVals_(indices_(i)); + return fieldVals_[indices_[i]]; + } + + INLINE_FUNCTION_HD + const viewType& field()const + { + return fieldVals_; + } + + INLINE_FUNCTION_HD + viewType& field() + { + return fieldVals_; + } + + uint32 index(uint32 i)const + { + return indices_[i]; } INLINE_FUNCTION_HD diff --git a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp index 237e4bd7..81a227a5 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp @@ -21,6 +21,33 @@ Licence: #include "boundaryList.hpp" #include "pointStructure.hpp" +void pFlow::boundaryList::setExtendedDomain() +{ + if(!listSet_) + { + fatalErrorInFunction<< + "boundary list is not set yet and you used the objects."< dist; dist[0] = boundary(0).neighborLength(); dist[1] = boundary(1).neighborLength(); @@ -40,20 +71,10 @@ bool pFlow::boundaryList::updateLists() dist[4] = boundary(4).neighborLength(); dist[5] = boundary(5).neighborLength(); - realx3 lowerExt = - boundary(0).boundaryExtensionLength() + - boundary(2).boundaryExtensionLength() + - boundary(4).boundaryExtensionLength(); - - realx3 upperExt = - boundary(1).boundaryExtensionLength()+ - boundary(3).boundaryExtensionLength()+ - boundary(5).boundaryExtensionLength(); - - auto extDomain = pStruct_.simDomain().extendThisDomain(lowerExt, upperExt); pStruct_.updateFlag( - extDomain, + extendedDomain_, dist); + const auto& maskD = pStruct_.activePointsMaskDevice(); boundary(0).setSize( maskD.leftSize() ); boundary(1).setSize( maskD.rightSize() ); @@ -69,7 +90,8 @@ bool pFlow::boundaryList::updateLists() boundary(3).indexList().deviceViewAll(), boundary(4).indexList().deviceViewAll(), boundary(5).indexList().deviceViewAll()); - + + return true; } @@ -117,7 +139,7 @@ bool pFlow::boundaryList::setLists() ); } listSet_ = true; - + setExtendedDomain(); return true; } diff --git a/src/phasicFlow/structuredData/boundaries/boundaryList.hpp b/src/phasicFlow/structuredData/boundaries/boundaryList.hpp index bed346da..6581d6cd 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryList.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryList.hpp @@ -22,6 +22,7 @@ Licence: #ifndef __boundaryList_hpp__ #define __boundaryList_hpp__ +#include "domain.hpp" #include "boundaryBase.hpp" #include "ListPtr.hpp" #include "baseTimeControl.hpp" @@ -36,22 +37,26 @@ class boundaryList : public ListPtr { - -protected: +private: //// - data members pointStructure& pStruct_; baseTimeControl timeControl_; + domain extendedDomain_; + bool listSet_ = false; + void setExtendedDomain(); + bool resetLists(); /// @brief update neighbor list of boundaries regardless /// of the time intervals bool updateLists(); + public: /// type info @@ -70,26 +75,36 @@ public: bool setLists(); + inline const pointStructure& pStruct()const { return pStruct_; } + inline auto& boundary(size_t i) { return ListPtr::operator[](i); } + inline const auto& boundary(size_t i)const { return ListPtr::operator[](i); } + inline const baseTimeControl& timeControl()const { return timeControl_; } + inline + const auto& extendedDomain()const + { + return extendedDomain_; + } + bool beforeIteration(uint32 iter, real t, real dt); bool iterate(uint32 iter, real t, real dt); diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp index e59b41ef..30fdc039 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp @@ -34,24 +34,18 @@ pFlow::boundaryPeriodic::boundaryPeriodic : boundaryBase(dict, bplane, internal, bndrs, thisIndex), mirrorBoundaryIndex_(dict.getVal("mirrorBoundaryIndex")) -{ - extendedPlane_ = boundaryBase::boundaryPlane().parallelPlane(-boundaryBase::neighborLength()); -} +{} pFlow::real pFlow::boundaryPeriodic::neighborLength() const { - return 2.0*boundaryBase::neighborLength(); + return (1+extensionLength_)*boundaryBase::neighborLength(); } pFlow::realx3 pFlow::boundaryPeriodic::boundaryExtensionLength() const { - return -neighborLength()*boundaryBase::boundaryPlane().normal(); + return -extensionLength_*neighborLength()*boundaryBase::boundaryPlane().normal(); } -const pFlow::plane &pFlow::boundaryPeriodic::boundaryPlane() const -{ - return extendedPlane_; -} bool pFlow::boundaryPeriodic::beforeIteration( uint32 iterNum, @@ -63,7 +57,7 @@ bool pFlow::boundaryPeriodic::beforeIteration( { return true; } - + uint32 s = size(); uint32Vector_D transferFlags("transferFlags",s+1, s+1, RESERVE()); transferFlags.fill(0u); @@ -71,6 +65,7 @@ bool pFlow::boundaryPeriodic::beforeIteration( auto points = thisPoints(); auto p = boundaryPlane().infPlane(); const auto & transferD = transferFlags.deviceViewAll(); + uint32 numTransfered = 0; Kokkos::parallel_reduce @@ -96,7 +91,7 @@ bool pFlow::boundaryPeriodic::beforeIteration( // to obtain the transfer vector realx3 transferVec = displacementVectroToMirror(); - + return transferPoints ( numTransfered, diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp index 3698926a..b4746a5e 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp @@ -35,7 +35,8 @@ private: uint32 mirrorBoundaryIndex_; - plane extendedPlane_; + static + inline const real extensionLength_ = 0.1; public: @@ -62,7 +63,7 @@ public: realx3 boundaryExtensionLength()const override; - const plane& boundaryPlane()const override; + //const plane& boundaryPlane()const override;*/ bool beforeIteration(uint32 iterNum, real t, real dt) override; diff --git a/src/phasicFlow/structuredData/box/box.hpp b/src/phasicFlow/structuredData/box/box.hpp index 4e78f2fc..8a350405 100644 --- a/src/phasicFlow/structuredData/box/box.hpp +++ b/src/phasicFlow/structuredData/box/box.hpp @@ -46,7 +46,7 @@ public: //// - Constructors INLINE_FUNCTION_HD - box(){} + box() = default; INLINE_FUNCTION_HD box(const realx3& minP, const realx3& maxP) @@ -57,10 +57,10 @@ public: FUNCTION_H - box(const dictionary& dict); + explicit box(const dictionary& dict); FUNCTION_H - box(iIstream& is); + explicit box(iIstream& is); INLINE_FUNCTION_HD box(const box&) = default; @@ -129,6 +129,19 @@ iIstream& operator >>(iIstream& is, box& b); FUNCTION_H iOstream& operator << (iOstream& os, const box& b); +INLINE_FUNCTION_HD +bool equal(const box& b1, const box& b2, real tol = smallValue) +{ + return equal(b1.minPoint(), b2.minPoint(), tol) && + equal(b1.maxPoint(), b2.maxPoint(), tol); +} + +INLINE_FUNCTION_HD +bool operator ==(const box& b1, const box& b2) +{ + return equal(b1, b2); +} + INLINE_FUNCTION_HD box extendBox(const box& b, const realx3& dl) { diff --git a/src/phasicFlow/structuredData/domain/domain.hpp b/src/phasicFlow/structuredData/domain/domain.hpp index f29b33ab..0b733a45 100644 --- a/src/phasicFlow/structuredData/domain/domain.hpp +++ b/src/phasicFlow/structuredData/domain/domain.hpp @@ -30,7 +30,7 @@ namespace pFlow class domain { -protected: +private: box domainBox_; @@ -60,10 +60,10 @@ public: //// - Constructors INLINE_FUNCTION_HD - domain(){} + domain() = default; FUNCTION_H - domain(const box& db); + explicit domain(const box& db); INLINE_FUNCTION_HD domain(const domain&) = default; @@ -127,25 +127,43 @@ public: INLINE_FUNCTION_H const auto& boundaryPlane(uint32 i)const { - if(i==0) return left_; - if(i==1) return right_; - if(i==2) return bottom_; - if(i==3) return top_; - if(i==4) return rear_; - return front_; + switch (i) + { + case 0: + return left_; + case 1: + return right_; + case 2: + return bottom_; + case 3: + return top_; + case 4: + return rear_; + case 5: + return front_; + default: + fatalErrorInFunction; + return front_; + } } - + INLINE_FUNCTION_HD + const auto& minPoint()const + { + return domainBox_.minPoint(); + } + + INLINE_FUNCTION_HD + const auto& maxPoint()const + { + return domainBox_.maxPoint(); + } + }; // domain -INLINE_FUNCTION_HD -bool equal(const domain& d1, const domain& d2) -{ - return equal(d1.domainBox(), d2.domainBox()); -} INLINE_FUNCTION_HD -bool equal(const domain& d1, const domain& d2, real tol) +bool equal(const domain& d1, const domain& d2, real tol=smallValue) { return equal(d1.domainBox(), d2.domainBox(), tol); } diff --git a/src/phasicFlow/structuredData/domain/regularSimulationDomain.cpp b/src/phasicFlow/structuredData/domain/regularSimulationDomain.cpp index 59ba7aa1..7f999541 100644 --- a/src/phasicFlow/structuredData/domain/regularSimulationDomain.cpp +++ b/src/phasicFlow/structuredData/domain/regularSimulationDomain.cpp @@ -1,3 +1,23 @@ +/*------------------------------- phasicFlow --------------------------------- + O C enter of + O O E ngineering and + O O M ultiscale modeling of + OOOOOOO F luid flow +------------------------------------------------------------------------------ + Copyright (C): www.cemf.ir + email: hamid.r.norouzi AT gmail.com +------------------------------------------------------------------------------ +Licence: + This file is part of phasicFlow code. It is a free software for simulating + granular and multiphase flows. You can redistribute it and/or modify it under + the terms of GNU General Public License v3 or any other later versions. + + phasicFlow is distributed to help others in their research in the field of + granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +-----------------------------------------------------------------------------*/ + #include #include "regularSimulationDomain.hpp" diff --git a/src/phasicFlow/structuredData/domain/regularSimulationDomain.hpp b/src/phasicFlow/structuredData/domain/regularSimulationDomain.hpp index 7eeb888a..39491387 100644 --- a/src/phasicFlow/structuredData/domain/regularSimulationDomain.hpp +++ b/src/phasicFlow/structuredData/domain/regularSimulationDomain.hpp @@ -1,3 +1,22 @@ +/*------------------------------- phasicFlow --------------------------------- + O C enter of + O O E ngineering and + O O M ultiscale modeling of + OOOOOOO F luid flow +------------------------------------------------------------------------------ + Copyright (C): www.cemf.ir + email: hamid.r.norouzi AT gmail.com +------------------------------------------------------------------------------ +Licence: + This file is part of phasicFlow code. It is a free software for simulating + granular and multiphase flows. You can redistribute it and/or modify it under + the terms of GNU General Public License v3 or any other later versions. + + phasicFlow is distributed to help others in their research in the field of + granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +-----------------------------------------------------------------------------*/ #ifndef __regularSimulationDomain_hpp__ #define __regularSimulationDomain_hpp__ diff --git a/src/phasicFlow/structuredData/domain/simulationDomain.cpp b/src/phasicFlow/structuredData/domain/simulationDomain.cpp index 2930b1b4..dde24ae9 100644 --- a/src/phasicFlow/structuredData/domain/simulationDomain.cpp +++ b/src/phasicFlow/structuredData/domain/simulationDomain.cpp @@ -47,8 +47,8 @@ pFlow::domain pFlow::simulationDomain::extendThisDomain const realx3 &upperPointExtension ) const { - realx3 minP = thisDomain().domainBox().minPoint() + lowerPointExtension; - realx3 maxP = thisDomain().domainBox().maxPoint() + upperPointExtension; + realx3 minP = thisDomain().minPoint() + lowerPointExtension; + realx3 maxP = thisDomain().maxPoint() + upperPointExtension; return domain({minP, maxP}); } diff --git a/src/phasicFlow/structuredData/plane/plane.hpp b/src/phasicFlow/structuredData/plane/plane.hpp index 93930a85..9c8f23e0 100644 --- a/src/phasicFlow/structuredData/plane/plane.hpp +++ b/src/phasicFlow/structuredData/plane/plane.hpp @@ -31,7 +31,7 @@ class plane : public infinitePlane { -protected: +private: /// First point realx3 p1_; diff --git a/src/phasicFlow/structuredData/pointStructure/internalPoints.cpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/internalPoints.cpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/internalPoints.cpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/internalPoints.cpp diff --git a/src/phasicFlow/structuredData/pointStructure/internalPoints.hpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/internalPoints.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/internalPoints.hpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/internalPoints.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/internalPointsKernels.cpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/internalPointsKernels.cpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/internalPointsKernels.cpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/internalPointsKernels.cpp diff --git a/src/phasicFlow/structuredData/pointStructure/internalPointsKernels.hpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/internalPointsKernels.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/internalPointsKernels.hpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/internalPointsKernels.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/pointFlag.hpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlag.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pointFlag.hpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlag.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/pointFlagKernels.hpp b/src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlagKernels.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pointFlagKernels.hpp rename to src/phasicFlow/structuredData/pointStructure/internalPoints/pointFlagKernels.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/mortonIndexing.cpp b/src/phasicFlow/structuredData/pointStructure/pointStructure/mortonIndexing.cpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/mortonIndexing.cpp rename to src/phasicFlow/structuredData/pointStructure/pointStructure/mortonIndexing.cpp diff --git a/src/phasicFlow/structuredData/pointStructure/mortonIndexing.hpp b/src/phasicFlow/structuredData/pointStructure/pointStructure/mortonIndexing.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/mortonIndexing.hpp rename to src/phasicFlow/structuredData/pointStructure/pointStructure/mortonIndexing.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/pStcutold.txt b/src/phasicFlow/structuredData/pointStructure/pointStructure/pStcutold.txt similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pStcutold.txt rename to src/phasicFlow/structuredData/pointStructure/pointStructure/pStcutold.txt diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp b/src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructure.cpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pointStructure.cpp rename to src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructure.cpp diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructure.hpp b/src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructure.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pointStructure.hpp rename to src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructure.hpp diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructureKernels.hpp b/src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructureKernels.hpp similarity index 100% rename from src/phasicFlow/structuredData/pointStructure/pointStructureKernels.hpp rename to src/phasicFlow/structuredData/pointStructure/pointStructure/pointStructureKernels.hpp diff --git a/src/phasicFlow/triSurface/subSurface.hpp b/src/phasicFlow/triSurface/subSurface.hpp index f6cdc75f..430dbbeb 100644 --- a/src/phasicFlow/triSurface/subSurface.hpp +++ b/src/phasicFlow/triSurface/subSurface.hpp @@ -89,6 +89,11 @@ public: return end_-start_; } + uint32 numPoints()const + { + return pointEnd_ - pointStart_; + } + friend iOstream& operator<< (iOstream& str, const subSurface & sub); /// >> operator diff --git a/src/phasicFlow/triSurface/triSurface.hpp b/src/phasicFlow/triSurface/triSurface.hpp index 09a572a0..204e0376 100644 --- a/src/phasicFlow/triSurface/triSurface.hpp +++ b/src/phasicFlow/triSurface/triSurface.hpp @@ -169,12 +169,12 @@ public: return vertices_.capacity(); } - const auto& points() const + const realx3Field_D& points() const { return points_; } - auto& points() + realx3Field_D& points() { return points_; } @@ -189,12 +189,12 @@ public: return area_; } - const auto& vertices() const + const uint32x3Field_D& vertices() const { return vertices_; } - auto& vertices() + uint32x3Field_D& vertices() { return vertices_; } diff --git a/src/phasicFlow/typeSelection/typeInfo.hpp b/src/phasicFlow/typeSelection/typeInfo.hpp index dc6cb8aa..e5b2b5be 100644 --- a/src/phasicFlow/typeSelection/typeInfo.hpp +++ b/src/phasicFlow/typeSelection/typeInfo.hpp @@ -197,5 +197,12 @@ namespace pFlow } \ virtual word typeName() const { return TYPENAME();} +#define TypeInfoTemplate22(tBase,tName1, Type1, Type2) \ + inline static word TYPENAME() \ + { \ + return word(tBase)+"<"+word(tName1)+","+getTypeName()+","+getTypeName()+">"; \ + } \ + virtual word typeName() const { return TYPENAME();} + #endif