prime2 is added and readme update

This commit is contained in:
Hamidreza
2025-04-24 14:08:17 +03:30
parent a9e5b9bb59
commit f2e8e69899
7 changed files with 407 additions and 174 deletions

View File

@ -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<processedRegFieldType>
@ -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<oFstream>(path);
regPoints().write(os2Ptr_());
}
std::visit
(
[&](auto&& arg)->bool
{
return writeField(os2Ptr_(), ti.t(), arg, threshold());
},
fluctuation2FieldPtr_()
);
return true;
}

View File

@ -150,6 +150,9 @@ private:
uniquePtr<processedRegFieldType> fluctuation2FieldPtr_ = nullptr;
/// Pointer to the output stream for writing fluctuation2 results
mutable uniquePtr<oFstream> os2Ptr_ = nullptr;
public:
TypeInfo("PostprocessOperation<average>");
@ -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