Commit a5b3176e authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Poromechanics: initialize properly the implicit fluid step varf (Which is...

#820 Poromechanics: initialize properly the implicit fluid step varf (Which is still mostly empty; only porosity parameter has been added for the time being).
parent 2350ab39
......@@ -27,11 +27,13 @@ namespace HappyHeart
::VariationalFormulation(const Wrappers::Mpi& mpi,
const TimeManager& time_manager,
const GodOfDof& god_of_dof,
const ParameterAtDof<ParameterNS::Type::scalar>& porosity,
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list)
: parent(mpi,
time_manager,
god_of_dof,
std::move(boundary_condition_list))
std::move(boundary_condition_list)),
porosity_parent(porosity)
{ }
......
......@@ -21,6 +21,7 @@
# include "FormulationSolver/VariationalFormulation.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameterList.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/Porosity.hpp"
namespace HappyHeart
......@@ -38,9 +39,10 @@ namespace HappyHeart
class VariationalFormulation
: public HappyHeart::VariationalFormulation
<
VariationalFormulation,
EnumUnderlyingType(SolverIndex::main_solver)
>
VariationalFormulation,
EnumUnderlyingType(SolverIndex::main_solver)
>,
public Crtp::Porosity<VariationalFormulation>
{
private:
......@@ -50,10 +52,12 @@ namespace HappyHeart
//! Alias to the parent class.
using parent = HappyHeart::VariationalFormulation
<
self,
EnumUnderlyingType(SolverIndex::main_solver)
self,
EnumUnderlyingType(SolverIndex::main_solver)
>;
//! Alias to the crtp parent about porosity.
using porosity_parent = Crtp::Porosity<VariationalFormulation>;
//! Friendship to parent class, so this one can access private methods defined below through CRTP.
friend parent;
......@@ -72,6 +76,7 @@ namespace HappyHeart
explicit VariationalFormulation(const Wrappers::Mpi& mpi,
const TimeManager& time_manager,
const GodOfDof& god_of_dof,
const ParameterAtDof<ParameterNS::Type::scalar>& porosity,
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list);
//! Destructor.
......
......@@ -26,6 +26,7 @@
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameter/Porosity.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/PorosityVariationalFormulation.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ExplicitStepVariationalFormulation.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluidVariationalFormulation.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Private/SolidOnFluidMesh.hpp"
......@@ -200,6 +201,12 @@ namespace HappyHeart
//! Non constant access to explicit step variational formulation.
ExplicitStepVariationalFormulation& GetNonCstExplicitStepVariationalFormulation() noexcept;
//! Constant accessor to the variational formulation for fluid implicit step
const ImplicitStepFluidNS::VariationalFormulation& GetImplicitStepFluidVarf() const noexcept;
//! Non constant accessor to the variational formulation for fluid implicit step
ImplicitStepFluidNS::VariationalFormulation& GetNonCstImplicitStepFluidVarf() noexcept;
//! Access to fluid mass parameter.
const ParameterAtDof<ParameterNS::Type::scalar>& GetFluidMassParameter() const noexcept;
......@@ -277,6 +284,8 @@ namespace HappyHeart
//! Variational formulation for explicit step.
ExplicitStepVariationalFormulation::unique_ptr explicit_step_varf_ = nullptr;
//! Variational formulation for fluid implicit step
ImplicitStepFluidNS::VariationalFormulation::unique_ptr implicit_step_fluid_varf_ = nullptr;
///@}
......
......@@ -148,6 +148,23 @@ namespace HappyHeart
{
return const_cast<ExplicitStepVariationalFormulation&>(GetExplicitStepVariationalFormulation());
}
template<class SolidVariationalFormulationPolicyT>
inline const ImplicitStepFluidNS::VariationalFormulation& Model<SolidVariationalFormulationPolicyT>
::GetImplicitStepFluidVarf() const noexcept
{
assert(!(!implicit_step_fluid_varf_));
return *implicit_step_fluid_varf_;
}
template<class SolidVariationalFormulationPolicyT>
inline ImplicitStepFluidNS::VariationalFormulation& Model<SolidVariationalFormulationPolicyT>
::GetNonCstImplicitStepFluidVarf() noexcept
{
return const_cast<ImplicitStepFluidNS::VariationalFormulation&>(GetImplicitStepFluidVarf());
}
template<class SolidVariationalFormulationPolicyT>
......
......@@ -226,6 +226,27 @@ namespace HappyHeart
}
{
auto&& bc_list =
{
bc_manager.GetDirichletBoundaryConditionPtr(EnumUnderlyingType(BoundaryConditionIndex::fluid_non_homegeneous)),
};
using varf_type = ImplicitStepFluidNS::VariationalFormulation;
implicit_step_fluid_varf_ = std::make_unique<varf_type>(mpi,
time_manager,
fluid_god_of_dof,
porosity,
std::move(bc_list));
implicit_step_fluid_varf_->Init(input_parameter_data);
}
}
......
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