change of namespace from pFlow to pFlow::postprocessData

This commit is contained in:
Hamidreza 2025-04-24 23:31:43 +03:30
parent d5ea338ab3
commit be807e4a71
49 changed files with 317 additions and 177 deletions

View File

@ -24,7 +24,7 @@ Licence:
#include "types.hpp" #include "types.hpp"
#include "span.hpp" #include "span.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T> template<typename T>

View File

@ -26,20 +26,24 @@ Licence:
#include "fieldFunctions.hpp" #include "fieldFunctions.hpp"
#include "dictionary.hpp" #include "dictionary.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
bool pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace); bool pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace);
} }
bool pFlow::fieldsDataBase::loadPointStructureToTime() bool pFlow::postprocessData::fieldsDataBase::loadPointStructureToTime()
{ {
return false; return false;
} }
bool pFlow::fieldsDataBase::checkForUpdate(const word &compoundName, bool forceUpdate) bool pFlow::postprocessData::fieldsDataBase::checkForUpdate
(
const word &compoundName,
bool forceUpdate
)
{ {
auto t = currentTime(); auto t = currentTime();
bool shouldUpdate = false; bool shouldUpdate = false;
@ -58,7 +62,10 @@ bool pFlow::fieldsDataBase::checkForUpdate(const word &compoundName, bool forceU
return shouldUpdate; return shouldUpdate;
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetRealField(const word &name) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetRealField
(
const word &name
)
{ {
bool shouldUpdate = checkForUpdate(name); bool shouldUpdate = checkForUpdate(name);
@ -83,7 +90,10 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetRealField(const word
field.size()); field.size());
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetVolume(bool forceUpdate) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetVolume
(
bool forceUpdate
)
{ {
const word fName = "volume"; const word fName = "volume";
bool shouldUpdate = checkForUpdate(fName, forceUpdate); bool shouldUpdate = checkForUpdate(fName, forceUpdate);
@ -119,7 +129,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetVolume(bool forceUpda
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetDensity(bool forceUpdate) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetDensity(bool forceUpdate)
{ {
const word fName = "density"; const word fName = "density";
@ -155,7 +165,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetDensity(bool forceUpd
field.size()); field.size());
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetOne(bool forceUpdate) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetOne(bool forceUpdate)
{ {
const word fName = "one"; const word fName = "one";
@ -182,7 +192,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetOne(bool forceUpdate)
field.size()); field.size());
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetMass(bool forceUpdate) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetMass(bool forceUpdate)
{ {
const word fName = "mass"; const word fName = "mass";
@ -218,7 +228,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetMass(bool forceUpdate
field.size()); field.size());
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetI(bool forceUpdate) pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::createOrGetI(bool forceUpdate)
{ {
const word fName = "I"; const word fName = "I";
@ -254,7 +264,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::createOrGetI(bool forceUpdate)
field.size()); field.size());
} }
bool pFlow::fieldsDataBase::findFunction( bool pFlow::postprocessData::fieldsDataBase::findFunction(
const word &compoundFieldName, const word &compoundFieldName,
word &fieldName, word &fieldName,
fieldsDataBase::Functions &func) fieldsDataBase::Functions &func)
@ -360,7 +370,7 @@ bool pFlow::fieldsDataBase::findFunction(
return false; // No match return false; // No match
} }
bool pFlow::fieldsDataBase::inputOutputType bool pFlow::postprocessData::fieldsDataBase::inputOutputType
( (
fieldsDataBase::Functions func, fieldsDataBase::Functions func,
const word &inputType, const word &inputType,
@ -458,7 +468,7 @@ bool pFlow::fieldsDataBase::inputOutputType
return false; return false;
} }
pFlow::fieldsDataBase::fieldsDataBase pFlow::postprocessData::fieldsDataBase::fieldsDataBase
( (
systemControl& control, systemControl& control,
const dictionary& postDict, 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(); return time_.currentTime();
} }
bool pFlow::fieldsDataBase::getFieldTypeNameFunction bool pFlow::postprocessData::fieldsDataBase::getFieldTypeNameFunction
( (
const word& compoundName, const word& compoundName,
word& pointFieldName, word& pointFieldName,
@ -543,7 +553,7 @@ bool pFlow::fieldsDataBase::getFieldTypeNameFunction
return true; return true;
} }
bool pFlow::fieldsDataBase::getFieldType bool pFlow::postprocessData::fieldsDataBase::getFieldType
( (
const word& compoundName, const word& compoundName,
word& originalType, word& originalType,
@ -559,7 +569,7 @@ bool pFlow::fieldsDataBase::getFieldType
return true; return true;
} }
bool pFlow::fieldsDataBase::getFieldType bool pFlow::postprocessData::fieldsDataBase::getFieldType
( (
const word &compoundName, const word &compoundName,
word &typeAfterFunction word &typeAfterFunction
@ -575,7 +585,7 @@ bool pFlow::fieldsDataBase::getFieldType
return true; return true;
} }
pFlow::span<pFlow::realx3> pFlow::fieldsDataBase::updatePoints(bool forceUpdate) pFlow::span<pFlow::realx3> pFlow::postprocessData::fieldsDataBase::updatePoints(bool forceUpdate)
{ {
const word fName = "position"; const word fName = "position";
bool shouldUpdate = checkForUpdate(fName, forceUpdate); bool shouldUpdate = checkForUpdate(fName, forceUpdate);
@ -604,7 +614,7 @@ pFlow::span<pFlow::realx3> pFlow::fieldsDataBase::updatePoints(bool forceUpdate)
} }
pFlow::span<pFlow::realx3> pFlow::fieldsDataBase::updateFieldRealx3 pFlow::span<pFlow::realx3> pFlow::postprocessData::fieldsDataBase::updateFieldRealx3
( (
const word &compoundName, const word &compoundName,
bool forceUpdate bool forceUpdate
@ -640,7 +650,7 @@ pFlow::span<pFlow::realx3> pFlow::fieldsDataBase::updateFieldRealx3
} }
pFlow::span<pFlow::realx4> pFlow::fieldsDataBase::updateFieldRealx4 pFlow::span<pFlow::realx4> pFlow::postprocessData::fieldsDataBase::updateFieldRealx4
( (
const word &compoundName, const word &compoundName,
bool forceUpdate bool forceUpdate
@ -676,7 +686,7 @@ pFlow::span<pFlow::realx4> pFlow::fieldsDataBase::updateFieldRealx4
} }
pFlow::span<pFlow::real> pFlow::fieldsDataBase::updateFieldReal pFlow::span<pFlow::real> pFlow::postprocessData::fieldsDataBase::updateFieldReal
( (
const word &compoundName, const word &compoundName,
bool forceUpdate bool forceUpdate
@ -843,7 +853,7 @@ pFlow::span<pFlow::real> pFlow::fieldsDataBase::updateFieldReal
return span<real>(nullptr, 0); return span<real>(nullptr, 0);
} }
pFlow::span<pFlow::uint32> pFlow::fieldsDataBase::updateFieldUint32 pFlow::span<pFlow::uint32> pFlow::postprocessData::fieldsDataBase::updateFieldUint32
( (
const word& name, const word& name,
bool forceUpdate bool forceUpdate
@ -852,7 +862,7 @@ pFlow::span<pFlow::uint32> pFlow::fieldsDataBase::updateFieldUint32
return updateField<uint32>(name, forceUpdate); return updateField<uint32>(name, forceUpdate);
} }
pFlow::allPointFieldTypes pFlow::fieldsDataBase::updateFieldAll pFlow::postprocessData::allPointFieldTypes pFlow::postprocessData::fieldsDataBase::updateFieldAll
( (
const word &compoundName, const word &compoundName,
bool forceUpdate bool forceUpdate
@ -890,8 +900,8 @@ pFlow::allPointFieldTypes pFlow::fieldsDataBase::updateFieldAll
pFlow::uniquePtr<pFlow::fieldsDataBase> pFlow::uniquePtr<pFlow::postprocessData::fieldsDataBase>
pFlow::fieldsDataBase::create pFlow::postprocessData::fieldsDataBase::create
( (
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
@ -931,7 +941,12 @@ pFlow::uniquePtr<pFlow::fieldsDataBase>
return nullptr; 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::regex match("pointField\\<([A-Za-z1-9_]*)\\,([A-Za-z1-9_]*)\\>");
std::smatch search; std::smatch search;

View File

@ -29,13 +29,15 @@ Licence:
#include "Map.hpp" #include "Map.hpp"
#include "shape.hpp" #include "shape.hpp"
namespace pFlow namespace pFlow
{ {
class dictionary;
class systemControl;
class Time;
}
class dictionary; namespace pFlow::postprocessData
class systemControl; {
class Time;
class fieldsDataBase class fieldsDataBase
@ -311,7 +313,7 @@ public:
timeValue startTime); timeValue startTime);
}; };
} // namespace pFlow } // namespace pFlow::postprocessData
#include "fieldsDataBaseTemplates.cpp" #include "fieldsDataBaseTemplates.cpp"

View File

@ -9,7 +9,7 @@
#include "types.hpp" #include "types.hpp"
#include "span.hpp" #include "span.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {

View File

@ -23,9 +23,9 @@ Licence:
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
template<pFlow::ValidFieldType T> template<pFlow::postprocessData::ValidFieldType T>
inline inline
pFlow::span<T> pFlow::fieldsDataBase::updateField(const word& name, bool forceUpdate) pFlow::span<T> pFlow::postprocessData::fieldsDataBase::updateField(const word& name, bool forceUpdate)
{ {
bool shouldUpdate = checkForUpdate(name, forceUpdate); bool shouldUpdate = checkForUpdate(name, forceUpdate);
@ -40,8 +40,8 @@ pFlow::span<T> pFlow::fieldsDataBase::updateField(const word& name, bool forceUp
{ {
if( loadPointFieldToTime(name) ) if( loadPointFieldToTime(name) )
{ {
const auto& pField = time_.lookupObject<pointField_D<T>>(name); const auto& pField = time_.template lookupObject<pointField_D<T>>(name);
allFields_.emplaceBackOrReplace<FieldTypeHost<T>>( allFields_.template emplaceBackOrReplace<FieldTypeHost<T>>(
name, name,
pField.activeValuesHost()); pField.activeValuesHost());
} }
@ -63,9 +63,9 @@ pFlow::span<T> pFlow::fieldsDataBase::updateField(const word& name, bool forceUp
} }
template<pFlow::ValidFieldType T> template<pFlow::postprocessData::ValidFieldType T>
inline inline
pFlow::span<T> pFlow::fieldsDataBase::updateReservedField pFlow::span<T> pFlow::postprocessData::fieldsDataBase::updateReservedField
( (
const word& name, const word& name,
bool forceUpdate bool forceUpdate

View File

@ -8,29 +8,32 @@ namespace pFlow
bool pointFieldGetType(const word& TYPENAME, word& fieldType, word& fieldSpace); 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); return time().lookupObjectName(name);
} }
bool pFlow::simulationFieldsDataBase::loadPointFieldToTime(const word &name) bool pFlow::postprocessData::simulationFieldsDataBase::loadPointFieldToTime(const word &name)
{ {
return time().lookupObjectName(name); return time().lookupObjectName(name);
} }
bool pFlow::simulationFieldsDataBase::loadPointStructureToTime() bool pFlow::postprocessData::simulationFieldsDataBase::loadPointStructureToTime()
{ {
// it is already in the Time object // it is already in the Time object
return time().lookupObjectName(pointStructureFile__); return time().lookupObjectName(pointStructureFile__);
} }
const pFlow::shape& pFlow::simulationFieldsDataBase::getShape() const const pFlow::shape& pFlow::postprocessData::simulationFieldsDataBase::getShape() const
{ {
return shape_; 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 pfType = time().lookupObjectTypeName(name);
word type, space; word type, space;
@ -44,7 +47,7 @@ pFlow::word pFlow::simulationFieldsDataBase::getPointFieldType(const word &name)
return type; return type;
} }
pFlow::simulationFieldsDataBase::simulationFieldsDataBase pFlow::postprocessData::simulationFieldsDataBase::simulationFieldsDataBase
( (
systemControl &control, systemControl &control,
const dictionary& postDict, 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 return
static_cast<const pointStructure&> static_cast<const pointStructure&>

View File

@ -23,7 +23,7 @@ Licence:
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class simulationFieldsDataBase class simulationFieldsDataBase

View File

@ -1,6 +1,9 @@
#include "PostprocessOperationAvMassVelocity.hpp" #include "PostprocessOperationAvMassVelocity.hpp"
pFlow::PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity namespace pFlow::postprocessData
{
PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity
( (
const dictionary &opDict, const dictionary &opDict,
const regionPoints &regPoints, const regionPoints &regPoints,
@ -17,4 +20,6 @@ pFlow::PostprocessOperationAvMassVelocity::PostprocessOperationAvMassVelocity
fieldsDB fieldsDB
) )
{ {
}
} }

View File

@ -132,7 +132,7 @@ Licence:
#include "regionField.hpp" #include "regionField.hpp"
#include "includeMask.hpp" #include "includeMask.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {

View File

@ -3,8 +3,11 @@
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
#include "operationFunctions.hpp" #include "operationFunctions.hpp"
namespace pFlow::postprocessData
{
/// Constructs average processor and initializes result field based on input field type /// Constructs average processor and initializes result field based on input field type
pFlow::PostprocessOperationAverage::PostprocessOperationAverage PostprocessOperationAverage::PostprocessOperationAverage
( (
const dictionary &opDict, const dictionary &opDict,
const regionPoints &regPoints, const regionPoints &regPoints,
@ -39,7 +42,7 @@ pFlow::PostprocessOperationAverage::PostprocessOperationAverage
} }
} }
pFlow::PostprocessOperationAverage::PostprocessOperationAverage PostprocessOperationAverage::PostprocessOperationAverage
( (
const dictionary &opDict, const dictionary &opDict,
const word &fieldName, const word &fieldName,
@ -79,7 +82,7 @@ pFlow::PostprocessOperationAverage::PostprocessOperationAverage
/// Performs weighted average of field values within each region /// Performs weighted average of field values within each region
bool pFlow::PostprocessOperationAverage::execute bool PostprocessOperationAverage::execute
( (
const std::vector<span<real>>& weights, const std::vector<span<real>>& weights,
const regionField<real>& volFactor const regionField<real>& volFactor
@ -140,7 +143,7 @@ bool pFlow::PostprocessOperationAverage::execute
return true; return true;
} }
bool pFlow::PostprocessOperationAverage::write(const fileSystem &parDir) const bool PostprocessOperationAverage::write(const fileSystem &parDir) const
{ {
if(! postprocessOperation::write(parDir)) if(! postprocessOperation::write(parDir))
{ {
@ -173,4 +176,6 @@ bool pFlow::PostprocessOperationAverage::write(const fileSystem &parDir) const
); );
return true; return true;
} }
} // namespace pFlow::postprocessData

View File

@ -132,10 +132,9 @@ Licence:
#include "regionField.hpp" #include "regionField.hpp"
#include "includeMask.hpp" #include "includeMask.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class PostprocessOperationAverage class PostprocessOperationAverage
: :
public postprocessOperation public postprocessOperation
@ -207,6 +206,6 @@ public:
}; };
} } // namespace pFlow::postprocessData
#endif //__PostprocessOperationAverage_hpp__ #endif //__PostprocessOperationAverage_hpp__

View File

@ -3,8 +3,11 @@
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
#include "operationFunctions.hpp" #include "operationFunctions.hpp"
namespace pFlow::postprocessData
{
/// Constructs sum processor and initializes result field based on input field type /// Constructs sum processor and initializes result field based on input field type
pFlow::PostprocessOperationSum::PostprocessOperationSum PostprocessOperationSum::PostprocessOperationSum
( (
const dictionary &opDict, const dictionary &opDict,
const regionPoints &regPoints, const regionPoints &regPoints,
@ -39,7 +42,7 @@ pFlow::PostprocessOperationSum::PostprocessOperationSum
} }
/// Performs weighted sum of field values within each region /// Performs weighted sum of field values within each region
bool pFlow::PostprocessOperationSum::execute bool PostprocessOperationSum::execute
( (
const std::vector<span<real>>& weights, const std::vector<span<real>>& weights,
const regionField<real>& volFactor const regionField<real>& volFactor
@ -72,3 +75,6 @@ bool pFlow::PostprocessOperationSum::execute
return true; return true;
} }
}

View File

@ -129,7 +129,7 @@ Licence:
#include "regionField.hpp" #include "regionField.hpp"
#include "includeMask.hpp" #include "includeMask.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
@ -182,6 +182,6 @@ public:
}; };
} } // namespace pFlow::postprocessData
#endif //__PostprocessOperationSum_hpp__ #endif //__PostprocessOperationSum_hpp__

View File

@ -28,7 +28,7 @@ Licence:
#include "regionField.hpp" #include "regionField.hpp"
#include "includeMask.hpp" #include "includeMask.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T> template<typename T>
@ -190,6 +190,6 @@ regionField<T> executeFluctuation2Operation
return processedField; return processedField;
} }
} // namespace pFlow } // namespace pFlow::postprocessData
#endif //__operationFunctions_hpp__ #endif //__operationFunctions_hpp__

View File

@ -61,7 +61,7 @@ Licence:
#include "Time.hpp" #include "Time.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T, typename Operator> template<typename T, typename Operator>
@ -270,7 +270,7 @@ public:
}; };
} // pFlow } // pFlow::postprocessData
#endif //__IncludeMask_hpp__ #endif //__IncludeMask_hpp__

