diff --git a/src/SIM/SIMoutput.C b/src/SIM/SIMoutput.C index f1a85bf4e..70d78e28d 100644 --- a/src/SIM/SIMoutput.C +++ b/src/SIM/SIMoutput.C @@ -79,6 +79,10 @@ bool SIMoutput::parseOutputTag (const TiXmlElement* elem) if (strcasecmp(elem->Value(),"resultpoints")) return this->SIMinput::parseOutputTag(elem); + int precision; + if (utl::getAttribute(elem,"precision",precision)) + this->setResultPrecision(precision); + std::string fname; if (utl::getAttribute(elem,"file",fname)) this->setPointResultFile(fname,elem->FirstChildElement("dump_coordinates")); @@ -1383,7 +1387,7 @@ bool SIMoutput::savePoints (const Vector& psol, double time, int step) const std::ofstream fs(myPoints[i].first.c_str(), step == 1 ? std::ios::out : std::ios::app); utl::LogStream logs(fs); - if (!this->dumpResults(psol,time,logs,myPoints[i].second,false,3)) + if (!this->dumpResults(psol,time,logs,myPoints[i].second,false,myResPrec)) return false; } } diff --git a/src/SIM/SIMoutput.h b/src/SIM/SIMoutput.h index 32434673e..1535d78e8 100644 --- a/src/SIM/SIMoutput.h +++ b/src/SIM/SIMoutput.h @@ -34,7 +34,7 @@ class SIMoutput : public SIMinput { protected: //! \brief The constructor just forwards to the base class constructor. - SIMoutput(IntegrandBase* itg) : SIMinput(itg), myGeomID(0), myVtf(nullptr) {} + SIMoutput(IntegrandBase* itg) : SIMinput(itg), myGeomID(0), myResPrec(3), myVtf(nullptr) {} public: //! \brief The destructor frees the dynamically allocated VTF object. @@ -206,6 +206,9 @@ class SIMoutput : public SIMinput //! \brief Defines the VTF-file for subsequent results output. void setVTF(VTF* vtf) { myVtf = vtf; } + //! \brief Initializes the geometry block counter. + void setResultPrecision(int precision) { myResPrec = precision; } + //! \brief Initializes the geometry block counter. void setStartGeo(int gID) { myGeomID = gID; } @@ -298,6 +301,7 @@ class SIMoutput : public SIMinput typedef std::pair ResPtPair; //!< Result point group std::vector myPoints; //!< User-defined result sampling points + int myResPrec; //!< User-defined precision for result sampling int myGeomID; //!< VTF geometry block ID for the first patch VTF* myVtf; //!< VTF-file for result visualization