Skip to content

Commit

Permalink
Changed: AdaptiveSIM::savePoints does not need a time argument,
Browse files Browse the repository at this point in the history
as this class is for static/stationary problems only. The iStep
argument is not a time step counter, but a refinement step counter.
Also, the method is made protected.
  • Loading branch information
kmokstad authored and akva2 committed Oct 8, 2021
1 parent 458b245 commit 35b4aa9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions Apps/Common/SIMSolverAdap.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ class AdaptiveISolver : public AdaptiveSIM
return true;
}

//! \brief Saves point results to output file for a given time step.
//! \param[in] time Load/time step parameter
//! \param[in] iStep Load/time step counter
bool savePoints(double time, int iStep) const override
//! \brief Saves point results to output file for a given refinement step.
//! \param[in] iStep Refinement step counter
bool savePoints(int iStep) const override
{
return model.savePoints(time, iStep);
return model.savePoints(0.0,iStep);
}

T1& model; //!< Reference to the actual sim
Expand Down
6 changes: 3 additions & 3 deletions src/SIM/AdaptiveSIM.C
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool AdaptiveSIM::solveStep (const char* inputfile, int iStep, bool withRF,
model.getProcessAdm().cout,true,precision))
return failure();

if (!this->savePoints(0.0, iStep))
if (!this->savePoints(iStep))
return failure();

return true;
Expand Down Expand Up @@ -267,7 +267,7 @@ bool AdaptiveSIM::writeGlv (const char* infile, int iStep)
}


bool AdaptiveSIM::savePoints(double time, int iStep) const
bool AdaptiveSIM::savePoints (int iStep) const
{
return model.savePoints(solution.front(), time, iStep);
return model.savePoints(solution.front(),0.0,iStep);
}
14 changes: 7 additions & 7 deletions src/SIM/AdaptiveSIM.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AdaptiveSIM : public SIMadmin, public AdaptiveSetup

//! \brief Writes current mesh and results to the VTF-file.
//! \param[in] infile File name used to construct the VTF-file name from
//! \param[in] iStep Refinement step identifier
//! \param[in] iStep Refinement step counter
bool writeGlv(const char* infile, int iStep);

//! \brief Accesses the solution of the linear system.
Expand All @@ -78,16 +78,16 @@ class AdaptiveSIM : public SIMadmin, public AdaptiveSetup
//! \param[in] fixDup Merge duplicated FE nodes on patch interfaces?
virtual bool preprocess(const std::vector<int>& ignored, bool fixDup);

//! \brief Saves point results to output file for a given time step.
//! \param[in] time Load/time step parameter
//! \param[in] iStep Load/time step counter
//! \details By default it just forwards to the underlying model
virtual bool savePoints(double time, int iStep) const;

protected:
//! \brief Assembles and solves the linear FE equation system.
virtual bool assembleAndSolveSystem();

//! \brief Saves point results to output file for a given refinement step.
//! \param[in] iStep Refinement step counter
//!
//! \details By default, this method just forwards to the underlying model.
virtual bool savePoints(int iStep) const;

private:
Vectors gNorm; //!< Global norms
Vectors dNorm; //!< Dual global norms
Expand Down

0 comments on commit 35b4aa9

Please sign in to comment.