View File

@ -20,31 +20,34 @@ Licence:
#include "IncludeMask.hpp" #include "IncludeMask.hpp"
namespace pFlow::postprocessData
{
// real // real
template class pFlow::IncludeMask<pFlow::real, pFlow::compareOne<pFlow::real, pFlow::lessThanOp> >; template class IncludeMask<real, compareOne<real, lessThanOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareOne<pFlow::real, pFlow::lessThanEqOp> >; template class IncludeMask<real, compareOne<real, lessThanEqOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareOne<pFlow::real, pFlow::greaterThanOp> >; template class IncludeMask<real, compareOne<real, greaterThanOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareOne<pFlow::real, pFlow::greaterThanEqOp> >; template class IncludeMask<real, compareOne<real, greaterThanEqOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareOne<pFlow::real, pFlow::equalOp> >; template class IncludeMask<real, compareOne<real, equalOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareTwo<pFlow::real, pFlow::betweenOp> >; template class IncludeMask<real, compareTwo<real, betweenOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::compareTwo<pFlow::real, pFlow::betweenEqOp> >; template class IncludeMask<real, compareTwo<real, betweenEqOp> >;
template class pFlow::IncludeMask<pFlow::real, pFlow::allOp<pFlow::real>>; template class IncludeMask<real, allOp<real>>;
// realx3 // realx3
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareOne<pFlow::realx3, pFlow::lessThanOp> >; template class IncludeMask<realx3, compareOne<realx3, lessThanOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareOne<pFlow::realx3, pFlow::lessThanEqOp> >; template class IncludeMask<realx3, compareOne<realx3, lessThanEqOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareOne<pFlow::realx3, pFlow::greaterThanOp> >; template class IncludeMask<realx3, compareOne<realx3, greaterThanOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareOne<pFlow::realx3, pFlow::greaterThanEqOp> >; template class IncludeMask<realx3, compareOne<realx3, greaterThanEqOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareOne<pFlow::realx3, pFlow::equalOp> >; template class IncludeMask<realx3, compareOne<realx3, equalOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareTwo<pFlow::realx3, pFlow::betweenOp> >; template class IncludeMask<realx3, compareTwo<realx3, betweenOp> >;
template class pFlow::IncludeMask<pFlow::realx3, pFlow::compareTwo<pFlow::realx3, pFlow::betweenEqOp> >; template class IncludeMask<realx3, compareTwo<realx3, betweenEqOp> >;
// realx4 } // postprocessData

View File

@ -24,7 +24,10 @@ Licence:
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
pFlow::includeMask::includeMask namespace pFlow::postprocessData
{
includeMask::includeMask
( (
const dictionary& dict, const dictionary& dict,
fieldsDataBase& fieldDB fieldsDataBase& fieldDB
@ -33,7 +36,7 @@ pFlow::includeMask::includeMask
database_(fieldDB) database_(fieldDB)
{} {}
pFlow::includeMask::includeMask includeMask::includeMask
( (
const word &type, const word &type,
const dictionary &opDict, const dictionary &opDict,
@ -44,7 +47,7 @@ pFlow::includeMask::includeMask
{ {
} }
pFlow::uniquePtr<pFlow::includeMask> pFlow::includeMask::create uniquePtr<includeMask> includeMask::create
( (
const dictionary& opDict, const dictionary& opDict,
fieldsDataBase& fieldsDB fieldsDataBase& fieldsDB
@ -97,8 +100,7 @@ pFlow::uniquePtr<pFlow::includeMask> pFlow::includeMask::create
return nullptr; return nullptr;
} }
pFlow::uniquePtr<pFlow::includeMask> uniquePtr<includeMask> includeMask::create
pFlow::includeMask::create
( (
const word &type, const word &type,
const dictionary &opDict, const dictionary &opDict,
@ -150,3 +152,5 @@ pFlow::uniquePtr<pFlow::includeMask>
} }
return nullptr; return nullptr;
} }
}

View File

@ -47,11 +47,15 @@ Licence:
#include "virtualConstructor.hpp" #include "virtualConstructor.hpp"
namespace pFlow namespace pFlow
{
class dictionary;
}
namespace pFlow::postprocessData
{ {
// forward declaration // forward declaration
class fieldsDataBase; class fieldsDataBase;
class dictionary;
class includeMask class includeMask
@ -188,7 +192,7 @@ public:
} // pFlow } // pFlow::postprocessData
#endif //__IncludeMask_hpp__ #endif //__IncludeMask_hpp__

View File

@ -24,7 +24,7 @@ Licence:
#include "types.hpp" #include "types.hpp"
#include "dictionary.hpp" #include "dictionary.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T> template<typename T>
@ -176,6 +176,6 @@ public:
} }
}; };
} } // namespace pFlow::postprocessData
#endif //__maskOperation_hpp__ #endif //__maskOperation_hpp__

View File

@ -24,7 +24,10 @@ Licence:
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
pFlow::postprocessOperation::postprocessOperation namespace pFlow::postprocessData
{
postprocessOperation::postprocessOperation
( (
const dictionary &opDict, const dictionary &opDict,
const regionPoints& regPoints, const regionPoints& regPoints,
@ -42,7 +45,7 @@ pFlow::postprocessOperation::postprocessOperation
) )
{} {}
pFlow::postprocessOperation::postprocessOperation postprocessOperation::postprocessOperation
( (
const dictionary &opDict, const dictionary &opDict,
const word &fieldName, const word &fieldName,
@ -89,12 +92,12 @@ pFlow::postprocessOperation::postprocessOperation
fatalExit; fatalExit;
} }
} }
const pFlow::Time& pFlow::postprocessOperation::time() const const Time& postprocessOperation::time() const
{ {
return database_.time(); return database_.time();
} }
bool pFlow::postprocessOperation::write(const fileSystem &parDir) const bool postprocessOperation::write(const fileSystem &parDir) const
{ {
auto ti = time().TimeInfo(); auto ti = time().TimeInfo();
@ -121,11 +124,12 @@ bool pFlow::postprocessOperation::write(const fileSystem &parDir) const
return true; return true;
} }
pFlow::uniquePtr<pFlow::postprocessOperation> uniquePtr<postprocessOperation> postprocessOperation::create
pFlow::postprocessOperation::create( (
const dictionary &opDict, const dictionary &opDict,
const regionPoints &regPoints, const regionPoints &regPoints,
fieldsDataBase &fieldsDB) fieldsDataBase &fieldsDB
)
{ {
word func = opDict.getVal<word>("function"); word func = opDict.getVal<word>("function");
word method = angleBracketsNames("PostprocessOperation", func); word method = angleBracketsNames("PostprocessOperation", func);
@ -151,3 +155,5 @@ pFlow::postprocessOperation::create(
return nullptr; return nullptr;
} }
} }
}

View File

@ -80,12 +80,15 @@ Licence:
namespace pFlow namespace pFlow
{ {
class Time;
}
namespace pFlow::postprocessData
{
/// - forward declaration /// - forward declaration
class fieldsDataBase; class fieldsDataBase;
class Time;
class postprocessOperation class postprocessOperation
{ {
@ -96,7 +99,7 @@ public:
private: private:
/// Dictionary containing operation-specific parameters. /// Dictionary containing operation-specific parameters.
dictionary operationDict_; pFlow::dictionary operationDict_;
/// This Threshold is used to exclude the regions which contain /// This Threshold is used to exclude the regions which contain
/// fewer than this value. /// fewer than this value.
@ -266,6 +269,6 @@ public:
}; };
} } // namespace pFlow::postprocessData
#endif //__postprocessOperation_hpp__ #endif //__postprocessOperation_hpp__

View File

@ -27,7 +27,7 @@ Licence:
#include "iOstream.hpp" #include "iOstream.hpp"
#include "regionField.hpp" #include "regionField.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
/// Type alias for processed region field types. /// Type alias for processed region field types.
@ -95,6 +95,6 @@ bool writeField
return true; return true;
} }
} // namespace pFlow } // namespace pFlow::postprocessData
#endif //__postprocessOperationFunctions_hpp__ #endif //__postprocessOperationFunctions_hpp__

