Commit 862036ff authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#718 FSI: report the changes done in hyperelastic time schemes interface.

parent f4c56982
......@@ -103,6 +103,21 @@ namespace HappyHeart
if (this->MpiHappyHeart().IsRootProcessor())
this->GetGodOfDof().PrintQuadratureRules(std::cout);
{
const double mass_coefficient = 2. * this->GetVolumicMass().GetConstantValue()
/ Utilities::Square(parent::GetTimeManager().GetTimeStep());
auto& vm = GetNonCstVectorsAndMatrices();
GlobalMatrixWithCoefficient matrix(vm.GetNonCstMassPerSquareTime(), mass_coefficient);
this->GetMassPerSquareTimeStepOperator().
Assemble(std::make_tuple(std::ref(matrix)));
HyperelasticityNS::Private::TimeSchemeInit(this->GetStiffnessOperator(), vm);
}
}
......@@ -120,11 +135,7 @@ namespace HappyHeart
const std::string& output_dir)
{
auto& vm = this->GetNonCstVectorsAndMatrices();
const auto& numbering_subset = this->GetNumberingSubset();
const auto& system_solution = this->GetSystemSolution(numbering_subset);
// Update first the velocity: it needs the not-yet-updated previous displacement.
auto& velocity_prev_time_it = vm.GetNonCstCurrentVelocity();
......@@ -244,35 +255,11 @@ namespace HappyHeart
{
auto& vm = GetNonCstVectorsAndMatrices();
bool is_first_dynamic_call = false;
const auto& time_manager = this->GetTimeManager();
// Index of the Newton iteration for the given time iteration (starts at 0 for each time step).
const unsigned int newton_iteration = this->GetSnes().GetSnesIteration(__FILE__, __LINE__);
if (time_manager.NtimeModified() == 1 && newton_iteration == 0)
{
is_first_dynamic_call = true;
const double mass_coefficient = 2. * this->GetVolumicMass().GetConstantValue()
/ Utilities::Square(time_manager.GetTimeStep());
GlobalMatrixWithCoefficient matrix(vm.GetNonCstMassPerSquareTime(), mass_coefficient);
this->GetMassPerSquareTimeStepOperator().
Assemble(std::make_tuple(std::ref(matrix)));
}
// Assemble stiffness (depends upon the time scheme; vm types is used here to call the proper
// assembling operation(s)).
HyperelasticityNS::Private::AssembleStiffness(this->GetStiffnessOperator(),
false,
is_first_dynamic_call,
vm);
}
......@@ -291,10 +278,6 @@ namespace HappyHeart
auto& rhs = this->GetNonCstSystemRhs(numbering_subset);
auto& vectors_and_matrices = this->GetNonCstVectorsAndMatrices();
auto& current_displacement = vectors_and_matrices.GetNonCstCurrentDisplacement();
auto& current_velocity = vectors_and_matrices.GetNonCstCurrentVelocity();
......
......@@ -49,7 +49,7 @@ int main(int argc, char ** argv)
mpi.Barrier();
}
//#define HYPERELASTICITY_IN_FSI
#define HYPERELASTICITY_IN_FSI
#ifdef HYPERELASTICITY_IN_FSI
......@@ -58,7 +58,7 @@ int main(int argc, char ** argv)
FSI_EINS::Policy::Hyperelasticity
<
HyperelasticityNS::LawNS::CiarletGeymonat,
HyperelasticityNS::TimeScheme::half_sum
HyperelasticityNS::TimeScheme::midpoint
>;
#else
......
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