MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

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

#1049 [DOES NOT COMPILE EVERYTHING] Add a Domain constructor argument in...

#1049 [DOES NOT COMPILE EVERYTHING] Add a Domain constructor argument in parameter. Currently only hyperelastic model (and its 2D demo Lua file) are guaranteed to work with this new convention.
parent e6b434e7
......@@ -183,6 +183,40 @@ Domain3 = {
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, VALUE2, ...}
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. No constraint is applied at Ops level, as some geometric element types could be added after
-- generation of current input parameter file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { },
} -- Domain4
EssentialBoundaryCondition1 = {
-- Name of the boundary condition (must be unique).
......@@ -362,11 +396,11 @@ Solid = {
-- Domain indices of the parameter in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_id = {},
piecewise_constant_domain_id = { 1 },
-- Value of the Young modulus in the case nature is 'piecewise_constant_by_domain'.
-- Expected format: {VALUE1, VALUE2, ...}
piecewise_constant_domain_value = {},
piecewise_constant_domain_value = { 21e5},
-- Value of the Young modulus in the case nature is 'lua_function'(and also initial value if nature is 'at_quadrature_point'; irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
......
......@@ -6684,7 +6684,6 @@
BEFC32DC1CB53C3B00C8903C /* RefFEltInLocalOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefFEltInLocalOperator.cpp; sourceTree = "<group>"; };
BEFC32DD1CB53C3B00C8903C /* RefFEltInLocalOperator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RefFEltInLocalOperator.hpp; sourceTree = "<group>"; };
BEFC32DE1CB53C3B00C8903C /* RefFEltInLocalOperator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RefFEltInLocalOperator.hxx; sourceTree = "<group>"; };
BEFD698B1D215E3600AEF0AF /* input_hyperelasticity.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = input_hyperelasticity.lua; path = Data/Lua/input_hyperelasticity.lua; sourceTree = SOURCE_ROOT; };
BEFE4F0F1CBD23200087DD1F /* PetscMatPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PetscMatPrivate.h; sourceTree = "<group>"; };
BEFF48FC1859C519005BB48A /* TestInputOutputMesh */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestInputOutputMesh; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
......@@ -11182,7 +11181,6 @@
isa = PBXGroup;
children = (
BE5BE50919336DEC006BE2BF /* SConscript */,
BEFD698B1D215E3600AEF0AF /* input_hyperelasticity.lua */,
BE45D8531AB1D62C00881FF0 /* demo_input_hyperelasticity.lua */,
BE9EBD0B1AADDBAD001B8FC8 /* demo_input_hyperelasticity_3d.lua */,
BEA075571860549B00E83E71 /* InputParameterList.hpp */,
......@@ -73,6 +73,7 @@ namespace HappyHeart
felt_storage_(nullptr),
dimension_(ExtractDimensionFromDomain(domain)),
god_of_dof_(god_of_dof_ptr),
domain_(domain),
extended_unknown_list_(std::move(extended_unknown_list)),
numbering_subset_list_(ComputeNumberingSubsetList(GetExtendedUnknownList()))
{
......
......@@ -451,6 +451,9 @@ namespace HappyHeart
*/
const QuadratureRulePerTopology& GetQuadratureRulePerTopology() const noexcept;
//! Domain upon which \a FEltSpace is defined. By construct its dimension is contrived (it can't overlap several).
const Domain& GetDomain() const noexcept;
private:
/*!
......@@ -516,6 +519,7 @@ namespace HappyHeart
const Internal::FEltSpaceNS::MovemeshHelper& GetMovemeshHelper(const GlobalVector& vector) const noexcept;
private:
......@@ -535,6 +539,9 @@ namespace HappyHeart
//! Weak pointer to the enclosing God of dof.
std::weak_ptr<const GodOfDof> god_of_dof_;
//! Domain upon which \a FEltSpace is defined. By construct its dimension is contrived (it can't overlap several).
const Domain& domain_;
/*!
* \brief List of all the pairs of unknowns and numbering subset.
*
......
......@@ -149,6 +149,11 @@ namespace HappyHeart
}
inline const Domain& FEltSpace::GetDomain() const noexcept
{
return domain_;
}
} // namespace HappyHeart
......
......@@ -52,9 +52,15 @@ namespace HappyHeart
using parameter_type = InputParameter::TransientSource<index>;
parameter_ptr = InitThreeDimensionalParameterFromInputData<parameter_type, TimeDependencyT>(std::forward<T>(name),
geometric_mesh_region,
input_parameter_data);
parameter_ptr =
InitThreeDimensionalParameterFromInputData
<
parameter_type,
TimeDependencyT
>(std::forward<T>(name),
geometric_mesh_region,
felt_space.GetDomain(),
input_parameter_data);
if (parameter_ptr == nullptr)
return;
......
......@@ -348,7 +348,7 @@ namespace HappyHeart
private:
/*!
* \brief Identifier of the geometric mesh region upon which the domain is defined.
* \brief Identifier of the geometric mesh region upon which the domain is defined.
*
* Relevant only if DomainNS::Criterion::geometric_mesh_region is enforced.
*/
......@@ -389,6 +389,16 @@ namespace HappyHeart
};
/*!
*
* \copydoc doxygen_hide_operator_equal
*
* Equality is ensured here only with unique ids.
*/
bool operator==(const Domain& lhs, const Domain& rhs) noexcept;
} // namespace HappyHeart
......
......@@ -104,6 +104,10 @@ namespace HappyHeart
}
inline bool operator==(const Domain& lhs, const Domain& rhs) noexcept
{
return lhs.GetUniqueId() == rhs.GetUniqueId();
}
} // namespace HappyHeart
......
......@@ -45,7 +45,8 @@ namespace HappyHeart
{
highest_dimension = 1,
neumann = 2,
dirichlet
dirichlet,
full_mesh
};
......@@ -100,6 +101,7 @@ namespace HappyHeart
InputParameter::Domain<EnumUnderlyingType(DomainIndex::highest_dimension)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::neumann)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::dirichlet)>,
InputParameter::Domain<EnumUnderlyingType(DomainIndex::full_mesh)>,
InputParameter::DirichletBoundaryCondition<EnumUnderlyingType(BoundaryConditionIndex::sole)>,
......
......@@ -158,8 +158,12 @@ namespace HappyHeart
{
const auto& geometric_mesh_region = this->GetGodOfDof().GetGeometricMeshRegion();
// \todo #912 Internal to drop here...
decltype(auto) domain_manager = Internal::DomainNS::DomainManager::GetInstance();
solid_ = std::make_unique<Solid>(input_parameter_data,
geometric_mesh_region,
domain_manager.GetDomain(EnumUnderlyingType(DomainIndex::full_mesh)),
GetMainFEltSpace().GetQuadratureRulePerTopology());
if (!GetSolid().template GetParameter<Solid::param::volumic_mass>().IsConstant())
......
......@@ -78,6 +78,7 @@ namespace HappyHeart
cauchy_green_tensor_ =
std::make_unique<cauchy_green_tensor_type>("Cauchy-Green tensor",
mesh,
felt_space.GetDomain(),
quadrature_rule_per_topology,
initial_value,
time_manager);
......
......@@ -85,6 +85,7 @@ namespace HappyHeart
template<class InputParameterDataT>
explicit Solid(const InputParameterDataT& input_parameter_data,
const GeometricMeshRegion& mesh,
const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
double relative_tolerance = 1.e-5);
......
......@@ -19,6 +19,7 @@ namespace HappyHeart
template<class InputParameterDataT>
Solid::Solid(const InputParameterDataT& input_parameter_data,
const GeometricMeshRegion& geometric_mesh_region,
const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const double relative_tolerance)
: geometric_mesh_region_(geometric_mesh_region),
......@@ -32,46 +33,55 @@ namespace HappyHeart
parameter_list_[EnumUnderlyingType(param::volumic_mass)] =
InitScalarParameterFromInputData<InputParameter::Solid::VolumicMass>("Volumic mass",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::lame_lambda)] =
InitScalarParameterFromInputData<InputParameter::Solid::LameLambda>("Lame lambda",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::lame_mu)] =
InitScalarParameterFromInputData<InputParameter::Solid::LameMu>("Lame mu",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::young_modulus)] =
InitScalarParameterFromInputData<InputParameter::Solid::YoungModulus>("Young modulus",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::poisson_ratio)] =
InitScalarParameterFromInputData<InputParameter::Solid::PoissonRatio>("Poisson ratio",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::kappa_1)] =
InitScalarParameterFromInputData<InputParameter::Solid::Kappa1>("Kappa_1",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::kappa_2)] =
InitScalarParameterFromInputData<InputParameter::Solid::Kappa2>("Kappa_2",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::hyperelastic_bulk)] =
InitScalarParameterFromInputData<InputParameter::Solid::HyperelasticBulk>("Hyperelastic bulk",
geometric_mesh_region,
domain,
input_parameter_data);
parameter_list_[EnumUnderlyingType(param::viscosity)] =
InitScalarParameterFromInputData<InputParameter::Solid::Viscosity>("Viscosity",
geometric_mesh_region,
domain,
input_parameter_data);
CheckConsistency(relative_tolerance);
......
......@@ -28,12 +28,14 @@ namespace HappyHeart
::GradientBasedElasticityTensor(const scalar_parameter& young_modulus,
const scalar_parameter& poisson_ratio)
: parent("Gradient-based elasticity tensor.",
young_modulus.GetGeometricMeshRegion()),
young_modulus.GetGeometricMeshRegion(),
young_modulus.GetDomain()),
young_modulus_(young_modulus),
poisson_ratio_(poisson_ratio)
{
assert(GetGeometricMeshRegion() == poisson_ratio.GetGeometricMeshRegion());
assert(GetDomain() == poisson_ratio.GetDomain());
if (IsConstant())
ComputeValue(young_modulus.GetConstantValue(), poisson_ratio.GetConstantValue());
}
......
......@@ -22,11 +22,13 @@ namespace HappyHeart
LameLambda::LameLambda(const scalar_parameter& young_modulus,
const scalar_parameter& poisson_ratio)
: scalar_parameter("Lame coefficient 'lambda'",
young_modulus.GetGeometricMeshRegion()),
young_modulus.GetGeometricMeshRegion(),
young_modulus.GetDomain()),
young_modulus_(young_modulus),
poisson_ratio_(poisson_ratio)
{
assert(GetGeometricMeshRegion() == poisson_ratio.GetGeometricMeshRegion());
assert(GetDomain() == poisson_ratio.GetDomain());
if (IsConstant())
constant_value_ = ComputeValue(young_modulus.GetConstantValue(), poisson_ratio.GetConstantValue());
......
......@@ -22,12 +22,14 @@ namespace HappyHeart
LameMu::LameMu(const scalar_parameter& young_modulus,
const scalar_parameter& poisson_ratio)
: scalar_parameter("Lame coefficient 'mu'",
young_modulus.GetGeometricMeshRegion()),
young_modulus.GetGeometricMeshRegion(),
young_modulus.GetDomain()),
young_modulus_(young_modulus),
poisson_ratio_(poisson_ratio)
{
assert(young_modulus.GetGeometricMeshRegion() == poisson_ratio.GetGeometricMeshRegion());
assert(young_modulus.GetDomain() == poisson_ratio.GetDomain());
if (IsConstant())
constant_value_ = ComputeValue(young_modulus.GetConstantValue(), poisson_ratio.GetConstantValue());
}
......
......@@ -45,11 +45,16 @@ namespace HappyHeart
scalar_parameter_ptr&& x_component,
scalar_parameter_ptr&& y_component,
scalar_parameter_ptr&& z_component)
: parent(std::forward<T>(name), x_component->GetGeometricMeshRegion()),
: parent(std::forward<T>(name),
x_component->GetGeometricMeshRegion(),
x_component->GetDomain()
),
scalar_parameter_x_(std::move(x_component)),
scalar_parameter_y_(std::move(y_component)),
scalar_parameter_z_(std::move(z_component))
{
assert(parent::GetDomain() == GetScalarParameterY().GetDomain());
assert(parent::GetDomain() == GetScalarParameterZ().GetDomain());
assert(parent::GetGeometricMeshRegion() == GetScalarParameterY().GetGeometricMeshRegion());
assert(parent::GetGeometricMeshRegion() == GetScalarParameterZ().GetGeometricMeshRegion());
......
......@@ -68,6 +68,7 @@ namespace HappyHeart
typename ScalarParameter<TimeDependencyT>::unique_ptr
InitScalarParameterFromInputData(StringT&& name,
const GeometricMeshRegion& mesh,
const Domain& domain,
const InputParameterDataT& input_parameter_data);
......@@ -93,6 +94,7 @@ namespace HappyHeart
typename Parameter<ParameterNS::Type::vector, TimeDependencyT>::unique_ptr
InitThreeDimensionalParameterFromInputData(StringT&& name,
const GeometricMeshRegion& mesh,
const Domain& domain,
const InputParameterDataT& input_parameter_data);
......
......@@ -27,6 +27,7 @@ namespace HappyHeart
typename ScalarParameter<TimeDependencyT>::unique_ptr
InitScalarParameterFromInputData(T&& name,
const GeometricMeshRegion& geometric_mesh_region,
const Domain& domain,
const InputParameterDataT& input_parameter_data)
{
namespace IPL = Utilities::InputParameterListNS;
......@@ -57,6 +58,7 @@ namespace HappyHeart
TimeDependencyT
>(std::forward<T>(name),
geometric_mesh_region,
domain,
input_parameter_data,
nature,
scalar_value,
......@@ -75,6 +77,7 @@ namespace HappyHeart
typename Parameter<ParameterNS::Type::vector, TimeDependencyT>::unique_ptr
InitThreeDimensionalParameterFromInputData(T&& name,
const GeometricMeshRegion& geometric_mesh_region,
const Domain& domain,
const InputParameterDataT& input_parameter_data)
{
namespace IPL = Utilities::InputParameterListNS;
......@@ -123,6 +126,7 @@ namespace HappyHeart
ParameterNS::TimeDependencyNS::None
>("Lua function X",
geometric_mesh_region,
domain,
input_parameter_data,
nature_list[0],
component_value_list[0],
......@@ -137,6 +141,7 @@ namespace HappyHeart
ParameterNS::TimeDependencyNS::None
>("Lua function Y",
geometric_mesh_region,
domain,
input_parameter_data,
nature_list[1],
component_value_list[1],
......@@ -151,6 +156,7 @@ namespace HappyHeart
ParameterNS::TimeDependencyNS::None
>("Lua function Z",
geometric_mesh_region,
domain,
input_parameter_data,
nature_list[2],
component_value_list[2],
......
......@@ -91,6 +91,7 @@ namespace HappyHeart
typename ScalarParameter<TimeDependencyT>::unique_ptr
InitScalarParameterFromInputData(StringT&& name,
const GeometricMeshRegion& mesh,
const Domain& domain,
const InputParameterDataT& input_parameter_data,
typename TimeDependencyT<ParameterNS::Type::scalar>::const_unique_ptr&& time_dependency,
const std::string& nature,
......
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