diff --git a/src/PostprocessData/fieldsDataBase/fieldFunctions.hpp b/src/PostprocessData/fieldsDataBase/fieldFunctions.hpp index ea5b7110..7454188d 100644 --- a/src/PostprocessData/fieldsDataBase/fieldFunctions.hpp +++ b/src/PostprocessData/fieldsDataBase/fieldFunctions.hpp @@ -24,7 +24,7 @@ Licence: #include "types.hpp" #include "span.hpp" -namespace pFlow +namespace pFlow::postprocessData { template diff --git a/src/PostprocessData/fieldsDataBase/fieldsDataBase.cpp b/src/PostprocessData/fieldsDataBase/fieldsDataBase.cpp index 51a533b4..08d5cbc2 100644 --- a/src/PostprocessData/fieldsDataBase/fieldsDataBase.cpp +++ b/src/PostprocessData/fieldsDataBase/fieldsDataBase.cpp @@ -26,20 +26,24 @@ Licence: #include "fieldFunctions.hpp" #include "dictionary.hpp" -namespace pFlow +namespace pFlow::postprocessData { bool pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace); } -bool pFlow::fieldsDataBase::loadPointStructureToTime() +bool pFlow::postprocessData::fieldsDataBase::loadPointStructureToTime() { return false; } -bool pFlow::fieldsDataBase::checkForUpdate(const word &compoundName, bool forceUpdate) +bool pFlow::postprocessData::fieldsDataBase::checkForUpdate +( + const word &compoundName, + bool forceUpdate +) { auto t = currentTime(); bool shouldUpdate = false; @@ -58,7 +62,10 @@ bool pFlow::fieldsDataBase::checkForUpdate(const word &compoundName, bool forceU return shouldUpdate; } -pFlow::span pFlow::fieldsDataBase::createOrGetRealField(const word &name) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetRealField +( + const word &name +) { bool shouldUpdate = checkForUpdate(name); @@ -83,7 +90,10 @@ pFlow::span pFlow::fieldsDataBase::createOrGetRealField(const word field.size()); } -pFlow::span pFlow::fieldsDataBase::createOrGetVolume(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetVolume +( + bool forceUpdate +) { const word fName = "volume"; bool shouldUpdate = checkForUpdate(fName, forceUpdate); @@ -119,7 +129,7 @@ pFlow::span pFlow::fieldsDataBase::createOrGetVolume(bool forceUpda } -pFlow::span pFlow::fieldsDataBase::createOrGetDensity(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetDensity(bool forceUpdate) { const word fName = "density"; @@ -155,7 +165,7 @@ pFlow::span pFlow::fieldsDataBase::createOrGetDensity(bool forceUpd field.size()); } -pFlow::span pFlow::fieldsDataBase::createOrGetOne(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetOne(bool forceUpdate) { const word fName = "one"; @@ -182,7 +192,7 @@ pFlow::span pFlow::fieldsDataBase::createOrGetOne(bool forceUpdate) field.size()); } -pFlow::span pFlow::fieldsDataBase::createOrGetMass(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetMass(bool forceUpdate) { const word fName = "mass"; @@ -218,7 +228,7 @@ pFlow::span pFlow::fieldsDataBase::createOrGetMass(bool forceUpdate field.size()); } -pFlow::span pFlow::fieldsDataBase::createOrGetI(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::createOrGetI(bool forceUpdate) { const word fName = "I"; @@ -254,7 +264,7 @@ pFlow::span pFlow::fieldsDataBase::createOrGetI(bool forceUpdate) field.size()); } -bool pFlow::fieldsDataBase::findFunction( +bool pFlow::postprocessData::fieldsDataBase::findFunction( const word &compoundFieldName, word &fieldName, fieldsDataBase::Functions &func) @@ -360,7 +370,7 @@ bool pFlow::fieldsDataBase::findFunction( return false; // No match } -bool pFlow::fieldsDataBase::inputOutputType +bool pFlow::postprocessData::fieldsDataBase::inputOutputType ( fieldsDataBase::Functions func, const word &inputType, @@ -458,7 +468,7 @@ bool pFlow::fieldsDataBase::inputOutputType return false; } -pFlow::fieldsDataBase::fieldsDataBase +pFlow::postprocessData::fieldsDataBase::fieldsDataBase ( systemControl& control, const dictionary& postDict, @@ -488,12 +498,12 @@ pFlow::fieldsDataBase::fieldsDataBase } } -pFlow::timeValue pFlow::fieldsDataBase::currentTime() const +pFlow::timeValue pFlow::postprocessData::fieldsDataBase::currentTime() const { return time_.currentTime(); } -bool pFlow::fieldsDataBase::getFieldTypeNameFunction +bool pFlow::postprocessData::fieldsDataBase::getFieldTypeNameFunction ( const word& compoundName, word& pointFieldName, @@ -543,7 +553,7 @@ bool pFlow::fieldsDataBase::getFieldTypeNameFunction return true; } -bool pFlow::fieldsDataBase::getFieldType +bool pFlow::postprocessData::fieldsDataBase::getFieldType ( const word& compoundName, word& originalType, @@ -559,7 +569,7 @@ bool pFlow::fieldsDataBase::getFieldType return true; } -bool pFlow::fieldsDataBase::getFieldType +bool pFlow::postprocessData::fieldsDataBase::getFieldType ( const word &compoundName, word &typeAfterFunction @@ -575,7 +585,7 @@ bool pFlow::fieldsDataBase::getFieldType return true; } -pFlow::span pFlow::fieldsDataBase::updatePoints(bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::updatePoints(bool forceUpdate) { const word fName = "position"; bool shouldUpdate = checkForUpdate(fName, forceUpdate); @@ -604,7 +614,7 @@ pFlow::span pFlow::fieldsDataBase::updatePoints(bool forceUpdate) } -pFlow::span pFlow::fieldsDataBase::updateFieldRealx3 +pFlow::span pFlow::postprocessData::fieldsDataBase::updateFieldRealx3 ( const word &compoundName, bool forceUpdate @@ -640,7 +650,7 @@ pFlow::span pFlow::fieldsDataBase::updateFieldRealx3 } -pFlow::span pFlow::fieldsDataBase::updateFieldRealx4 +pFlow::span pFlow::postprocessData::fieldsDataBase::updateFieldRealx4 ( const word &compoundName, bool forceUpdate @@ -676,7 +686,7 @@ pFlow::span pFlow::fieldsDataBase::updateFieldRealx4 } -pFlow::span pFlow::fieldsDataBase::updateFieldReal +pFlow::span pFlow::postprocessData::fieldsDataBase::updateFieldReal ( const word &compoundName, bool forceUpdate @@ -843,7 +853,7 @@ pFlow::span pFlow::fieldsDataBase::updateFieldReal return span(nullptr, 0); } -pFlow::span pFlow::fieldsDataBase::updateFieldUint32 +pFlow::span pFlow::postprocessData::fieldsDataBase::updateFieldUint32 ( const word& name, bool forceUpdate @@ -852,7 +862,7 @@ pFlow::span pFlow::fieldsDataBase::updateFieldUint32 return updateField(name, forceUpdate); } -pFlow::allPointFieldTypes pFlow::fieldsDataBase::updateFieldAll +pFlow::postprocessData::allPointFieldTypes pFlow::postprocessData::fieldsDataBase::updateFieldAll ( const word &compoundName, bool forceUpdate @@ -890,8 +900,8 @@ pFlow::allPointFieldTypes pFlow::fieldsDataBase::updateFieldAll -pFlow::uniquePtr - pFlow::fieldsDataBase::create +pFlow::uniquePtr + pFlow::postprocessData::fieldsDataBase::create ( systemControl& control, const dictionary& postDict, @@ -931,7 +941,12 @@ pFlow::uniquePtr return nullptr; } -bool pFlow::pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace) +bool pFlow::postprocessData::pointFieldGetType +( + const word& TYPENAME, + word& fieldType, + word& fieldSpace +) { std::regex match("pointField\\<([A-Za-z1-9_]*)\\,([A-Za-z1-9_]*)\\>"); std::smatch search; diff --git a/src/PostprocessData/fieldsDataBase/fieldsDataBase.hpp b/src/PostprocessData/fieldsDataBase/fieldsDataBase.hpp index 6af3f2f9..822af933 100644 --- a/src/PostprocessData/fieldsDataBase/fieldsDataBase.hpp +++ b/src/PostprocessData/fieldsDataBase/fieldsDataBase.hpp @@ -29,13 +29,15 @@ Licence: #include "Map.hpp" #include "shape.hpp" - namespace pFlow { + class dictionary; + class systemControl; + class Time; +} -class dictionary; -class systemControl; -class Time; +namespace pFlow::postprocessData +{ class fieldsDataBase @@ -311,7 +313,7 @@ public: timeValue startTime); }; -} // namespace pFlow +} // namespace pFlow::postprocessData #include "fieldsDataBaseTemplates.cpp" diff --git a/src/PostprocessData/fieldsDataBase/fieldsDataBaseDclr.hpp b/src/PostprocessData/fieldsDataBase/fieldsDataBaseDclr.hpp index 283b5e7b..e5d483c0 100644 --- a/src/PostprocessData/fieldsDataBase/fieldsDataBaseDclr.hpp +++ b/src/PostprocessData/fieldsDataBase/fieldsDataBaseDclr.hpp @@ -9,7 +9,7 @@ #include "types.hpp" #include "span.hpp" -namespace pFlow +namespace pFlow::postprocessData { diff --git a/src/PostprocessData/fieldsDataBase/fieldsDataBaseTemplates.cpp b/src/PostprocessData/fieldsDataBase/fieldsDataBaseTemplates.cpp index b473e8c8..33cb0d87 100644 --- a/src/PostprocessData/fieldsDataBase/fieldsDataBaseTemplates.cpp +++ b/src/PostprocessData/fieldsDataBase/fieldsDataBaseTemplates.cpp @@ -23,9 +23,9 @@ Licence: #include "fieldsDataBase.hpp" -template +template inline -pFlow::span pFlow::fieldsDataBase::updateField(const word& name, bool forceUpdate) +pFlow::span pFlow::postprocessData::fieldsDataBase::updateField(const word& name, bool forceUpdate) { bool shouldUpdate = checkForUpdate(name, forceUpdate); @@ -40,8 +40,8 @@ pFlow::span pFlow::fieldsDataBase::updateField(const word& name, bool forceUp { if( loadPointFieldToTime(name) ) { - const auto& pField = time_.lookupObject>(name); - allFields_.emplaceBackOrReplace>( + const auto& pField = time_.template lookupObject>(name); + allFields_.template emplaceBackOrReplace>( name, pField.activeValuesHost()); } @@ -63,9 +63,9 @@ pFlow::span pFlow::fieldsDataBase::updateField(const word& name, bool forceUp } -template +template inline -pFlow::span pFlow::fieldsDataBase::updateReservedField +pFlow::span pFlow::postprocessData::fieldsDataBase::updateReservedField ( const word& name, bool forceUpdate diff --git a/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.cpp b/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.cpp index 9348037a..3e1683a0 100644 --- a/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.cpp +++ b/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.cpp @@ -8,29 +8,32 @@ namespace pFlow bool pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace); } -bool pFlow::simulationFieldsDataBase::pointFieldNameExists(const word &name) const +bool pFlow::postprocessData::simulationFieldsDataBase::pointFieldNameExists(const word &name) const { return time().lookupObjectName(name); } -bool pFlow::simulationFieldsDataBase::loadPointFieldToTime(const word &name) +bool pFlow::postprocessData::simulationFieldsDataBase::loadPointFieldToTime(const word &name) { return time().lookupObjectName(name); } -bool pFlow::simulationFieldsDataBase::loadPointStructureToTime() +bool pFlow::postprocessData::simulationFieldsDataBase::loadPointStructureToTime() { // it is already in the Time object return time().lookupObjectName(pointStructureFile__); } -const pFlow::shape& pFlow::simulationFieldsDataBase::getShape() const +const pFlow::shape& pFlow::postprocessData::simulationFieldsDataBase::getShape() const { return shape_; } -pFlow::word pFlow::simulationFieldsDataBase::getPointFieldType(const word &name) const +pFlow::word pFlow::postprocessData::simulationFieldsDataBase::getPointFieldType +( + const word &name +) const { word pfType = time().lookupObjectTypeName(name); word type, space; @@ -44,7 +47,7 @@ pFlow::word pFlow::simulationFieldsDataBase::getPointFieldType(const word &name) return type; } -pFlow::simulationFieldsDataBase::simulationFieldsDataBase +pFlow::postprocessData::simulationFieldsDataBase::simulationFieldsDataBase ( systemControl &control, const dictionary& postDict, @@ -60,7 +63,7 @@ pFlow::simulationFieldsDataBase::simulationFieldsDataBase { } -const pFlow::pointStructure &pFlow::simulationFieldsDataBase::pStruct() const +const pFlow::pointStructure &pFlow::postprocessData::simulationFieldsDataBase::pStruct() const { return static_cast diff --git a/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.hpp b/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.hpp index de1d5b51..298a4957 100644 --- a/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.hpp +++ b/src/PostprocessData/fieldsDataBase/simulationFieldsDataBase.hpp @@ -23,7 +23,7 @@ Licence: #include "fieldsDataBase.hpp" -namespace pFlow +namespace pFlow::postprocessData { class simulationFieldsDataBase diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.cpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.cpp index 580d5ae0..b64ba902 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.cpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.cpp @@ -1,6 +1,9 @@ #include "PostprocessOperationAvMassVelocity.hpp" -pFlow::PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity +namespace pFlow::postprocessData +{ + +PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity ( const dictionary &opDict, const regionPoints ®Points, @@ -17,4 +20,6 @@ pFlow::PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity fieldsDB ) { +} + } \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.hpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.hpp index 5c0f164e..efa0478a 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.hpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAvMassVelocity.hpp @@ -132,7 +132,7 @@ Licence: #include "regionField.hpp" #include "includeMask.hpp" -namespace pFlow +namespace pFlow::postprocessData { diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp index 3ffbd5b8..07a4411e 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp @@ -3,8 +3,11 @@ #include "fieldsDataBase.hpp" #include "operationFunctions.hpp" +namespace pFlow::postprocessData +{ + /// Constructs average processor and initializes result field based on input field type -pFlow::PostprocessOperationAverage::PostprocessOperationAverage +PostprocessOperationAverage::PostprocessOperationAverage ( const dictionary &opDict, const regionPoints ®Points, @@ -39,7 +42,7 @@ pFlow::PostprocessOperationAverage::PostprocessOperationAverage } } -pFlow::PostprocessOperationAverage::PostprocessOperationAverage +PostprocessOperationAverage::PostprocessOperationAverage ( const dictionary &opDict, const word &fieldName, @@ -77,8 +80,9 @@ pFlow::PostprocessOperationAverage::PostprocessOperationAverage } } + /// Performs weighted average of field values within each region -bool pFlow::PostprocessOperationAverage::execute +bool PostprocessOperationAverage::execute ( const std::vector>& weights, const regionField& volFactor @@ -109,7 +113,7 @@ bool pFlow::PostprocessOperationAverage::execute allField) ); - if(calculateFluctuation2_) + if(calculateFluctuation2_()) { auto& processedRegField = processedRegFieldPtr_(); fluctuation2FieldPtr_ = makeUnique @@ -137,4 +141,41 @@ bool pFlow::PostprocessOperationAverage::execute return true; -} \ No newline at end of file +} + +bool PostprocessOperationAverage::write(const fileSystem &parDir) const +{ + if(! postprocessOperation::write(parDir)) + { + return false; + } + if(!calculateFluctuation2_()) + { + return true; + } + + auto ti = time().TimeInfo(); + + if(!os2Ptr_) + { + fileSystem path = parDir+( + processedFieldName()+"_prime2" + ".Start_" + ti.timeName()); + os2Ptr_ = makeUnique(path); + + regPoints().write(os2Ptr_()); + } + + + std::visit + ( + [&](auto&& arg)->bool + { + return writeField(os2Ptr_(), ti.t(), arg, threshold()); + }, + fluctuation2FieldPtr_() + ); + + return true; +} + +} // namespace pFlow::postprocessData \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp index 6620d588..1840c0c4 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp @@ -132,10 +132,9 @@ Licence: #include "regionField.hpp" #include "includeMask.hpp" -namespace pFlow +namespace pFlow::postprocessData { - class PostprocessOperationAverage : public postprocessOperation @@ -150,6 +149,9 @@ private: uniquePtr fluctuation2FieldPtr_ = nullptr; + /// Pointer to the output stream for writing fluctuation2 results + mutable uniquePtr os2Ptr_ = nullptr; + public: TypeInfo("PostprocessOperation"); @@ -190,6 +192,10 @@ public: return processedRegFieldPtr_(); } + /// write to os stream + bool write(const fileSystem &parDir)const override; + + /// @brief Execute average operation on field values /// @param weights Weight factors for particles /// @return True if successful @@ -200,6 +206,6 @@ public: }; -} +} // namespace pFlow::postprocessData #endif //__PostprocessOperationAverage_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.cpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.cpp index c10315d7..1eec581f 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.cpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.cpp @@ -3,8 +3,11 @@ #include "fieldsDataBase.hpp" #include "operationFunctions.hpp" +namespace pFlow::postprocessData +{ + /// Constructs sum processor and initializes result field based on input field type -pFlow::PostprocessOperationSum::PostprocessOperationSum +PostprocessOperationSum::PostprocessOperationSum ( const dictionary &opDict, const regionPoints ®Points, @@ -39,7 +42,7 @@ pFlow::PostprocessOperationSum::PostprocessOperationSum } /// Performs weighted sum of field values within each region -bool pFlow::PostprocessOperationSum::execute +bool PostprocessOperationSum::execute ( const std::vector>& weights, const regionField& volFactor @@ -72,3 +75,6 @@ bool pFlow::PostprocessOperationSum::execute return true; } + + +} \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.hpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.hpp index b811e89b..4452be0e 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.hpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationSum.hpp @@ -129,7 +129,7 @@ Licence: #include "regionField.hpp" #include "includeMask.hpp" -namespace pFlow +namespace pFlow::postprocessData { @@ -182,6 +182,6 @@ public: }; -} +} // namespace pFlow::postprocessData #endif //__PostprocessOperationSum_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/operationFunctions.hpp b/src/PostprocessData/operation/PostprocessOperation/operationFunctions.hpp index 8dbe643b..d9c23552 100644 --- a/src/PostprocessData/operation/PostprocessOperation/operationFunctions.hpp +++ b/src/PostprocessData/operation/PostprocessOperation/operationFunctions.hpp @@ -28,7 +28,7 @@ Licence: #include "regionField.hpp" #include "includeMask.hpp" -namespace pFlow +namespace pFlow::postprocessData { template @@ -190,6 +190,6 @@ regionField executeFluctuation2Operation return processedField; } -} // namespace pFlow +} // namespace pFlow::postprocessData #endif //__operationFunctions_hpp__ diff --git a/src/PostprocessData/operation/includeMask/IncludeMask.hpp b/src/PostprocessData/operation/includeMask/IncludeMask.hpp index 34ae4dfb..3689f22c 100644 --- a/src/PostprocessData/operation/includeMask/IncludeMask.hpp +++ b/src/PostprocessData/operation/includeMask/IncludeMask.hpp @@ -61,7 +61,7 @@ Licence: #include "Time.hpp" -namespace pFlow +namespace pFlow::postprocessData { template @@ -270,7 +270,7 @@ public: }; -} // pFlow +} // pFlow::postprocessData #endif //__IncludeMask_hpp__ diff --git a/src/PostprocessData/operation/includeMask/IncludeMasks.cpp b/src/PostprocessData/operation/includeMask/IncludeMasks.cpp index 8fd6cd3e..7e8e687c 100644 --- a/src/PostprocessData/operation/includeMask/IncludeMasks.cpp +++ b/src/PostprocessData/operation/includeMask/IncludeMasks.cpp @@ -20,31 +20,34 @@ Licence: #include "IncludeMask.hpp" +namespace pFlow::postprocessData +{ + // real -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask>; +template class IncludeMask>; // realx3 -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; -template class pFlow::IncludeMask >; -template class pFlow::IncludeMask >; +template class IncludeMask >; +template class IncludeMask >; -// realx4 +} // postprocessData diff --git a/src/PostprocessData/operation/includeMask/includeMask.cpp b/src/PostprocessData/operation/includeMask/includeMask.cpp index 209391be..6ba84aa8 100644 --- a/src/PostprocessData/operation/includeMask/includeMask.cpp +++ b/src/PostprocessData/operation/includeMask/includeMask.cpp @@ -24,7 +24,10 @@ Licence: #include "fieldsDataBase.hpp" -pFlow::includeMask::includeMask +namespace pFlow::postprocessData +{ + +includeMask::includeMask ( const dictionary& dict, fieldsDataBase& fieldDB @@ -33,7 +36,7 @@ pFlow::includeMask::includeMask database_(fieldDB) {} -pFlow::includeMask::includeMask +includeMask::includeMask ( const word &type, const dictionary &opDict, @@ -44,7 +47,7 @@ pFlow::includeMask::includeMask { } -pFlow::uniquePtr pFlow::includeMask::create +uniquePtr includeMask::create ( const dictionary& opDict, fieldsDataBase& fieldsDB @@ -97,8 +100,7 @@ pFlow::uniquePtr pFlow::includeMask::create return nullptr; } -pFlow::uniquePtr - pFlow::includeMask::create +uniquePtr includeMask::create ( const word &type, const dictionary &opDict, @@ -150,3 +152,5 @@ pFlow::uniquePtr } return nullptr; } + +} \ No newline at end of file diff --git a/src/PostprocessData/operation/includeMask/includeMask.hpp b/src/PostprocessData/operation/includeMask/includeMask.hpp index 928822b8..1f58a31a 100644 --- a/src/PostprocessData/operation/includeMask/includeMask.hpp +++ b/src/PostprocessData/operation/includeMask/includeMask.hpp @@ -47,11 +47,15 @@ Licence: #include "virtualConstructor.hpp" namespace pFlow +{ + class dictionary; +} + +namespace pFlow::postprocessData { // forward declaration class fieldsDataBase; -class dictionary; class includeMask @@ -188,7 +192,7 @@ public: -} // pFlow +} // pFlow::postprocessData #endif //__IncludeMask_hpp__ diff --git a/src/PostprocessData/operation/includeMask/maskOperations.hpp b/src/PostprocessData/operation/includeMask/maskOperations.hpp index 63bb5665..054ea240 100644 --- a/src/PostprocessData/operation/includeMask/maskOperations.hpp +++ b/src/PostprocessData/operation/includeMask/maskOperations.hpp @@ -24,7 +24,7 @@ Licence: #include "types.hpp" #include "dictionary.hpp" -namespace pFlow +namespace pFlow::postprocessData { template @@ -176,6 +176,6 @@ public: } }; -} +} // namespace pFlow::postprocessData #endif //__maskOperation_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp index e752f359..b123f0af 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp @@ -23,66 +23,11 @@ Licence: #include "regionPoints.hpp" #include "fieldsDataBase.hpp" -namespace pFlow + +namespace pFlow::postprocessData { -template -inline -bool writeField -( - iOstream& os, - timeValue t, - const regionField field, - uint32 threshold, - const T& defValue=T{} -) -{ - const auto& regPoints = field.regPoints(); - const uint32 n = field.size(); - os<= threshold) - { - if constexpr(std::is_same_v) - { - os<) - { - os << field[i].x() << ' ' << field[i].y() << ' ' << field[i].z() << ' ' << field[i].w() << tab; - } - else - { - os<) - { - os<) - { - os << defValue.x() << ' ' << defValue.y() << ' ' << defValue.z() << ' ' << defValue.w() << tab; - } - else - { - os< -pFlow::postprocessOperation::create( +uniquePtr postprocessOperation::create +( const dictionary &opDict, const regionPoints ®Points, - fieldsDataBase &fieldsDB) + fieldsDataBase &fieldsDB +) { word func = opDict.getVal("function"); word method = angleBracketsNames("PostprocessOperation", func); @@ -209,3 +155,5 @@ pFlow::postprocessOperation::create( return nullptr; } } + +} \ No newline at end of file diff --git a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp index 285a7b7e..73aa3112 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp @@ -76,23 +76,19 @@ Licence: #include "oFstream.hpp" #include "regionField.hpp" #include "includeMask.hpp" +#include "postprocessOperationFunctions.hpp" namespace pFlow { + class Time; +} -/// Type alias for processed region field types. -/// Only regionField, regionField, and regionField are supported -/// in the postprocessOperation class. -using processedRegFieldType = std::variant - < - regionField, - regionField, - regionField - >; +namespace pFlow::postprocessData +{ /// - forward declaration class fieldsDataBase; -class Time; + class postprocessOperation { @@ -103,7 +99,7 @@ public: private: /// Dictionary containing operation-specific parameters. - dictionary operationDict_; + pFlow::dictionary operationDict_; /// This Threshold is used to exclude the regions which contain /// fewer than this value. @@ -273,6 +269,6 @@ public: }; -} +} // namespace pFlow::postprocessData #endif //__postprocessOperation_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp b/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp new file mode 100644 index 00000000..5356cf84 --- /dev/null +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp @@ -0,0 +1,100 @@ +/*------------------------------- 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 __postprocessOperationFunctions_hpp__ +#define __postprocessOperationFunctions_hpp__ + +#include + +#include "types.hpp" +#include "iOstream.hpp" +#include "regionField.hpp" + +namespace pFlow::postprocessData +{ + +/// Type alias for processed region field types. +/// Only regionField, regionField, and regionField are supported +/// in the postprocessOperation class. +using processedRegFieldType = std::variant +< + regionField, + regionField, + regionField +>; + + +template +inline +bool writeField +( + iOstream& os, + timeValue t, + const regionField field, + uint32 threshold, + const T& defValue=T{} +) +{ + const auto& regPoints = field.regPoints(); + const uint32 n = field.size(); + os<= threshold) + { + if constexpr(std::is_same_v) + { + os<) + { + os << field[i].x() << ' ' << field[i].y() << ' ' << field[i].z() << ' ' << field[i].w() << tab; + } + else + { + os<) + { + os<) + { + os << defValue.x() << ' ' << defValue.y() << ' ' << defValue.z() << ' ' << defValue.w() << tab; + } + else + { + os< -pFlow::PostprocessComponent::PostprocessComponent +pFlow::postprocessData::PostprocessComponent::PostprocessComponent ( const dictionary& dict, fieldsDataBase& fieldsDB, @@ -61,7 +61,7 @@ pFlow::PostprocessComponent::PostprocessComponent template -bool pFlow::PostprocessComponent::execute +bool pFlow::postprocessData::PostprocessComponent::execute ( const timeInfo &ti, bool forceUpdate @@ -129,7 +129,7 @@ bool pFlow::PostprocessComponent::execute template inline -bool pFlow::PostprocessComponent::write +bool pFlow::postprocessData::PostprocessComponent::write ( const fileSystem &parDir ) const diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.hpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.hpp index 996467a1..cc6ead75 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.hpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.hpp @@ -32,7 +32,7 @@ Licence: #include "regionPoints.hpp" #include "regionField.hpp" -namespace pFlow +namespace pFlow::postprocessData { template diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentArithmetic.hpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentArithmetic.hpp index 7b9a37c3..aa335dd6 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentArithmetic.hpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentArithmetic.hpp @@ -24,7 +24,7 @@ Licence: #include "PostprocessComponent.hpp" #include "arithmetic.hpp" -namespace pFlow +namespace pFlow::postprocessData { template diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentGaussian.hpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentGaussian.hpp index 0fb00163..2f5cbd3e 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentGaussian.hpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentGaussian.hpp @@ -25,7 +25,7 @@ Licence: #include "GaussianDistribution.hpp" #include "numericConstants.hpp" -namespace pFlow +namespace pFlow::postprocessData { template diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentUniform.hpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentUniform.hpp index 5a181474..93f0d9d2 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentUniform.hpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponentUniform.hpp @@ -24,7 +24,7 @@ Licence: #include "PostprocessComponent.hpp" #include "uniformDistribution.hpp" -namespace pFlow +namespace pFlow::postprocessData { template diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponents.cpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponents.cpp index 2a6245a5..5556e342 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponents.cpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponents.cpp @@ -27,16 +27,18 @@ Licence: #include "lineRegionPoints.hpp" #include "multipleSpheresRegionPoints.hpp" +namespace pFlow::postprocessData +{ +template class PostprocessComponentGaussian; +template class PostprocessComponentUniform; +template class PostprocessComponentArithmetic; -template class pFlow::PostprocessComponentGaussian; -template class pFlow::PostprocessComponentUniform; -template class pFlow::PostprocessComponentArithmetic; +template class PostprocessComponentGaussian; +template class PostprocessComponentUniform; +template class PostprocessComponentArithmetic; -template class pFlow::PostprocessComponentGaussian; -template class pFlow::PostprocessComponentUniform; -template class pFlow::PostprocessComponentArithmetic; - -template class pFlow::PostprocessComponentGaussian; -template class pFlow::PostprocessComponentUniform; -template class pFlow::PostprocessComponentArithmetic; +template class PostprocessComponentGaussian; +template class PostprocessComponentUniform; +template class PostprocessComponentArithmetic; +} \ No newline at end of file diff --git a/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.cpp b/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.cpp index 7588e602..3c390cc9 100644 --- a/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.cpp +++ b/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.cpp @@ -1,7 +1,27 @@ +/*------------------------------- 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 "particleProbePostprocessComponent.hpp" #include "Time.hpp" -namespace pFlow +namespace pFlow::postprocessData { template @@ -62,7 +82,7 @@ inline bool writeField } -pFlow::particleProbePostprocessComponent::particleProbePostprocessComponent +pFlow::postprocessData::particleProbePostprocessComponent::particleProbePostprocessComponent ( const dictionary &dict, fieldsDataBase &fieldsDB, @@ -81,7 +101,7 @@ pFlow::particleProbePostprocessComponent::particleProbePostprocessComponent name_(dict.name()) {} -bool pFlow::particleProbePostprocessComponent::execute +bool pFlow::postprocessData::particleProbePostprocessComponent::execute ( const timeInfo &ti, bool forceExecute @@ -126,7 +146,7 @@ bool pFlow::particleProbePostprocessComponent::execute } -bool pFlow::particleProbePostprocessComponent::write(const fileSystem& parDir)const +bool pFlow::postprocessData::particleProbePostprocessComponent::write(const fileSystem& parDir)const { if(! executed_ ) return true; diff --git a/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.hpp b/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.hpp index 5069e291..808e6615 100644 --- a/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.hpp +++ b/src/PostprocessData/postprocessComponent/particleProbePostprocessComponent/particleProbePostprocessComponent.hpp @@ -27,7 +27,7 @@ Licence: #include "regionField.hpp" #include "oFstream.hpp" -namespace pFlow +namespace pFlow::postprocessData { diff --git a/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.cpp b/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.cpp index ed2e3b6c..d7882334 100644 --- a/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.cpp +++ b/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.cpp @@ -1,9 +1,29 @@ +/*------------------------------- 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 "postprocessComponent.hpp" #include "fieldsDataBase.hpp" #include "Time.hpp" -pFlow::postprocessComponent::postprocessComponent +pFlow::postprocessData::postprocessComponent::postprocessComponent ( const dictionary &dict, fieldsDataBase &fieldsDB, @@ -23,7 +43,7 @@ pFlow::postprocessComponent::postprocessComponent } -pFlow::uniquePtr pFlow::postprocessComponent::create +pFlow::uniquePtr pFlow::postprocessData::postprocessComponent::create ( const dictionary& dict, fieldsDataBase& fieldsDB, diff --git a/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.hpp b/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.hpp index 70db2153..1f6c633f 100644 --- a/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.hpp +++ b/src/PostprocessData/postprocessComponent/postprocessComponent/postprocessComponent.hpp @@ -25,12 +25,17 @@ Licence: #include "dictionary.hpp" #include "virtualConstructor.hpp" -namespace pFlow +namespace +{ + class dictionary; +} + +namespace pFlow::postprocessData { -class fieldsDataBase; + class regionPoints; -class dictionary; +class fieldsDataBase; class postprocessComponent { @@ -112,6 +117,6 @@ public: }; -} // namespace pFlow +} // namespace pFlow::postprocessData #endif // __postprocessComponent_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/postprocessData/postprocessData.cpp b/src/PostprocessData/postprocessData/postprocessData.cpp index ac76c26b..967bcfda 100644 --- a/src/PostprocessData/postprocessData/postprocessData.cpp +++ b/src/PostprocessData/postprocessData/postprocessData.cpp @@ -1,4 +1,3 @@ - /*------------------------------- phasicFlow --------------------------------- O C enter of O O E ngineering and @@ -25,7 +24,7 @@ Licence: #include "postprocessGlobals.hpp" #include "postprocessComponent.hpp" -pFlow::postprocessData::postprocessData +pFlow::postprocessData::postprocessData::postprocessData ( const systemControl &control, timeValue startTime @@ -45,7 +44,7 @@ pFlow::postprocessData::postprocessData ) ) { - postProcessGlobals::defaultDir__ = CWD()/pFlow::postProcessGlobals::defaultRelDir__; + defaultDir__ = CWD()/defaultRelDir__; // if dictionary is not provided, no extra action is required. if( !dict_.fileExist() || !dict_.headerOk() ) @@ -98,7 +97,7 @@ pFlow::postprocessData::postprocessData } -bool pFlow::postprocessData::execute() +bool pFlow::postprocessData::postprocessData::execute() { if( inSimulation_ && !activeInSimulation_() ) return true; @@ -118,7 +117,7 @@ bool pFlow::postprocessData::execute() return true; } -bool pFlow::postprocessData::write() const +bool pFlow::postprocessData::postprocessData::write() const { if( inSimulation_ && !activeInSimulation_() ) return true; @@ -129,7 +128,7 @@ bool pFlow::postprocessData::write() const continue; } - if(!component->write(postProcessGlobals::defaultDir__/component->name())) + if(!component->write(defaultDir__/component->name())) { fatalErrorInFunction <<"Error occured in writing postprocess component: " @@ -140,7 +139,7 @@ bool pFlow::postprocessData::write() const return true; } -void pFlow::postprocessData::setOutputDirectory(const fileSystem &path) const +void pFlow::postprocessData::postprocessData::setOutputDirectory(const fileSystem &path) const { - postProcessGlobals::defaultDir__ = path; + defaultDir__ = path; } diff --git a/src/PostprocessData/postprocessData/postprocessData.hpp b/src/PostprocessData/postprocessData/postprocessData.hpp index 04ae6188..553c3d22 100644 --- a/src/PostprocessData/postprocessData/postprocessData.hpp +++ b/src/PostprocessData/postprocessData/postprocessData.hpp @@ -28,14 +28,18 @@ Licence: #include "fieldsDataBase.hpp" #include "postprocessComponent.hpp" - -namespace pFlow +namespace pFlow { class systemControl; class Time; class timeInfo; +} + +namespace pFlow::postprocessData +{ + /** * @class postprocessData @@ -109,6 +113,6 @@ public: void setOutputDirectory(const fileSystem& path)const; }; -} // namespace pFlow +} // namespace pFlow::postprocessData #endif // __postprocessData_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/postprocessData/postprocessGlobals.hpp b/src/PostprocessData/postprocessData/postprocessGlobals.hpp index 335bc267..f7ba18ec 100644 --- a/src/PostprocessData/postprocessData/postprocessGlobals.hpp +++ b/src/PostprocessData/postprocessData/postprocessGlobals.hpp @@ -23,7 +23,7 @@ Licence: #include "fileSystem.hpp" -namespace pFlow::postProcessGlobals +namespace pFlow::postprocessData { static fileSystem defaultDir__; diff --git a/src/PostprocessData/postprocessData/postprocessTimeControl.hpp b/src/PostprocessData/postprocessData/postprocessTimeControl.hpp index f70cfd2a..1d2689ea 100644 --- a/src/PostprocessData/postprocessData/postprocessTimeControl.hpp +++ b/src/PostprocessData/postprocessData/postprocessTimeControl.hpp @@ -22,9 +22,11 @@ Licence: #define __postprocessTimeControl_hpp__ #include "baseTimeControl.hpp" +#include "dictionary.hpp" -namespace pFlow +namespace pFlow::postprocessData { + class postprocessTimeControl : public baseTimeControl @@ -60,6 +62,6 @@ postprocessTimeControl( // Additional methods and members can be added here }; -} // namespace pFlow +} // namespace pFlow::postprocessData #endif // __postprocessTimeControl_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/readme.md b/src/PostprocessData/readme.md index 436b7e25..ee1431ca 100644 --- a/src/PostprocessData/readme.md +++ b/src/PostprocessData/readme.md @@ -2,7 +2,10 @@ The `PostprocessData` module in phasicFlow provides powerful tools for analyzing particle-based simulations both during runtime (in-simulation) and after simulation completion (post-simulation). This document explains how to configure and use the postprocessing features through the dictionary-based input system. -## Overview +- in-simulation: this is postprocessing that is active during simulation. When running a solver, it allows for real-time data analysis and adjustments based on the simulation's current state. See below to see how you can activate in-simulation postprocessing. +- post-simulation: this is postprocessing that is done after the simulation is completed. It allows for detailed analysis of the simulation results, including data extraction and visualization based on the results that are stored in time-folders. If you want to use post-simulation, you need to run utility `postprocessPhasicFlow` in terminal (in the simulation case setup folder) to run the postprocessing. This utility reads the `postprocessDataDict` file and performs the specified operations on the simulation data. + +## 1. Overview Postprocessing in phasicFlow allows you to: @@ -12,11 +15,36 @@ Postprocessing in phasicFlow allows you to: - Apply different weighing methods when calculating statistics - Perform postprocessing at specific time intervals -## Setting Up Postprocessing +## Table of Contents + +- [1. Overview](#1-overview) +- [2. Setting Up Postprocessing](#2-setting-up-postprocessing) + - [2.1. Basic Configuration](#21-basic-configuration) +- [3. Time Control Options](#3-time-control-options) +- [4. Processing Methods](#4-processing-methods) +- [5. Region Types](#5-region-types) +- [6. Processing Operations](#6-processing-operations) + - [6.1. Available Functions in average](#61-available-functions-in-average) + - [6.2. About fluctuation2 in average function](#62-about-fluctuation2-in-average-function) + - [6.3. Derived Functions](#63-derived-functions) + - [6.4. Available Fields](#64-available-fields) + - [6.5. Optional Parameters](#65-optional-parameters) +- [7. Examples](#7-examples) + - [7.1. Example 1: Probing Individual Particles](#71-example-1-probing-individual-particles) + - [7.2. Example 2: Processing in a Spherical Region](#72-example-2-processing-in-a-spherical-region) + - [7.3. Example 3: Processing Along a Line](#73-example-3-processing-along-a-line) +- [8. Advanced Features](#8-advanced-features) + - [8.1. Special functions applied on fields](#81-special-functions-applied-on-fields) + - [8.2. Particle Filtering with includeMask](#82-particle-filtering-with-includemask) + - [8.3. Implementation Notes](#83-implementation-notes) +- [9. Mathematical Formulations](#9-mathematical-formulations) +- [10. A complete dictionary file (postprocessDataDict)](#10-a-complete-dictionary-file-postprocessdatadict) + +## 2. Setting Up Postprocessing Postprocessing is configured through a dictionary file named `postprocessDataDict` which should be placed in the `settings` directory. Below is a detailed explanation of the configuration options. -### Basic Configuration +### 2.1. Basic Configuration The input dictionary, **settings/postprocessDataDict**, may look like this: @@ -46,7 +74,8 @@ components ); ``` -If you want to activate in-simulaiton postprocessing, you need to add these lines to the `settings/settingsDict` file: + +If you want to activate in-simulation postprocessing, you need to add these lines to the `settings/settingsDict` file: ```cpp libs ("libPostprocessData.so"); @@ -56,7 +85,7 @@ auxFunctions postprocessData; This will link the postprocessing library to your simulation, allowing you to use its features. Note that, anytime you want to deactivate the in-simulation postprocessing, you can simply change the `runTimeActive` option to `no` in `postprocessDataDict` file. -## Time Control Options +## 3. Time Control Options Each postprocessing component can either use the default time control settings or define its own. There are three main options for time control: @@ -69,7 +98,7 @@ Each postprocessing component can either use the default time control settings o If no time control is specified, the `default` option is used automatically. -## Processing Methods +## 4. Processing Methods The postprocessing module provides several methods for processing particle data. They are categorized into two main groups: bulk and individual methods. @@ -83,7 +112,7 @@ The postprocessing module provides several methods for processing particle data. | `GaussianDistribution` | bulk | Weight contribution based on distance from center with Gaussian falloff | $w_i = \exp(-\|x_i - c\|^2/(2\sigma^2))/\sqrt{2\pi\sigma^2}$ | | `particleProbe` | individual | Extracts values from specific particles | Direct access to particle properties | -## Region Types +## 5. Region Types Regions define where in the domain the postprocessing operations are applied: @@ -94,24 +123,24 @@ Regions define where in the domain the postprocessing operations are applied: | `line` | Spheres along a line with specified radius | `p1`, `p2`, `nSpheres`, `radius` | bulk | | `centerPoints` | Specific particles selected by ID | `ids` | individual | -## Processing Operations +## 6. Processing Operations Within each processing region of type `bulk`, you can define multiple operations to be performed: -### Available Functions +### 6.1. Available Functions in average | Function | Property type | Description | Formula | Required Parameters | |----------|---------------|-------------|---------|---------------------| -| `average` | bulk | Weighted average of particle field values | see Equation 1 | `field`, `phi` (optional), `threshold` (optional), `includeMask` (optional), `divideByVolume` (optional) | +| `average` | bulk | Weighted average of particle field values | see Equation 1 | `field`, `phi` (optional), `threshold` (optional), `includeMask` (optional), `divideByVolume` (optional), `fluctuation2` (optional) | | `sum` | bulk | Weighted sum of particle field values | see Equation 2 | `field`, `phi` (optional),`threshold` (optional), `includeMask` (optional), `divideByVolume` (optional) | Equation 1: -$$\text{result} = \frac{\sum_j w_j \cdot \phi_j \cdot \text{field}_j}{\sum_i w_i \cdot \phi_i}$$ +$$\text{mean} = \frac{\sum_j w_j \cdot \phi_j \cdot \text{field}_j}{\sum_i w_i \cdot \phi_i}$$ Equation 2: -$$\text{result} = \sum_j w_j \cdot \phi_j \cdot \text{field}_j$$ +$$\text{sum} = \sum_j w_j \cdot \phi_j \cdot \text{field}_j$$ where: @@ -121,16 +150,28 @@ where: - $\phi_j$ is the value of the `phi` field for particle $j$ (default is 1) - $field_j$ is the value of the specified field for particle $j$ +### 6.2. About fluctuation2 in average function -### Derived Functions +Fluctuation2 is an optional parameter that can be used to account for fluctuations in the particle field values with respect to mean value of the field. +It is used in the `average` function to calculate the fluctuation of the field values around the mean. The formula for fluctuation2 is: + +$$\text{fluctuation}^2 = \frac{\sum_j w_j \cdot \phi_j \cdot (\text{field}_j - \text{mean})^2}{\sum_i w_i \cdot \phi_i}$$ + +where: + +- `mean`: is the average value of the field in the region. +- `field`: The field to be processed (e.g., `velocity`, `mass`, etc.) +- `fluctuation2`: Optional parameter to account for fluctuations in the particle field values. + +### 6.3. Derived Functions In addition to the above basic functions, some derived functions are available for specific calculations: | Function | Property type | Description | Formula | Required Parameters | |----------|---------------|-------------|---------|---------------------| -|`avMassVelocity` | bulk | Average velocity weighted by mass | $\frac{\sum_{i \in \text{region}} m_i \cdot v_i}{\sum_{i \in \text{region}} m_i}$ | - | +|`avMassVelocity` | bulk | Average velocity weighted by mass | $\frac{\sum_{i \in \text{region}} w_i \cdot m_i \cdot v_i}{\sum_{i \in \text{region}} w_i \cdot m_i}$ | - | -### Available Fields +### 6.4. Available Fields All the pointFields in the simulation database (for in-simulation processing), or the ones stored in the time folders (for post-simulation processing) can be referenced in the operations. In addition to them, some extra fields are available for use in the operations. The following fields are available for use in the operations: @@ -161,17 +202,19 @@ All the pointFields in the simulation database (for in-simulation processing), o The above fields may vary from one type of simulation to other. Pleas note that this is only a tentative list. -### Optional Parameters +### 6.5. Optional Parameters | Parameter | Description | Default | Options | |-----------|-------------|---------|---------| -| `divideByVolume` | Divide result by region volume | `no` | `yes`, `no` | +| `divideByVolume` | Divide result by region volume | `no` | `yes` or `no` | | `threshold` | Exclude regions with fewer particles | 1 | Integer value | -| `includeMask` | Filter particles based on a field value | `all` | `all`, `lessThan`, `greaterThan`, `between`, `lessThanOrEq`, `greaterThanEq`, `betweenEq` | +| `includeMask` | Filter particles based on a field value | `all` | `all`, `lessThan`, `greaterThan`, `between`, `lessThanOrEq`, `greaterThanOrEq`, `betweenEq` | +|`fluctuation2` (in average only)| Calculate fluctuation of field values | `no` | `yes` or `no` | +| `phi` | Field to be used for weighted averaging | `one` | Any valid field name | -## Examples +## 7. Examples -### Example 1: Probing Individual Particles +### 7.1. Example 1: Probing Individual Particles ```cpp velocityProb @@ -187,7 +230,7 @@ velocityProb This example extracts the y-component of the position for particles with IDs 0, 10, and 100. -### Example 2: Processing in a Spherical Region +### 7.2. Example 2: Processing in a Spherical Region ```cpp on_single_sphere @@ -210,6 +253,7 @@ on_single_sphere function average; field mag(velocity); divideByVolume no; + fluctuation2 yes; threshold 3; includeMask all; } @@ -246,9 +290,9 @@ This example defines a sphere region and performs three operations: 2. Calculate the fraction of particles with diameter less than 0.0031 3. Calculate the number density by summing and dividing by volume -### Example 3: Processing Along a Line +### 7.3. Example 3: Processing Along a Line -In this example, a line region is defined. The `lineInfo` section specifies the start and end points of the line, the number of spheres to create along the line, and the radius of each point. Bulk properties are calculated in each sphere, based on the properties of particles contained in each sphere. +In this example, a line region is defined. The `lineInfo` section specifies the start and end points of the line, the number of spheres to create along the line, and the radius of each point. Bulk properties are calculated in each sphere, based on the properties of particles contained in each sphere. ```cpp along_a_line @@ -291,9 +335,9 @@ along_a_line This example creates 10 spherical regions along a line from (0,0,0) to (0,0.15,0.15) and calculates the bulk density and volume density in each region. -## Advanced Features +## 8. Advanced Features -### Special functions applied on fields +### 8.1. Special functions applied on fields You can access specific components of vector fields (`realx3`) using the `component` function: @@ -315,8 +359,7 @@ Here is a complete list of these special functions: | `magnitude cube` | `realx3` | `magCube(velocity)` | | `magnitude square root` | `realx3` | `magSqrt(acceleration)` | - -### Particle Filtering with includeMask +### 8.2. Particle Filtering with includeMask The `includeMask` parameter allows you to filter particles based on field values: @@ -339,7 +382,7 @@ Supported masks: - `greaterThanOrEq`: Include particles where field ≥ value - `betweenEq`: Include particles where value1 ≤ field ≤ value2 -## Implementation Notes +### 8.3. Implementation Notes - The postprocessing system can work both during simulation (`runTimeActive yes`) or after simulation completion. - When using post-simulation mode, you must specify the correct `shapeType` to properly initialize the shape objects. @@ -347,17 +390,180 @@ Supported masks: - The `threshold` parameter helps eliminate statistical noise in regions with few particles. - Setting `divideByVolume` to `yes` normalizes results by the volume of the region, useful for calculating densities. -## Mathematical Formulations +## 9. Mathematical Formulations -For weighted `bulk` properties calculation: +For weighted `bulk` properties calculation, we have these two general formulations: -$$ \text{average} = \frac{\sum_{i \in \text{region and includeMask}} w_i \cdot \phi_i \cdot \text{field}_i}{\sum_{i \in \text{region}} w_i \cdot \phi_i} $$ +- For weighted averaging: -For weighted summing: +$$ \text{average} = \frac{\sum_j w_j \cdot \phi_j \cdot \text{field}_j}{\sum_i w_i \cdot \phi_i} $$ -$$ \text{sum} = \sum_{i \in \text{region and includeMask}} w_i \cdot \phi_i \cdot \text{field}_i $$ +- For weighted summing: + +$$ \text{sum} = \sum_j w_j \cdot \phi_j \cdot \text{field}_j $$ If `divideByVolume` is set to `yes`, the result is divided by the volume of the region: $$ \text{volumetric result} = \frac{\text{result}}{V_{\text{region}}} $$ +## 10. A complete dictionary file (postprocessDataDict) + +```C++ +/* -------------------------------*- C++ -*--------------------------------- *\ +| phasicFlow File | +| copyright: www.cemf.ir | +\* ------------------------------------------------------------------------- */ +objectName postprocessDataDict; +objectType dictionary;; +fileFormat ASCII; +/*---------------------------------------------------------------------------*/ + +// Yes: postprocessing is active during the simulation +// No: postprocessing is not active during the simulation +// and it can be done after simulation +runTimeActive yes; + +// shapeType: defines the type of the shape that is used in the simulation +// (for example: sphere, grain, etc). +// shapeType is only used when postprocessing is done after simulation +// to initialize the shape object for post processing operatoins +shapeType sphere; + +// default time control to be used in the postprocessing components +defaultTimeControl +{ + timeControl timeStep; // timeStep, simulationTime are the options here + startTime 0; + endTime 1000; + executionInterval 150; +} + +// list of postprocessing components +components +( + // probing particles for their state variables, like velocity, position, etc + velocityProb + { + processMethod particleProbe; + processRegion centerPoints; + selector id; + field component(position,y); + ids (0 10 100); + timeControl default; // other options are settings, timeStep, simulationTime + // settings: uses parameters from settingsDict file + // timeStep: uses the time step of the simulation controlling the execution of postprocessing + // simulationTime: uses the simulation time of the simulation controlling the execution of postprocessing + // default: uses the default time control (defined in defaultTimeControl). + // default behavior: if you do not specify it, parameters in defaultTimeControl is used. + } + + on_single_sphere + { + // method of performing the sum (arithmetic, uniformDistribution, GaussianDistribution) + processMethod arithmetic; + + // Postprocessing is done on particles whose centers are inside this spehre + processRegion sphere; + + sphereInfo + { + radius 0.01; // radius of sphere + center (-0.08 -0.08 0.015); // center of sphere + } + + timeControl default; + + /// all the postprocess operations to be done on sphere region + operations + ( + // computes the arithmetic mean of particle velocity + averageVel + { + function average; + field velocity; + fluctuation2 yes; + divideByVolume no; // default is no + threshold 3; // default is 1 + includeMask all; // default is all + } + // - function: average, sum, and other derived ones from sum and average + // - field: names of the fields in the simulation. Some special fields + // are: mass, density, volume, position, one, I. + // - divideByVolume: whether the result is divided by the volume of the region + // - threshold: exclude regions that contains particles less than threshold + // - includeMask: all, lessThan, greaterThan, between, lessThanOrEq, greaterThanEq, betweenEq + + + // computes the fraction of par1 in the region + par1Fraction + { + function average; + field one; // default + phi one; // default + divideByVolume no; + includeMask lessThan; + + // diameter of par1 is 0.003, so these settings + // will select only particles of type par1 + lessThanInfo + { + field diameter; + value 0.0031; + } + } + + numberDensity + { + function sum; + field one; + phi one; + divideByVolume yes; + + } + ); + } + + along_a_line + { + processMethod arithmetic; + + processRegion line; + + // the time interval for executing the post-processing + // other options: timeStep, default, and settings + timeControl simulationTime; + startTime 1.0; + endTime 3.0; + executionInterval 0.1; + + // 10 spheres with radius 0.01 along the straight line defined by p1 and p2 + lineInfo + { + p1 (0 0 0); + p2 (0 0.15 0.15); + nSpheres 10; + radius 0.01; + } + + operations + ( + // computes the arithmetic mean of particle velocity + numberDensity + { + function sum; + field one; + divideByVolume yes; //default is no + } + + volumeDensity + { + function sum; + field volume; // + divideByVolume yes; //default is no + } + ); + } + +); + +``` diff --git a/src/PostprocessData/region/regionFields/regionField.hpp b/src/PostprocessData/region/regionFields/regionField.hpp index 1996fed1..9094cd34 100644 --- a/src/PostprocessData/region/regionFields/regionField.hpp +++ b/src/PostprocessData/region/regionFields/regionField.hpp @@ -25,7 +25,7 @@ Licence: #include "regionPoints.hpp" #include "Field.hpp" -namespace pFlow +namespace pFlow::postprocessData { template @@ -119,7 +119,7 @@ public: }; -} // namespace pFlow +} // namespace pFlow::postprocessData #include "regionFieldTemplate.cpp" diff --git a/src/PostprocessData/region/regionFields/regionFieldTemplate.cpp b/src/PostprocessData/region/regionFields/regionFieldTemplate.cpp index 65112474..408107c6 100644 --- a/src/PostprocessData/region/regionFields/regionFieldTemplate.cpp +++ b/src/PostprocessData/region/regionFields/regionFieldTemplate.cpp @@ -1,10 +1,14 @@ +namespace pFlow::postprocessData +{ template -pFlow::regionField::regionField( +regionField::regionField( const word& name, const regionPoints& rPoints, const T defaultVal) : field_(name, "regionFieldValue", rPoints.size(), rPoints.size(), defaultVal), regionPoints_(rPoints) -{} \ No newline at end of file +{} + +} // End namespace pFlow::postprocessData \ No newline at end of file diff --git a/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp b/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp index b5ffb730..73aaf7f2 100644 --- a/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp +++ b/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp @@ -3,7 +3,10 @@ #include "Set.hpp" #include "pStructSelector.hpp" -bool pFlow::centerPointsRegionPoints::selectIds() +namespace pFlow::postprocessData +{ + +bool centerPointsRegionPoints::selectIds() { if(!firstTimeUpdate_) return true; firstTimeUpdate_ = false; @@ -42,7 +45,7 @@ bool pFlow::centerPointsRegionPoints::selectIds() return true; } -pFlow::centerPointsRegionPoints::centerPointsRegionPoints( +centerPointsRegionPoints::centerPointsRegionPoints( const dictionary &dict, fieldsDataBase &fieldsDataBase) : regionPoints(dict, fieldsDataBase), @@ -50,7 +53,7 @@ pFlow::centerPointsRegionPoints::centerPointsRegionPoints( probDict_(dict) {} -bool pFlow::centerPointsRegionPoints::update() +bool centerPointsRegionPoints::update() { if(!selectIds()) return false; @@ -74,7 +77,7 @@ bool pFlow::centerPointsRegionPoints::update() return true; } -bool pFlow::centerPointsRegionPoints::write(iOstream &os) const +bool centerPointsRegionPoints::write(iOstream &os) const { if(firstTimeUpdate_) { @@ -95,3 +98,5 @@ bool pFlow::centerPointsRegionPoints::write(iOstream &os) const return true; } + +} // End namespace pFlow::postprocessData diff --git a/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.hpp b/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.hpp index 1da7cc4f..979018fc 100644 --- a/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.hpp +++ b/src/PostprocessData/region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.hpp @@ -23,7 +23,7 @@ Licence: #include "regionPoints.hpp" -namespace pFlow +namespace pFlow::postprocessData { /** @@ -163,7 +163,7 @@ public: }; // class centerPointsRegionPoints -} // namespace pFlow +} // namespace pFlow::postprocessData diff --git a/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.cpp b/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.cpp index 5d3e4482..c313321c 100644 --- a/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.cpp +++ b/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.cpp @@ -1,7 +1,10 @@ #include "lineRegionPoints.hpp" #include "fieldsDataBase.hpp" -pFlow::lineRegionPoints::lineRegionPoints +namespace pFlow::postprocessData +{ + +lineRegionPoints::lineRegionPoints ( const dictionary &dict, fieldsDataBase &fieldsDataBase @@ -50,7 +53,7 @@ pFlow::lineRegionPoints::lineRegionPoints } } -pFlow::span pFlow::lineRegionPoints::indices(uint32 elem) const +pFlow::span lineRegionPoints::indices(uint32 elem) const { if(elem >= size()) { @@ -65,7 +68,7 @@ pFlow::span pFlow::lineRegionPoints::indices(uint32 elem) c selectedPoints_[elem].size()); } -pFlow::span pFlow::lineRegionPoints::indices(uint32 elem) +pFlow::span lineRegionPoints::indices(uint32 elem) { if(elem >= size()) { @@ -80,7 +83,7 @@ pFlow::span pFlow::lineRegionPoints::indices(uint32 elem) selectedPoints_[elem].size()); } -bool pFlow::lineRegionPoints::update() +bool lineRegionPoints::update() { const auto points = database().updatePoints(); for(auto& elem : selectedPoints_) @@ -101,7 +104,7 @@ bool pFlow::lineRegionPoints::update() return true; } -bool pFlow::lineRegionPoints::write(iOstream &os) const +bool lineRegionPoints::write(iOstream &os) const { os << "# Spheres along a straight line \n"; os << "# No." << tab << "centerPoint" << tab << "diameter" << endl; @@ -118,3 +121,5 @@ bool pFlow::lineRegionPoints::write(iOstream &os) const os << endl; return true; } + +} // End namespace pFlow::postprocessData diff --git a/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.hpp b/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.hpp index 58989aab..8271d917 100644 --- a/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.hpp +++ b/src/PostprocessData/region/regionPoints/lineRegionPoints/lineRegionPoints.hpp @@ -54,7 +54,7 @@ Licence: #include "Vectors.hpp" -namespace pFlow +namespace pFlow::postprocessData { class lineRegionPoints diff --git a/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp b/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp index e983c602..8dae8757 100644 --- a/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp +++ b/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp @@ -1,7 +1,10 @@ #include "multipleSpheresRegionPoints.hpp" #include "fieldsDataBase.hpp" -pFlow::multipleSpheresRegionPoints::multipleSpheresRegionPoints +namespace pFlow::postprocessData +{ + +multipleSpheresRegionPoints::multipleSpheresRegionPoints ( const dictionary &dict, fieldsDataBase &fieldsDataBase @@ -46,7 +49,7 @@ pFlow::multipleSpheresRegionPoints::multipleSpheresRegionPoints } } -pFlow::span pFlow::multipleSpheresRegionPoints::indices(uint32 elem) const +pFlow::span multipleSpheresRegionPoints::indices(uint32 elem) const { if (elem >= size()) { @@ -59,7 +62,7 @@ pFlow::span pFlow::multipleSpheresRegionPoints::indices(uin return span(selectedPoints_[elem].data(), selectedPoints_[elem].size()); } -pFlow::span pFlow::multipleSpheresRegionPoints::indices(uint32 elem) +pFlow::span multipleSpheresRegionPoints::indices(uint32 elem) { if (elem >= size()) { @@ -73,7 +76,7 @@ pFlow::span pFlow::multipleSpheresRegionPoints::indices(uint32 el } -bool pFlow::multipleSpheresRegionPoints::update() +bool multipleSpheresRegionPoints::update() { const auto points = database().updatePoints(); for (auto& elem : selectedPoints_) @@ -94,7 +97,7 @@ bool pFlow::multipleSpheresRegionPoints::update() return true; } -bool pFlow::multipleSpheresRegionPoints::write(iOstream &os) const +bool multipleSpheresRegionPoints::write(iOstream &os) const { os << "# Multiple spheres region points\n"; os << "# No." << tab << "centerPoint" << tab << "diameter" << endl; @@ -110,3 +113,5 @@ bool pFlow::multipleSpheresRegionPoints::write(iOstream &os) const os << endl; return true; } + +} // End namespace pFlow::postprocessData diff --git a/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.hpp b/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.hpp index e01da658..8a67549c 100644 --- a/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.hpp +++ b/src/PostprocessData/region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.hpp @@ -51,7 +51,7 @@ Licence: #include "sphere.hpp" #include "Vectors.hpp" -namespace pFlow +namespace pFlow::postprocessData { class multipleSpheresRegionPoints diff --git a/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.cpp b/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.cpp index 20599503..696c33a4 100644 --- a/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.cpp +++ b/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.cpp @@ -2,7 +2,10 @@ #include "fieldsDataBase.hpp" #include "Time.hpp" -pFlow::regionPoints::regionPoints +namespace pFlow::postprocessData +{ + +regionPoints::regionPoints ( const dictionary &dict, fieldsDataBase &fieldsDataBase @@ -11,18 +14,20 @@ pFlow::regionPoints::regionPoints fieldsDataBase_(fieldsDataBase) {} -const pFlow::Time& pFlow::regionPoints::time() const +const Time& regionPoints::time() const { return fieldsDataBase_.time(); } -const pFlow::fieldsDataBase & pFlow::regionPoints::database() const +const fieldsDataBase & regionPoints::database() const { return fieldsDataBase_; } -pFlow::fieldsDataBase& pFlow::regionPoints::database() +fieldsDataBase& regionPoints::database() { return fieldsDataBase_; } +} // namespace pFlow::postprocessData + diff --git a/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.hpp b/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.hpp index 0931175f..54cca825 100644 --- a/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.hpp +++ b/src/PostprocessData/region/regionPoints/regionPoints/regionPoints.hpp @@ -25,12 +25,16 @@ Licence: #include "dictionary.hpp" #include "pointStructure.hpp" - namespace pFlow +{ + class Time; +} + +namespace pFlow::postprocessData { class fieldsDataBase; -class Time; + /** * @class regionPoints diff --git a/src/PostprocessData/region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp b/src/PostprocessData/region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp index 4022c00e..b647560b 100644 --- a/src/PostprocessData/region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp +++ b/src/PostprocessData/region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp @@ -1,7 +1,10 @@ #include "sphereRegionPoints.hpp" #include "fieldsDataBase.hpp" -pFlow::sphereRegionPoints::sphereRegionPoints +namespace pFlow::postprocessData +{ + +sphereRegionPoints::sphereRegionPoints ( const dictionary &dict, fieldsDataBase &fieldsDataBase @@ -15,7 +18,7 @@ pFlow::sphereRegionPoints::sphereRegionPoints { } -bool pFlow::sphereRegionPoints::update() +bool sphereRegionPoints::update() { const auto points = database().updatePoints(); selectedPoints_.clear(); @@ -30,7 +33,7 @@ bool pFlow::sphereRegionPoints::update() return true; } -bool pFlow::sphereRegionPoints::write(iOstream &os) const +bool sphereRegionPoints::write(iOstream &os) const { os <<"# Single sphere\n"; os <<"# center point: "<