Commit 078df49f authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#718 FSI/hyperelasticity: remove PrepareDynamicRuns and move SupplInit().

parent d32c89f1
......@@ -216,7 +216,6 @@ namespace HappyHeart
{
auto& fixed_contribution_to_rhs = GetNonCstFixedContributionToRhs();
// Update first the velocity: it needs the not-yet-updated previous displacement.
auto& velocity_prev_time_it = GetNonCstVectorVelocityPreviousTimeIteration();
......@@ -239,12 +238,9 @@ namespace HappyHeart
newest_displacement.template Print<MpiScale::processor_wise>(mpi, output_dir + "solid_displacement_prev_it.hhdata", __FILE__, __LINE__);
{
const auto& displacement_matrix = GetMatrixDisplacement();
const auto& velocity_matrix = GetMatrixVelocity();
Wrappers::Petsc::MatMult(displacement_matrix, newest_displacement,
fixed_contribution_to_rhs,
__FILE__, __LINE__);
......@@ -254,9 +250,6 @@ namespace HappyHeart
fixed_contribution_to_rhs,
__FILE__, __LINE__);
}
}
......
......@@ -142,9 +142,7 @@ namespace HappyHeart
///@}
//! Prepare dynamic runs.
void PrepareDynamicRuns();
//! Update for next time step. (not called after each dynamic iteration).
void UpdateForNextTimeStep();
......
......@@ -56,12 +56,58 @@ namespace HappyHeart
class LawPolicyT,
HyperelasticityNS::TimeScheme TimeSchemeT
>
template<class InputParameterDataT>
void VariationalFormulationHyperElasticity<LawPolicyT, TimeSchemeT>
::PrepareDynamicRuns()
::SupplInit(const InputParameterDataT& input_parameter_data)
{
UpdateDisplacementBetweenTimeStep();
const auto& geometric_mesh_region = this->GetGodOfDof().GetGeometricMeshRegion();
volumic_mass_ = InitScalarParameter<InputParameter::Solid::VolumicMass>("Volumic mass",
geometric_mesh_region,
input_parameter_data);
if (!GetVolumicMass().IsConstant())
throw Exception("Current hyperelastic model is restricted to a constant volumic mass!",
__FILE__, __LINE__);
young_modulus_ = InitScalarParameter<InputParameter::Solid::YoungModulus>("Young modulus",
geometric_mesh_region,
input_parameter_data);
poisson_ratio_ = InitScalarParameter<InputParameter::Solid::PoissonRatio>("Poisson ratio",
geometric_mesh_region,
input_parameter_data);
kappa1_ = InitScalarParameter<InputParameter::Solid::Kappa1>("Kappa1",
geometric_mesh_region,
input_parameter_data);
kappa2_ = InitScalarParameter<InputParameter::Solid::Kappa2>("Kappa2",
geometric_mesh_region,
input_parameter_data);
bulk_ = InitScalarParameter<InputParameter::Solid::HyperelasticBulk>("HyperelasticBulk",
geometric_mesh_region,
input_parameter_data);
{
// \todo #583: Temporary to make code work; quite stupid nonetheless!
const auto degree_of_exactness = DEFAULT_DEGREE_OF_EXACTNESS;
auto&& default_rule = DetermineDefaultQuadratureRule(degree_of_exactness);
this->GetNonCstQuadratureRulePerTopology().emplace_back(std::move(default_rule));
assert(this->GetNonCstQuadratureRulePerTopology().size() == 1ul);
}
DefineOperators(input_parameter_data);
if (this->MpiHappyHeart().IsRootProcessor())
this->GetGodOfDof().PrintQuadratureRules(std::cout);
}
template
<
......@@ -146,60 +192,6 @@ namespace HappyHeart
}
template
<
class LawPolicyT,
HyperelasticityNS::TimeScheme TimeSchemeT
>
template<class InputParameterDataT>
void VariationalFormulationHyperElasticity<LawPolicyT, TimeSchemeT>
::SupplInit(const InputParameterDataT& input_parameter_data)
{
const auto& geometric_mesh_region = this->GetGodOfDof().GetGeometricMeshRegion();
volumic_mass_ = InitScalarParameter<InputParameter::Solid::VolumicMass>("Volumic mass",
geometric_mesh_region,
input_parameter_data);
if (!GetVolumicMass().IsConstant())
throw Exception("Current hyperelastic model is restricted to a constant volumic mass!",
__FILE__, __LINE__);
young_modulus_ = InitScalarParameter<InputParameter::Solid::YoungModulus>("Young modulus",
geometric_mesh_region,
input_parameter_data);
poisson_ratio_ = InitScalarParameter<InputParameter::Solid::PoissonRatio>("Poisson ratio",
geometric_mesh_region,
input_parameter_data);
kappa1_ = InitScalarParameter<InputParameter::Solid::Kappa1>("Kappa1",
geometric_mesh_region,
input_parameter_data);
kappa2_ = InitScalarParameter<InputParameter::Solid::Kappa2>("Kappa2",
geometric_mesh_region,
input_parameter_data);
bulk_ = InitScalarParameter<InputParameter::Solid::HyperelasticBulk>("HyperelasticBulk",
geometric_mesh_region,
input_parameter_data);
{
// \todo #583: Temporary to make code work; quite stupid nonetheless!
const auto degree_of_exactness = DEFAULT_DEGREE_OF_EXACTNESS;
auto&& default_rule = DetermineDefaultQuadratureRule(degree_of_exactness);
this->GetNonCstQuadratureRulePerTopology().emplace_back(std::move(default_rule));
assert(this->GetNonCstQuadratureRulePerTopology().size() == 1ul);
}
DefineOperators(input_parameter_data);
if (this->MpiHappyHeart().IsRootProcessor())
this->GetGodOfDof().PrintQuadratureRules(std::cout);
}
template
<
......
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