added: save result points in AdaptiveSIM

This commit is contained in:
Arne Morten Kvarving 2020-03-31 13:43:24 +02:00
parent 611149434c
commit a64a40de09
3 changed files with 24 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public:
protected: protected:
//! \brief Assembles and solves the linearized FE equation system. //! \brief Assembles and solves the linearized FE equation system.
virtual bool assembleAndSolveSystem() bool assembleAndSolveSystem() override
{ {
TimeStep dummy; TimeStep dummy;
model.init(dummy); model.init(dummy);
@ -44,6 +44,14 @@ protected:
return true; return true;
} }
//! \brief Saves point results to output file for a given time step.
//! \param[in] time Load/time step parameter
//! \param[in] step Load/time step counter
bool savePoints(double time, int iStep) const override
{
return model.savePoints(time, iStep);
}
T1& model; //!< Reference to the actual sim T1& model; //!< Reference to the actual sim
}; };

View File

@ -174,6 +174,9 @@ bool AdaptiveSIM::solveStep (const char* inputfile, int iStep, bool withRF,
model.getProcessAdm().cout,true,precision)) model.getProcessAdm().cout,true,precision))
return failure(); return failure();
if (!this->savePoints(0.0, iStep))
return failure();
return true; return true;
} }
@ -256,3 +259,9 @@ bool AdaptiveSIM::writeGlv (const char* infile, int iStep)
// Write state information // Write state information
return model.writeGlvStep(iStep,iStep,1); return model.writeGlvStep(iStep,iStep,1);
} }
bool AdaptiveSIM::savePoints(double time, int iStep) const
{
return model.savePoints(solution.front(), time, iStep);
}

View File

@ -73,6 +73,12 @@ public:
//! \param[in] elem The XML element to parse //! \param[in] elem The XML element to parse
virtual bool parse(const TiXmlElement* elem); virtual bool parse(const TiXmlElement* elem);
//! \brief Saves point results to output file for a given time step.
//! \param[in] time Load/time step parameter
//! \param[in] step Load/time step counter
//! \details By default it just forwards to the underlying model
virtual bool savePoints(double time, int iStep) const;
protected: protected:
//! \brief Assembles and solves the linear FE equation system. //! \brief Assembles and solves the linear FE equation system.
virtual bool assembleAndSolveSystem(); virtual bool assembleAndSolveSystem();