View File

@ -20,7 +20,7 @@ Licence:
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
template<typename RegionType, typename ProcessMethodType> template<typename RegionType, typename ProcessMethodType>
pFlow::PostprocessComponent<RegionType,ProcessMethodType>::PostprocessComponent pFlow::postprocessData::PostprocessComponent<RegionType,ProcessMethodType>::PostprocessComponent
( (
const dictionary& dict, const dictionary& dict,
fieldsDataBase& fieldsDB, fieldsDataBase& fieldsDB,
@ -61,7 +61,7 @@ pFlow::PostprocessComponent<RegionType,ProcessMethodType>::PostprocessComponent
template <typename RegionType, typename ProcessMethodType> template <typename RegionType, typename ProcessMethodType>
bool pFlow::PostprocessComponent<RegionType, ProcessMethodType>::execute bool pFlow::postprocessData::PostprocessComponent<RegionType, ProcessMethodType>::execute
( (
const timeInfo &ti, const timeInfo &ti,
bool forceUpdate bool forceUpdate
@ -129,7 +129,7 @@ bool pFlow::PostprocessComponent<RegionType, ProcessMethodType>::execute
template <typename RegionType, typename ProcessMethodType> template <typename RegionType, typename ProcessMethodType>
inline inline
bool pFlow::PostprocessComponent<RegionType, ProcessMethodType>::write bool pFlow::postprocessData::PostprocessComponent<RegionType, ProcessMethodType>::write
( (
const fileSystem &parDir const fileSystem &parDir
) const ) const

View File

@ -32,7 +32,7 @@ Licence:
#include "regionPoints.hpp" #include "regionPoints.hpp"
#include "regionField.hpp" #include "regionField.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename RegionType, typename ProcessMethodType> template<typename RegionType, typename ProcessMethodType>

View File

@ -24,7 +24,7 @@ Licence:
#include "PostprocessComponent.hpp" #include "PostprocessComponent.hpp"
#include "arithmetic.hpp" #include "arithmetic.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename RegionType> template<typename RegionType>

View File

@ -25,7 +25,7 @@ Licence:
#include "GaussianDistribution.hpp" #include "GaussianDistribution.hpp"
#include "numericConstants.hpp" #include "numericConstants.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename RegionType> template<typename RegionType>

View File

@ -24,7 +24,7 @@ Licence:
#include "PostprocessComponent.hpp" #include "PostprocessComponent.hpp"
#include "uniformDistribution.hpp" #include "uniformDistribution.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename RegionType> template<typename RegionType>

View File

@ -27,16 +27,18 @@ Licence:
#include "lineRegionPoints.hpp" #include "lineRegionPoints.hpp"
#include "multipleSpheresRegionPoints.hpp" #include "multipleSpheresRegionPoints.hpp"
namespace pFlow::postprocessData
{
template class PostprocessComponentGaussian<sphereRegionPoints>;
template class PostprocessComponentUniform<sphereRegionPoints>;
template class PostprocessComponentArithmetic<sphereRegionPoints>;
template class pFlow::PostprocessComponentGaussian<pFlow::sphereRegionPoints>; template class PostprocessComponentGaussian<multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::sphereRegionPoints>; template class PostprocessComponentUniform<multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::sphereRegionPoints>; template class PostprocessComponentArithmetic<multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentGaussian<pFlow::multipleSpheresRegionPoints>; template class PostprocessComponentGaussian<lineRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::multipleSpheresRegionPoints>; template class PostprocessComponentUniform<lineRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::multipleSpheresRegionPoints>; template class PostprocessComponentArithmetic<lineRegionPoints>;
template class pFlow::PostprocessComponentGaussian<pFlow::lineRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::lineRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::lineRegionPoints>;
}

View File

@ -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 "particleProbePostprocessComponent.hpp"
#include "Time.hpp" #include "Time.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T> template<typename T>
@ -62,7 +82,7 @@ inline bool writeField
} }
pFlow::particleProbePostprocessComponent::particleProbePostprocessComponent pFlow::postprocessData::particleProbePostprocessComponent::particleProbePostprocessComponent
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDB, fieldsDataBase &fieldsDB,
@ -81,7 +101,7 @@ pFlow::particleProbePostprocessComponent::particleProbePostprocessComponent
name_(dict.name()) name_(dict.name())
{} {}
bool pFlow::particleProbePostprocessComponent::execute bool pFlow::postprocessData::particleProbePostprocessComponent::execute
( (
const timeInfo &ti, const timeInfo &ti,
bool forceExecute 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; if(! executed_ ) return true;

View File

@ -27,7 +27,7 @@ Licence:
#include "regionField.hpp" #include "regionField.hpp"
#include "oFstream.hpp" #include "oFstream.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {

View File

@ -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 "postprocessComponent.hpp"
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
#include "Time.hpp" #include "Time.hpp"
pFlow::postprocessComponent::postprocessComponent pFlow::postprocessData::postprocessComponent::postprocessComponent
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDB, fieldsDataBase &fieldsDB,
@ -23,7 +43,7 @@ pFlow::postprocessComponent::postprocessComponent
} }
pFlow::uniquePtr<pFlow::postprocessComponent> pFlow::postprocessComponent::create pFlow::uniquePtr<pFlow::postprocessData::postprocessComponent> pFlow::postprocessData::postprocessComponent::create
( (
const dictionary& dict, const dictionary& dict,
fieldsDataBase& fieldsDB, fieldsDataBase& fieldsDB,

View File

@ -25,12 +25,17 @@ Licence:
#include "dictionary.hpp" #include "dictionary.hpp"
#include "virtualConstructor.hpp" #include "virtualConstructor.hpp"
namespace pFlow namespace
{
class dictionary;
}
namespace pFlow::postprocessData
{ {
class fieldsDataBase;
class regionPoints; class regionPoints;
class dictionary; class fieldsDataBase;
class postprocessComponent class postprocessComponent
{ {
@ -112,6 +117,6 @@ public:
}; };
} // namespace pFlow } // namespace pFlow::postprocessData
#endif // __postprocessComponent_hpp__ #endif // __postprocessComponent_hpp__

View File

@ -1,4 +1,3 @@
/*------------------------------- phasicFlow --------------------------------- /*------------------------------- phasicFlow ---------------------------------
O C enter of O C enter of
O O E ngineering and O O E ngineering and
@ -25,7 +24,7 @@ Licence:
#include "postprocessGlobals.hpp" #include "postprocessGlobals.hpp"
#include "postprocessComponent.hpp" #include "postprocessComponent.hpp"
pFlow::postprocessData::postprocessData pFlow::postprocessData::postprocessData::postprocessData
( (
const systemControl &control, const systemControl &control,
timeValue startTime 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 dictionary is not provided, no extra action is required.
if( !dict_.fileExist() || !dict_.headerOk() ) 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; if( inSimulation_ && !activeInSimulation_() ) return true;
@ -118,7 +117,7 @@ bool pFlow::postprocessData::execute()
return true; return true;
} }
bool pFlow::postprocessData::write() const bool pFlow::postprocessData::postprocessData::write() const
{ {
if( inSimulation_ && !activeInSimulation_() ) return true; if( inSimulation_ && !activeInSimulation_() ) return true;
@ -129,7 +128,7 @@ bool pFlow::postprocessData::write() const
continue; continue;
} }
if(!component->write(postProcessGlobals::defaultDir__/component->name())) if(!component->write(defaultDir__/component->name()))
{ {
fatalErrorInFunction fatalErrorInFunction
<<"Error occured in writing postprocess component: " <<"Error occured in writing postprocess component: "
@ -140,7 +139,7 @@ bool pFlow::postprocessData::write() const
return true; return true;
} }
void pFlow::postprocessData::setOutputDirectory(const fileSystem &path) const void pFlow::postprocessData::postprocessData::setOutputDirectory(const fileSystem &path) const
{ {
postProcessGlobals::defaultDir__ = path; defaultDir__ = path;
} }

View File

@ -28,14 +28,18 @@ Licence:
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
#include "postprocessComponent.hpp" #include "postprocessComponent.hpp"
namespace pFlow
namespace pFlow
{ {
class systemControl; class systemControl;
class Time; class Time;
class timeInfo; class timeInfo;
}
namespace pFlow::postprocessData
{
/** /**
* @class postprocessData * @class postprocessData
@ -109,6 +113,6 @@ public:
void setOutputDirectory(const fileSystem& path)const; void setOutputDirectory(const fileSystem& path)const;
}; };
} // namespace pFlow } // namespace pFlow::postprocessData
#endif // __postprocessData_hpp__ #endif // __postprocessData_hpp__

View File

@ -23,7 +23,7 @@ Licence:
#include "fileSystem.hpp" #include "fileSystem.hpp"
namespace pFlow::postProcessGlobals namespace pFlow::postprocessData
{ {
static fileSystem defaultDir__; static fileSystem defaultDir__;

View File

@ -22,9 +22,11 @@ Licence:
#define __postprocessTimeControl_hpp__ #define __postprocessTimeControl_hpp__
#include "baseTimeControl.hpp" #include "baseTimeControl.hpp"
#include "dictionary.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class postprocessTimeControl class postprocessTimeControl
: :
public baseTimeControl public baseTimeControl
@ -60,6 +62,6 @@ postprocessTimeControl(
// Additional methods and members can be added here // Additional methods and members can be added here
}; };
} // namespace pFlow } // namespace pFlow::postprocessData
#endif // __postprocessTimeControl_hpp__ #endif // __postprocessTimeControl_hpp__

View File

@ -169,7 +169,7 @@ In addition to the above basic functions, some derived functions are available f
| Function | Property type | Description | Formula | Required Parameters | | 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 ### 6.4. Available Fields

View File

@ -25,7 +25,7 @@ Licence:
#include "regionPoints.hpp" #include "regionPoints.hpp"
#include "Field.hpp" #include "Field.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
template<typename T> template<typename T>
@ -119,7 +119,7 @@ public:
}; };
} // namespace pFlow } // namespace pFlow::postprocessData
#include "regionFieldTemplate.cpp" #include "regionFieldTemplate.cpp"

View File

@ -1,10 +1,14 @@
namespace pFlow::postprocessData
{
template<typename T> template<typename T>
pFlow::regionField<T>::regionField( regionField<T>::regionField(
const word& name, const word& name,
const regionPoints& rPoints, const regionPoints& rPoints,
const T defaultVal) const T defaultVal)
: :
field_(name, "regionFieldValue", rPoints.size(), rPoints.size(), defaultVal), field_(name, "regionFieldValue", rPoints.size(), rPoints.size(), defaultVal),
regionPoints_(rPoints) regionPoints_(rPoints)
{} {}
} // End namespace pFlow::postprocessData

View File

@ -3,7 +3,10 @@
#include "Set.hpp" #include "Set.hpp"
#include "pStructSelector.hpp" #include "pStructSelector.hpp"
bool pFlow::centerPointsRegionPoints::selectIds() namespace pFlow::postprocessData
{
bool centerPointsRegionPoints::selectIds()
{ {
if(!firstTimeUpdate_) return true; if(!firstTimeUpdate_) return true;
firstTimeUpdate_ = false; firstTimeUpdate_ = false;
@ -42,7 +45,7 @@ bool pFlow::centerPointsRegionPoints::selectIds()
return true; return true;
} }
pFlow::centerPointsRegionPoints::centerPointsRegionPoints( centerPointsRegionPoints::centerPointsRegionPoints(
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDataBase) fieldsDataBase &fieldsDataBase)
: regionPoints(dict, fieldsDataBase), : regionPoints(dict, fieldsDataBase),
@ -50,7 +53,7 @@ pFlow::centerPointsRegionPoints::centerPointsRegionPoints(
probDict_(dict) probDict_(dict)
{} {}
bool pFlow::centerPointsRegionPoints::update() bool centerPointsRegionPoints::update()
{ {
if(!selectIds()) return false; if(!selectIds()) return false;
@ -74,7 +77,7 @@ bool pFlow::centerPointsRegionPoints::update()
return true; return true;
} }
bool pFlow::centerPointsRegionPoints::write(iOstream &os) const bool centerPointsRegionPoints::write(iOstream &os) const
{ {
if(firstTimeUpdate_) if(firstTimeUpdate_)
{ {
@ -95,3 +98,5 @@ bool pFlow::centerPointsRegionPoints::write(iOstream &os) const
return true; return true;
} }
} // End namespace pFlow::postprocessData

View File

@ -23,7 +23,7 @@ Licence:
#include "regionPoints.hpp" #include "regionPoints.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
/** /**
@ -163,7 +163,7 @@ public:
}; // class centerPointsRegionPoints }; // class centerPointsRegionPoints
} // namespace pFlow } // namespace pFlow::postprocessData

View File

@ -1,7 +1,10 @@
#include "lineRegionPoints.hpp" #include "lineRegionPoints.hpp"
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
pFlow::lineRegionPoints::lineRegionPoints namespace pFlow::postprocessData
{
lineRegionPoints::lineRegionPoints
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDataBase fieldsDataBase &fieldsDataBase
@ -50,7 +53,7 @@ pFlow::lineRegionPoints::lineRegionPoints
} }
} }
pFlow::span<const pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem) const pFlow::span<const pFlow::uint32> lineRegionPoints::indices(uint32 elem) const
{ {
if(elem >= size()) if(elem >= size())
{ {
@ -65,7 +68,7 @@ pFlow::span<const pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem) c
selectedPoints_[elem].size()); selectedPoints_[elem].size());
} }
pFlow::span<pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem) pFlow::span<pFlow::uint32> lineRegionPoints::indices(uint32 elem)
{ {
if(elem >= size()) if(elem >= size())
{ {
@ -80,7 +83,7 @@ pFlow::span<pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem)
selectedPoints_[elem].size()); selectedPoints_[elem].size());
} }
bool pFlow::lineRegionPoints::update() bool lineRegionPoints::update()
{ {
const auto points = database().updatePoints(); const auto points = database().updatePoints();
for(auto& elem : selectedPoints_) for(auto& elem : selectedPoints_)
@ -101,7 +104,7 @@ bool pFlow::lineRegionPoints::update()
return true; return true;
} }
bool pFlow::lineRegionPoints::write(iOstream &os) const bool lineRegionPoints::write(iOstream &os) const
{ {
os << "# Spheres along a straight line \n"; os << "# Spheres along a straight line \n";
os << "# No." << tab << "centerPoint" << tab << "diameter" << endl; os << "# No." << tab << "centerPoint" << tab << "diameter" << endl;
@ -118,3 +121,5 @@ bool pFlow::lineRegionPoints::write(iOstream &os) const
os << endl; os << endl;
return true; return true;
} }
} // End namespace pFlow::postprocessData

View File

@ -54,7 +54,7 @@ Licence:
#include "Vectors.hpp" #include "Vectors.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class lineRegionPoints class lineRegionPoints

View File

@ -1,7 +1,10 @@
#include "multipleSpheresRegionPoints.hpp" #include "multipleSpheresRegionPoints.hpp"
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
pFlow::multipleSpheresRegionPoints::multipleSpheresRegionPoints namespace pFlow::postprocessData
{
multipleSpheresRegionPoints::multipleSpheresRegionPoints
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDataBase fieldsDataBase &fieldsDataBase
@ -46,7 +49,7 @@ pFlow::multipleSpheresRegionPoints::multipleSpheresRegionPoints
} }
} }
pFlow::span<const pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uint32 elem) const pFlow::span<const pFlow::uint32> multipleSpheresRegionPoints::indices(uint32 elem) const
{ {
if (elem >= size()) if (elem >= size())
{ {
@ -59,7 +62,7 @@ pFlow::span<const pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uin
return span<const uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size()); return span<const uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size());
} }
pFlow::span<pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uint32 elem) pFlow::span<pFlow::uint32> multipleSpheresRegionPoints::indices(uint32 elem)
{ {
if (elem >= size()) if (elem >= size())
{ {
@ -73,7 +76,7 @@ pFlow::span<pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uint32 el
} }
bool pFlow::multipleSpheresRegionPoints::update() bool multipleSpheresRegionPoints::update()
{ {
const auto points = database().updatePoints(); const auto points = database().updatePoints();
for (auto& elem : selectedPoints_) for (auto& elem : selectedPoints_)
@ -94,7 +97,7 @@ bool pFlow::multipleSpheresRegionPoints::update()
return true; return true;
} }
bool pFlow::multipleSpheresRegionPoints::write(iOstream &os) const bool multipleSpheresRegionPoints::write(iOstream &os) const
{ {
os << "# Multiple spheres region points\n"; os << "# Multiple spheres region points\n";
os << "# No." << tab << "centerPoint" << tab << "diameter" << endl; os << "# No." << tab << "centerPoint" << tab << "diameter" << endl;
@ -110,3 +113,5 @@ bool pFlow::multipleSpheresRegionPoints::write(iOstream &os) const
os << endl; os << endl;
return true; return true;
} }
} // End namespace pFlow::postprocessData

View File

@ -51,7 +51,7 @@ Licence:
#include "sphere.hpp" #include "sphere.hpp"
#include "Vectors.hpp" #include "Vectors.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class multipleSpheresRegionPoints class multipleSpheresRegionPoints

View File

@ -2,7 +2,10 @@
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
#include "Time.hpp" #include "Time.hpp"
pFlow::regionPoints::regionPoints namespace pFlow::postprocessData
{
regionPoints::regionPoints
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDataBase fieldsDataBase &fieldsDataBase
@ -11,18 +14,20 @@ pFlow::regionPoints::regionPoints
fieldsDataBase_(fieldsDataBase) fieldsDataBase_(fieldsDataBase)
{} {}
const pFlow::Time& pFlow::regionPoints::time() const const Time& regionPoints::time() const
{ {
return fieldsDataBase_.time(); return fieldsDataBase_.time();
} }
const pFlow::fieldsDataBase & pFlow::regionPoints::database() const const fieldsDataBase & regionPoints::database() const
{ {
return fieldsDataBase_; return fieldsDataBase_;
} }
pFlow::fieldsDataBase& pFlow::regionPoints::database() fieldsDataBase& regionPoints::database()
{ {
return fieldsDataBase_; return fieldsDataBase_;
} }
} // namespace pFlow::postprocessData

View File

@ -25,12 +25,16 @@ Licence:
#include "dictionary.hpp" #include "dictionary.hpp"
#include "pointStructure.hpp" #include "pointStructure.hpp"
namespace pFlow namespace pFlow
{
class Time;
}
namespace pFlow::postprocessData
{ {
class fieldsDataBase; class fieldsDataBase;
class Time;
/** /**
* @class regionPoints * @class regionPoints

View File

@ -1,7 +1,10 @@
#include "sphereRegionPoints.hpp" #include "sphereRegionPoints.hpp"
#include "fieldsDataBase.hpp" #include "fieldsDataBase.hpp"
pFlow::sphereRegionPoints::sphereRegionPoints namespace pFlow::postprocessData
{
sphereRegionPoints::sphereRegionPoints
( (
const dictionary &dict, const dictionary &dict,
fieldsDataBase &fieldsDataBase fieldsDataBase &fieldsDataBase
@ -15,7 +18,7 @@ pFlow::sphereRegionPoints::sphereRegionPoints
{ {
} }
bool pFlow::sphereRegionPoints::update() bool sphereRegionPoints::update()
{ {
const auto points = database().updatePoints(); const auto points = database().updatePoints();
selectedPoints_.clear(); selectedPoints_.clear();
@ -30,7 +33,7 @@ bool pFlow::sphereRegionPoints::update()
return true; return true;
} }
bool pFlow::sphereRegionPoints::write(iOstream &os) const bool sphereRegionPoints::write(iOstream &os) const
{ {
os <<"# Single sphere\n"; os <<"# Single sphere\n";
os <<"# center point: "<<sphereRegion_.center()<<endl; os <<"# center point: "<<sphereRegion_.center()<<endl;
@ -39,3 +42,5 @@ bool pFlow::sphereRegionPoints::write(iOstream &os) const
return true; return true;
} }
} // End namespace pFlow::postprocessData

View File

@ -38,7 +38,7 @@ Licence:
#include "sphere.hpp" #include "sphere.hpp"
#include "Vectors.hpp" #include "Vectors.hpp"
namespace pFlow namespace pFlow::postprocessData
{ {
class sphereRegionPoints class sphereRegionPoints