Commit 3565f771 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1022 Extend NewFluidPressure to make room for evaluation of current pressure.

parent 7e5c2682
......@@ -14,38 +14,36 @@
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameterList.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Parameter/UpdatePressureAtQuadPt.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Crtp/CauchyGreenAccess.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/Data/Fluidmass.hpp"
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace DataNS
{
template<class HyperelasticLawT>
class NewFluidPressure
: public ::HappyHeart::PoromechanicsNS::Crtp::CauchyGreenAccess<NewFluidPressure<HyperelasticLawT>>
{
public:
//! Alias to pressure parameter.
using pressure_parameter_type =
ParameterAtQuadraturePoint<::HappyHeart::ParameterNS::Type::scalar>;
ParameterAtQuadraturePoint<::HappyHeart::ParameterNS::Type::scalar>;
//! Alias to pressure parameter operator.
template
<
TimeLabel2 TimeLabelT
>
template<TimeLabel2 TimeLabelT>
using pressure_parameter_operator_type =
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, TimeLabelT>;
GlobalParameterOperatorNS::UpdatePressureAtQuadPt<HyperelasticLawT, TimeLabelT>;
//! \copydoc doxygen_hide_alias_self
using self = NewFluidPressure<HyperelasticLawT>;
......@@ -55,74 +53,91 @@ namespace HappyHeart
//! Class name.
static const std::string& ClassName();
static_assert(EnumUnderlyingType(TimeLabel2::new_value) == 0, "Value will be used as array index.");
static_assert(EnumUnderlyingType(TimeLabel2::current) == 1, "Value will be used as array index.");
public:
/// \name Special members.
///@{
//! Constructor.
explicit NewFluidPressure(const HyperelasticLawT& hyperelastic_law,
const cauchy_green_tensor_type& cauchy_green_tensor,
const TimeManager& time_manager);
//! Destructor.
~NewFluidPressure() = default;
//! Copy constructor.
NewFluidPressure(const NewFluidPressure&) = delete;
//! Move constructor.
NewFluidPressure(NewFluidPressure&&) = delete;
//! Copy affectation.
NewFluidPressure& operator=(const NewFluidPressure&) = delete;
//! Move affectation.
NewFluidPressure& operator=(NewFluidPressure&&) = delete;
///@}
public:
//! Operator which updates pressure parameter on solid mesh.
pressure_parameter_operator_type<TimeLabel2::new_value>& GetNonCstUpdatePressureParamOnSolid() noexcept;
//! Operator which updates pressure parameter on solid mesh for iteration {n+1}.
pressure_parameter_operator_type<TimeLabel2::new_value>& GetNonCstUpdatePressureParamOnSolidNew() noexcept;
//! Operator which updates pressure parameter on fluid mesh for iteration {n+1}.
pressure_parameter_operator_type<TimeLabel2::new_value>& GetNonCstUpdatePressureParamOnFluidNew() noexcept;
//! Operator which updates pressure parameter on solid mesh.
pressure_parameter_operator_type<TimeLabel2::new_value>& GetNonCstUpdatePressureParamOnFluid() noexcept;
//! Operator which updates pressure parameter on solid mesh for iteration {n}.
pressure_parameter_operator_type<TimeLabel2::current>& GetNonCstUpdatePressureParamOnSolidCurrent() noexcept;
//! Operator which updates pressure parameter on fluid mesh for iteration {n}.
pressure_parameter_operator_type<TimeLabel2::current>& GetNonCstUpdatePressureParamOnFluidCurrent() noexcept;
//! Hyperelastic law.
const HyperelasticLawT& GetHyperelasticLaw() const noexcept;
private:
//! Pressure parameter.
typename pressure_parameter_type::unique_ptr pressure_parameter_on_solid_ = nullptr;
//! Pressure parameter; index is for new or current.
typename pressure_parameter_type::array_unique_ptr<2> pressure_parameter_on_solid_
{ { nullptr, nullptr } };
//! Operator which updates pressure parameter.
typename pressure_parameter_operator_type<TimeLabel2::new_value>::unique_ptr update_pressure_param_on_solid_ = nullptr;
//! Operator which updates pressure parameter at iteration {n+1} on solid mesh.
typename pressure_parameter_operator_type<TimeLabel2::new_value>::unique_ptr update_pressure_param_on_solid_new_ = nullptr;
//! Pressure parameter.
typename pressure_parameter_type::unique_ptr pressure_parameter_on_fluid_ = nullptr;
//! Operator which updates pressure parameter at iteration {n} on solid mesh.
typename pressure_parameter_operator_type<TimeLabel2::current>::unique_ptr update_pressure_param_on_solid_current_ = nullptr;
//! Operator which updates pressure parameter.
typename pressure_parameter_operator_type<TimeLabel2::new_value>::unique_ptr update_pressure_param_on_fluid_ = nullptr;
//! Pressure parameter; index is for new or current.
typename pressure_parameter_type::array_unique_ptr<2> pressure_parameter_on_fluid_
{ { nullptr, nullptr } };
//! Operator which updates pressure parameter at iteration {n+1} on fluid mesh.
typename pressure_parameter_operator_type<TimeLabel2::new_value>::unique_ptr update_pressure_param_on_fluid_new_ = nullptr;
//! Operator which updates pressure parameter at iteration {n} on fluid mesh.
typename pressure_parameter_operator_type<TimeLabel2::current>::unique_ptr update_pressure_param_on_fluid_current_ = nullptr;
//! Hyperelastic law.
const HyperelasticLawT& hyperelastic_law_;
};
} // namespace DataNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
......
......@@ -14,24 +14,24 @@
namespace HappyHeart
{
namespace PoromechanicsNS
{
namespace DataNS
{
template<class HyperelasticLawT>
const std::string& NewFluidPressure<HyperelasticLawT>::ClassName()
{
static std::string ret("Fluid pressure - new scheme");
return ret;
}
template<class HyperelasticLawT>
NewFluidPressure<HyperelasticLawT>::NewFluidPressure(const HyperelasticLawT& a_hyperelastic_law,
......@@ -42,53 +42,93 @@ namespace HappyHeart
{
decltype(auto) god_of_dof_manager = GodOfDofManager::GetInstance();
decltype(auto) solid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::solid));
decltype(auto) fluid_god_of_dof =
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::fluid));
god_of_dof_manager.GetGodOfDof(EnumUnderlyingType(MeshIndex::fluid));
decltype(auto) solid_felt_space =
solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
pressure_parameter_on_solid_ =
std::make_unique<pressure_parameter_type>("Fluid pressure on solid",
solid_god_of_dof.GetGeometricMeshRegion(),
solid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
solid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::solid));
decltype(auto) unknown_manager = UnknownManager::GetInstance();
decltype(auto) solid_displacement_unknown =
unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::solid_displacement));
unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::solid_displacement));
decltype(auto) hyperelastic_law = GetHyperelasticLaw();
update_pressure_param_on_solid_ =
std::make_unique<pressure_parameter_operator_type<TimeLabel2::new_value>>(solid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_solid_,
hyperelastic_law,
this->GetCauchyGreenTensor());
decltype(auto) fluid_felt_space =
fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
fluid_god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fluid));
pressure_parameter_on_fluid_ =
{
constexpr auto time_label_type = TimeLabel2::new_value;
constexpr auto index = EnumUnderlyingType(time_label_type);
pressure_parameter_on_solid_[index] =
std::make_unique<pressure_parameter_type>("Fluid pressure on solid",
solid_god_of_dof.GetGeometricMeshRegion(),
solid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
update_pressure_param_on_solid_new_ =
std::make_unique<pressure_parameter_operator_type<time_label_type>>(solid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_solid_[index],
hyperelastic_law,
this->GetCauchyGreenTensor());
pressure_parameter_on_fluid_[index] =
std::make_unique<pressure_parameter_type>("Fluid pressure on fluid",
fluid_god_of_dof.GetGeometricMeshRegion(),
fluid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
update_pressure_param_on_fluid_new_ =
std::make_unique<pressure_parameter_operator_type<time_label_type>>(fluid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_fluid_[index],
hyperelastic_law,
this->GetCauchyGreenTensor());
}
update_pressure_param_on_fluid_ =
std::make_unique<pressure_parameter_operator_type<TimeLabel2::new_value>>(fluid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_fluid_,
hyperelastic_law,
this->GetCauchyGreenTensor()); // \todo #1022 Probably another one...
{
constexpr auto time_label_type = TimeLabel2::current;
constexpr auto index = EnumUnderlyingType(time_label_type);
pressure_parameter_on_solid_[index] =
std::make_unique<pressure_parameter_type>("Fluid pressure on solid",
solid_god_of_dof.GetGeometricMeshRegion(),
solid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
update_pressure_param_on_solid_current_ =
std::make_unique<pressure_parameter_operator_type<time_label_type>>(solid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_solid_[index],
hyperelastic_law,
this->GetCauchyGreenTensor());
pressure_parameter_on_fluid_[index] =
std::make_unique<pressure_parameter_type>("Fluid pressure on fluid",
fluid_god_of_dof.GetGeometricMeshRegion(),
fluid_felt_space.GetQuadratureRulePerTopology(),
0.,
time_manager);
update_pressure_param_on_fluid_current_ =
std::make_unique<pressure_parameter_operator_type<time_label_type>>(fluid_felt_space,
solid_displacement_unknown,
*pressure_parameter_on_fluid_[index],
hyperelastic_law,
this->GetCauchyGreenTensor());
}
}
......@@ -99,32 +139,49 @@ namespace HappyHeart
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::template pressure_parameter_operator_type<TimeLabel2::new_value>&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnSolid() noexcept
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnSolidNew() noexcept
{
assert(!(!update_pressure_param_on_solid_));
return *update_pressure_param_on_solid_;
assert(!(!update_pressure_param_on_solid_new_));
return *update_pressure_param_on_solid_new_;
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::template pressure_parameter_operator_type<TimeLabel2::new_value>&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnFluid() noexcept
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnFluidNew() noexcept
{
assert(!(!update_pressure_param_on_fluid_));
return *update_pressure_param_on_fluid_;
assert(!(!update_pressure_param_on_fluid_new_));
return *update_pressure_param_on_fluid_new_;
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::template pressure_parameter_operator_type<TimeLabel2::current>&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnSolidCurrent() noexcept
{
assert(!(!update_pressure_param_on_solid_current_));
return *update_pressure_param_on_solid_current_;
}
template<class HyperelasticLawT>
typename NewFluidPressure<HyperelasticLawT>::template pressure_parameter_operator_type<TimeLabel2::current>&
NewFluidPressure<HyperelasticLawT>::GetNonCstUpdatePressureParamOnFluidCurrent() noexcept
{
assert(!(!update_pressure_param_on_fluid_current_));
return *update_pressure_param_on_fluid_current_;
}
} // namespace DataNS
} // namespace PoromechanicsNS
} // namespace HappyHeart
......
......@@ -193,8 +193,8 @@ namespace HappyHeart
this->GetNonCstFluidmassData(),
this->GetNonCstSolidDisplacementData(),
this->GetNonCstSolidVelocityData(),
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnSolid(),
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnFluid()
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnSolidNew(),
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnFluidNew()
);
implicit_step_fluid_newton_FP_varf_->Init(input_parameter_data);
......@@ -223,7 +223,7 @@ namespace HappyHeart
this->GetNonCstMonolithicData(),
this->GetNonCstFluidmassData(),
this->GetNonCstFluidVelocityData(),
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnFluid());
new_fluid_pressure_data.GetNonCstUpdatePressureParamOnFluidNew());
}
implicit_step_fluid_differential_varf_->Init(input_parameter_data);
......
......@@ -9,6 +9,8 @@
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_PARAMETER_x_UPDATE_PRESSURE_AT_QUAD_PT_HPP_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_UNDER_DEVELOPMENT_x_POROMECHANICS_x_PARAMETER_x_UPDATE_PRESSURE_AT_QUAD_PT_HPP_
# include <array>
# include "Parameters/Parameter.hpp"
# include "Parameters/InitParameterFromInputData/InitParameterFromInputData.hpp"
......@@ -62,6 +64,10 @@ namespace HappyHeart
//! Alias to unique pointer.
using unique_ptr = std::unique_ptr<self>;
//! Alias to an array of unique_ptr.
template<std::size_t N>
using array_unique_ptr = std::array<unique_ptr, N>;
//! Alias to local operator.
using local_operator_type =
LocalParameterOperatorNS::UpdatePressureAtQuadPt<PoroHyperelasticLawT, TimeLabelT>;
......
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