Changed: After the restart refactoring, fastForward and postSolve are no
longer needed in the solver templates. Also some doxy issues in SIMSemi3D.
This commit is contained in:
parent
8765eb75e3
commit
6ceb84993e
@ -67,12 +67,6 @@ public:
|
|||||||
return S2.solveStep(tp) && S1.solveStep(tp);
|
return S2.solveStep(tp) && S1.solveStep(tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Postprocesses the solution of current time step.
|
|
||||||
bool postSolve(const TimeStep& tp, bool restart = false)
|
|
||||||
{
|
|
||||||
return S1.postSolve(tp,restart) && S2.postSolve(tp,restart);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \brief Saves the converged results to VTF-file of a given time step.
|
//! \brief Saves the converged results to VTF-file of a given time step.
|
||||||
virtual bool saveStep(const TimeStep& tp, int& nBlock)
|
virtual bool saveStep(const TimeStep& tp, int& nBlock)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,9 @@ template<class PlaneSolver>
|
|||||||
class SIMSemi3D : public SIMadmin, public SIMdependency
|
class SIMSemi3D : public SIMadmin, public SIMdependency
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename PlaneSolver::SetupProps SetupProps;
|
typedef typename PlaneSolver::SetupProps SetupProps; //!< Convenience type
|
||||||
|
|
||||||
|
//! \brief Enum announcing the dimensionality.
|
||||||
enum { dimension = 2 };
|
enum { dimension = 2 };
|
||||||
|
|
||||||
//! \brief The constructor initializes the setup properties.
|
//! \brief The constructor initializes the setup properties.
|
||||||
@ -122,7 +124,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Returns the name of this simulator (for use in the HDF5 export).
|
//! \brief Returns the name of this simulator (for use in the HDF5 export).
|
||||||
std::string getName() const { return "Semi3D"; }
|
virtual std::string getName() const { return "Semi3D"; }
|
||||||
|
|
||||||
//! \brief Adds fields to a data exporter.
|
//! \brief Adds fields to a data exporter.
|
||||||
void registerFields(DataExporter& exporter)
|
void registerFields(DataExporter& exporter)
|
||||||
@ -171,11 +173,10 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief No serialization support.
|
//! \brief Dummy method, no serialization support.
|
||||||
bool serialize(DataExporter::SerializeData& data) { return false; }
|
bool serialize(DataExporter::SerializeData&) { return false; }
|
||||||
|
//! \brief Dummy method, no deserialization support.
|
||||||
//! \brief No deserialization support.
|
bool deSerialize(const DataExporter::SerializeData&) { return false; }
|
||||||
bool deSerialize(const DataExporter::SerializeData& data) { return false; }
|
|
||||||
|
|
||||||
//! \brief Solves the nonlinear equations by Newton-Raphson iterations.
|
//! \brief Solves the nonlinear equations by Newton-Raphson iterations.
|
||||||
bool solveStep(TimeStep& tp)
|
bool solveStep(TimeStep& tp)
|
||||||
@ -189,16 +190,6 @@ public:
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Extracts the velocity vector from the nonlinear solution vector.
|
|
||||||
bool postSolve(const TimeStep& tp, bool restart = false)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
for (size_t i = 0; i < m_planes.size() && ok; i++)
|
|
||||||
ok = m_planes[i]->postSolve(tp,restart);
|
|
||||||
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \brief Sets the initial conditions.
|
//! \brief Sets the initial conditions.
|
||||||
bool setInitialConditions()
|
bool setInitialConditions()
|
||||||
{
|
{
|
||||||
@ -308,6 +299,7 @@ public:
|
|||||||
//! \param[in] nvc Number of components in field
|
//! \param[in] nvc Number of components in field
|
||||||
//! \param[in] patches The geometry the field is defined over
|
//! \param[in] patches The geometry the field is defined over
|
||||||
//! \param[in] diffBasis Different basis for the SIM class and the field
|
//! \param[in] diffBasis Different basis for the SIM class and the field
|
||||||
|
//! \param[in] component Component to use from field
|
||||||
template<class T>
|
template<class T>
|
||||||
void registerDependency(SIMSemi3D<T>* sim, const std::string& name,
|
void registerDependency(SIMSemi3D<T>* sim, const std::string& name,
|
||||||
short int nvc, const PatchVec& patches,
|
short int nvc, const PatchVec& patches,
|
||||||
@ -372,12 +364,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Dummy method.
|
//! \brief Dummy method.
|
||||||
int getLocalNode(int node) const { return -1; }
|
int getLocalNode(int) const { return -1; }
|
||||||
//! \brief Dummy method.
|
//! \brief Dummy method.
|
||||||
int getGlobalNode(int node) const { return -1; }
|
int getGlobalNode(int) const { return -1; }
|
||||||
|
|
||||||
//! \brief Returns the number of bases in the model.
|
//! \brief Returns the number of bases in the model.
|
||||||
int getNoBasis() const { return m_planes[0]->getNoBasis(); }
|
int getNoBasis() const { return m_planes.front()->getNoBasis(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<PlaneSolver*> m_planes; //!< Planar solvers
|
std::vector<PlaneSolver*> m_planes; //!< Planar solvers
|
||||||
|
@ -72,11 +72,6 @@ public:
|
|||||||
|
|
||||||
//! \brief Advances the time step one step forward.
|
//! \brief Advances the time step one step forward.
|
||||||
bool advanceStep() { return tp.increment() && S1.advanceStep(tp); }
|
bool advanceStep() { return tp.increment() && S1.advanceStep(tp); }
|
||||||
//! \brief Advances the time step \a n steps forward.
|
|
||||||
void fastForward(int n) { for (int i = 0; i < n; i++) this->advanceStep(); }
|
|
||||||
|
|
||||||
//! \brief Postprocesses the solution of current time step.
|
|
||||||
void postSolve(const TimeStep& t, bool rst = false) { S1.postSolve(t,rst); }
|
|
||||||
|
|
||||||
//! \brief Solves the problem up to the final time.
|
//! \brief Solves the problem up to the final time.
|
||||||
virtual int solveProblem(char* infile, const char* heading = nullptr,
|
virtual int solveProblem(char* infile, const char* heading = nullptr,
|
||||||
|
@ -26,7 +26,6 @@ public:
|
|||||||
preprocess_called(false),
|
preprocess_called(false),
|
||||||
advancestep_called(false),
|
advancestep_called(false),
|
||||||
solvestep_called(false),
|
solvestep_called(false),
|
||||||
postsolve_called(false),
|
|
||||||
savestep_called(false),
|
savestep_called(false),
|
||||||
savemodel_called(false),
|
savemodel_called(false),
|
||||||
init_called(false),
|
init_called(false),
|
||||||
@ -46,7 +45,6 @@ public:
|
|||||||
bool preprocess() { return preprocess_called = true; }
|
bool preprocess() { return preprocess_called = true; }
|
||||||
bool advanceStep(TimeStep& tp) { return advancestep_called = true; }
|
bool advanceStep(TimeStep& tp) { return advancestep_called = true; }
|
||||||
bool solveStep(TimeStep& tp) { return solvestep_called = true; }
|
bool solveStep(TimeStep& tp) { return solvestep_called = true; }
|
||||||
bool postSolve(const TimeStep&, bool) { return postsolve_called = true; }
|
|
||||||
bool saveStep(const TimeStep&, int&) { return savestep_called = true; }
|
bool saveStep(const TimeStep&, int&) { return savestep_called = true; }
|
||||||
bool saveModel(char*, int&, int&) { return savemodel_called = true; }
|
bool saveModel(char*, int&, int&) { return savemodel_called = true; }
|
||||||
bool init(const TimeStep&) { return init_called = true; }
|
bool init(const TimeStep&) { return init_called = true; }
|
||||||
@ -87,7 +85,6 @@ public:
|
|||||||
bool preprocess_called;
|
bool preprocess_called;
|
||||||
bool advancestep_called;
|
bool advancestep_called;
|
||||||
bool solvestep_called;
|
bool solvestep_called;
|
||||||
bool postsolve_called;
|
|
||||||
bool savestep_called;
|
bool savestep_called;
|
||||||
bool savemodel_called;
|
bool savemodel_called;
|
||||||
bool init_called;
|
bool init_called;
|
||||||
@ -115,7 +112,6 @@ TEST(TestSIMCoupled, Override)
|
|||||||
sim.preprocess();
|
sim.preprocess();
|
||||||
sim.advanceStep(tp);
|
sim.advanceStep(tp);
|
||||||
sim.solveStep(tp);
|
sim.solveStep(tp);
|
||||||
sim.postSolve(tp);
|
|
||||||
sim.saveStep(tp, nBlock);
|
sim.saveStep(tp, nBlock);
|
||||||
sim.saveModel((char*)"", geoBlk, nBlock);
|
sim.saveModel((char*)"", geoBlk, nBlock);
|
||||||
sim.init(tp);
|
sim.init(tp);
|
||||||
@ -136,8 +132,6 @@ TEST(TestSIMCoupled, Override)
|
|||||||
ASSERT_TRUE(ovr2.advancestep_called);
|
ASSERT_TRUE(ovr2.advancestep_called);
|
||||||
ASSERT_TRUE(ovr1.solvestep_called);
|
ASSERT_TRUE(ovr1.solvestep_called);
|
||||||
ASSERT_TRUE(ovr2.solvestep_called);
|
ASSERT_TRUE(ovr2.solvestep_called);
|
||||||
ASSERT_TRUE(ovr1.postsolve_called);
|
|
||||||
ASSERT_TRUE(ovr2.postsolve_called);
|
|
||||||
ASSERT_TRUE(ovr1.savemodel_called);
|
ASSERT_TRUE(ovr1.savemodel_called);
|
||||||
ASSERT_TRUE(ovr1.init_called);
|
ASSERT_TRUE(ovr1.init_called);
|
||||||
ASSERT_TRUE(ovr2.init_called);
|
ASSERT_TRUE(ovr2.init_called);
|
||||||
|
Loading…
Reference in New Issue
Block a user