Commit 77772ad8 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1049 Fix active stress in SecondPiolaKirchhoffStressTensor operator and...

#1049 Fix active stress in SecondPiolaKirchhoffStressTensor operator and cardiac mechanics pre-stress model.
parent f6e9a0d8
......@@ -180,6 +180,31 @@ Domain3 = {
geometric_element_type_list = { }
}
Domain4 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh; at most one value is expected here.
-- Expected format: {VALUE1}
-- Expected format: VALUE
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {0, 1, 2, 3})
dimension_list = { },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
EssentialBoundaryCondition1 = {
-- Name of the boundary condition (must be unique).
......@@ -761,7 +786,7 @@ Fiber_vector_1 = {
-- Index of the domain upon which parameter is defined.
-- Expected format: VALUE
mesh_index = 1,
domain_index = 4,
-- Index of the finite element space upon which parameter is defined.
-- Expected format: VALUE
......
......@@ -48,7 +48,8 @@ namespace HappyHeart
{
highest_dimension = 1,
surface_pressure = 2,
dirichlet = 3
dirichlet = 3,
full_mesh = 4
};
......@@ -110,6 +111,7 @@ namespace HappyHeart
InputParameter::Domain<EnumUnderlyingType(DomainIndex::highest_dimension)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::surface_pressure)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::dirichlet)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::full_mesh)>,
InputParameter::DirichletBoundaryCondition<EnumUnderlyingType(BoundaryConditionIndex::sole)>,
......
......@@ -47,15 +47,18 @@ namespace HappyHeart
void VariationalFormulation::SupplInit(const InputParameterList& input_parameter_data)
{
const auto& god_of_dof = GetGodOfDof();
const auto& geometric_mesh_region = god_of_dof.GetGeometricMeshRegion();
const auto& felt_space_highest_dimension = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::highest_dimension));
decltype(auto) domain = DomainManager::GetInstance().GetDomain(EnumUnderlyingType(DomainIndex::full_mesh));
solid_ = std::make_unique<Solid>(input_parameter_data,
geometric_mesh_region,
domain,
felt_space_highest_dimension.GetQuadratureRulePerTopology());
static_pressure_ = InitScalarParameterFromInputData<InputParameter::Source::StaticPressure>("StaticPressure",
geometric_mesh_region,
input_parameter_data);
static_pressure_ =
InitScalarParameterFromInputData<InputParameter::Source::StaticPressure>("StaticPressure",
domain,
input_parameter_data);
namespace IPL = Utilities::InputParameterListNS;
......@@ -215,8 +218,10 @@ namespace HappyHeart
find_coords_of_global_vector_operator_ = std::make_unique<FindCoordsOfGlobalVector>(felt_space_highest_dimension,
GetSystemRhs(electrical_activation_numbering_subset));
decltype(auto) domain = DomainManager::GetInstance().GetDomain(EnumUnderlyingType(DomainIndex::full_mesh));
input_analytical_prestress_ = std::make_unique<InputAnalyticalPrestress>(input_parameter_data,
mesh,
domain,
raw_match_dof_in_numbering_subset_operator);
InputAnalyticalPrestress* raw_input_analytical_prestress = input_analytical_prestress_.get();
......
......@@ -59,7 +59,7 @@ namespace HappyHeart
*/
template <class InputParameterDataT>
explicit InputAnalyticalPrestress(const InputParameterDataT& input_parameter_data,
const GeometricMeshRegion& geometric_mesh_region,
const Domain& domain,
const MatchDofInNumberingSubset* match_dof_in_numbering_subset_operator);
public:
......
......@@ -32,13 +32,14 @@ namespace HappyHeart
template<class InputParameterDataT>
InputAnalyticalPrestress::InputAnalyticalPrestress(const InputParameterDataT& input_parameter_data,
const GeometricMeshRegion& geometric_mesh_region,
const Domain& domain,
const MatchDofInNumberingSubset* match_dof_in_numbering_subset_operator)
: match_dof_in_numbering_subset_operator_(match_dof_in_numbering_subset_operator),
initial_value_active_stress_(Utilities::InputParameterListNS::Extract<InputParameter::ActiveStressProperties::InitialCondition::ActiveStress>::Value(input_parameter_data))
{
contractility_ = InitScalarParameterFromInputData<InputParameter::ActiveStressProperties::Contractility>("Contractility",
geometric_mesh_region,
contractility_ =
InitScalarParameterFromInputData<InputParameter::ActiveStressProperties::Contractility>("Contractility",
domain,
input_parameter_data);
};
......
......@@ -51,7 +51,7 @@ namespace HappyHeart
auto& active_stress = *active_stress_ptr;
Internal::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressHelper<ActiveStressPolicyT>
::InitActiveStress(mesh,
::InitActiveStress(felt_space.GetDomain(),
parent::GetQuadratureRulePerTopology(),
time_manager,
local_operator_storage,
......
......@@ -92,7 +92,7 @@ namespace HappyHeart
//! Initialize Sigma_c.
template<class LocalOperatorStorageT>
void InitializeActiveStressPolicy(const GeometricMeshRegion& mesh,
void InitializeActiveStressPolicy(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
......
......@@ -31,7 +31,7 @@ namespace HappyHeart
template <unsigned int FiberIndexT>
template<class LocalOperatorStorageT>
void AnalyticalPrestress<FiberIndexT>
::InitializeActiveStressPolicy(const GeometricMeshRegion& mesh,
::InitializeActiveStressPolicy(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
......@@ -42,7 +42,7 @@ namespace HappyHeart
input_active_stress_policy_ = input_active_stress_policy;
sigma_c_ = std::make_unique<ParameterAtQuadraturePoint<ParameterNS::Type::scalar>>("SigmaC",
mesh,
domain,
quadrature_rule_per_topology,
GetInputActiveStressPolicy().GetInitialValueActiveStress(),
time_manager);
......
......@@ -74,7 +74,7 @@ namespace HappyHeart
//! \copydoc doxygen_hide_active_stress_helper_init_function
template<class LocalOperatorStorageT>
static void InitActiveStress(const GeometricMeshRegion& mesh,
static void InitActiveStress(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
......@@ -107,7 +107,7 @@ namespace HappyHeart
//! \copydoc doxygen_hide_active_stress_helper_init_function
template <class LocalOperatorStorageT>
static void InitActiveStress(const GeometricMeshRegion& mesh,
static void InitActiveStress(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
......
......@@ -31,14 +31,14 @@ namespace HappyHeart
template <class ActiveStressPolicyT>
template <class LocalOperatorStorageT>
void ActiveStressHelper<ActiveStressPolicyT>
::InitActiveStress(const GeometricMeshRegion& mesh,
::InitActiveStress(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
typename ActiveStressPolicyT::input_active_stress_policy_type* input_active_stress_policy,
ActiveStressPolicyT& active_stress)
{
active_stress.template InitializeActiveStressPolicy(mesh,
active_stress.template InitializeActiveStressPolicy(domain,
quadrature_rule_per_topology,
time_manager,
local_operator_storage,
......@@ -48,14 +48,14 @@ namespace HappyHeart
template <class LocalOperatorStorageT>
void ActiveStressHelper<::HappyHeart::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressPolicyNS::None>
::InitActiveStress(const GeometricMeshRegion& mesh,
::InitActiveStress(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
typename none_type::input_active_stress_policy_type* input_active_stress_policy,
none_type& active_stress)
{
static_cast<void>(mesh);
static_cast<void>(domain);
static_cast<void>(quadrature_rule_per_topology);
static_cast<void>(time_manager);
static_cast<void>(local_operator_storage);
......
Markdown is supported
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