mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-08-07 03:37:02 +00:00
bug fix for issue #241, precision in output file
This commit is contained in:
@ -161,7 +161,15 @@ bool PostprocessOperationAverage::write(const fileSystem &parDir) const
|
|||||||
fileSystem path = parDir+(
|
fileSystem path = parDir+(
|
||||||
processedFieldName()+"_prime2" + ".Start_" + ti.timeName());
|
processedFieldName()+"_prime2" + ".Start_" + ti.timeName());
|
||||||
os2Ptr_ = makeUnique<oFstream>(path);
|
os2Ptr_ = makeUnique<oFstream>(path);
|
||||||
|
|
||||||
|
if(regPoints().scientific())
|
||||||
|
{
|
||||||
|
// set output format to scientific notation
|
||||||
|
os2Ptr_().stdStream()<<std::scientific;
|
||||||
|
}
|
||||||
|
|
||||||
|
os2Ptr_().precision(regPoints().precision());
|
||||||
|
|
||||||
regPoints().write(os2Ptr_());
|
regPoints().write(os2Ptr_());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +107,14 @@ bool postprocessOperation::write(const fileSystem &parDir) const
|
|||||||
processedFieldName() + ".Start_" + ti.timeName());
|
processedFieldName() + ".Start_" + ti.timeName());
|
||||||
osPtr_ = makeUnique<oFstream>(path);
|
osPtr_ = makeUnique<oFstream>(path);
|
||||||
|
|
||||||
|
if(regPoints().scientific())
|
||||||
|
{
|
||||||
|
// set output format to scientific notation
|
||||||
|
osPtr_().stdStream()<<std::scientific;
|
||||||
|
}
|
||||||
|
|
||||||
|
osPtr_().precision(regPoints().precision());
|
||||||
|
|
||||||
regPoints().write(osPtr_());
|
regPoints().write(osPtr_());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,14 @@ bool pFlow::postprocessData::PostprocessComponent<RegionType, ProcessMethodType>
|
|||||||
|
|
||||||
auto osPtr = makeUnique<oFstream>(file);
|
auto osPtr = makeUnique<oFstream>(file);
|
||||||
|
|
||||||
|
// set output format to scientific notation
|
||||||
|
if(regPoints().scientific())
|
||||||
|
{
|
||||||
|
osPtr->stdStream() << std::scientific;
|
||||||
|
}
|
||||||
|
|
||||||
|
osPtr().precision(regPoints().precision());
|
||||||
|
|
||||||
regPoints().write(osPtr());
|
regPoints().write(osPtr());
|
||||||
|
|
||||||
for(auto& operation:operatios_)
|
for(auto& operation:operatios_)
|
||||||
|
@ -157,6 +157,12 @@ bool pFlow::postprocessData::particleProbePostprocessComponent::write(const file
|
|||||||
// file is not open yet
|
// file is not open yet
|
||||||
fileSystem path = parDir + (name_+".Start_"+ti.timeName());
|
fileSystem path = parDir + (name_+".Start_"+ti.timeName());
|
||||||
osPtr_ = makeUnique<oFstream>(path);
|
osPtr_ = makeUnique<oFstream>(path);
|
||||||
|
|
||||||
|
if(regionPointsPtr_().scientific())
|
||||||
|
{
|
||||||
|
osPtr_().stdStream() << std::scientific;
|
||||||
|
}
|
||||||
|
osPtr_().precision(regionPointsPtr_().precision());
|
||||||
regionPointsPtr_().write(osPtr_());
|
regionPointsPtr_().write(osPtr_());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,10 @@ regionPoints::regionPoints
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fieldsDataBase_(fieldsDataBase)
|
fieldsDataBase_(fieldsDataBase)
|
||||||
{}
|
{
|
||||||
|
precision_ = dict.getValOrSet<int>("precision", 6);
|
||||||
|
scientific_ = dict.getValOrSet<Logical>("scientific", Logical(true));
|
||||||
|
}
|
||||||
|
|
||||||
const Time& regionPoints::time() const
|
const Time& regionPoints::time() const
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,13 @@ class regionPoints
|
|||||||
using PointsTypeHost = typename pointStructure::PointsTypeHost;
|
using PointsTypeHost = typename pointStructure::PointsTypeHost;
|
||||||
|
|
||||||
/// Reference to the fields database containing simulation data
|
/// Reference to the fields database containing simulation data
|
||||||
fieldsDataBase& fieldsDataBase_;
|
fieldsDataBase& fieldsDataBase_;
|
||||||
|
|
||||||
|
/// default precision for output
|
||||||
|
int precision_ = 6;
|
||||||
|
|
||||||
|
/// if scientific notation is used for output
|
||||||
|
Logical scientific_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -74,7 +80,16 @@ public:
|
|||||||
|
|
||||||
/// Returns non-const reference to the fields database
|
/// Returns non-const reference to the fields database
|
||||||
fieldsDataBase& database();
|
fieldsDataBase& database();
|
||||||
|
|
||||||
|
int precision() const
|
||||||
|
{
|
||||||
|
return precision_;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool scientific()const
|
||||||
|
{
|
||||||
|
return scientific_();
|
||||||
|
}
|
||||||
/// @brief size of elements
|
/// @brief size of elements
|
||||||
virtual
|
virtual
|
||||||
uint32 size()const = 0;
|
uint32 size()const = 0;
|
||||||
|
Reference in New Issue
Block a user