Commit 3beb6e96 authored by thomaskummer's avatar thomaskummer
Browse files

intrepid lifev update

parent 9e4c0091
......@@ -545,54 +545,7 @@ int main (int argc, char** argv)
if ( ! restart )
{
solver.structuralOperatorPtr() -> data() -> dataTime() -> setTime(0.0);
auto preloadPressure = [] (std::vector<double> p, const int& step, const int& steps)
{
for (auto& i : p) {i *= double(step) / double(steps);}
return p;
};
LifeChrono chronoSave;
chronoSave.start();
solver.saveSolution (-1.0);
if ( 0 == comm->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nData stored in " << chronoSave.diff() << " s";
std::cout << "\n*****************************************************************\n";
}
LifeChrono chronoPreload;
chronoPreload.start();
for (int i (1); i <= heartSolver.data().preloadSteps(); i++)
{
if ( 0 == comm->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nPreload step: " << i << " / " << heartSolver.data().preloadSteps();
std::cout << "\n*****************************************************************\n";
}
// Update pressure b.c.
modifyFeBC(preloadPressure(bcValues, i, heartSolver.data().preloadSteps() ));
// Solve mechanics
solver.bcInterfacePtr() -> updatePhysicalSolverVariables();
solver.solveMechanics();
//solver.saveSolution (i-1);
}
if ( 0 == comm->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nPreload done in: " << chronoPreload.diff();
std::cout << "\n*****************************************************************\n";
}
heartSolver.preload(modifyFeBC);
}
......
......@@ -136,7 +136,7 @@ public:
virtual ~HeartSolver() {}
const HeartData& data()
const HeartData& data() const
{
return M_heartData;
}
......@@ -148,8 +148,58 @@ public:
M_heartData.setup(datafile);
}
templace <class lambda>
void restart(const lambda& modifyFeBC) const
{
emSolver.structuralOperatorPtr() -> data() -> dataTime() -> setTime(0.0);
auto preloadPressure = [] (std::vector<double> p, const int& step, const int& steps)
{
for (auto& i : p) {i *= double(step) / double(steps);}
return p;
};
LifeChrono chronoSave;
chronoSave.start();
emSolver.saveSolution (-1.0);
if ( 0 == emSolver.comm()->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nData stored in " << chronoSave.diff() << " s";
std::cout << "\n*****************************************************************\n";
}
LifeChrono chronoPreload;
chronoPreload.start();
for (int i (1); i <= data().preloadSteps(); i++)
{
if ( 0 == emSolver.comm()->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nPreload step: " << i << " / " << data().preloadSteps();
std::cout << "\n*****************************************************************\n";
}
// Update pressure b.c.
modifyFeBC(preloadPressure(bcValues, i, heartSolver.data().preloadSteps() ));
// Solve mechanics
emSolver.bcInterfacePtr() -> updatePhysicalSolverVariables();
emSolver.solveMechanics();
//solver.saveSolution (i-1);
}
if ( 0 == emSolver.comm()->MyPID() )
{
std::cout << "\n*****************************************************************";
std::cout << "\nPreload done in: " << chronoPreload.diff();
std::cout << "\n*****************************************************************\n";
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment