Commit fac4bb1e authored by DIAZ Jerome's avatar DIAZ Jerome Committed by GILLES Sebastien
Browse files

#1381 Fix the C4 and C5 solid parameters that were not introduced properly in the latest tag:

- It is possible to define Mu1, Mu2 and C0 to C3 without C4 and C5.
- If C4 and C5 are defined, the formers are also required.
parent 2760d4b2
Pipeline #74418 passed with stages
in 8 minutes and 12 seconds
......@@ -7,10 +7,6 @@ stages:
# Todo: Doxygen doc should be published with pages.
# As suggested by https://blog.sparksuite.com/7-ways-to-speed-up-gitlab-ci-cd-times-29f60aab69f9
variables:
DOCKER_DRIVER: overlay2
.build_template_linux: &build_template_linux
stage: build_and_test
image: registry.gitlab.inria.fr/morefem/thirdpartycompilationfactory/${OS}-${COMPILER}-${MODE}
......@@ -33,6 +29,8 @@ variables:
.build_template_macos: &build_template_macos
stage: build_and_test
tags:
- macos
cache:
key: "cache_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
untracked: true
......@@ -56,7 +54,7 @@ variables:
image: ubuntu:latest
artifacts:
name: "artifact_run_doxygen_${CI_COMMIT_REF_SLUG}_${DOX}"
expire_in: 1 day
expire_in: 2 hours
paths:
- Documentation/Doxygen/${OUTPUT_FILE}
before_script:
......@@ -86,7 +84,7 @@ variables:
artifacts:
name: "artifact_check_warning_doxygen_${CI_COMMIT_REF_SLUG}_${DOXYGEN_OUTPUT_FILE}"
when: on_failure
expire_in: 1 day
expire_in: 2 hours
paths:
- filtered_doxygen_log.txt
before_script:
......@@ -219,85 +217,84 @@ check_warning_Fedora-gcc-debug-static-one_lib:
MODE: "debug"
LIB_NATURE: "static"
IS_ONLY_ONE_LIB: "True"
build-macos-clang-debug-static-one_lib:
<<: *build_template_macos
tags:
- macos
- debug
- static
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "static"
IS_ONLY_ONE_LIB: "True"
check_warning_macos-clang-debug-static-one_lib:
<<: *check_compilation_warning_template
dependencies:
- build-macos-clang-debug-static-one_lib
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "static"
IS_ONLY_ONE_LIB: "True"
build-macos-clang-debug-shared-several_libs:
<<: *build_template_macos
tags:
- macos
- debug
- shared
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "shared"
IS_ONLY_ONE_LIB: "False"
check_warning-macos-clang-debug-shared-several_libs:
<<: *check_compilation_warning_template
dependencies:
- build-macos-clang-debug-shared-several_libs
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "shared"
IS_ONLY_ONE_LIB: "False"
build-macos-clang-release-static-one_lib:
<<: *build_template_macos
tags:
- macos
- release
- static
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
IS_ONLY_ONE_LIB: "True"
check_warning_macos-clang-release-static-one_lib:
<<: *check_compilation_warning_template
dependencies:
- build-macos-clang-release-static-one_lib
variables:
OS: "macOS"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
IS_ONLY_ONE_LIB: "True"
# build-macos-clang-debug-static-one_lib:
# <<: *build_template_macos
# tags:
# - macos
# - debug
# - static
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "static"
# IS_ONLY_ONE_LIB: "True"
#
#
# check_warning_macos-clang-debug-static-one_lib:
# <<: *check_compilation_warning_template
# dependencies:
# - build-macos-clang-debug-static-one_lib
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "static"
# IS_ONLY_ONE_LIB: "True"
#
#
# build-macos-clang-debug-shared-several_libs:
# <<: *build_template_macos
# tags:
# - macos
# - debug
# - shared
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "shared"
# IS_ONLY_ONE_LIB: "False"
#
#
# check_warning-macos-clang-debug-shared-several_libs:
# <<: *check_compilation_warning_template
# dependencies:
# - build-macos-clang-debug-shared-several_libs
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "shared"
# IS_ONLY_ONE_LIB: "False"
#
#
# build-macos-clang-release-static-one_lib:
# <<: *build_template_macos
# tags:
# - macos
# - release
# - static
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# IS_ONLY_ONE_LIB: "True"
#
#
# check_warning_macos-clang-release-static-one_lib:
# <<: *check_compilation_warning_template
# dependencies:
# - build-macos-clang-release-static-one_lib
# variables:
# OS: "macOS"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# IS_ONLY_ONE_LIB: "True"
complete_doxygen:
......@@ -335,4 +332,4 @@ check_warning_complete_doxygen:
# artifacts:
# paths:
# - public
\ No newline at end of file
......@@ -1033,7 +1033,9 @@ namespace MoReFEM
C0,
C1,
C2,
C3
C3,
C4,
C5
>;
......
......@@ -71,6 +71,7 @@ namespace MoReFEM
return 0.;
}
inline constexpr double ExponentialJ1J4J6
::SecondDerivativeWFirstAndSixthInvariant(const invariant_holder_type& invariant_holder,
const QuadraturePoint& quad_pt,
......@@ -106,6 +107,7 @@ namespace MoReFEM
return mu_2_;
}
inline const ExponentialJ1J4J6::scalar_parameter& ExponentialJ1J4J6::GetC0() const noexcept
{
return c_0_;
......@@ -159,6 +161,7 @@ namespace MoReFEM
return fibers_I6_;
}
} // namespace HyperelasticLawNS
......
......@@ -389,7 +389,7 @@ namespace MoReFEM
scalar_parameter::array_unique_ptr<2> lame_coeff_ { { nullptr, nullptr } };
/*!
* \brief Mu1, Mu2, C0 to C3.
* \brief Mu1, Mu2, C0 to C5.
*
* \copydoc doxygen_hide_solid_optional_plural
*/
......
......@@ -143,21 +143,17 @@ namespace MoReFEM
}
if constexpr (Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu1>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C0>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C1>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C2>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C3>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C4>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C5>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu2>())
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C0>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C1>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C2>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C3>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu2>())
{
static_assert(Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu2>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C0>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C1>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C2>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C3>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C4>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C5>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu1>(),
"It makes no sense to define one and not the others");
......@@ -188,22 +184,36 @@ namespace MoReFEM
InitScalarParameterFromInputData<InputDataNS::Solid::C3>("C3",
domain,
input_data);
}
if constexpr (Internal::SolidNS::IsDefined<InputDataT, SolidIP::C4>()
|| Internal::SolidNS::IsDefined<InputDataT, SolidIP::C5>())
{
static_assert(Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu2>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C0>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C1>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C2>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C3>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C4>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::C5>()
&& Internal::SolidNS::IsDefined<InputDataT, SolidIP::Mu1>(),
"It makes no sense to define one and not the others");
std::get<6>(mu_i_C_i_) =
InitScalarParameterFromInputData<InputDataNS::Solid::C2>("C4",
domain,
input_data);
InitScalarParameterFromInputData<InputDataNS::Solid::C4>("C4",
domain,
input_data);
std::get<7>(mu_i_C_i_) =
InitScalarParameterFromInputData<InputDataNS::Solid::C3>("C5",
domain,
input_data);
}
InitScalarParameterFromInputData<InputDataNS::Solid::C5>("C5",
domain,
input_data);
} // if constexpr C4 / C5
if (relative_tolerance >= 0.)
CheckConsistency(relative_tolerance);
}
inline const Domain& Solid::GetDomain() const noexcept
{
......
......@@ -334,6 +334,49 @@ Solid = {
}, -- C3
C4 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
-- Expected format: see the variant description...
value = 15.
}, -- C4
C5 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
-- Expected format: see the variant description...
value = 16.
}, -- C5
-- For 2D operators, which approximation to use.
-- Expected format: "VALUE"
......
......@@ -334,7 +334,50 @@ Solid = {
}, -- C3
C4 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
-- Expected format: see the variant description...
value = 15.
}, -- C4
C5 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
-- Expected format: see the variant description...
value = 16.
}, -- C5
-- For 2D operators, which approximation to use.
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'irrelevant', 'plane_strain', 'plane_stress'})
......
......@@ -90,6 +90,10 @@ namespace // anonymous
constexpr double c2 = 13.;
constexpr double c3 = 14.;
constexpr double c4 = 15.;
constexpr double c5 = 16.;
} // namespace anonymous
......@@ -146,8 +150,11 @@ BOOST_FIXTURE_TEST_CASE(solid_data_correctly_interpreted, TestNS::FixtureNS::Env
BOOST_CHECK(NumericNS::AreEqual(solid.GetC1().GetConstantValue(), c1));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC2().GetConstantValue(), c2));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC3().GetConstantValue(), c3));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC4().GetConstantValue(), c4));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC5().GetConstantValue(), c5));
BOOST_CHECK(NumericNS::AreEqual(solid.GetPoissonRatio().GetConstantValue(), poisson_ratio));
BOOST_CHECK(NumericNS::AreEqual(solid.GetYoungModulus().GetConstantValue(), young_modulus));
}
PRAGMA_DIAGNOSTIC(pop)
......@@ -87,7 +87,11 @@ namespace // anonymous
constexpr double c3 = 14.;
constexpr double c4 = 15.;
constexpr double c5 = 16.;
} // namespace anonymous
......@@ -141,8 +145,12 @@ BOOST_FIXTURE_TEST_CASE(lame_ignored, TestNS::FixtureNS::Environment)
BOOST_CHECK(NumericNS::AreEqual(solid.GetC1().GetConstantValue(), c1));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC2().GetConstantValue(), c2));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC3().GetConstantValue(), c3));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC4().GetConstantValue(), c4));
BOOST_CHECK(NumericNS::AreEqual(solid.GetC5().GetConstantValue(), c5));
BOOST_CHECK(NumericNS::AreEqual(solid.GetPoissonRatio().GetConstantValue(), poisson_ratio));
BOOST_CHECK(NumericNS::AreEqual(solid.GetYoungModulus().GetConstantValue(), young_modulus));
}
PRAGMA_DIAGNOSTIC(pop)
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