Skip to content
Snippets Groups Projects
Commit c37c0533 authored by jonathan.froehlich's avatar jonathan.froehlich
Browse files

Updated comments

parent 7e1fb38d
No related branches found
No related tags found
1 merge request!231Resolve "Document Code"
Pipeline #125730 canceled
......@@ -172,8 +172,10 @@ void SegregatedSolver::Step(IElphyAssemble &elphyAssemble, IElasticity &mechAsse
*/
vout(2) << "Solving MechStep from " << mechAssemble.Time() << " to "
<< mechAssemble.NextTimeStep(false) << endl;
elphyAssemble.ResetTime(mechAssemble.Time(), mechAssemble.NextTimeStep(false), elphySteps);
elphyAssemble.UpdateDeformation(u_displacement(mechValues), v_potential(elphyValues));
while (!elphyAssemble.IsFinished()) {
vout(3) << "Solving ElphyProblem in [" << elphyAssemble.FirstTStep() << ", "
<< elphyAssemble.LastTStep()
......@@ -182,19 +184,23 @@ void SegregatedSolver::Step(IElphyAssemble &elphyAssemble, IElasticity &mechAsse
elphySolver->SolveStep(elphyAssemble, elphyValues);
}
// Projects stretch from elphy to mech
cardiacTransfer->Project(u_stretch(mechValues), v_stretch(elphyValues));
mechAssemble.UpdateStretch(u_stretch(mechValues));
// Solves one mech step
mechSolver->Step(mechAssemble, u_displacement(mechValues));
// Interpolates iota_4 from mech to elphy
mechAssemble.GetInvariant(u_displacement(mechValues), u_iota(mechValues));
cardiacTransfer->Prolongate(u_iota(mechValues), v_iota(elphyValues));
cardiacTransfer->Project(u_pot(mechValues), v_potential(elphyValues));
}
void SegregatedSolver::PlotIteration(const IElphyAssemble &elphyAssemble,
const IElasticity &mechAssemble, const Vectors &elphyValues,
const Vectors &mechValues) {
const IElasticity &mechAssemble, Vectors &elphyValues,
Vectors &mechValues) const {
cardiacTransfer->Project(u_pot(mechValues), v_potential(elphyValues));
if (vtk <= 0) return;
if (elphyVtk > 0) elphyAssemble.PlotIteration(elphyValues, mechAssemble.Step());
......
......@@ -12,6 +12,15 @@
#include "solvers/ElphySolver.hpp"
#include "solvers/DynamicMechanicsSolver.hpp"
/**
* Solves coupled electro-elastodynamical problem with the following scheme:
* 0. Initialize ELPHY and MECH
* 1. Solve ELPHY from t_n to t_{n+1} in m steps
* 2. Project values from ELPHY to MECH
* 3. Solve MECH from t_n to t_{n+1} in 1 step
* 4. Interpolate values from MECH to ELPHY
* 5. If t_{n+1} = t_N STOP, else return to 1.
*/
class SegregatedSolver : public CardiacSolver {
int elphyVtk{0};
int mechVtk{0};
......@@ -24,14 +33,12 @@ class SegregatedSolver : public CardiacSolver {
std::unique_ptr<ElastodynamicTimeIntegrator> mechSolver;
void printStep();
void printFullEvaluation();
void initEvaluation(const IElphyAssemble &elphyAssemble,
const IElasticity &elasticityAssemble);
public:
/*explicit SegregatedSolver() : SegregatedSolver(GetElphySolver(), GetDynamicSolver()) {}
explicit SegregatedSolver(const string &elphySolverName, const string& mechSolverName)
: SegregatedSolver(GetElphySolver(elphySolverName), GetDynamicSolver(mechSolverName)) {}*/
explicit SegregatedSolver(
std::unique_ptr<ElphySolver> &&eSolver,
std::unique_ptr<ElastodynamicTimeIntegrator> &&mSolver,
......@@ -55,9 +62,9 @@ public:
void EvaluateIteration(const IElphyAssemble &elphyAssemble, const IElasticity &mechAssemble,
Vectors elphyValues, Vectors mechValues);
void PlotIteration(const IElphyAssemble &elphyAssemble, const IElasticity &mechAssemble,
const Vectors &elphyValues, const Vectors &mechValues);
void PlotIteration(const IElphyAssemble &elphyAssemble, const IElasticity &mechAssemble,
Vectors &elphyValues, Vectors &mechValues) const;
void Initialize(IElphyAssemble &elphyAssemble, IElasticity &mechAssemble, Vector &potential, Vector &displacement);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment