From f2e8e69899fc207112f5bb5c4c14f17fdd189144 Mon Sep 17 00:00:00 2001 From: Hamidreza Date: Thu, 24 Apr 2025 14:08:17 +0330 Subject: [PATCH 1/5] prime2 is added and readme update --- .../PostprocessOperationAverage.cpp | 38 ++- .../PostprocessOperationAverage.hpp | 7 + .../postprocessOperation.cpp | 58 ---- .../postprocessOperation.hpp | 11 +- .../postprocessOperationFunctions.hpp | 100 +++++++ src/PostprocessData/readme.md | 259 ++++++++++++++++-- .../sampleDictionary/postprocessDataDict | 108 +++----- 7 files changed, 407 insertions(+), 174 deletions(-) create mode 100644 src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp index 3ffbd5b8..15474667 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.cpp @@ -77,6 +77,7 @@ pFlow::PostprocessOperationAverage::PostprocessOperationAverage } } + /// Performs weighted average of field values within each region bool pFlow::PostprocessOperationAverage::execute ( @@ -109,7 +110,7 @@ bool pFlow::PostprocessOperationAverage::execute allField) ); - if(calculateFluctuation2_) + if(calculateFluctuation2_()) { auto& processedRegField = processedRegFieldPtr_(); fluctuation2FieldPtr_ = makeUnique @@ -136,5 +137,40 @@ bool pFlow::PostprocessOperationAverage::execute } + return true; +} + +bool pFlow::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; } \ No newline at end of file diff --git a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp index 6620d588..4d71d54f 100644 --- a/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp +++ b/src/PostprocessData/operation/PostprocessOperation/PostprocessOperationAverage.hpp @@ -150,6 +150,9 @@ private: uniquePtr fluctuation2FieldPtr_ = nullptr; + /// Pointer to the output stream for writing fluctuation2 results + mutable uniquePtr os2Ptr_ = nullptr; + public: TypeInfo("PostprocessOperation"); @@ -190,6 +193,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 diff --git a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp index e752f359..3eedd066 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp @@ -23,64 +23,6 @@ Licence: #include "regionPoints.hpp" #include "fieldsDataBase.hpp" -namespace pFlow -{ - -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<, regionField, and regionField are supported -/// in the postprocessOperation class. -using processedRegFieldType = std::variant - < - regionField, - regionField, - regionField - >; + /// - forward declaration class fieldsDataBase; diff --git a/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp b/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp new file mode 100644 index 00000000..82376fd1 --- /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 +{ + +/// 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< Date: Thu, 24 Apr 2025 14:18:08 +0330 Subject: [PATCH 2/5] minor change to readme.md --- src/PostprocessData/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PostprocessData/readme.md b/src/PostprocessData/readme.md index fa22ebff..8dbefd5b 100644 --- a/src/PostprocessData/readme.md +++ b/src/PostprocessData/readme.md @@ -150,6 +150,7 @@ where: 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: From a448ce5f8d2179bcfe1c6ea7f2de9776a4a7d061 Mon Sep 17 00:00:00 2001 From: Hamidreza Date: Thu, 24 Apr 2025 14:28:28 +0330 Subject: [PATCH 3/5] minor changes to readme.md --- src/PostprocessData/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PostprocessData/readme.md b/src/PostprocessData/readme.md index 8dbefd5b..543e35cc 100644 --- a/src/PostprocessData/readme.md +++ b/src/PostprocessData/readme.md @@ -2,6 +2,9 @@ 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. +- 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 bellow 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 utitlity `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: From d5ea338ab33d3e838cc4478d2213d237aef31840 Mon Sep 17 00:00:00 2001 From: Hamidreza Date: Thu, 24 Apr 2025 14:41:31 +0330 Subject: [PATCH 4/5] spell check readme.md --- src/PostprocessData/readme.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/PostprocessData/readme.md b/src/PostprocessData/readme.md index 543e35cc..050420d4 100644 --- a/src/PostprocessData/readme.md +++ b/src/PostprocessData/readme.md @@ -2,8 +2,8 @@ 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. -- 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 bellow 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 utitlity `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. +- 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 @@ -38,7 +38,7 @@ Postprocessing in phasicFlow allows you to: - [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 dictioanry file (postprocessDataDict)](#10-a-complete-dictioanry-file-postprocessdatadict) +- [10. A complete dictionary file (postprocessDataDict)](#10-a-complete-dictionary-file-postprocessdatadict) ## 2. Setting Up Postprocessing @@ -74,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"); @@ -159,8 +160,8 @@ $$\text{fluctuation}^2 = \frac{\sum_j w_j \cdot \phi_j \cdot (\text{field}_j - \ 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. +- `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 @@ -291,7 +292,7 @@ This example defines a sphere region and performs three operations: ### 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 @@ -358,7 +359,6 @@ Here is a complete list of these special functions: | `magnitude cube` | `realx3` | `magCube(velocity)` | | `magnitude square root` | `realx3` | `magSqrt(acceleration)` | - ### 8.2. Particle Filtering with includeMask The `includeMask` parameter allows you to filter particles based on field values: @@ -393,7 +393,8 @@ Supported masks: ## 9. Mathematical Formulations For weighted `bulk` properties calculation, we have these two general formulations: - - For weighted averaging: + +- For weighted averaging: $$ \text{average} = \frac{\sum_j w_j \cdot \phi_j \cdot \text{field}_j}{\sum_i w_i \cdot \phi_i} $$ @@ -405,7 +406,7 @@ If `divideByVolume` is set to `yes`, the result is divided by the volume of the $$ \text{volumetric result} = \frac{\text{result}}{V_{\text{region}}} $$ -## 10. A complete dictioanry file (postprocessDataDict) +## 10. A complete dictionary file (postprocessDataDict) ```C++ /* -------------------------------*- C++ -*--------------------------------- *\ From be807e4a71c9bd02c216a774ca50e36b2f305411 Mon Sep 17 00:00:00 2001 From: Hamidreza Date: Thu, 24 Apr 2025 23:31:43 +0330 Subject: [PATCH 5/5] change of namespace from pFlow to pFlow::postprocessData --- .../fieldsDataBase/fieldFunctions.hpp | 2 +- .../fieldsDataBase/fieldsDataBase.cpp | 65 ++++++++++++------- .../fieldsDataBase/fieldsDataBase.hpp | 12 ++-- .../fieldsDataBase/fieldsDataBaseDclr.hpp | 2 +- .../fieldsDataBaseTemplates.cpp | 12 ++-- .../simulationFieldsDataBase.cpp | 17 +++-- .../simulationFieldsDataBase.hpp | 2 +- .../PostprocessOperationAvMassVelocity.cpp | 7 +- .../PostprocessOperationAvMassVelocity.hpp | 2 +- .../PostprocessOperationAverage.cpp | 15 +++-- .../PostprocessOperationAverage.hpp | 5 +- .../PostprocessOperationSum.cpp | 10 ++- .../PostprocessOperationSum.hpp | 4 +- .../operationFunctions.hpp | 4 +- .../operation/includeMask/IncludeMask.hpp | 4 +- .../operation/includeMask/IncludeMasks.cpp | 35 +++++----- .../operation/includeMask/includeMask.cpp | 14 ++-- .../operation/includeMask/includeMask.hpp | 8 ++- .../operation/includeMask/maskOperations.hpp | 4 +- .../postprocessOperation.cpp | 20 ++++-- .../postprocessOperation.hpp | 11 ++-- .../postprocessOperationFunctions.hpp | 4 +- .../PostprocessComponent.cpp | 6 +- .../PostprocessComponent.hpp | 2 +- .../PostprocessComponentArithmetic.hpp | 2 +- .../PostprocessComponentGaussian.hpp | 2 +- .../PostprocessComponentUniform.hpp | 2 +- .../PostprocessComponents.cpp | 22 ++++--- .../particleProbePostprocessComponent.cpp | 28 ++++++-- .../particleProbePostprocessComponent.hpp | 2 +- .../postprocessComponent.cpp | 24 ++++++- .../postprocessComponent.hpp | 13 ++-- .../postprocessData/postprocessData.cpp | 15 ++--- .../postprocessData/postprocessData.hpp | 10 ++- .../postprocessData/postprocessGlobals.hpp | 2 +- .../postprocessTimeControl.hpp | 6 +- src/PostprocessData/readme.md | 2 +- .../region/regionFields/regionField.hpp | 4 +- .../regionFields/regionFieldTemplate.cpp | 8 ++- .../centerPointsRegionPoints.cpp | 13 ++-- .../centerPointsRegionPoints.hpp | 4 +- .../lineRegionPoints/lineRegionPoints.cpp | 15 +++-- .../lineRegionPoints/lineRegionPoints.hpp | 2 +- .../multipleSpheresRegionPoints.cpp | 15 +++-- .../multipleSpheresRegionPoints.hpp | 2 +- .../regionPoints/regionPoints.cpp | 13 ++-- .../regionPoints/regionPoints.hpp | 8 ++- .../sphereRegionPoints/sphereRegionPoints.cpp | 11 +++- .../sphereRegionPoints/sphereRegionPoints.hpp | 2 +- 49 files changed, 317 insertions(+), 177 deletions(-) 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 15474667..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, @@ -79,7 +82,7 @@ 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 @@ -140,7 +143,7 @@ bool pFlow::PostprocessOperationAverage::execute return true; } -bool pFlow::PostprocessOperationAverage::write(const fileSystem &parDir) const +bool PostprocessOperationAverage::write(const fileSystem &parDir) const { if(! postprocessOperation::write(parDir)) { @@ -173,4 +176,6 @@ bool pFlow::PostprocessOperationAverage::write(const fileSystem &parDir) const ); return true; -} \ No newline at end of file +} + +} // 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 4d71d54f..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 @@ -207,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 3eedd066..b123f0af 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.cpp @@ -24,7 +24,10 @@ Licence: #include "fieldsDataBase.hpp" -pFlow::postprocessOperation::postprocessOperation +namespace pFlow::postprocessData +{ + +postprocessOperation::postprocessOperation ( const dictionary &opDict, const regionPoints& regPoints, @@ -42,7 +45,7 @@ pFlow::postprocessOperation::postprocessOperation ) {} -pFlow::postprocessOperation::postprocessOperation +postprocessOperation::postprocessOperation ( const dictionary &opDict, const word &fieldName, @@ -89,12 +92,12 @@ pFlow::postprocessOperation::postprocessOperation fatalExit; } } -const pFlow::Time& pFlow::postprocessOperation::time() const +const Time& postprocessOperation::time() const { return database_.time(); } -bool pFlow::postprocessOperation::write(const fileSystem &parDir) const +bool postprocessOperation::write(const fileSystem &parDir) const { auto ti = time().TimeInfo(); @@ -121,11 +124,12 @@ bool pFlow::postprocessOperation::write(const fileSystem &parDir) const return true; } -pFlow::uniquePtr -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); @@ -151,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 61ee263e..73aa3112 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperation.hpp @@ -80,12 +80,15 @@ Licence: namespace pFlow { + class Time; +} - +namespace pFlow::postprocessData +{ /// - forward declaration class fieldsDataBase; -class Time; + class postprocessOperation { @@ -96,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. @@ -266,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 index 82376fd1..5356cf84 100644 --- a/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp +++ b/src/PostprocessData/operation/postprocessOperation/postprocessOperationFunctions.hpp @@ -27,7 +27,7 @@ Licence: #include "iOstream.hpp" #include "regionField.hpp" -namespace pFlow +namespace pFlow::postprocessData { /// Type alias for processed region field types. @@ -95,6 +95,6 @@ bool writeField return true; } -} // namespace pFlow +} // namespace pFlow::postprocessData #endif //__postprocessOperationFunctions_hpp__ \ No newline at end of file diff --git a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.cpp b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.cpp index 10590f7c..90dcff16 100644 --- a/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.cpp +++ b/src/PostprocessData/postprocessComponent/PostprocessComponent/PostprocessComponent.cpp @@ -20,7 +20,7 @@ Licence: -----------------------------------------------------------------------------*/ template -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 050420d4..ee1431ca 100644 --- a/src/PostprocessData/readme.md +++ b/src/PostprocessData/readme.md @@ -169,7 +169,7 @@ In addition to the above basic functions, some derived functions are available f | 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}$ | - | ### 6.4. Available Fields 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: "<