diff --git a/bindings/python/include/TFEL/Python/TupleConverter.hxx b/bindings/python/include/TFEL/Python/TupleConverter.hxx index 3ac39ceaa..165c6bbf6 100644 --- a/bindings/python/include/TFEL/Python/TupleConverter.hxx +++ b/bindings/python/include/TFEL/Python/TupleConverter.hxx @@ -68,7 +68,7 @@ namespace tfel::python::internals { using namespace boost::python; return incref(make_tuple(std::get(t)...).ptr()); } // end of exe - }; // end of build_python_tuple + }; // end of build_python_tuple template T extract_nth_elt(const boost::python::tuple& l) { @@ -92,7 +92,7 @@ namespace tfel::python::internals { const integer_sequence&) { new (s) std::tuple(extract_nth_elt(l)...); } // end of exe - }; // end of build_tuple + }; // end of build_tuple /*! * \brief convert tuple converter to python tuple @@ -102,7 +102,7 @@ namespace tfel::python::internals { static PyObject* convert(const std::tuple& t) { return build_python_tuple::exe(t); } // end of convert - }; // end of struct tuple_to_python_tuple + }; // end of struct tuple_to_python_tuple template struct tuple_from_python_tuple { diff --git a/bindings/python/mfront/BehaviourData.cxx b/bindings/python/mfront/BehaviourData.cxx index 056bf5a4c..6320369f0 100644 --- a/bindings/python/mfront/BehaviourData.cxx +++ b/bindings/python/mfront/BehaviourData.cxx @@ -54,7 +54,7 @@ void declareBehaviourData() { using namespace boost::python; using namespace mfront; - const VariableDescription& (BehaviourData::*ptr)(const std::string&)const = + const VariableDescription& (BehaviourData::*ptr)(const std::string&) const = &BehaviourData::getVariableDescription; class_("BehaviourData") diff --git a/bindings/python/mfront/OverridableImplementation.cxx b/bindings/python/mfront/OverridableImplementation.cxx index 765118ada..756d60e44 100644 --- a/bindings/python/mfront/OverridableImplementation.cxx +++ b/bindings/python/mfront/OverridableImplementation.cxx @@ -34,11 +34,12 @@ void declareOverridableImplementation() { a); }, "override the name of the author") - .def("overrideDate", - +[](mfront::OverridableImplementation& i, const std::string& a) { - i.setOverridenValue(a); - }, - "override the date at which the implementation was written") + .def( + "overrideDate", + +[](mfront::OverridableImplementation& i, const std::string& a) { + i.setOverridenValue(a); + }, + "override the date at which the implementation was written") .def( "overrideDescription", +[](mfront::OverridableImplementation& i, const std::string& a) { @@ -46,12 +47,13 @@ void declareOverridableImplementation() { a); }, "override the description") - .def("overrideMaterial", - +[](mfront::OverridableImplementation& i, const std::string& a) { - i.setOverridenValue< - mfront::OverridableImplementation::MATERIAL_NAME>(a); - }, - "override the name of the material") + .def( + "overrideMaterial", + +[](mfront::OverridableImplementation& i, const std::string& a) { + i.setOverridenValue< + mfront::OverridableImplementation::MATERIAL_NAME>(a); + }, + "override the name of the material") .def( "overrideMaterialPropertyName", +[](mfront::OverridableImplementation& i, const std::string& a) { @@ -65,30 +67,32 @@ void declareOverridableImplementation() { }, "override the name of the material property (fails if the source " "file does not describe a material property)") - .def("overrideBehaviourName", - +[](mfront::OverridableImplementation& i, const std::string& a) { - if (i.getTargetType() != mfront::AbstractDSL::BEHAVIOURDSL) { - tfel::raise( - "overrideBehaviourName: invalid call (the DSL does not " - "describe a behaviour)"); - } - i.setOverridenValue(a); - }, - "override the name of the behaviour (fails if the source file does " - "not describe a behaviour)") - .def("overrideModelName", - +[](mfront::OverridableImplementation& i, const std::string& a) { - if (i.getTargetType() != mfront::AbstractDSL::MODELDSL) { - tfel::raise( - "overrideModelName: invalid call (the DSL does not describe " - "a model"); - } - i.setOverridenValue(a); - }, - "override the name of the model (fails if the source file does not " - "describe a model)") + .def( + "overrideBehaviourName", + +[](mfront::OverridableImplementation& i, const std::string& a) { + if (i.getTargetType() != mfront::AbstractDSL::BEHAVIOURDSL) { + tfel::raise( + "overrideBehaviourName: invalid call (the DSL does not " + "describe a behaviour)"); + } + i.setOverridenValue(a); + }, + "override the name of the behaviour (fails if the source file does " + "not describe a behaviour)") + .def( + "overrideModelName", + +[](mfront::OverridableImplementation& i, const std::string& a) { + if (i.getTargetType() != mfront::AbstractDSL::MODELDSL) { + tfel::raise( + "overrideModelName: invalid call (the DSL does not describe " + "a model"); + } + i.setOverridenValue(a); + }, + "override the name of the model (fails if the source file does not " + "describe a model)") .def("overrideByAParameter", &mfront::OverridableImplementation::overrideByAParameter, "override a variable by the given parameter") diff --git a/bindings/python/mfront/VariableDescription.cxx b/bindings/python/mfront/VariableDescription.cxx index ab9819eaa..a256e89fe 100644 --- a/bindings/python/mfront/VariableDescription.cxx +++ b/bindings/python/mfront/VariableDescription.cxx @@ -39,7 +39,7 @@ void declareVariableDescription() { const VariableBoundsDescription& (VariableDescription::*getBounds_1)() const = &VariableDescription::getBounds; const VariableBoundsDescription& (VariableDescription::*getBounds_2)( - const unsigned short)const = &VariableDescription::getBounds; + const unsigned short) const = &VariableDescription::getBounds; void (VariableDescription::*setBounds_1)(const VariableBoundsDescription&) = &VariableDescription::setBounds; void (VariableDescription::*setBounds_2)(const VariableBoundsDescription&, @@ -52,7 +52,7 @@ void declareVariableDescription() { const VariableBoundsDescription& (VariableDescription::*getPhysicalBounds_1)() const = &VariableDescription::getPhysicalBounds; const VariableBoundsDescription& (VariableDescription::*getPhysicalBounds_2)( - const unsigned short)const = &VariableDescription::getPhysicalBounds; + const unsigned short) const = &VariableDescription::getPhysicalBounds; void (VariableDescription::*setPhysicalBounds_1)( const VariableBoundsDescription&) = &VariableDescription::setPhysicalBounds; diff --git a/bindings/python/mtest/CurrentState.cxx b/bindings/python/mtest/CurrentState.cxx index f2c5786b2..702f90e33 100644 --- a/bindings/python/mtest/CurrentState.cxx +++ b/bindings/python/mtest/CurrentState.cxx @@ -160,6 +160,7 @@ void declareCurrentState() { .add_property("iv1", CurrentState_getiv1) .add_property("evs0", CurrentState_getesv0) .add_property("desv", CurrentState_getdesv) + .def_readonly("position", &mtest::CurrentState::position) .def("setInternalStateVariableValue", ptr, "set the value of a scalar internal state variable\n" "\n" diff --git a/docs/mfront/CMakeLists.txt b/docs/mfront/CMakeLists.txt index d5b4618b4..a5218f84e 100644 --- a/docs/mfront/CMakeLists.txt +++ b/docs/mfront/CMakeLists.txt @@ -1,21 +1,4 @@ macro(install_mfront_desc file) - # if(HAVE_PANDOC) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${file}.html - # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.md - # DEPENDS ${PROJECT_SOURCE_DIR}/docs/web/mfront-template.html - # DEPENDS ${PROJECT_SOURCE_DIR}/docs/web/css/main.css - # COMMAND ${PANDOC} - # ARGS -f markdown-markdown_in_html_blocks+tex_math_single_backslash - # ARGS --mathjax - # ARGS ${ARGN} - # ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.md -o ${file}.html) - # add_custom_target(mfront-${file}-html ALL DEPENDS ${file}.html) - # add_dependencies(website mfront-${file}-html) - # install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.html - # DESTINATION share/doc/tfel/web/mfront - # COMPONENT website) - # endif(HAVE_PANDOC) if(TFEL_APPEND_SUFFIX) install(FILES ${file}.md DESTINATION share/doc/mfront-${TFEL_SUFFIX} @@ -27,21 +10,6 @@ macro(install_mfront_desc file) endmacro(install_mfront_desc file) macro(install_mfront_desc2 directory file) - # if(HAVE_PANDOC) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${file}-${directory}.html - # DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${directory}/${file}.md - # COMMAND ${PANDOC} - # ARGS -f markdown-markdown_in_html_blocks+tex_math_single_backslash - # ARGS --mathjax - # ARGS ${ARGN} - # ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${directory}/${file}.md -o ${file}-${directory}.html) - # add_custom_target(mfront-${file}-${directory}-html ALL DEPENDS ${file}-${directory}.html) - # add_dependencies(website mfront-${file}-${directory}-html) - # install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}-${directory}.html - # DESTINATION share/doc/tfel/web/mfront/${directory}/${file}.html - # COMPONENT website) - # endif(HAVE_PANDOC) if(TFEL_APPEND_SUFFIX) install(FILES ${directory}/${file}.md DESTINATION share/doc/mfront-${TFEL_SUFFIX}/${directory} @@ -53,6 +21,24 @@ macro(install_mfront_desc2 directory file) endif(TFEL_APPEND_SUFFIX) endmacro(install_mfront_desc2 directory file) +macro(install_mfront_desc3 directory1 directory2 file) + if(TFEL_APPEND_SUFFIX) + install(FILES ${directory1}/${file}.md + DESTINATION share/doc/mfront-${TFEL_SUFFIX}/${directory1} + COMPONENT mfront) + install(FILES ${directory1}/${file}.md + DESTINATION share/doc/mfront-${TFEL_SUFFIX}/${directory2} + COMPONENT mfront) + else(TFEL_APPEND_SUFFIX) + install(FILES ${directory1}/${file}.md + DESTINATION share/doc/mfront/${directory1} + COMPONENT mfront) + install(FILES ${directory1}/${file}.md + DESTINATION share/doc/mfront/${directory2} + COMPONENT mfront) + endif(TFEL_APPEND_SUFFIX) +endmacro(install_mfront_desc2 directory file) + install_mfront_desc(AdditionalConvergenceChecks) install_mfront_desc(AdditionalTangentOperatorBlock) install_mfront_desc(AdditionalTangentOperatorBlocks) @@ -154,12 +140,13 @@ install_mfront_desc(UseQt) install_mfront_desc2(Implicit HillTensor) -install_mfront_desc2(MaterialLaw Constant) -install_mfront_desc2(MaterialLaw Function) -install_mfront_desc2(MaterialLaw Input) -install_mfront_desc2(MaterialLaw Law) -install_mfront_desc2(MaterialLaw MFront) -install_mfront_desc2(MaterialLaw Output) +install_mfront_desc3(MaterialLaw MaterialProperty Constant) +install_mfront_desc3(MaterialLaw MaterialProperty Data) +install_mfront_desc3(MaterialLaw MaterialProperty Function) +install_mfront_desc3(MaterialLaw MaterialProperty Input) +install_mfront_desc3(MaterialLaw MaterialProperty Law) +install_mfront_desc3(MaterialLaw MaterialProperty MFront) +install_mfront_desc3(MaterialLaw MaterialProperty Output) install_mfront_desc2(Model ConstantMaterialProperty) install_mfront_desc2(Model Domain) diff --git a/docs/mfront/MaterialLaw/Data.md b/docs/mfront/MaterialLaw/Data.md new file mode 100644 index 000000000..ae26e2067 --- /dev/null +++ b/docs/mfront/MaterialLaw/Data.md @@ -0,0 +1,52 @@ +The `@Data` keyword allow the definition of a material properties using +the interpolation of a set of values. + +The `@Data` keyword is followed by a set of options defining: + +- the interpolation option, +- the set of values, +- the extrapolation option. + +The precise syntax depends on the number of inputs of the material +property. + +## Material properties without input + +The only option accepted is `value`. + +## Material properties with only one input + +The `values` option is required. It must be a map associating values of +the input and values of the output. + +The `interpolation` option is optional. It must be a string. The values +`linear` and `cubic_spline` are accepted. + +The `extrapolation` option is optional. It must be a boolean or a +string: + +- The boolean value `true` means that a linear extrapolation will be performed. +- The boolean value `false` or the string value `bound_to_last_value` or + the string value `constant` means that a constant value will be used + for extrapolation. + +## Example of usage + +~~~~{.cpp} +@DSL MaterialProperty; +@Law LinearDataInterpolation; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear" +} +~~~~ diff --git a/docs/mfront/MaterialLaw/Function.md b/docs/mfront/MaterialLaw/Function.md index 511dd2b82..47c3e33d0 100644 --- a/docs/mfront/MaterialLaw/Function.md +++ b/docs/mfront/MaterialLaw/Function.md @@ -18,6 +18,6 @@ thus introduced by the interfaces. We advice the user to use this { const real C0 = 575.57; const real C1 = -21094.; - Cp = C0+C1/T; + Cp = C0 + C1 / T; } ~~~~ diff --git a/docs/mfront/lsdyna/mfront-lsdyna.cxx b/docs/mfront/lsdyna/mfront-lsdyna.cxx index a71b82b39..d9dd08cd4 100644 --- a/docs/mfront/lsdyna/mfront-lsdyna.cxx +++ b/docs/mfront/lsdyna/mfront-lsdyna.cxx @@ -71,7 +71,7 @@ namespace lsdyna { } return ""; #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of getErrorMessage + } // end of getErrorMessage static void log(const std::string& m) { static std::ofstream log("mfront-lsdyna.log"); diff --git a/docs/mfront/mfront/SICCreepBehaviour-ple.cxx b/docs/mfront/mfront/SICCreepBehaviour-ple.cxx index 1a6042965..2c8535130 100644 --- a/docs/mfront/mfront/SICCreepBehaviour-ple.cxx +++ b/docs/mfront/mfront/SICCreepBehaviour-ple.cxx @@ -6,6 +6,10 @@ * \date 06 / 12 / 07 */ -MechanicalBehaviour 'IsotropicUmatBehaviour' 'libUmatBehaviour.so' 'umatSiCCreep' MaterialProperty 'YoungModulus' 150.e9 MaterialProperty 'PoissonRatio' 0.3 MaterialProperty< - constant> 'ThermalExpansion' 0. MaterialProperty 'MassDensity' 0. InternalStateVariable 'ElasticStrain' InternalStateVariable 'EquivalentViscoplasticStrain' EndOfMechanicalBehaviour - EndOfMaterial +MechanicalBehaviour 'IsotropicUmatBehaviour' 'libUmatBehaviour.so' 'umatSiCCreep' MaterialProperty < + constant > 'YoungModulus' 150.e9 MaterialProperty < constant > + 'PoissonRatio' 0.3 MaterialProperty < constant > + 'ThermalExpansion' 0. MaterialProperty < constant > + 'MassDensity' 0. InternalStateVariable < Stensor > + 'ElasticStrain' InternalStateVariable < Scalar > + 'EquivalentViscoplasticStrain' EndOfMechanicalBehaviour EndOfMaterial diff --git a/docs/tutorial/mfront/EllipticCreep.hxx b/docs/tutorial/mfront/EllipticCreep.hxx index 82a732680..b0c5fb8cb 100644 --- a/docs/tutorial/mfront/EllipticCreep.hxx +++ b/docs/tutorial/mfront/EllipticCreep.hxx @@ -109,7 +109,7 @@ namespace tfel { static_assert(tfel::typetraits::IsFundamentalNumericType::cond); static_assert(tfel::typetraits::IsReal::cond); - friend std::ostream& operator<<<>(std::ostream&, const EllipticCreep&); + friend std::ostream& operator<< <>(std::ostream&, const EllipticCreep&); static constexpr unsigned short TVectorSize = N; typedef tfel::math::StensorDimeToSize StensorDimeToSize; @@ -833,7 +833,7 @@ namespace tfel { */ static std::string getName(void) { return std::string("EllipticCreep"); } }; // end of struct Name - } // end of namespace utilities + } // end of namespace utilities } // end of namespace tfel #endif /* LIB_TFELMATERIAL_ELLIPTICCREEP_HXX_ */ diff --git a/docs/web/cxx/mfront/src/PorousStressCriterionTemplate.cxx b/docs/web/cxx/mfront/src/PorousStressCriterionTemplate.cxx index 9be030211..bb2151f3e 100644 --- a/docs/web/cxx/mfront/src/PorousStressCriterionTemplate.cxx +++ b/docs/web/cxx/mfront/src/PorousStressCriterionTemplate.cxx @@ -79,7 +79,7 @@ namespace mfront { return std::make_shared<__StressCriterionName__StressCriterion>(); }); } // end of __StressCriterionName__StressCriterionProxy - }; // end of struct __StressCriterionName__StressCriterionProxy + }; // end of struct __StressCriterionName__StressCriterionProxy static __StressCriterionName__StressCriterionProxy proxy; diff --git a/docs/web/cxx/mfront/src/StressCriterionTemplate.cxx b/docs/web/cxx/mfront/src/StressCriterionTemplate.cxx index 96131c314..0d46cca38 100644 --- a/docs/web/cxx/mfront/src/StressCriterionTemplate.cxx +++ b/docs/web/cxx/mfront/src/StressCriterionTemplate.cxx @@ -61,7 +61,7 @@ namespace mfront { return std::make_shared<__StressCriterionName__StressCriterion>(); }); } // end of __StressCriterionName__StressCriterionProxy - }; // end of struct __StressCriterionName__StressCriterionProxy + }; // end of struct __StressCriterionName__StressCriterionProxy static __StressCriterionName__StressCriterionProxy proxy; diff --git a/docs/web/release-notes-5.0.md b/docs/web/release-notes-5.0.md index 736f45ac2..a097d1ab0 100644 --- a/docs/web/release-notes-5.0.md +++ b/docs/web/release-notes-5.0.md @@ -127,6 +127,63 @@ default `TFEL` solver. # MFront +## Improvements to the `MaterialProperty` DSL + +### The `@Data` keyword + +The `@Data` keyword allow the definition of a material properties using +the interpolation of a set of values. + +The `@Data` keyword is followed by a set of options defining: + +- the interpolation option, +- the set of values, +- the extrapolation option. + +The precise syntax depends on the number of inputs of the material +property. + +#### Material properties without input + +The only option accepted is `value`. + +#### Material properties with only one input + +The `values` option is required. It must be a map associating values of +the input and values of the output. + +The `interpolation` option is optional. It must be a string. The values +`linear` and `cubic_spline` are accepted. + +The `extrapolation` option is optional. It must be a boolean or a +string: + +- The boolean value `true` means that a linear extrapolation will be performed. +- The boolean value `false` or the string value `bound_to_last_value` or + the string value `constant` means that a constant value will be used + for extrapolation. + +#### Example of usage + +~~~~{.cpp} +@DSL MaterialProperty; +@Law LinearDataInterpolation; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear" +} +~~~~ + ## `generic` interface improvements ### The `@SelectedModellingHypothesis` and `@SelectedModellingHypotheses` keywords diff --git a/include/FSES/Utilities.ixx b/include/FSES/Utilities.ixx index 05159ad59..b5625fd7c 100644 --- a/include/FSES/Utilities.ixx +++ b/include/FSES/Utilities.ixx @@ -52,8 +52,9 @@ namespace fses { template struct GetVectorNumericType { //! the result - using type = typename std::decay().operator()(0))>::type; + using type = + typename std::decay().operator()( + 0))>::type; }; // end of struct GetVectorNumericType /*! @@ -80,8 +81,9 @@ namespace fses { template struct GetMatrixNumericType { //! the result - using type = typename std::decay().operator()(0, 0))>::type; + using type = + typename std::decay().operator()( + 0, 0))>::type; }; // end of struct GetMatrixNumericType /*! * \brief partial specialisation for pointers diff --git a/include/TFEL/FSAlgorithm/copy.hxx b/include/TFEL/FSAlgorithm/copy.hxx index 0112d89cf..a2abac860 100644 --- a/include/TFEL/FSAlgorithm/copy.hxx +++ b/include/TFEL/FSAlgorithm/copy.hxx @@ -154,10 +154,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<1u>::exe(++p, ++q); } @@ -194,10 +196,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -209,10 +212,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<2u>::exe(++p, ++q); } @@ -249,10 +254,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -265,10 +271,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<3u>::exe(++p, ++q); } @@ -305,10 +313,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -322,10 +331,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<4u>::exe(++p, ++q); } @@ -362,10 +373,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -380,10 +392,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<5u>::exe(++p, ++q); } @@ -420,10 +434,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -439,10 +454,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<6u>::exe(++p, ++q); } @@ -479,10 +496,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -499,10 +517,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<7u>::exe(++p, ++q); } @@ -539,10 +559,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - (tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires((tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -560,10 +581,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<8u>::exe(++p, ++q); } @@ -600,10 +623,11 @@ namespace tfel::fsalgo { * \date 30 Jun 2006 */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - tfel::typetraits::IsRandomAccessIterator::cond&& - tfel::typetraits::IsRandomAccessIterator::cond) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond) + { q[0] = p[0]; q[1] = p[1]; q[2] = p[2]; @@ -622,10 +646,12 @@ namespace tfel::fsalgo { * \see copy::exe for details */ template - TFEL_HOST_DEVICE static constexpr auto - exe(InputIterator p, OutputIterator q) noexcept requires( - !(tfel::typetraits::IsRandomAccessIterator::cond && - tfel::typetraits::IsRandomAccessIterator::cond)) { + TFEL_HOST_DEVICE static constexpr auto exe(InputIterator p, + OutputIterator q) noexcept + requires( + !(tfel::typetraits::IsRandomAccessIterator::cond && + tfel::typetraits::IsRandomAccessIterator::cond)) + { *q = *p; return copy<9u>::exe(++p, ++q); } diff --git a/include/TFEL/FSAlgorithm/loop.hxx b/include/TFEL/FSAlgorithm/loop.hxx index 1a2c89d13..9c6c69bb5 100644 --- a/include/TFEL/FSAlgorithm/loop.hxx +++ b/include/TFEL/FSAlgorithm/loop.hxx @@ -54,7 +54,7 @@ namespace tfel::fsalgo { */ template void exe(F&) {} // end of exe - }; // end of struct do_loop + }; // end of struct do_loop } // namespace internals diff --git a/include/TFEL/Material/Barlat2004YieldCriterion.ixx b/include/TFEL/Material/Barlat2004YieldCriterion.ixx index 8cee220cd..5ffe8ca26 100644 --- a/include/TFEL/Material/Barlat2004YieldCriterion.ixx +++ b/include/TFEL/Material/Barlat2004YieldCriterion.ixx @@ -40,8 +40,8 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, BarlatStressType>&, const tfel::math::tmatrix<3u, 3u, BarlatBaseType>&, const tfel::material::BarlatStressType) noexcept // - requires(tfel::math::getSpaceDimension() == 1u) { - } // end of completeBaralatStressSecondDerivative + requires(tfel::math::getSpaceDimension() == 1u) + {} // end of completeBaralatStressSecondDerivative /*! * \brief add the terms relative to the eigenvectors derivatives * \param[out] d2Phi_ds2: second derivative of the Barlat equivalent stress @@ -66,7 +66,8 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, BarlatStressType>& vp, const tfel::math::tmatrix<3u, 3u, BarlatBaseType>& m, const tfel::material::BarlatStressType e) // - requires(tfel::math::getSpaceDimension() == 2u) { + requires(tfel::math::getSpaceDimension() == 2u) + { using namespace tfel::math; using base = tfel::material::BarlatBaseType; constexpr auto icste = Cste::isqrt2; @@ -106,7 +107,8 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, BarlatStressType>& vp, const tfel::math::tmatrix<3u, 3u, BarlatBaseType>& m, const tfel::material::BarlatStressType e) // - requires(tfel::math::getSpaceDimension() == 3u) { + requires(tfel::math::getSpaceDimension() == 3u) + { using namespace tfel::math; using base = tfel::material::BarlatBaseType; constexpr auto cste = Cste::isqrt2; diff --git a/include/TFEL/Material/CrystalStructure.hxx b/include/TFEL/Material/CrystalStructure.hxx index 862c7b27b..d539da74c 100644 --- a/include/TFEL/Material/CrystalStructure.hxx +++ b/include/TFEL/Material/CrystalStructure.hxx @@ -22,7 +22,7 @@ namespace tfel::material { BCC, //!< body centered cubic structure FCC, //!< face centered cubic structure HCP //!< hexagonal closed-packed structures - }; // end of enum struct CrystalStructure + }; // end of enum struct CrystalStructure } // end of namespace tfel::material diff --git a/include/TFEL/Material/FiniteStrainBehaviourTangentOperator.hxx b/include/TFEL/Material/FiniteStrainBehaviourTangentOperator.hxx index 017170025..05ae97a25 100644 --- a/include/TFEL/Material/FiniteStrainBehaviourTangentOperator.hxx +++ b/include/TFEL/Material/FiniteStrainBehaviourTangentOperator.hxx @@ -117,17 +117,19 @@ namespace tfel::material { * \pre T1 must be a type that the GenType can hold. */ template - TFEL_INLINE void set_uninitialised() requires( - tfel::meta::TLCountNbrOfT::value == 1) { + TFEL_INLINE void set_uninitialised() + requires(tfel::meta::TLCountNbrOfT::value == 1) + { GenType::template set_uninitialised(); } /*! * \brief assignement operator */ template - FiniteStrainBehaviourTangentOperator& operator=(const T& e) requires( - tfel::math::getSpaceDimension() == N && - std::is_same_v, StressType>) { + FiniteStrainBehaviourTangentOperator& operator=(const T& e) + requires(tfel::math::getSpaceDimension() == N && + std::is_same_v, StressType>) + { using namespace tfel::math; if (this->template is*>()) { *(this->template get*>()) = e; @@ -143,9 +145,10 @@ namespace tfel::material { * \brief assignement operator */ template - FiniteStrainBehaviourTangentOperator& operator=(const T& e) requires( - tfel::math::getSpaceDimension() == N && - std::is_same_v, StressType>) { + FiniteStrainBehaviourTangentOperator& operator=(const T& e) + requires(tfel::math::getSpaceDimension() == N && + std::is_same_v, StressType>) + { using namespace tfel::math; if (this->template is*>()) { *(this->template get*>()) = e; diff --git a/include/TFEL/Material/FiniteStrainBehaviourTangentOperatorBase.hxx b/include/TFEL/Material/FiniteStrainBehaviourTangentOperatorBase.hxx index 5b68747e9..212c5bc52 100644 --- a/include/TFEL/Material/FiniteStrainBehaviourTangentOperatorBase.hxx +++ b/include/TFEL/Material/FiniteStrainBehaviourTangentOperatorBase.hxx @@ -67,7 +67,7 @@ namespace tfel::material { with respect to Hencky strain tensor */ DPK1_DF /*!< derivative of the first Piola-Kirchhoff stress with respect to deformation gradient */ - }; // end of Flag + }; // end of Flag }; } // end of namespace tfel::material diff --git a/include/TFEL/Material/Hill.ixx b/include/TFEL/Material/Hill.ixx index 74bbfc05f..793a8e0fa 100644 --- a/include/TFEL/Material/Hill.ixx +++ b/include/TFEL/Material/Hill.ixx @@ -120,7 +120,7 @@ namespace tfel::material { return ComputeHillTensorBase::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct + }; // end of struct // ComputeHillTensor /*! * \brief partial specialisation of the `ComputeHillTensor` @@ -166,7 +166,7 @@ namespace tfel::material { return ComputeHillTensorBase::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct + }; // end of struct // ComputeHillTensor /*! * \brief partial specialisation of the `ComputeHillTensor` @@ -200,7 +200,7 @@ namespace tfel::material { return ComputeHillTensorBase<2u, real>::hillTensor(H_H, H_G, H_F, H_M, H_L, H_N); } // end of exe - }; // end of struct + }; // end of struct // ComputeHillTensor /*! * \brief partial specialisation of the `ComputeHillTensor` @@ -234,7 +234,7 @@ namespace tfel::material { return ComputeHillTensorBase<2u, real>::hillTensor(H_H, H_G, H_F, H_M, H_L, H_N); } // end of exe - }; // end of struct + }; // end of struct // ComputeHillTensor /*! * \brief partial specialisation of the `ComputeHillTensor` @@ -269,7 +269,7 @@ namespace tfel::material { return ComputeHillTensorBase<2u, real>::hillTensor(H_H, H_G, H_F, H_M, H_L, H_N); } // end of exe - }; // end of struct + }; // end of struct // ComputeHillTensor /*! * \brief partial specialisation of the `ComputeHillTensor` @@ -304,16 +304,16 @@ namespace tfel::material { return ComputeHillTensorBase<3u, real>::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct ComputeHillTensor - /*! - * \brief partial specialisation of the `ComputeHillTensor` - * class for the: - * - `OrthotropicAxesConvention::PLATE` orthotropic axes - * convention. - * - `ModellingHypothesis::PLANESTRESS` modelling hypothesis. - * - * \tparam real: numeric type - */ + }; // end of struct ComputeHillTensor + /*! + * \brief partial specialisation of the `ComputeHillTensor` + * class for the: + * - `OrthotropicAxesConvention::PLATE` orthotropic axes + * convention. + * - `ModellingHypothesis::PLANESTRESS` modelling hypothesis. + * + * \tparam real: numeric type + */ template struct ComputeHillTensor::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct ComputeHillTensor - /*! - * \brief partial specialisation of the `ComputeHillTensor` - * class for the: - * - `OrthotropicAxesConvention::PLATE` orthotropic axes - * convention. - * - `ModellingHypothesis::PLANESTRAIN` modelling hypothesis. - * - * \tparam real: numeric type - */ + }; // end of struct ComputeHillTensor + /*! + * \brief partial specialisation of the `ComputeHillTensor` + * class for the: + * - `OrthotropicAxesConvention::PLATE` orthotropic axes + * convention. + * - `ModellingHypothesis::PLANESTRAIN` modelling hypothesis. + * + * \tparam real: numeric type + */ template struct ComputeHillTensor::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct ComputeHillTensor - /*! - * \brief partial specialisation of the `ComputeHillTensor` - * class for the: - * - `OrthotropicAxesConvention::PLATE` orthotropic axes - * convention. - * - `ModellingHypothesis::GENERALISEDPLANESTRAIN` modelling hypothesis. - * - * \tparam real: numeric type - */ + }; // end of struct ComputeHillTensor + /*! + * \brief partial specialisation of the `ComputeHillTensor` + * class for the: + * - `OrthotropicAxesConvention::PLATE` orthotropic axes + * convention. + * - `ModellingHypothesis::GENERALISEDPLANESTRAIN` modelling hypothesis. + * + * \tparam real: numeric type + */ template struct ComputeHillTensor< tfel::material::ModellingHypothesis::GENERALISEDPLANESTRAIN, @@ -404,7 +404,7 @@ namespace tfel::material { return ComputeHillTensorBase<2u, real>::hillTensor(H_F, H_G, H_H, H_L, H_M, H_N); } // end of exe - }; // end of struct ComputeHillTensor + }; // end of struct ComputeHillTensor } // end of namespace internals diff --git a/include/TFEL/Material/Hosford1972YieldCriterion.ixx b/include/TFEL/Material/Hosford1972YieldCriterion.ixx index 1d96d52d3..8df970951 100644 --- a/include/TFEL/Material/Hosford1972YieldCriterion.ixx +++ b/include/TFEL/Material/Hosford1972YieldCriterion.ixx @@ -51,26 +51,27 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, HosfordStressType>&, const tfel::math::tmatrix<3u, 3u, HosfordBaseType>&, const tfel::material::HosfordStressType) // - requires(tfel::math::getSpaceDimension() == 1u) { + requires(tfel::math::getSpaceDimension() == 1u) + { d2Psi_ds2 = {d2Psi_dvp2[0], d2Psi_dvp2[3], d2Psi_dvp2[4], d2Psi_dvp2[3], d2Psi_dvp2[1], d2Psi_dvp2[5], d2Psi_dvp2[4], d2Psi_dvp2[5], d2Psi_dvp2[2]}; } // end of computeHosfordStressSecondDerivative - /*! - * \brief compute the second derivative of the Hosford equivalent stress - * \param[out] d2Psi_ds2: second derivative of the Hosford equivalent - * stress - * \param[in] dPsi_dvp: first derivative of the Hosford - * equivalent stress with respect to the eigenvalue - * \param[in] d2Psi_dvp2: second derivative of the Hosford - * equivalent stress with respect to the eigenvalue - * \param[in] n0: first eigen tensor - * \param[in] n1: second eigen tensor - * \param[in] n2: third eigen tensor - * \param[in] vp: eigen values - * \param[in] m: matrix for the eigen vectors - * \param[in] e: criterion used to check if two eigenvalues are equal - */ + /*! + * \brief compute the second derivative of the Hosford equivalent stress + * \param[out] d2Psi_ds2: second derivative of the Hosford equivalent + * stress + * \param[in] dPsi_dvp: first derivative of the Hosford + * equivalent stress with respect to the eigenvalue + * \param[in] d2Psi_dvp2: second derivative of the Hosford + * equivalent stress with respect to the eigenvalue + * \param[in] n0: first eigen tensor + * \param[in] n1: second eigen tensor + * \param[in] n2: third eigen tensor + * \param[in] vp: eigen values + * \param[in] m: matrix for the eigen vectors + * \param[in] e: criterion used to check if two eigenvalues are equal + */ template void computeHosfordStressSecondDerivative( tfel::material::HosfordStressSecondDerivativeType& @@ -87,7 +88,8 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, HosfordStressType>& vp, const tfel::math::tmatrix<3u, 3u, HosfordBaseType>& m, const tfel::material::HosfordStressType e) // - requires(tfel::math::getSpaceDimension() == 2u) { + requires(tfel::math::getSpaceDimension() == 2u) + { using namespace tfel::math; using base = tfel::material::HosfordBaseType; constexpr auto icste = Cste::isqrt2; @@ -110,21 +112,21 @@ namespace tfel::material::internals { d2Psi_ds2 += (dPsi_dvp[0] - dPsi_dvp[1]) / (vp[0] - vp[1]) * (n01 ^ n01); } } // end of computeHosfordStressSecondDerivative - /*! - * \brief compute the second derivative of the Hosford equivalent stress - * \param[out] d2Psi_ds2: second derivative of the Hosford equivalent - * stress - * \param[in] dPsi_dvp: first derivative of the Hosford - * equivalent stress with respect to the eigenvalue - * \param[in] d2Psi_dvp2: second derivative of the Hosford - * equivalent stress with respect to the eigenvalue - * \param[in] n0: first eigen tensor - * \param[in] n1: second eigen tensor - * \param[in] n2: third eigen tensor - * \param[in] vp: eigen values - * \param[in] m: matrix for the eigen vectors - * \param[in] e: criterion used to check if two eigenvalues are equal - */ + /*! + * \brief compute the second derivative of the Hosford equivalent stress + * \param[out] d2Psi_ds2: second derivative of the Hosford equivalent + * stress + * \param[in] dPsi_dvp: first derivative of the Hosford + * equivalent stress with respect to the eigenvalue + * \param[in] d2Psi_dvp2: second derivative of the Hosford + * equivalent stress with respect to the eigenvalue + * \param[in] n0: first eigen tensor + * \param[in] n1: second eigen tensor + * \param[in] n2: third eigen tensor + * \param[in] vp: eigen values + * \param[in] m: matrix for the eigen vectors + * \param[in] e: criterion used to check if two eigenvalues are equal + */ template void computeHosfordStressSecondDerivative( tfel::material::HosfordStressSecondDerivativeType& @@ -141,7 +143,8 @@ namespace tfel::material::internals { const tfel::math::tvector<3u, HosfordStressType>& vp, const tfel::math::tmatrix<3u, 3u, HosfordBaseType>& m, const tfel::material::HosfordStressType e) // - requires(tfel::math::getSpaceDimension() == 3u) { + requires(tfel::math::getSpaceDimension() == 3u) + { using namespace tfel::math; using base = tfel::material::HosfordBaseType; constexpr auto cste = Cste::isqrt2; diff --git a/include/TFEL/Material/IsotropicLinearFourierLaw.hxx b/include/TFEL/Material/IsotropicLinearFourierLaw.hxx index 4dcf23e39..ddedc3c3f 100644 --- a/include/TFEL/Material/IsotropicLinearFourierLaw.hxx +++ b/include/TFEL/Material/IsotropicLinearFourierLaw.hxx @@ -36,7 +36,7 @@ namespace tfel::material { public: //! \brief default constructor - IsotropicLinearFourierLaw(){}; + IsotropicLinearFourierLaw() {}; /*! * Law integration */ diff --git a/include/TFEL/Material/MechanicalBehaviour.hxx b/include/TFEL/Material/MechanicalBehaviour.hxx index 9260c7ca4..b37e777bf 100644 --- a/include/TFEL/Material/MechanicalBehaviour.hxx +++ b/include/TFEL/Material/MechanicalBehaviour.hxx @@ -133,7 +133,7 @@ namespace tfel::material { CONSISTENTTANGENTOPERATOR, NOSTIFFNESSREQUESTED }; // end of enum SMType - }; // end of struct MechanicalBehaviourBase + }; // end of struct MechanicalBehaviourBase /*! * a trait class describing which tangent operators can be @@ -146,7 +146,7 @@ namespace tfel::material { * operator. Finite strain beaviours are a noticeable exception. */ enum SMFlag { STANDARDTANGENTOPERATOR }; // end of enum Flag - }; // end of struct + }; // end of struct /*! * a trait class describing which tangent operators can be diff --git a/include/TFEL/Material/MohrCoulombYieldCriterion.ixx b/include/TFEL/Material/MohrCoulombYieldCriterion.ixx index 0afa23826..c557abcef 100644 --- a/include/TFEL/Material/MohrCoulombYieldCriterion.ixx +++ b/include/TFEL/Material/MohrCoulombYieldCriterion.ixx @@ -53,12 +53,14 @@ namespace tfel::material { const MohrCoulombParameters&) = default; template - MohrCoulombParameters& MohrCoulombParameters:: - operator=(MohrCoulombParameters&&) = default; + MohrCoulombParameters& + MohrCoulombParameters::operator=(MohrCoulombParameters&&) = + default; template - MohrCoulombParameters& MohrCoulombParameters:: - operator=(const MohrCoulombParameters&) = default; + MohrCoulombParameters& + MohrCoulombParameters::operator=( + const MohrCoulombParameters&) = default; template ::AngleUnit u> diff --git a/include/TFEL/Material/OrthotropicPlasticity.hxx b/include/TFEL/Material/OrthotropicPlasticity.hxx index f729ae132..fd755a619 100644 --- a/include/TFEL/Material/OrthotropicPlasticity.hxx +++ b/include/TFEL/Material/OrthotropicPlasticity.hxx @@ -64,15 +64,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute \f$J_{2}^{O}\f$ the orthotropic generalization * of the third invariant of the deviatoric part of the stress @@ -93,15 +93,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute \f$J_{2}^{O}\f$ the orthotropic generalization * of the third invariant of the deviatoric part of the stress @@ -122,15 +122,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{2}^{O}}{\partial \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -176,15 +176,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{2}^{O}}{\partial \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -209,15 +209,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{2}^{O}}{\partial \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -242,15 +242,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial^{2} * J_{2}^{O}}{\partial^{2} \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -296,15 +296,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial^{2} * J_{2}^{O}}{\partial^{2} \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -329,15 +329,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial^{2} * J_{2}^{O}}{\partial^{2} \underline{s}}\f$ of \f$J_{2}^{O}\f$ with respect @@ -362,15 +362,15 @@ namespace tfel::material { * \param[in] a6: sixth coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); //! a simple alias template @@ -435,20 +435,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute \f$J_{3}^{O}\f$ the orthotropic generalization * of the third invariant of the deviatoric part of the stress @@ -482,20 +482,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute \f$J_{3}^{O}\f$ the orthotropic generalization * of the third invariant of the deviatoric part of the stress @@ -529,20 +529,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{3}^{O}}{\partial \underline{s}}\f$ of \f$J_{3}^{O}\f$ with @@ -613,20 +613,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{3}^{O}}{\partial \underline{s}}\f$ of \f$J_{3}^{O}\f$ with @@ -666,20 +666,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial * J_{3}^{O}}{\partial \underline{s}}\f$ of \f$J_{3}^{O}\f$ with @@ -719,20 +719,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the second derivative \f$\frac{\partial^{2} @@ -804,20 +804,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial^{2} * J_{3}^{O}}{\partial^{2} \underline{s}}\f$ of \f$J_{3}^{O}\f$ with @@ -857,20 +857,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); /*! * \brief compute the derivative \f$\frac{\partial^{2} * J_{3}^{O}}{\partial^{2} \underline{s}}\f$ of \f$J_{3}^{O}\f$ with @@ -910,20 +910,20 @@ namespace tfel::material { * \param[in] b11: eleventh coefficient */ template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType&, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type); + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType&, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type); } // end of namespace tfel::material diff --git a/include/TFEL/Material/OrthotropicPlasticity.ixx b/include/TFEL/Material/OrthotropicPlasticity.ixx index 0f8cb41e4..18bf56f7d 100644 --- a/include/TFEL/Material/OrthotropicPlasticity.ixx +++ b/include/TFEL/Material/OrthotropicPlasticity.ixx @@ -24,15 +24,15 @@ namespace tfel::material { } template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { return (a2 * (s[1] - s[2]) * (s[1] - s[2]) + a3 * (s[0] - s[2]) * (s[0] - s[2]) + a1 * (s[0] - s[1]) * (s[0] - s[1])) / @@ -40,15 +40,15 @@ namespace tfel::material { } // end of computeJ2O template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type, + const tfel::math::base_type) { return (a2 * (s[1] - s[2]) * (s[1] - s[2]) + a3 * (s[0] - s[2]) * (s[0] - s[2]) + a1 * (s[0] - s[1]) * (s[0] - s[1])) / @@ -57,15 +57,15 @@ namespace tfel::material { } // end of computeJ2O template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE - constexpr auto computeJ2O(const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type a5, - const tfel::math::base_type a6) { + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2O( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type a5, + const tfel::math::base_type a6) { return (a6 * s[5] * s[5] + a5 * s[4] * s[4] + a4 * s[3] * s[3]) / 2 + (a2 * (s[1] - s[2]) * (s[1] - s[2]) + a3 * (s[0] - s[2]) * (s[0] - s[2]) + @@ -80,15 +80,15 @@ namespace tfel::material { } // end of computeJ2ODerivative template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { using Result = tfel::math::stensor(), tfel::math::numeric_type>; @@ -98,15 +98,15 @@ namespace tfel::material { } // end of computeJ2ODerivative template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type, + const tfel::math::base_type) { using Result = tfel::math::stensor(), tfel::math::numeric_type>; @@ -117,15 +117,15 @@ namespace tfel::material { } // end of computeJ2ODerivative template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( - const StensorType& s, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type a5, - const tfel::math::base_type a6) { + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2ODerivative( + const StensorType& s, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type a5, + const tfel::math::base_type a6) { using Result = tfel::math::stensor(), tfel::math::numeric_type>; @@ -144,15 +144,15 @@ namespace tfel::material { } // end of computeJ2OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { using Result = tfel::math::st2tost2< tfel::math::getSpaceDimension(), tfel::math::BinaryOperationResult, @@ -163,15 +163,15 @@ namespace tfel::material { } // end of computeJ2OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type, + const tfel::math::base_type) { using Result = tfel::math::st2tost2< tfel::math::getSpaceDimension(), tfel::math::BinaryOperationResult, @@ -186,15 +186,15 @@ namespace tfel::material { } // end of computeJ2OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( - const StensorType&, - const tfel::math::base_type a1, - const tfel::math::base_type a2, - const tfel::math::base_type a3, - const tfel::math::base_type a4, - const tfel::math::base_type a5, - const tfel::math::base_type a6) { + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ2OSecondDerivative( + const StensorType&, + const tfel::math::base_type a1, + const tfel::math::base_type a2, + const tfel::math::base_type a3, + const tfel::math::base_type a4, + const tfel::math::base_type a5, + const tfel::math::base_type a6) { using Result = tfel::math::st2tost2< tfel::math::getSpaceDimension(), tfel::math::BinaryOperationResult, @@ -218,20 +218,20 @@ namespace tfel::material { } template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { return ((2 * (b4 + b1) - b3 - b2) * s[2] * s[2] * s[2]) / 27 + ((b4 + b3) * s[1] * s[1] * s[1]) / 27 + ((b2 + b1) * s[0] * s[0] * s[0]) / 27 - @@ -242,20 +242,20 @@ namespace tfel::material { } template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type b10, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type b10, + const tfel::math::base_type) { return ((2 * (b4 + b1) - b3 - b2) * s[2] * s[2] * s[2]) / 27 + ((b4 + b3) * s[1] * s[1] * s[1]) / 27 + ((b2 + b1) * s[0] * s[0] * s[0]) / 27 - @@ -269,20 +269,20 @@ namespace tfel::material { } template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE - constexpr auto computeJ3O(const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type b6, - const tfel::math::base_type b7, - const tfel::math::base_type b8, - const tfel::math::base_type b9, - const tfel::math::base_type b10, - const tfel::math::base_type b11) { + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ3O( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type b6, + const tfel::math::base_type b7, + const tfel::math::base_type b8, + const tfel::math::base_type b9, + const tfel::math::base_type b10, + const tfel::math::base_type b11) { using real = tfel::math::base_type; constexpr const auto icste = tfel::math::Cste::isqrt2; return ((2 * (b4 + b1) - b3 - b2) * s[2] * s[2] * s[2]) / 27 + @@ -310,20 +310,20 @@ namespace tfel::material { } // end of computeJ3ODerivative template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { using namespace tfel::math; auto dJ3O = stensor<1u, @@ -345,20 +345,20 @@ namespace tfel::material { } // end of computeJ3ODerivative template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type b10, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3ODerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type b10, + const tfel::math::base_type) { using namespace tfel::math; auto dJ3O = stensor<2u, @@ -384,20 +384,20 @@ namespace tfel::material { } // end of computeJ3ODerivative template - requires(tfel::math::getSpaceDimension() == 3u) // - constexpr auto computeJ3ODerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type b6, - const tfel::math::base_type b7, - const tfel::math::base_type b8, - const tfel::math::base_type b9, - const tfel::math::base_type b10, - const tfel::math::base_type b11) { + requires(tfel::math::getSpaceDimension() == 3u) // + constexpr auto computeJ3ODerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type b6, + const tfel::math::base_type b7, + const tfel::math::base_type b8, + const tfel::math::base_type b9, + const tfel::math::base_type b10, + const tfel::math::base_type b11) { using namespace tfel::math; using real = base_type; constexpr const auto icste = Cste::isqrt2; @@ -440,20 +440,20 @@ namespace tfel::material { } // end of computeJ3OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 1u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 1u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type) { auto d2J3O = tfel::math::st2tost2<1u, tfel::math::numeric_type>{}; d2J3O(0, 0) = @@ -478,20 +478,20 @@ namespace tfel::material { } // end of computeJ3OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 2u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type, - const tfel::math::base_type b10, - const tfel::math::base_type) { + requires(tfel::math::getSpaceDimension() == 2u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type, + const tfel::math::base_type b10, + const tfel::math::base_type) { auto d2J3O = tfel::math::st2tost2<2u, tfel::math::numeric_type>{}; d2J3O(0, 0) = @@ -523,20 +523,20 @@ namespace tfel::material { } // end of computeJ3OSecondDerivative template - requires(tfel::math::getSpaceDimension() == 3u) // - TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( - const StensorType& s, - const tfel::math::base_type b1, - const tfel::math::base_type b2, - const tfel::math::base_type b3, - const tfel::math::base_type b4, - const tfel::math::base_type b5, - const tfel::math::base_type b6, - const tfel::math::base_type b7, - const tfel::math::base_type b8, - const tfel::math::base_type b9, - const tfel::math::base_type b10, - const tfel::math::base_type b11) { + requires(tfel::math::getSpaceDimension() == 3u) // + TFEL_HOST_DEVICE constexpr auto computeJ3OSecondDerivative( + const StensorType& s, + const tfel::math::base_type b1, + const tfel::math::base_type b2, + const tfel::math::base_type b3, + const tfel::math::base_type b4, + const tfel::math::base_type b5, + const tfel::math::base_type b6, + const tfel::math::base_type b7, + const tfel::math::base_type b8, + const tfel::math::base_type b9, + const tfel::math::base_type b10, + const tfel::math::base_type b11) { using namespace tfel::math; using real = base_type; constexpr const auto icste = Cste::isqrt2; diff --git a/include/TFEL/Material/OrthotropicStressLinearTransformation.ixx b/include/TFEL/Material/OrthotropicStressLinearTransformation.ixx index 4ce81b892..4c9a56872 100644 --- a/include/TFEL/Material/OrthotropicStressLinearTransformation.ixx +++ b/include/TFEL/Material/OrthotropicStressLinearTransformation.ixx @@ -68,7 +68,7 @@ namespace tfel::material { (c23 - 2 * c21) / 3, (c23 + c21) / 3, (c21 - 2 * c23) / 3, (c32 - 2 * c31) / 3, (c31 - 2 * c32) / 3, (c32 + c31) / 3}; } // end of exe - }; // end of struct OrthotropicStressLinearTransformation<1u> + }; // end of struct OrthotropicStressLinearTransformation<1u> /*! * \brief partial specialisation of the * `OrthotropicStressLinearTransformation` in `2D`. @@ -117,7 +117,7 @@ namespace tfel::material { zero, c44}; } // end of exe - }; // end of struct OrthotropicStressLinearTransformation<2u> + }; // end of struct OrthotropicStressLinearTransformation<2u> /*! * \brief partial specialisation of the * `OrthotropicStressLinearTransformation` in `3D`. @@ -186,7 +186,7 @@ namespace tfel::material { zero, c66}; } // end of exe - }; // end of struct OrthotropicStressLinearTransformation<3u> + }; // end of struct OrthotropicStressLinearTransformation<3u> /*! * \brief an helper structure used to build linear * transformation according to the modelling hypothesis and the @@ -263,7 +263,7 @@ namespace tfel::material { return OrthotropicStressLinearTransformation<2u>::exe( c13, c31, c12, c21, c32, c23, c55, c44, c66); } // end of exe - }; // end of struct OrthotropicStressLinearTransformationII + }; // end of struct OrthotropicStressLinearTransformationII /*! * \brief partial specialisation of the * `OrthotropicStressLinearTransformationII` for the @@ -303,7 +303,7 @@ namespace tfel::material { return OrthotropicStressLinearTransformation<2u>::exe( c13, c31, c12, c21, c32, c23, c55, c44, c66); } // end of exe - }; // end of struct + }; // end of struct // OrthotropicStressLinearTransformationII /*! * \brief partial specialisation of the @@ -344,7 +344,7 @@ namespace tfel::material { return OrthotropicStressLinearTransformation<2u>::exe( c13, c31, c12, c21, c32, c23, c55, c44, c66); } // end of exe - }; // end of struct + }; // end of struct // OrthotropicStressLinearTransformationII /*! * \brief partial specialisation of the diff --git a/include/TFEL/Material/SlipSystemsDescription.hxx b/include/TFEL/Material/SlipSystemsDescription.hxx index 42a262af9..342e8e556 100644 --- a/include/TFEL/Material/SlipSystemsDescription.hxx +++ b/include/TFEL/Material/SlipSystemsDescription.hxx @@ -55,10 +55,10 @@ namespace tfel::material { NONE, DUPUY2017 }; // end of InteractionMatrixModel - /*! - * \brief structure describing the structure of the interaction - * matrix. - */ + /*! + * \brief structure describing the structure of the interaction + * matrix. + */ struct TFELMATERIAL_VISIBILITY_EXPORT InteractionMatrixStructure { /*! * \brief structure descrbing the interaction of two sliding diff --git a/include/TFEL/Material/ThermalBehaviour.hxx b/include/TFEL/Material/ThermalBehaviour.hxx index 99dff2fea..f13da96bd 100644 --- a/include/TFEL/Material/ThermalBehaviour.hxx +++ b/include/TFEL/Material/ThermalBehaviour.hxx @@ -32,7 +32,7 @@ namespace tfel::material { typedef ThermalBehaviourData ThermalBehaviourData; public: - virtual ~ThermalBehaviour(){}; + virtual ~ThermalBehaviour() {}; }; } // end of namespace tfel::material diff --git a/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.hxx b/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.hxx index 1e8e6c53f..44a4f30e9 100644 --- a/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.hxx +++ b/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.hxx @@ -69,8 +69,8 @@ namespace tfel::math::anderson { const unsigned char n); template - auto scalar_product(const Field& f1, const Field& f2) - -> decltype(f1[0] * f2[0]); + auto scalar_product(const Field& f1, + const Field& f2) -> decltype(f1[0] * f2[0]); } // end of namespace tfel::math::anderson diff --git a/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.ixx b/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.ixx index c22eb078a..7fde8e5ce 100644 --- a/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.ixx +++ b/include/TFEL/Math/AccelerationAlgorithms/AndersonBase.ixx @@ -126,8 +126,8 @@ namespace tfel::math::anderson { } template - auto scalar_product(const Field& f1, const Field& f2) - -> decltype(f1[0] * f2[0]) { + auto scalar_product(const Field& f1, + const Field& f2) -> decltype(f1[0] * f2[0]) { using value_type = typename Field::value_type; auto r = value_type{}; for (decltype(f1.size()) i = 0; i != f1.size(); ++i) { diff --git a/include/TFEL/Math/Array/ArrayCommonMethods.hxx b/include/TFEL/Math/Array/ArrayCommonMethods.hxx index 1756e2332..9bb73324d 100644 --- a/include/TFEL/Math/Array/ArrayCommonMethods.hxx +++ b/include/TFEL/Math/Array/ArrayCommonMethods.hxx @@ -40,8 +40,8 @@ namespace tfel::math { * \param[in] i: requested index */ TFEL_HOST_DEVICE constexpr typename ArrayPolicyType::const_reference - operator[](const typename ArrayPolicyType::IndexingPolicy::size_type) const - noexcept; + operator[](const typename ArrayPolicyType::IndexingPolicy::size_type) + const noexcept; /*! * \brief access operator * \return a reference to the data associated with the given indices @@ -50,8 +50,8 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr typename ArrayPolicyType::const_reference operator[]( const std::array&) const - noexcept; + ArrayPolicyType::IndexingPolicy::arity>&) + const noexcept; /*! * \brief access operator * \return a reference to the data associated with the given indices @@ -68,8 +68,8 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr typename ArrayPolicyType::const_reference operator()( const std::array&) const - noexcept; + ArrayPolicyType::IndexingPolicy::arity>&) + const noexcept; }; // end of ConstArrayCommonMethods @@ -120,9 +120,10 @@ namespace tfel::math { * \param[in] values: values to be assigned */ template - TFEL_HOST_DEVICE constexpr Child& - operator=(const std::initializer_list&) noexcept requires( - isAssignableTo()); + TFEL_HOST_DEVICE constexpr Child& operator=( + const std::initializer_list&) noexcept + requires( + isAssignableTo()); /*! * \brief import array values from a sequence * \param[in] p: random access iterator to the first element of the @@ -139,18 +140,19 @@ namespace tfel::math { * \param[in] v: value */ template - TFEL_HOST_DEVICE constexpr void fill(const ValueType2&) requires( - isAssignableTo()); + TFEL_HOST_DEVICE constexpr void fill(const ValueType2&) + requires( + isAssignableTo()); /*! * \brief clamp all the values between the given bounds * \param[in] lower_bound: lower bound * \param[in] upper_bound: upper bound */ template - TFEL_HOST_DEVICE constexpr void - clamp(const ValueType2&, const ValueType3&) requires( - isAssignableTo() && - isAssignableTo()); + TFEL_HOST_DEVICE constexpr void clamp(const ValueType2&, const ValueType3&) + requires( + isAssignableTo() && + isAssignableTo()); protected: /*! @@ -184,13 +186,12 @@ namespace tfel::math { * \param[in] s: scalar value */ template - TFEL_HOST_DEVICE constexpr void - multiplyByScalar(const ValueType2&) requires( - isAssignableTo< - BinaryOperationResult, - typename ArrayPolicyType::value_type>()); + TFEL_HOST_DEVICE constexpr void multiplyByScalar(const ValueType2&) + requires(isAssignableTo< + BinaryOperationResult, + typename ArrayPolicyType::value_type>()); }; } // end of namespace tfel::math diff --git a/include/TFEL/Math/Array/ArrayCommonMethods.ixx b/include/TFEL/Math/Array/ArrayCommonMethods.ixx index 74b1ef9c4..941b502e5 100644 --- a/include/TFEL/Math/Array/ArrayCommonMethods.ixx +++ b/include/TFEL/Math/Array/ArrayCommonMethods.ixx @@ -20,9 +20,9 @@ namespace tfel::math { template constexpr typename ArrayPolicyType::const_reference - ConstArrayCommonMethods::operator[]( - const typename ArrayPolicyType::IndexingPolicy::size_type i) const - noexcept { + ConstArrayCommonMethods::operator[]( + const typename ArrayPolicyType::IndexingPolicy::size_type i) + const noexcept { static_assert(ArrayPolicyType::IndexingPolicy::arity == 1u, "invalid call"); const auto& child = static_cast(*this); const auto* const d = child.data(); @@ -35,10 +35,10 @@ namespace tfel::math { template constexpr typename ArrayPolicyType::const_reference - ConstArrayCommonMethods::operator[]( - const std::array& i) const - noexcept { + ConstArrayCommonMethods::operator[]( + const std::array& i) + const noexcept { const auto& child = static_cast(*this); const auto* const d = child.data(); if constexpr (ArrayPolicyType::isMakeConstReferenceTrivial) { @@ -70,8 +70,8 @@ namespace tfel::math { constexpr typename ArrayPolicyType::const_reference ConstArrayCommonMethods::operator()( const std::array& i) const - noexcept { + ArrayPolicyType::IndexingPolicy::arity>& i) + const noexcept { const auto& child = static_cast(*this); const auto* const d = child.data(); if constexpr (ArrayPolicyType::isMakeConstReferenceTrivial) { @@ -83,9 +83,8 @@ namespace tfel::math { template constexpr typename ArrayPolicyType::reference - MutableArrayCommonMethods::operator[]( - const typename ArrayPolicyType::IndexingPolicy::size_type - i) noexcept { + MutableArrayCommonMethods::operator[]( + const typename ArrayPolicyType::IndexingPolicy::size_type i) noexcept { static_assert(ArrayPolicyType::IndexingPolicy::arity == 1u, "invalid call"); auto& child = static_cast(*this); auto* const d = child.data(); @@ -98,10 +97,9 @@ namespace tfel::math { template constexpr typename ArrayPolicyType::reference - MutableArrayCommonMethods::operator[]( - const std::array& - i) noexcept { + MutableArrayCommonMethods::operator[]( + const std::array& i) noexcept { auto& child = static_cast(*this); auto* const d = child.data(); if constexpr (ArrayPolicyType::isMakeReferenceTrivial) { @@ -180,9 +178,10 @@ namespace tfel::math { template template - constexpr Child& MutableArrayCommonMethods:: - operator=(const std::initializer_list& values) noexcept requires( - isAssignableTo()) { + constexpr Child& MutableArrayCommonMethods::operator=( + const std::initializer_list& values) noexcept + requires(isAssignableTo()) + { auto& child = static_cast(*this); if (values.size() != child.size()) { tfel::reportContractViolation( @@ -219,9 +218,10 @@ namespace tfel::math { template template - constexpr void MutableArrayCommonMethods:: - fill(const ValueType2& v) requires( - isAssignableTo()) { + constexpr void MutableArrayCommonMethods::fill( + const ValueType2& v) + requires(isAssignableTo()) + { const auto f = makeMultiIndicesUnaryOperatorFunctor( [v](typename ArrayPolicyType::reference a) { a = v; }, *this); auto& child = static_cast(*this); @@ -233,9 +233,10 @@ namespace tfel::math { constexpr void MutableArrayCommonMethods::clamp( const ValueType2& lower_bound, const ValueType3& upper_bound) // - requires( - isAssignableTo() && - isAssignableTo()) { + requires( + isAssignableTo() && + isAssignableTo()) + { const auto f = makeMultiIndicesUnaryOperatorFunctor( [lower_bound, upper_bound](typename ArrayPolicyType::reference a) { if (a < lower_bound) { @@ -254,11 +255,12 @@ namespace tfel::math { constexpr void MutableArrayCommonMethods::multiplyByScalar( const ValueType2& s) // - requires(isAssignableTo< - BinaryOperationResult, - typename ArrayPolicyType::value_type>()) { + requires(isAssignableTo< + BinaryOperationResult, + typename ArrayPolicyType::value_type>()) + { const auto f = makeMultiIndicesUnaryOperatorFunctor( [s](typename ArrayPolicyType::reference a) { a *= s; }, *this); auto& child = static_cast(*this); diff --git a/include/TFEL/Math/Array/ArrayConcept.hxx b/include/TFEL/Math/Array/ArrayConcept.hxx index 1241d2bab..5abcc6e25 100644 --- a/include/TFEL/Math/Array/ArrayConcept.hxx +++ b/include/TFEL/Math/Array/ArrayConcept.hxx @@ -48,7 +48,7 @@ namespace tfel::math { template concept ArrayConcept = (std::is_same_v::ConceptTag, - ArrayTag>)&& // + ArrayTag>) && // (requires(const ArrayType t, const index_type i) { t[i]; }) && // diff --git a/include/TFEL/Math/Array/FixedSizeIndexingPolicies.hxx b/include/TFEL/Math/Array/FixedSizeIndexingPolicies.hxx index d8123d2e4..6db9850aa 100644 --- a/include/TFEL/Math/Array/FixedSizeIndexingPolicies.hxx +++ b/include/TFEL/Math/Array/FixedSizeIndexingPolicies.hxx @@ -47,8 +47,8 @@ namespace tfel::math { //! static constexpr auto unRollLoop = true; //! \return the minimal data size - TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() + const noexcept { return 1; } //! \return if the array is empty @@ -83,8 +83,8 @@ namespace tfel::math { //! static constexpr auto unRollLoop = N < 100; //! \return the minimal data size - TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() + const noexcept { if constexpr (Stride == 1) { return this->size(); } else { @@ -92,8 +92,8 @@ namespace tfel::math { } } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i) const noexcept { if constexpr (Stride == 1) { return i; } else { @@ -113,8 +113,8 @@ namespace tfel::math { * \return the logical size of the array for the given dimension * \param[in] i: dimension */ - TFEL_HOST_DEVICE constexpr size_type size(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type size( + const size_type i) const noexcept { if (i != 0) { tfel::reportContractViolation( "FixedSizeVectorIndexingPolicy: " @@ -142,7 +142,7 @@ namespace tfel::math { static constexpr bool haveTheSameMemoryLayout() { return Stride1 == Stride2; } // end of haveTheSameMemoryLayout - }; // end of struct IndexingPolicyCompatiblityCheck + }; // end of struct IndexingPolicyCompatiblityCheck /*! * \brief an indexing policy suitable for fixed sized matrices @@ -169,9 +169,8 @@ namespace tfel::math { using RowMajorIndexingPolicy = FixedSizeRowMajorMatrixIndexingPolicy; //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i, - const size_type j) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i, const size_type j) const noexcept { return i * Stride + j; } //! @@ -180,8 +179,8 @@ namespace tfel::math { return this->getIndex(indices[0], indices[1]); } //! \return the minimal data size - TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() + const noexcept { if constexpr (Stride == M) { return this->size(); } else { @@ -202,8 +201,8 @@ namespace tfel::math { * \return the logical size of the array for the given dimension * \param[in] i: dimension */ - TFEL_HOST_DEVICE constexpr size_type size(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type size( + const size_type i) const noexcept { #ifndef TFEL_NO_RUNTIME_CHECK_BOUNDS if (i > 1) { tfel::reportContractViolation( @@ -233,7 +232,7 @@ namespace tfel::math { static constexpr bool haveTheSameMemoryLayout() { return Stride1 == Stride2; } // end of haveTheSameMemoryLayout - }; // end of struct IndexingPoliciesCompatiblityCheck + }; // end of struct IndexingPoliciesCompatiblityCheck /*! * \brief an indexing policy build as the cartesian product of the two @@ -284,8 +283,8 @@ namespace tfel::math { return size_type{}; } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i) const noexcept { static_assert(arity == 1); constexpr auto a1 = IndexingPolicy1::arity; if constexpr (a1 == 1) { @@ -297,9 +296,8 @@ namespace tfel::math { } } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i, - const size_type j) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i, const size_type j) const noexcept { static_assert(arity == 2); constexpr auto a1 = IndexingPolicy1::arity; if constexpr (a1 == 0) { @@ -315,10 +313,10 @@ namespace tfel::math { } } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i, - const size_type j, - const size_type k) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i, + const size_type j, + const size_type k) const noexcept { static_assert(arity == 3); constexpr auto a1 = IndexingPolicy1::arity; if constexpr (a1 == 0) { @@ -338,11 +336,11 @@ namespace tfel::math { } } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i, - const size_type j, - const size_type k, - const size_type l) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i, + const size_type j, + const size_type k, + const size_type l) const noexcept { static_assert(arity == 4); constexpr auto a1 = IndexingPolicy1::arity; if constexpr (a1 == 0) { @@ -367,8 +365,8 @@ namespace tfel::math { } //! template - TFEL_HOST_DEVICE constexpr size_type getIndex(const SizeType... i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const SizeType... i) const noexcept { static_assert(sizeof...(SizeType) == arity, "invalid number of arguments"); checkIndicesValiditity(); @@ -447,8 +445,8 @@ namespace tfel::math { * \return the logical size of the array for the given dimension * \param[in] i: dimension */ - TFEL_HOST_DEVICE constexpr size_type size(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type size( + const size_type i) const noexcept { if (i >= FixedSizeIndexingPoliciesCartesianProduct::arity) { tfel::reportContractViolation( "FixedSizeMatrixIndexingPolicy: " diff --git a/include/TFEL/Math/Array/GenericFixedSizeArray.hxx b/include/TFEL/Math/Array/GenericFixedSizeArray.hxx index 1a4e7b4fa..0bb954e80 100644 --- a/include/TFEL/Math/Array/GenericFixedSizeArray.hxx +++ b/include/TFEL/Math/Array/GenericFixedSizeArray.hxx @@ -20,70 +20,65 @@ #include "TFEL/Math/General/MathObjectTraits.hxx" #include "TFEL/Math/Array/MutableFixedSizeArrayBase.hxx" -#define TFEL_MATH_FIXED_SIZE_ARRAY_DEFAULT_METHODS(X, Y) \ - /*! \brief default constructor */ \ - TFEL_HOST_DEVICE constexpr X() noexcept = default; \ - /*! \brief move constructor */ \ - TFEL_HOST_DEVICE constexpr X(X&&) noexcept = default; \ - /*! \brief copy constructor */ \ - TFEL_HOST_DEVICE constexpr X(const X&) noexcept = default; \ - /*! \brief move assignement */ \ - TFEL_HOST_DEVICE constexpr X& operator=(X&&) noexcept = default; \ - /*! \brief standard assignement */ \ - TFEL_HOST_DEVICE constexpr X& operator=(const X&) noexcept = default; \ - /*! \ - * \brief constructor from a value \ - * \param[in] value: value used to initialize the array \ - */ \ - template \ - TFEL_HOST_DEVICE constexpr explicit X( \ - const ValueType2& \ - value) noexcept requires(isAssignableTo()) \ - : Y(value) {} \ - /*! \ - * \brief constructor from an initializer list \ - * \param[in] values: values \ - */ \ - TFEL_HOST_DEVICE constexpr X( \ - const std::initializer_list& values) noexcept \ - : Y(values) {} \ - /*! \ - * \brief constructor from an initializer list \ - * \param[in] values: values \ - */ \ - template \ - TFEL_HOST_DEVICE constexpr X( \ - const std::initializer_list& \ - values) noexcept requires(isAssignableTo()) \ - : Y(values) {} \ - /*! \ - * \brief copy constructor from an object assignable the X class. \ - * \param[in] src: source \ - * \ - * This is mostly used by expression objects and views. \ - */ \ - template \ - TFEL_HOST_DEVICE constexpr X(const OtherArray& src) noexcept requires( \ - (isAssignableTo()) && (!std::is_same_v)) \ - : Y(src) {} \ - /*! \ - * \brief Default Constructor. \ - * \param const base_type* \ - * const, pointer to a tabular used to initialise the components \ - * of the stensor. This tabular is left unchanged. \ - */ \ - template \ - TFEL_HOST_DEVICE constexpr explicit X( \ - const InputIterator \ - p) noexcept requires(std:: \ - is_same_v< \ - typename std::iterator_traits< \ - InputIterator>::value_type, \ - base_type>) \ - : Y(p) {} \ - /* inheriting GenericFixedSizeArray' assignement operators */ \ +#define TFEL_MATH_FIXED_SIZE_ARRAY_DEFAULT_METHODS(X, Y) \ + /*! \brief default constructor */ \ + TFEL_HOST_DEVICE constexpr X() noexcept = default; \ + /*! \brief move constructor */ \ + TFEL_HOST_DEVICE constexpr X(X&&) noexcept = default; \ + /*! \brief copy constructor */ \ + TFEL_HOST_DEVICE constexpr X(const X&) noexcept = default; \ + /*! \brief move assignement */ \ + TFEL_HOST_DEVICE constexpr X& operator=(X&&) noexcept = default; \ + /*! \brief standard assignement */ \ + TFEL_HOST_DEVICE constexpr X& operator=(const X&) noexcept = default; \ + /*! \ + * \brief constructor from a value \ + * \param[in] value: value used to initialize the array \ + */ \ + template \ + TFEL_HOST_DEVICE constexpr explicit X(const ValueType2& value) noexcept \ + requires(isAssignableTo()) \ + : Y(value) {} \ + /*! \ + * \brief constructor from an initializer list \ + * \param[in] values: values \ + */ \ + TFEL_HOST_DEVICE constexpr X( \ + const std::initializer_list& values) noexcept \ + : Y(values) {} \ + /*! \ + * \brief constructor from an initializer list \ + * \param[in] values: values \ + */ \ + template \ + TFEL_HOST_DEVICE constexpr X( \ + const std::initializer_list& values) noexcept \ + requires(isAssignableTo()) \ + : Y(values) {} \ + /*! \ + * \brief copy constructor from an object assignable the X class. \ + * \param[in] src: source \ + * \ + * This is mostly used by expression objects and views. \ + */ \ + template \ + TFEL_HOST_DEVICE constexpr X(const OtherArray& src) noexcept \ + requires((isAssignableTo()) && \ + (!std::is_same_v)) \ + : Y(src) {} \ + /*! \ + * \brief Default Constructor. \ + * \param const base_type* \ + * const, pointer to a tabular used to initialise the components \ + * of the stensor. This tabular is left unchanged. \ + */ \ + template \ + TFEL_HOST_DEVICE constexpr explicit X(const InputIterator p) noexcept \ + requires(std::is_same_v< \ + typename std::iterator_traits::value_type, \ + base_type>) \ + : Y(p) {} \ + /* inheriting GenericFixedSizeArray' assignement operators */ \ using Y::operator= namespace tfel::math { @@ -123,12 +118,11 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr explicit GenericFixedSizeArray( - const ValueType&) noexcept requires(isAssignableTo:: - value_type>()); + const ValueType&) noexcept + requires( + isAssignableTo:: + value_type>()); /*! * \brief constructor from an initializer list * \param[in] values: values @@ -136,10 +130,10 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr GenericFixedSizeArray( const std::initializer_list& values) noexcept // - requires(isAssignableTo< - ValueType2, - typename GenericFixedSizeArray:: - value_type>()); + requires( + isAssignableTo:: + value_type>()); /*! * \brief default donstructor. * \param p pointer to an array used to initialise the components @@ -148,11 +142,10 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr explicit GenericFixedSizeArray( const InputIterator) noexcept // - requires(std::is_same_v< - typename std::iterator_traits::value_type, - base_type::value_type>>); + requires(std::is_same_v< + typename std::iterator_traits::value_type, + base_type:: + value_type>>); /*! * \brief copy constructor from an object assignable to the `Child` class. * \param[in] src: source @@ -162,8 +155,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr GenericFixedSizeArray( const OtherArray&) noexcept // - requires((isAssignableTo()) && - (!std::is_same_v)); + requires((isAssignableTo()) && + (!std::is_same_v)); /*! * \return the physical size used by the underlying array. This size must * be greater than than the logical number of elements contained in the @@ -182,41 +175,38 @@ namespace tfel::math { * \param[in] src: array to be assigned */ template - TFEL_HOST_DEVICE constexpr Child& - operator=(const OtherArray&) noexcept requires( - isAssignableTo()); + TFEL_HOST_DEVICE constexpr Child& operator=(const OtherArray&) noexcept + requires(isAssignableTo()); // template - TFEL_HOST_DEVICE constexpr Child& - operator+=(const OtherArray&) noexcept requires( - isAssignableTo()); + TFEL_HOST_DEVICE constexpr Child& operator+=(const OtherArray&) noexcept + requires(isAssignableTo()); // template - TFEL_HOST_DEVICE constexpr Child& - operator-=(const OtherArray&) noexcept requires( - isAssignableTo()); + TFEL_HOST_DEVICE constexpr Child& operator-=(const OtherArray&) noexcept + requires(isAssignableTo()); // template TFEL_HOST_DEVICE constexpr Child& operator*=(const ValueType2&) noexcept // - requires(isAssignableTo< - BinaryOperationResult< - ValueType2, - typename GenericFixedSizeArray:: - value_type, - OpMult>, - typename GenericFixedSizeArray:: - value_type>()); + requires(isAssignableTo< + BinaryOperationResult< + ValueType2, + typename GenericFixedSizeArray:: + value_type, + OpMult>, + typename GenericFixedSizeArray:: + value_type>()); // template TFEL_HOST_DEVICE constexpr Child& operator/=(const ValueType2&) noexcept // - requires(isAssignableTo< - BinaryOperationResult< - typename GenericFixedSizeArray:: - value_type, - ValueType2, - OpDiv>, - typename GenericFixedSizeArray:: - value_type>()); + requires(isAssignableTo< + BinaryOperationResult< + typename GenericFixedSizeArray:: + value_type, + ValueType2, + OpDiv>, + typename GenericFixedSizeArray:: + value_type>()); //! \return a pointer to the underlying array serving as element storage. TFEL_HOST_DEVICE constexpr typename GenericFixedSizeArray::pointer diff --git a/include/TFEL/Math/Array/GenericFixedSizeArray.ixx b/include/TFEL/Math/Array/GenericFixedSizeArray.ixx index ea0634ca4..4c3900d22 100644 --- a/include/TFEL/Math/Array/GenericFixedSizeArray.ixx +++ b/include/TFEL/Math/Array/GenericFixedSizeArray.ixx @@ -46,10 +46,11 @@ namespace tfel::math { typename ArrayPolicy::IndexingPolicy::size_type N> template TFEL_HOST_DEVICE constexpr GenericFixedSizeArray:: - GenericFixedSizeArray(const ValueType& value) noexcept requires( - isAssignableTo:: - value_type>()) + GenericFixedSizeArray(const ValueType& value) noexcept + requires( + isAssignableTo:: + value_type>()) : GenericFixedSizeArray() { this->fill(value); } // end of GenericFixedSizeArray @@ -60,8 +61,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr GenericFixedSizeArray:: GenericFixedSizeArray(const OtherArray& src) noexcept // - requires((isAssignableTo()) && - (!std::is_same_v)) + requires((isAssignableTo()) && + (!std::is_same_v)) : GenericFixedSizeArray() { // static_assert(checkIndexingPoliciesCompatiblity< // typename ArrayPolicy::indexing_policy, @@ -77,10 +78,10 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr GenericFixedSizeArray:: GenericFixedSizeArray( const std::initializer_list& values) noexcept // - requires( - isAssignableTo:: - value_type>()) + requires( + isAssignableTo:: + value_type>()) : GenericFixedSizeArray() { if (values.size() == 1u) { this->fill(*(values.begin())); @@ -95,10 +96,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr GenericFixedSizeArray:: GenericFixedSizeArray(const InputIterator p) noexcept // - requires(std::is_same_v< - typename std::iterator_traits::value_type, - base_type:: - value_type>>) { + requires(std::is_same_v< + typename std::iterator_traits::value_type, + base_type:: + value_type>>) + { const auto& policy = this->getRowMajorIndexingPolicy(); this->import(policy, p, p + this->size()); } // end of GenericFixedSizeArray @@ -128,9 +130,10 @@ namespace tfel::math { typename ArrayPolicy::IndexingPolicy::size_type N> template TFEL_HOST_DEVICE constexpr Child& - GenericFixedSizeArray:: - operator=(const OtherArray& src) noexcept requires( - isAssignableTo()) { + GenericFixedSizeArray::operator=( + const OtherArray& src) noexcept + requires(isAssignableTo()) + { auto& child = static_cast(*this); child.assign(src); return child; @@ -143,7 +146,8 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr Child& GenericFixedSizeArray::operator+=( const OtherArray& src) noexcept // - requires(isAssignableTo()) { + requires(isAssignableTo()) + { auto& child = static_cast(*this); child.addAndAssign(src); return child; @@ -154,9 +158,10 @@ namespace tfel::math { typename ArrayPolicy::IndexingPolicy::size_type N> template TFEL_HOST_DEVICE constexpr Child& - GenericFixedSizeArray:: - operator-=(const OtherArray& src) noexcept requires( - isAssignableTo()) { + GenericFixedSizeArray::operator-=( + const OtherArray& src) noexcept + requires(isAssignableTo()) + { auto& child = static_cast(*this); child.substractAndAssign(src); return child; @@ -169,14 +174,15 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr Child& GenericFixedSizeArray::operator*=( const ValueType2& s) noexcept // - requires(isAssignableTo< - BinaryOperationResult< - ValueType2, - typename GenericFixedSizeArray:: - value_type, - OpMult>, - typename GenericFixedSizeArray:: - value_type>()) { + requires(isAssignableTo< + BinaryOperationResult< + ValueType2, + typename GenericFixedSizeArray:: + value_type, + OpMult>, + typename GenericFixedSizeArray:: + value_type>()) + { auto& child = static_cast(*this); child.multiplyByScalar(s); return child; @@ -189,14 +195,15 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr Child& GenericFixedSizeArray::operator/=( const ValueType2& s) noexcept // - requires(isAssignableTo< - BinaryOperationResult< - typename GenericFixedSizeArray:: - value_type, - ValueType2, - OpDiv>, - typename GenericFixedSizeArray:: - value_type>()) { + requires(isAssignableTo< + BinaryOperationResult< + typename GenericFixedSizeArray:: + value_type, + ValueType2, + OpDiv>, + typename GenericFixedSizeArray:: + value_type>()) + { auto& child = static_cast(*this); child.multiplyByScalar(1 / s); return child; @@ -225,8 +232,8 @@ namespace tfel::math { typename ArrayPolicy::IndexingPolicy::size_type N> TFEL_HOST_DEVICE constexpr typename GenericFixedSizeArray::size_type - GenericFixedSizeArray::getContainerSize() const - noexcept { + GenericFixedSizeArray::getContainerSize() + const noexcept { return N; } // end of data diff --git a/include/TFEL/Math/Array/GenericRuntimeArray.hxx b/include/TFEL/Math/Array/GenericRuntimeArray.hxx index 4c4db2975..503d2d848 100644 --- a/include/TFEL/Math/Array/GenericRuntimeArray.hxx +++ b/include/TFEL/Math/Array/GenericRuntimeArray.hxx @@ -20,62 +20,63 @@ #include "TFEL/Math/General/MathObjectTraits.hxx" #include "TFEL/Math/Array/MutableRuntimeArrayBase.hxx" -#define TFEL_MATH_RUNTIME_ARRAY_DEFAULT_METHODS(X, Y) \ - /*! \brief default constructor */ \ - X() = default; \ - /*! \brief move constructor */ \ - X(X&&) = default; \ - /*! \brief copy constructor */ \ - X(const X&) = default; \ - /*! \brief move assignement */ \ - X& operator=(X&&) = default; \ - /*! \brief standard assignement */ \ - X& operator=(const X&) = default; \ - /*! \ - * \brief constructor from a value \ - * \param[in] value: value used to initialize the array \ - */ \ - template \ - explicit X(const ValueType2& value) requires( \ - isAssignableTo()) \ - : Y(value) {} \ - /*! \ - * \brief constructor from an initializer list \ - * \param[in] values: values \ - */ \ - X(const std::initializer_list& values) \ - : Y(values) {} \ - /*! \ - * \brief constructor from an initializer list \ - * \param[in] values: values \ - */ \ - template \ - X(const std::initializer_list& values) \ - requires(isAssignableTo()) \ - : Y(values) {} \ - /*! \ - * \brief copy constructor from an object assignable the X class. \ - * \param[in] src: source \ - * \ - * This is mostly used by expression objects and views. \ - */ \ - template \ - X(const OtherArray& src) \ - requires((isAssignableTo()) && \ - (!std::is_same_v)) \ - : Y(src) {} \ - /*! \ - * \brief Default Constructor. \ - * \param const base_type* \ - * const, pointer to a tabular used to initialise the components \ - * of the stensor. This tabular is left unchanged. \ - */ \ - template \ - explicit X(const InputIterator p) requires( \ - std::is_same_v::value_type, \ - base_type>) \ - : Y(p) {} \ - /* inheriting GenericFixedSizeArray' assignement operators */ \ +#define TFEL_MATH_RUNTIME_ARRAY_DEFAULT_METHODS(X, Y) \ + /*! \brief default constructor */ \ + X() = default; \ + /*! \brief move constructor */ \ + X(X&&) = default; \ + /*! \brief copy constructor */ \ + X(const X&) = default; \ + /*! \brief move assignement */ \ + X& operator=(X&&) = default; \ + /*! \brief standard assignement */ \ + X& operator=(const X&) = default; \ + /*! \ + * \brief constructor from a value \ + * \param[in] value: value used to initialize the array \ + */ \ + template \ + explicit X(const ValueType2& value) \ + requires(isAssignableTo()) \ + : Y(value) {} \ + /*! \ + * \brief constructor from an initializer list \ + * \param[in] values: values \ + */ \ + X(const std::initializer_list& values) \ + : Y(values) {} \ + /*! \ + * \brief constructor from an initializer list \ + * \param[in] values: values \ + */ \ + template \ + X(const std::initializer_list& values) \ + requires(isAssignableTo()) \ + : Y(values) {} \ + /*! \ + * \brief copy constructor from an object assignable the X class. \ + * \param[in] src: source \ + * \ + * This is mostly used by expression objects and views. \ + */ \ + template \ + X(const OtherArray& src) \ + requires((isAssignableTo()) && \ + (!std::is_same_v)) \ + : Y(src) {} \ + /*! \ + * \brief Default Constructor. \ + * \param const base_type* \ + * const, pointer to a tabular used to initialise the components \ + * of the stensor. This tabular is left unchanged. \ + */ \ + template \ + explicit X(const InputIterator p) \ + requires(std::is_same_v< \ + typename std::iterator_traits::value_type, \ + base_type>) \ + : Y(p) {} \ + /* inheriting GenericFixedSizeArray' assignement operators */ \ using Y::operator= namespace tfel::math { @@ -105,13 +106,11 @@ namespace tfel::math { * \param[in] value: value used to initialize the array */ template - explicit GenericRuntimeArray( - const typename ArrayPolicy::IndexingPolicy&, - const ValueType&) requires(isAssignableTo:: - value_type>()); + explicit GenericRuntimeArray(const typename ArrayPolicy::IndexingPolicy&, + const ValueType&) + requires(isAssignableTo< + ValueType, + typename GenericRuntimeArray::value_type>()); /*! * \brief constructor from an initializer list * \param[in] values: values @@ -119,26 +118,25 @@ namespace tfel::math { template GenericRuntimeArray( const typename GenericRuntimeArray::indexing_policy, - const std::initializer_list< - ValueType>&) requires((isAssignableTo:: - value_type>()) && - (ArrayPolicy::IndexingPolicy::arity == 1) && - (ArrayPolicy::IndexingPolicy:: - areDataContiguous)); + const std::initializer_list&) + requires( + (isAssignableTo:: + value_type>()) && + (ArrayPolicy::IndexingPolicy::arity == 1) && + (ArrayPolicy::IndexingPolicy::areDataContiguous)); /*! * \brief constructor from an initializer list * \param[in] values: values */ template - GenericRuntimeArray(const std::initializer_list&) requires( - (isAssignableTo< - ValueType, - typename GenericRuntimeArray::value_type>()) && - (ArrayPolicy::IndexingPolicy::arity == 1) && - (ArrayPolicy::IndexingPolicy::areDataContiguous)); + GenericRuntimeArray(const std::initializer_list&) + requires( + (isAssignableTo:: + value_type>()) && + (ArrayPolicy::IndexingPolicy::arity == 1) && + (ArrayPolicy::IndexingPolicy::areDataContiguous)); /*! * \brief copy constructor from an object assignable to the `Child` class. * \param[in] src: source @@ -146,14 +144,14 @@ namespace tfel::math { * This is mostly used by expression objects and views. */ template - explicit GenericRuntimeArray(const OtherArray&) requires( - (isAssignableTo()) && - (!std::is_same_v)); + explicit GenericRuntimeArray(const OtherArray&) + requires((isAssignableTo()) && + (!std::is_same_v)); //! \return a pointer to the underlying array serving as element storage. typename GenericRuntimeArray::pointer data() noexcept; //! \return a pointer to the underlying array serving as element storage. - typename GenericRuntimeArray::const_pointer data() const - noexcept; + typename GenericRuntimeArray::const_pointer data() + const noexcept; //! \brief resize the array void resize(const typename ArrayPolicy::IndexingPolicy&); /*! @@ -172,34 +170,34 @@ namespace tfel::math { * \param[in] src: array to be assigned */ template - Child& operator=(const OtherArray&) requires( - isAssignableTo()); + Child& operator=(const OtherArray&) + requires(isAssignableTo()); // template - Child& operator+=(const OtherArray&) requires( - isAssignableTo()); + Child& operator+=(const OtherArray&) + requires(isAssignableTo()); // template - Child& operator-=(const OtherArray&) requires( - isAssignableTo()); + Child& operator-=(const OtherArray&) + requires(isAssignableTo()); // template - Child& operator*=(const ValueType2&) noexcept requires( - isAssignableTo< - BinaryOperationResult< - ValueType2, - typename GenericRuntimeArray::value_type, - OpMult>, - typename GenericRuntimeArray::value_type>()); + Child& operator*=(const ValueType2&) noexcept + requires(isAssignableTo< + BinaryOperationResult< + ValueType2, + typename GenericRuntimeArray::value_type, + OpMult>, + typename GenericRuntimeArray::value_type>()); // template - Child& operator/=(const ValueType2&) noexcept requires( - isAssignableTo< - BinaryOperationResult< - typename GenericRuntimeArray::value_type, - ValueType2, - OpDiv>, - typename GenericRuntimeArray::value_type>()); + Child& operator/=(const ValueType2&) noexcept + requires(isAssignableTo< + BinaryOperationResult< + typename GenericRuntimeArray::value_type, + ValueType2, + OpDiv>, + typename GenericRuntimeArray::value_type>()); // bool empty() const; // diff --git a/include/TFEL/Math/Array/GenericRuntimeArray.ixx b/include/TFEL/Math/Array/GenericRuntimeArray.ixx index 816bb1d2b..877db65f8 100644 --- a/include/TFEL/Math/Array/GenericRuntimeArray.ixx +++ b/include/TFEL/Math/Array/GenericRuntimeArray.ixx @@ -29,9 +29,9 @@ namespace tfel::math { GenericRuntimeArray::GenericRuntimeArray( const typename ArrayPolicy::IndexingPolicy& p, const ValueType& value) // - requires(isAssignableTo< - ValueType, - typename GenericRuntimeArray::value_type>()) + requires(isAssignableTo< + ValueType, + typename GenericRuntimeArray::value_type>()) : GenericRuntimeArray(p) { this->fill(value); } // end of GenericRuntimeArray @@ -39,8 +39,9 @@ namespace tfel::math { template template GenericRuntimeArray::GenericRuntimeArray( - const OtherArray& src) requires((isAssignableTo()) && - (!std::is_same_v)) + const OtherArray& src) + requires((isAssignableTo()) && + (!std::is_same_v)) : GenericRuntimeArray(src.getIndexingPolicy()) { this->operator=(src); } // end of GenericRuntimeArray @@ -48,13 +49,13 @@ namespace tfel::math { template template GenericRuntimeArray::GenericRuntimeArray( - const std::initializer_list& - values) requires((isAssignableTo::value_type>()) && - (ArrayPolicy::IndexingPolicy::arity == 1) && - (ArrayPolicy::IndexingPolicy::areDataContiguous)) + const std::initializer_list& values) + requires( + (isAssignableTo< + ValueType, + typename GenericRuntimeArray::value_type>()) && + (ArrayPolicy::IndexingPolicy::arity == 1) && + (ArrayPolicy::IndexingPolicy::areDataContiguous)) : GenericRuntimeArray(values.size()) { this->operator=(values); } // end of GenericRuntimeArray @@ -96,7 +97,9 @@ namespace tfel::math { template template Child& GenericRuntimeArray::operator=( - const OtherArray& src) requires(isAssignableTo()) { + const OtherArray& src) + requires(isAssignableTo()) + { auto& child = static_cast(*this); // checkIndexingPoliciesRuntimeCompatiblity(child.getIndexingPolicy(), // src.getIndexingPolicy()); @@ -107,7 +110,9 @@ namespace tfel::math { template template Child& GenericRuntimeArray::operator+=( - const OtherArray& src) requires(isAssignableTo()) { + const OtherArray& src) + requires(isAssignableTo()) + { auto& child = static_cast(*this); // checkIndexingPoliciesRuntimeCompatiblity(child.getIndexingPolicy(), // src.getIndexingPolicy()); @@ -118,7 +123,9 @@ namespace tfel::math { template template Child& GenericRuntimeArray::operator-=( - const OtherArray& src) requires(isAssignableTo()) { + const OtherArray& src) + requires(isAssignableTo()) + { auto& child = static_cast(*this); // checkIndexingPoliciesRuntimeCompatiblity(child.getIndexingPolicy(), // src.getIndexingPolicy()); @@ -128,14 +135,15 @@ namespace tfel::math { template template - Child& GenericRuntimeArray:: - operator*=(const ValueType2& v) noexcept requires( - isAssignableTo< - BinaryOperationResult< - ValueType2, - typename GenericRuntimeArray::value_type, - OpMult>, - typename GenericRuntimeArray::value_type>()) { + Child& GenericRuntimeArray::operator*=( + const ValueType2& v) noexcept + requires(isAssignableTo< + BinaryOperationResult< + ValueType2, + typename GenericRuntimeArray::value_type, + OpMult>, + typename GenericRuntimeArray::value_type>()) + { auto& child = static_cast(*this); child.multiplyByScalar(v); return child; @@ -143,14 +151,15 @@ namespace tfel::math { // template template - Child& GenericRuntimeArray:: - operator/=(const ValueType2& v) noexcept requires( - isAssignableTo< - BinaryOperationResult< - typename GenericRuntimeArray::value_type, - ValueType2, - OpDiv>, - typename GenericRuntimeArray::value_type>()) { + Child& GenericRuntimeArray::operator/=( + const ValueType2& v) noexcept + requires(isAssignableTo< + BinaryOperationResult< + typename GenericRuntimeArray::value_type, + ValueType2, + OpDiv>, + typename GenericRuntimeArray::value_type>()) + { auto& child = static_cast(*this); child.multiplyByScalar(1 / v); return child; diff --git a/include/TFEL/Math/Array/IterateOverMultipleIndices.hxx b/include/TFEL/Math/Array/IterateOverMultipleIndices.hxx index 6bfcb5eb3..9620a98e9 100644 --- a/include/TFEL/Math/Array/IterateOverMultipleIndices.hxx +++ b/include/TFEL/Math/Array/IterateOverMultipleIndices.hxx @@ -53,7 +53,7 @@ namespace tfel::math { } } } // end of exe - }; // end of struct + }; // end of struct } // end of namespace tfel::math diff --git a/include/TFEL/Math/Array/MutableRuntimeArrayBase.ixx b/include/TFEL/Math/Array/MutableRuntimeArrayBase.ixx index d625c2649..bc3c9eb0c 100644 --- a/include/TFEL/Math/Array/MutableRuntimeArrayBase.ixx +++ b/include/TFEL/Math/Array/MutableRuntimeArrayBase.ixx @@ -25,8 +25,8 @@ namespace tfel::math { template constexpr const typename ArrayPolicy::IndexingPolicy& - MutableRuntimeArrayBase::getIndexingPolicy() const - noexcept { + MutableRuntimeArrayBase::getIndexingPolicy() + const noexcept { return *this; } // end of getIndexingPolicy diff --git a/include/TFEL/Math/Array/RuntimeIndexingPolicies.hxx b/include/TFEL/Math/Array/RuntimeIndexingPolicies.hxx index 046338a44..0d028ecc4 100644 --- a/include/TFEL/Math/Array/RuntimeIndexingPolicies.hxx +++ b/include/TFEL/Math/Array/RuntimeIndexingPolicies.hxx @@ -60,13 +60,13 @@ namespace tfel::math { constexpr RuntimeVectorIndexingPolicy& operator=( const RuntimeVectorIndexingPolicy&) = default; //! \return the minimal data size - TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() + const noexcept { return this->size(); } //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i) const noexcept { return i; } //! @@ -86,8 +86,8 @@ namespace tfel::math { * \return the logical size of the array for the given dimension * \param[in] i: dimension */ - TFEL_HOST_DEVICE constexpr size_type size(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type size( + const size_type i) const noexcept { if (i != 0) { tfel::reportContractViolation( "RuntimeVectorIndexingPolicy: invalid dimension"); @@ -118,7 +118,7 @@ namespace tfel::math { static constexpr bool haveTheSameMemoryLayout() { return true; } // end of haveTheSameMemoryLayout - }; // end of struct IndexingPolicyCompatiblityCheck + }; // end of struct IndexingPolicyCompatiblityCheck /*! * \brief an indexing policy suitable for runtime matrices @@ -160,9 +160,8 @@ namespace tfel::math { constexpr RuntimeRowMajorMatrixIndexingPolicy& operator=( const RuntimeRowMajorMatrixIndexingPolicy&) = default; //! - TFEL_HOST_DEVICE constexpr size_type getIndex(const size_type i, - const size_type j) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getIndex( + const size_type i, const size_type j) const noexcept { return i * this->n_columns + j; } //! @@ -171,8 +170,8 @@ namespace tfel::math { return this->getIndex(indices[0], indices[1]); } //! \return the minimal data size - TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() const - noexcept { + TFEL_HOST_DEVICE constexpr size_type getUnderlyingArrayMinimalSize() + const noexcept { return this->size(); } //! @@ -193,8 +192,8 @@ namespace tfel::math { * \return the logical size of the array for the given dimension * \param[in] i: dimension */ - TFEL_HOST_DEVICE constexpr size_type size(const size_type i) const - noexcept { + TFEL_HOST_DEVICE constexpr size_type size( + const size_type i) const noexcept { if (i > 1) { tfel::reportContractViolation( "FixedSizeMatrixIndexingPolicy: " diff --git a/include/TFEL/Math/Array/StandardTemplateLibraryCompatibilityLayers.ixx b/include/TFEL/Math/Array/StandardTemplateLibraryCompatibilityLayers.ixx index 5ac76c2c3..91d1c25cf 100644 --- a/include/TFEL/Math/Array/StandardTemplateLibraryCompatibilityLayers.ixx +++ b/include/TFEL/Math/Array/StandardTemplateLibraryCompatibilityLayers.ixx @@ -60,8 +60,8 @@ namespace tfel::math { Child, ArrayPolicy>::const_iterator ConstArrayWithContiguousDataSTLCompatibilityLayer::cbegin() const - noexcept { + ArrayPolicy>::cbegin() + const noexcept { static_assert(ArrayPolicy::IndexingPolicy::areDataContiguous, "invalid indexing policy"); return static_cast(*this).data(); @@ -95,8 +95,8 @@ namespace tfel::math { Child, ArrayPolicy>::const_reverse_iterator ConstArrayWithContiguousDataSTLCompatibilityLayer::rbegin() const - noexcept { + ArrayPolicy>::rbegin() + const noexcept { static_assert(ArrayPolicy::IndexingPolicy::areDataContiguous, "invalid indexing policy"); return this->crbegin(); diff --git a/include/TFEL/Math/Array/View.hxx b/include/TFEL/Math/Array/View.hxx index 0b2f2dc0c..3cb7c265b 100644 --- a/include/TFEL/Math/Array/View.hxx +++ b/include/TFEL/Math/Array/View.hxx @@ -222,8 +222,9 @@ namespace tfel::math { * \param[in] src: array to be assigned */ template - TFEL_HOST_DEVICE constexpr View& operator=(const OtherArray& src) requires( - isAssignableTo()) { + TFEL_HOST_DEVICE constexpr View& operator=(const OtherArray& src) + requires(isAssignableTo()) + { static_assert(!is_const, "invalid call"); // checkIndexingPoliciesRuntimeCompatiblity(this->getIndexingPolicy(), // src.getIndexingPolicy()); @@ -232,8 +233,9 @@ namespace tfel::math { } // template - TFEL_HOST_DEVICE constexpr View& operator+=(const OtherArray& src) requires( - isAssignableTo()) { + TFEL_HOST_DEVICE constexpr View& operator+=(const OtherArray& src) + requires(isAssignableTo()) + { static_assert(!is_const, "invalid call"); // checkIndexingPoliciesRuntimeCompatiblity(this->getIndexingPolicy(), // src.getIndexingPolicy()); @@ -242,8 +244,9 @@ namespace tfel::math { } // template - TFEL_HOST_DEVICE constexpr View& operator-=(const OtherArray& src) requires( - isAssignableTo()) { + TFEL_HOST_DEVICE constexpr View& operator-=(const OtherArray& src) + requires(isAssignableTo()) + { static_assert(!is_const, "invalid call"); // checkIndexingPoliciesRuntimeCompatiblity(this->getIndexingPolicy(), // src.getIndexingPolicy()); @@ -252,22 +255,24 @@ namespace tfel::math { } // template - TFEL_HOST_DEVICE constexpr View& - operator*=(const ValueType2& s) noexcept requires( - isAssignableTo< - BinaryOperationResult, OpMult>, - numeric_type>()) { + TFEL_HOST_DEVICE constexpr View& operator*=(const ValueType2& s) noexcept + requires(isAssignableTo, + OpMult>, + numeric_type>()) + { static_assert(!is_const, "invalid call"); selectViewArrayBase::multiplyByScalar(s); return *this; } // end of operator*= // template - TFEL_HOST_DEVICE constexpr View& - operator/=(const ValueType2& s) noexcept requires( - isAssignableTo< - BinaryOperationResult, ValueType2, OpDiv>, - numeric_type>()) { + TFEL_HOST_DEVICE constexpr View& operator/=(const ValueType2& s) noexcept + requires(isAssignableTo, + ValueType2, + OpDiv>, + numeric_type>()) + { static_assert(!is_const, "invalid call"); selectViewArrayBase::multiplyByScalar(1 / s); @@ -323,25 +328,32 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr scalar_view map( base_type* const p) // - requires(isScalar()) { + requires(isScalar()) + { return scalar_view(*p); } // end of map template TFEL_HOST_DEVICE constexpr scalar_view map( - base_type& v) requires(isScalar()) { + base_type& v) + requires(isScalar()) + { return scalar_view(v); } // end of map template TFEL_HOST_DEVICE constexpr scalar_view // - map(const base_type* const p) requires(isScalar()) { + map(const base_type* const p) + requires(isScalar()) + { return scalar_view(*p); } // end of map template TFEL_HOST_DEVICE constexpr scalar_view map( - const base_type& v) requires(isScalar()) { + const base_type& v) + requires(isScalar()) + { return scalar_view(v); } // end of map @@ -352,20 +364,22 @@ namespace tfel::math { */ template - TFEL_HOST_DEVICE constexpr View - map(const ViewDataPointerType p) requires( - (!std::is_const_v)&&(!isScalar()) && - (std::remove_cv_t::hasFixedSizes)) { + TFEL_HOST_DEVICE constexpr View map( + const ViewDataPointerType p) + requires((!std::is_const_v) && (!isScalar()) && + (std::remove_cv_t::hasFixedSizes)) + { return View{p}; } // end of map template ::indexing_policy> - TFEL_HOST_DEVICE constexpr View - map(const ViewConstDataPointerType p) requires( - (!isScalar()) && - (std::remove_cv_t::indexing_policy::hasFixedSizes)) { + TFEL_HOST_DEVICE constexpr View map( + const ViewConstDataPointerType p) + requires((!isScalar()) && + (std::remove_cv_t::indexing_policy::hasFixedSizes)) + { return View{p}; } // end of map @@ -397,13 +411,15 @@ namespace tfel::math { template - TFEL_HOST_DEVICE constexpr View - map(Args&&... args) requires( - (!std::is_const_v)&&(!IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename MappedType::indexing_policy>()) && - (canMakeViewFromLastArgument())) { + TFEL_HOST_DEVICE constexpr View map( + Args&&... args) + requires((!std::is_const_v) && + (!IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename MappedType::indexing_policy>()) && + (canMakeViewFromLastArgument())) + { static_assert(sizeof...(Args) >= 2, "invalid call"); const auto r = buildIndexingPolicyAndExtractPointerToData(args...); @@ -415,14 +431,15 @@ namespace tfel::math { typename... Args, typename IndexingPolicyType = typename std::remove_cv_t::indexing_policy> - TFEL_HOST_DEVICE constexpr View - map(const Args&... args) requires( - (!std::remove_cv_t::indexing_policy::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>()) && - (canMakeConstViewFromLastArgument, - Args...>())) { + TFEL_HOST_DEVICE constexpr View map( + const Args&... args) + requires((!std::remove_cv_t::indexing_policy::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>()) && + (canMakeConstViewFromLastArgument, + Args...>())) + { static_assert(sizeof...(Args) >= 2, "invalid call"); const auto r = buildIndexingPolicyAndExtractPointerToData(args...); diff --git a/include/TFEL/Math/Array/ViewsArray.hxx b/include/TFEL/Math/Array/ViewsArray.hxx index 78ff1e754..b2bd0c3c4 100644 --- a/include/TFEL/Math/Array/ViewsArray.hxx +++ b/include/TFEL/Math/Array/ViewsArray.hxx @@ -260,8 +260,8 @@ namespace tfel::math { constexpr auto operator()( const typename MemoryIndexingPolicyType::size_type i, const std::array& vsizes) const - noexcept { + ViewIndexingPolicyType::arity>& vsizes) + const noexcept { static_assert(!ViewIndexingPolicyType::hasFixedSizes, "invalid call"); static_assert(MemoryIndexingPolicyType::arity == 1u, "invalid call"); using const_view_type = typename ViewsArrayBase::const_view_type; @@ -306,8 +306,8 @@ namespace tfel::math { const std::array& indices, const std::array& vsizes) const - noexcept { + ViewIndexingPolicyType::arity>& vsizes) + const noexcept { static_assert(!ViewIndexingPolicyType::hasFixedSizes, "invalid call"); using const_view_type = typename ViewsArrayBase::const_view_type; const auto p = ViewIndexingPolicyType{vsizes}; @@ -315,11 +315,13 @@ namespace tfel::math { } // \brief multiplication by a scalar template - TFEL_HOST_DEVICE constexpr ViewsArray& - operator*=(const ValueType2& s) noexcept requires( - (isScalar()) && - (isAssignableTo, - MappedType>())) { + TFEL_HOST_DEVICE constexpr ViewsArray& operator*=( + const ValueType2& s) noexcept + requires( + (isScalar()) && + (isAssignableTo, + MappedType>())) + { static_assert(!std::is_const_v, "invalid call"); const auto f = makeMultiIndicesUnaryOperatorFunctor([s](auto& a) { a *= s; }, *this); @@ -340,11 +342,13 @@ namespace tfel::math { } // end of operator*= // \brief division by a scalar template - TFEL_HOST_DEVICE constexpr ViewsArray& - operator/=(const ValueType2& s) noexcept requires( - (isScalar()) && - (isAssignableTo, - MappedType>())) { + TFEL_HOST_DEVICE constexpr ViewsArray& operator/=( + const ValueType2& s) noexcept + requires( + (isScalar()) && + (isAssignableTo, + MappedType>())) + { static_assert(!std::is_const_v, "invalid call"); return this->operator*=(1 / s); } // end of operator/= diff --git a/include/TFEL/Math/CubicSpline.hxx b/include/TFEL/Math/CubicSpline.hxx index 72c26bdda..db04b0ac0 100644 --- a/include/TFEL/Math/CubicSpline.hxx +++ b/include/TFEL/Math/CubicSpline.hxx @@ -233,8 +233,8 @@ namespace tfel::math { * \param p : first point * \param x : abscissa */ - constexpr bool operator()(const Point&, const AbscissaType&) const - noexcept; + constexpr bool operator()(const Point&, + const AbscissaType&) const noexcept; }; // end of struct PointComparator /*! diff --git a/include/TFEL/Math/CubicSpline.ixx b/include/TFEL/Math/CubicSpline.ixx index 504cf4ef4..b05df2895 100644 --- a/include/TFEL/Math/CubicSpline.ixx +++ b/include/TFEL/Math/CubicSpline.ixx @@ -96,8 +96,9 @@ namespace tfel::math { } // end of namespace internals template - constexpr bool CubicSpline::PointComparator:: - operator()(const Point& p, const AbscissaType& x) const noexcept { + constexpr bool + CubicSpline::PointComparator::operator()( + const Point& p, const AbscissaType& x) const noexcept { return p.x < x; } // end of operator() diff --git a/include/TFEL/Math/Discretization1D.ixx b/include/TFEL/Math/Discretization1D.ixx index 935045f0b..4d8770c15 100644 --- a/include/TFEL/Math/Discretization1D.ixx +++ b/include/TFEL/Math/Discretization1D.ixx @@ -72,7 +72,7 @@ namespace tfel::math { } v.back() = xe; // not mandatory (xe is the value that shall be // found) but this is more precise - } // end of geometricDiscretization + } // end of geometricDiscretization } // end of namespace tfel::math diff --git a/include/TFEL/Math/ExpressionTemplates/StandardOperations.hxx b/include/TFEL/Math/ExpressionTemplates/StandardOperations.hxx index d0475ae57..e2b881379 100644 --- a/include/TFEL/Math/ExpressionTemplates/StandardOperations.hxx +++ b/include/TFEL/Math/ExpressionTemplates/StandardOperations.hxx @@ -37,10 +37,11 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator-(T1&& a) noexcept - -> UnaryOperationHandler requires( - (!isScalar()) && - (isUnaryOperationResultTypeValid()) && - (!isInvalid>())) { + -> UnaryOperationHandler + requires((!isScalar()) && + (isUnaryOperationResultTypeValid()) && + (!isInvalid>())) + { return UnaryOperationHandler(std::forward(a)); } @@ -61,11 +62,12 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator+(T1&& a, T2&& b) noexcept - -> BinaryOperationHandler requires( - (isBinaryOperationResultTypeValid()) && - (!((isScalar()) && (isScalar())))) { + -> BinaryOperationHandler + requires((isBinaryOperationResultTypeValid()) && + (!((isScalar()) && (isScalar())))) + { return BinaryOperationHandler( std::forward(a), std::forward(b)); } @@ -87,11 +89,12 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator-(T1&& a, T2&& b) noexcept - -> BinaryOperationHandler requires( - (isBinaryOperationResultTypeValid()) && - (!((isScalar()) && (isScalar())))) { + -> BinaryOperationHandler + requires((isBinaryOperationResultTypeValid()) && + (!((isScalar()) && (isScalar())))) + { return BinaryOperationHandler( std::forward(a), std::forward(b)); } @@ -113,11 +116,12 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator*(T1&& a, T2&& b) noexcept - -> BinaryOperationHandler requires( - (isBinaryOperationResultTypeValid()) && - (!((isScalar()) && (isScalar())))) { + -> BinaryOperationHandler + requires((isBinaryOperationResultTypeValid()) && + (!((isScalar()) && (isScalar())))) + { return BinaryOperationHandler( std::forward(a), std::forward(b)); } @@ -139,11 +143,11 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator/(T1&& a, T2&& b) noexcept - -> BinaryOperationHandler requires( - (isBinaryOperationResultTypeValid()) && - (!((isScalar()) && (isScalar())))) { + -> BinaryOperationHandler + requires( + (isBinaryOperationResultTypeValid()) && + (!((isScalar()) && (isScalar())))) + { return BinaryOperationHandler( std::forward(a), std::forward(b)); } @@ -165,11 +169,12 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto operator^(T1&& a, T2&& b) noexcept - -> BinaryOperationHandler requires( - (isBinaryOperationResultTypeValid()) && - (!((isScalar()) && (isScalar())))) { + -> BinaryOperationHandler + requires((isBinaryOperationResultTypeValid()) && + (!((isScalar()) && (isScalar())))) + { return BinaryOperationHandler( std::forward(a), std::forward(b)); } diff --git a/include/TFEL/Math/Forward/stensor.hxx b/include/TFEL/Math/Forward/stensor.hxx index 7a37560ec..c72cffaff 100644 --- a/include/TFEL/Math/Forward/stensor.hxx +++ b/include/TFEL/Math/Forward/stensor.hxx @@ -58,12 +58,12 @@ namespace tfel::math { * \tparam N : the spatial dimension. */ template - requires((N == 1u) || (N == 2u) || (N == 3u)) struct StensorDimeToSize { + requires((N == 1u) || (N == 2u) || (N == 3u)) + struct StensorDimeToSize { static constexpr auto value = []() constexpr -> unsigned short { constexpr unsigned short values[4] = {0u, 3u, 4u, 6u}; return values[N]; - } - (); + }(); }; /*! @@ -74,12 +74,12 @@ namespace tfel::math { * \param value, the spatial dimension. */ template - requires((N == 3u) || (N == 4u) || (N == 6u)) struct StensorSizeToDime { + requires((N == 3u) || (N == 4u) || (N == 6u)) + struct StensorSizeToDime { static constexpr auto value = []() constexpr -> unsigned short { constexpr unsigned short values[7] = {0u, 0u, 0u, 1u, 2u, 0u, 3u}; return values[N]; - } - (); + }(); }; /*! diff --git a/include/TFEL/Math/Forward/tensor.hxx b/include/TFEL/Math/Forward/tensor.hxx index 8a34a02fe..ae091c1b6 100644 --- a/include/TFEL/Math/Forward/tensor.hxx +++ b/include/TFEL/Math/Forward/tensor.hxx @@ -57,12 +57,12 @@ namespace tfel::math { * \tparam N, the spatial dimension. */ template - requires((N == 1u) || (N == 2u) || (N == 3u)) struct TensorDimeToSize { + requires((N == 1u) || (N == 2u) || (N == 3u)) + struct TensorDimeToSize { static constexpr auto value = []() constexpr -> unsigned short { constexpr unsigned short values[4] = {0u, 3u, 5u, 9u}; return values[N]; - } - (); + }(); }; /*! @@ -73,13 +73,13 @@ namespace tfel::math { * \param value, the spatial dimension. */ template - requires((N == 3u) || (N == 5u) || (N == 9u)) struct TensorSizeToDime { + requires((N == 3u) || (N == 5u) || (N == 9u)) + struct TensorSizeToDime { static constexpr auto value = []() constexpr -> unsigned short { constexpr unsigned short values[10] = {0u, 0u, 0u, 1u, 0u, // 2u, 0u, 0u, 0u, 3u}; return values[N]; - } - (); + }(); }; } // end of namespace tfel::math diff --git a/include/TFEL/Math/General/Abs.hxx b/include/TFEL/Math/General/Abs.hxx index 823c65c33..955a34990 100644 --- a/include/TFEL/Math/General/Abs.hxx +++ b/include/TFEL/Math/General/Abs.hxx @@ -27,8 +27,9 @@ namespace tfel::math { * \param[in] s: value */ template - TFEL_HOST_DEVICE constexpr auto abs(const NumericType& s) noexcept requires( - tfel::typetraits::isFundamentalNumericType()) { + TFEL_HOST_DEVICE constexpr auto abs(const NumericType& s) noexcept + requires(tfel::typetraits::isFundamentalNumericType()) + { return (s < NumericType(0)) ? -s : s; } /*! @@ -36,8 +37,9 @@ namespace tfel::math { * \param[in] s: value */ template - TFEL_HOST_DEVICE constexpr auto abs(const Complex& s) requires( - tfel::typetraits::IsFundamentalNumericType::cond) { + TFEL_HOST_DEVICE constexpr auto abs(const Complex& s) + requires(tfel::typetraits::IsFundamentalNumericType::cond) + { return s.norm(); } diff --git a/include/TFEL/Math/General/BasicOperations.hxx b/include/TFEL/Math/General/BasicOperations.hxx index a953d228d..349cdfa12 100644 --- a/include/TFEL/Math/General/BasicOperations.hxx +++ b/include/TFEL/Math/General/BasicOperations.hxx @@ -198,16 +198,18 @@ namespace tfel::math { TFEL_MATH_RESULT_TYPE(long double); template - TFEL_HOST_DEVICE constexpr auto conj(const T src) noexcept requires( - (tfel::typetraits::isScalar()) && - (!tfel::typetraits::IsComplex::cond)) { + TFEL_HOST_DEVICE constexpr auto conj(const T src) noexcept + requires((tfel::typetraits::isScalar()) && + (!tfel::typetraits::IsComplex::cond)) + { return src; } // end of conj template - TFEL_HOST_DEVICE constexpr auto real(const T src) noexcept requires( - (tfel::typetraits::isScalar()) && - (!tfel::typetraits::IsComplex::cond)) { + TFEL_HOST_DEVICE constexpr auto real(const T src) noexcept + requires((tfel::typetraits::isScalar()) && + (!tfel::typetraits::IsComplex::cond)) + { return src; } diff --git a/include/TFEL/Math/General/CubicRoots.hxx b/include/TFEL/Math/General/CubicRoots.hxx index 4d72bc08c..7a94ebae2 100644 --- a/include/TFEL/Math/General/CubicRoots.hxx +++ b/include/TFEL/Math/General/CubicRoots.hxx @@ -99,8 +99,9 @@ namespace tfel::math { const T a2, const T a1, const T a0) // - requires((tfel::typetraits::IsReal::cond) && - (tfel::typetraits::IsFundamentalNumericType::cond)) { + requires((tfel::typetraits::IsReal::cond) && + (tfel::typetraits::IsFundamentalNumericType::cond)) + { constexpr auto C_1_2 = T{1} / T{2}; constexpr auto C_1_3 = T{1} / T{3}; constexpr auto C_2_3 = T{2} * C_1_3; @@ -218,8 +219,9 @@ namespace tfel::math { const T a1, const T a0, const bool b = false) // - requires((tfel::typetraits::IsReal::cond) && - (tfel::typetraits::IsFundamentalNumericType::cond)) { + requires((tfel::typetraits::IsReal::cond) && + (tfel::typetraits::IsFundamentalNumericType::cond)) + { const auto nb = CubicRoots::find_roots(x1, x2, x3, a3, a2, a1, a0); if ((nb > 0) && (b)) { CubicRoots::improve(x1, a3, a2, a1, a0); diff --git a/include/TFEL/Math/General/RunTimeCheck.hxx b/include/TFEL/Math/General/RunTimeCheck.hxx index 61eb769db..f12eeffd5 100644 --- a/include/TFEL/Math/General/RunTimeCheck.hxx +++ b/include/TFEL/Math/General/RunTimeCheck.hxx @@ -84,7 +84,7 @@ namespace tfel::math { } return a; } // end of exe. - }; // end of RunTimeCheck. + }; // end of RunTimeCheck. /*! * Partial specialisation for EmptyRunTimeProperties. @@ -101,7 +101,7 @@ namespace tfel::math { const EmptyRunTimeProperties) noexcept { return EmptyRunTimeProperties(); } // end of exe - }; // end of RunTimeCheck + }; // end of RunTimeCheck } // end of namespace tfel::math diff --git a/include/TFEL/Math/Matrix/MatrixConcept.hxx b/include/TFEL/Math/Matrix/MatrixConcept.hxx index 0a9fe33d2..2fbaf7518 100644 --- a/include/TFEL/Math/Matrix/MatrixConcept.hxx +++ b/include/TFEL/Math/Matrix/MatrixConcept.hxx @@ -45,11 +45,10 @@ namespace tfel::math { template concept MatrixConcept = (std::is_same_v::ConceptTag, - MatrixTag>)&&(requires(const MatrixType t, - const index_type i, - const index_type j) { - t(i, j); - }); + MatrixTag>) && + (requires(const MatrixType t, + const index_type i, + const index_type j) { t(i, j); }); //! paratial specialisation for matrices template diff --git a/include/TFEL/Math/Matrix/TMatrixTMatrixExpr.hxx b/include/TFEL/Math/Matrix/TMatrixTMatrixExpr.hxx index e36927457..8aa6a420c 100644 --- a/include/TFEL/Math/Matrix/TMatrixTMatrixExpr.hxx +++ b/include/TFEL/Math/Matrix/TMatrixTMatrixExpr.hxx @@ -87,7 +87,7 @@ namespace tfel::math { const MType& m; //! reference to the underlying matrix const unsigned short i; //! row index unsigned short j = 0; //! current column - }; // end of struc RowConstIterator + }; // end of struc RowConstIterator struct ColumnConstIterator { using MType = std::decay_t; @@ -113,9 +113,8 @@ namespace tfel::math { const B& r) noexcept : a(l), b(r) {} - TFEL_HOST_DEVICE constexpr auto operator()(const IndexType i, - const IndexType j) const - noexcept { + TFEL_HOST_DEVICE constexpr auto operator()( + const IndexType i, const IndexType j) const noexcept { using namespace tfel::fsalgo; return inner_product::template exe(RowConstIterator(a, i), ColumnConstIterator(b, j)); diff --git a/include/TFEL/Math/Matrix/TMatrixTVectorExpr.hxx b/include/TFEL/Math/Matrix/TMatrixTVectorExpr.hxx index e4adadd72..b33bcbf86 100644 --- a/include/TFEL/Math/Matrix/TMatrixTVectorExpr.hxx +++ b/include/TFEL/Math/Matrix/TMatrixTVectorExpr.hxx @@ -73,7 +73,7 @@ namespace tfel::math { const MType& m; //! reference to the underlying matrix const unsigned short i; //! row index unsigned short j = 0; //! current column - }; // end of struc RowConstIterator + }; // end of struc RowConstIterator //! a pseudo iterator for the vector. This iterator works even if // VType does not provide an iterator struct VectorConstIterator { diff --git a/include/TFEL/Math/Matrix/TVectorTMatrixExpr.hxx b/include/TFEL/Math/Matrix/TVectorTMatrixExpr.hxx index f52ebedab..6ba10cf09 100644 --- a/include/TFEL/Math/Matrix/TVectorTMatrixExpr.hxx +++ b/include/TFEL/Math/Matrix/TVectorTMatrixExpr.hxx @@ -96,8 +96,8 @@ namespace tfel::math { const B& r) noexcept : a(l), b(r) {} - TFEL_HOST_DEVICE constexpr auto operator()(const IndexType i) const - noexcept { + TFEL_HOST_DEVICE constexpr auto operator()( + const IndexType i) const noexcept { using namespace tfel::fsalgo; return inner_product::template exe(VectorConstIterator(a), ColumnConstIterator(b, i)); diff --git a/include/TFEL/Math/Matrix/matrix.ixx b/include/TFEL/Math/Matrix/matrix.ixx index f0118f121..4f1c87001 100644 --- a/include/TFEL/Math/Matrix/matrix.ixx +++ b/include/TFEL/Math/Matrix/matrix.ixx @@ -34,8 +34,9 @@ namespace tfel::math { template template matrix& matrix::operator=( - const std::initializer_list>& - values) requires(isAssignableTo()) { + const std::initializer_list>& values) + requires(isAssignableTo()) + { const auto nc = values.begin()->size(); for (const auto row : values) { if (row.size() != nc) { diff --git a/include/TFEL/Math/Matrix/tmatrix.ixx b/include/TFEL/Math/Matrix/tmatrix.ixx index 81e4d8b87..4c1842e89 100644 --- a/include/TFEL/Math/Matrix/tmatrix.ixx +++ b/include/TFEL/Math/Matrix/tmatrix.ixx @@ -83,7 +83,7 @@ namespace tfel::math::internals { VariableType>{ &m(i, j)}; } // end of exe - }; // end of struct DerivativeViewFromTinyMatrixImplementation + }; // end of struct DerivativeViewFromTinyMatrixImplementation /*! * \brief partial specialization if the function type is a scalar. @@ -137,7 +137,7 @@ namespace tfel::math::internals { VariableType>{ &m(i, j)}; } // end of exe - }; // end of struct DerivativeViewFromTinyMatrixImplementation + }; // end of struct DerivativeViewFromTinyMatrixImplementation /*! * \brief partial specialization if the variable type is a scalar. @@ -191,7 +191,7 @@ namespace tfel::math::internals { VariableType>{ &m(i, j)}; } // end of exe - }; // end of struct DerivativeViewFromTinyMatrixImplementation + }; // end of struct DerivativeViewFromTinyMatrixImplementation /*! * \brief partial specialization if the function type and the variable type @@ -241,7 +241,7 @@ namespace tfel::math::internals { VariableType>( m(i, j)); } // end of exe - }; // end of struct DerivativeViewFromTinyMatrixImplementation + }; // end of struct DerivativeViewFromTinyMatrixImplementation template TFEL_HOST_DEVICE constexpr auto det2(const MatrixType& m) noexcept { @@ -270,7 +270,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr tmatrix::tmatrix( ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == N) && ((d == M) && ...)) { + requires((sizeof...(d) == N) && ((d == M) && ...)) + { auto init_row = [this](const typename tmatrix::size_type i, ValueType const(&values)[M]) { for (typename tmatrix::size_type j = 0u; j < M; ++j) { diff --git a/include/TFEL/Math/Minimization/LevenbergMarquardtFunctionWrapper.ixx b/include/TFEL/Math/Minimization/LevenbergMarquardtFunctionWrapper.ixx index f328a4454..f49aa5797 100644 --- a/include/TFEL/Math/Minimization/LevenbergMarquardtFunctionWrapper.ixx +++ b/include/TFEL/Math/Minimization/LevenbergMarquardtFunctionWrapper.ixx @@ -38,8 +38,9 @@ namespace tfel::math { // LevenbergMarquardtFunctionWrapper::LevenbergMarquardtFunctionWrapper template - LevenbergMarquardtFunctionWrapper& LevenbergMarquardtFunctionWrapper:: - operator=(const LevenbergMarquardtFunctionWrapper& src) { + LevenbergMarquardtFunctionWrapper& + LevenbergMarquardtFunctionWrapper::operator=( + const LevenbergMarquardtFunctionWrapper& src) { this->f = src.f; this->np = src.np; this->nv = src.nv; diff --git a/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.hxx b/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.hxx index 71b162fc2..3aaa3c788 100644 --- a/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.hxx +++ b/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.hxx @@ -171,8 +171,8 @@ namespace tfel::math { * \brief check the convergence of the method * \param[in] e: current error */ - TFEL_HOST_DEVICE constexpr bool checkConvergence(const NumericType e) const - noexcept { + TFEL_HOST_DEVICE constexpr bool checkConvergence( + const NumericType e) const noexcept { return e < this->epsilon; } /*! @@ -183,9 +183,8 @@ namespace tfel::math { */ template - TFEL_HOST_DEVICE bool solveLinearSystem(FixedSizeMatrixType&, - FixedSizeVectorType&) const - noexcept; + TFEL_HOST_DEVICE bool solveLinearSystem( + FixedSizeMatrixType&, FixedSizeVectorType&) const noexcept; /*! * \brief update the jacobian matrix if required. * @@ -218,15 +217,15 @@ namespace tfel::math { */ TFEL_HOST_DEVICE constexpr void processNewEstimate() noexcept {} //! \brief method called when the resolution begins - TFEL_HOST_DEVICE constexpr void reportBeginningOfResolution() const - noexcept {} + TFEL_HOST_DEVICE constexpr void reportBeginningOfResolution() + const noexcept {} //! \brief method called when the resolution succeeds TFEL_HOST_DEVICE constexpr void reportSuccess() const noexcept {} //! \brief method called when the resolution fails TFEL_HOST_DEVICE constexpr void reportFailure() const noexcept {} //! \brief method called when the evaluation of the residual failed. - TFEL_HOST_DEVICE constexpr void reportInvalidResidualEvaluation() const - noexcept {} + TFEL_HOST_DEVICE constexpr void reportInvalidResidualEvaluation() + const noexcept {} //! \brief method called when the computation of a new correction failed. TFEL_HOST_DEVICE constexpr void reportNewCorrectionComputationFailure() const noexcept {} diff --git a/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.ixx b/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.ixx index 7a671dba9..6b40d7e4a 100644 --- a/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.ixx +++ b/include/TFEL/Math/NonLinearSolvers/TinyNonLinearSolverBase.ixx @@ -122,8 +122,8 @@ namespace tfel::math { VectorConcept FixedSizeVectorType> TFEL_HOST_DEVICE bool TinyNonLinearSolverBase:: - solveLinearSystem(FixedSizeMatrixType& m, FixedSizeVectorType& v) const - noexcept { + solveLinearSystem(FixedSizeMatrixType& m, + FixedSizeVectorType& v) const noexcept { return TinyMatrixSolve::exe(m, v); } // end of solveLinearSystem diff --git a/include/TFEL/Math/Quantity/qtOperations.hxx b/include/TFEL/Math/Quantity/qtOperations.hxx index bc11085c6..d8b15c597 100644 --- a/include/TFEL/Math/Quantity/qtOperations.hxx +++ b/include/TFEL/Math/Quantity/qtOperations.hxx @@ -220,13 +220,13 @@ TFEL_HOST_DEVICE constexpr qt< \ UnitType, typename tfel::typetraits::Promote::type> \ operator*(const Quantity&, \ - const X&)noexcept; \ + const X&) noexcept; \ \ template \ TFEL_HOST_DEVICE constexpr qt< \ UnitType, typename tfel::typetraits::Promote::type> \ operator*(const X&, \ - const Quantity&)noexcept; \ + const Quantity&) noexcept; \ \ /*! \ * \brief Partial specialisation for qt by scalar division \ diff --git a/include/TFEL/Math/ST2toST2/BuildFromRotationMatrix.hxx b/include/TFEL/Math/ST2toST2/BuildFromRotationMatrix.hxx index 8680939f4..9edf1872d 100644 --- a/include/TFEL/Math/ST2toST2/BuildFromRotationMatrix.hxx +++ b/include/TFEL/Math/ST2toST2/BuildFromRotationMatrix.hxx @@ -83,7 +83,7 @@ namespace tfel::math::st2tost2_internals { s(3, 3) = r(0, 0) * r(1, 1) + r(0, 1) * r(1, 0); return s; } // end of BuildFromRotationMatrix<2u>::exe - }; // end of struct BuildFromRotationMatrix<2u> + }; // end of struct BuildFromRotationMatrix<2u> /*! * \brief partial specialisation in 3D */ @@ -157,7 +157,7 @@ namespace tfel::math::st2tost2_internals { s(5, 5) = e * i + f * h; return s; } // end of BuildFromRotationMatrix<3u>::exe - }; // end of struct BuildFromRotationMatrix<3u> + }; // end of struct BuildFromRotationMatrix<3u> } // end of namespace tfel::math::st2tost2_internals diff --git a/include/TFEL/Math/ST2toST2/ConvertLogarithmicStrainTangentOperator.hxx b/include/TFEL/Math/ST2toST2/ConvertLogarithmicStrainTangentOperator.hxx index 45309d4f8..71e86e018 100644 --- a/include/TFEL/Math/ST2toST2/ConvertLogarithmicStrainTangentOperator.hxx +++ b/include/TFEL/Math/ST2toST2/ConvertLogarithmicStrainTangentOperator.hxx @@ -65,13 +65,13 @@ namespace tfel::math { const tmatrix<3u, 3u, real>&, const tvector<3u, real>&) noexcept // - requires( - (tfel::math::getSpaceDimension() == 1u) && - (std::is_same, stress>::value) && - (tfel::math::getSpaceDimension() == 1u) && - (isAssignableTo, stress>()), - (tfel::math::getSpaceDimension() == 1u) && - (isAssignableTo, real>())) { + requires((tfel::math::getSpaceDimension() == 1u) && + (std::is_same, stress>::value) && + (tfel::math::getSpaceDimension() == 1u) && + (isAssignableTo, stress>()), + (tfel::math::getSpaceDimension() == 1u) && + (isAssignableTo, real>())) + { const auto iC0 = P(0, 0); const auto iC1 = P(1, 1); const auto iC2 = P(2, 2); diff --git a/include/TFEL/Math/ST2toST2/ConvertSpatialModuliToKirchhoffJaumanRateModuli.hxx b/include/TFEL/Math/ST2toST2/ConvertSpatialModuliToKirchhoffJaumanRateModuli.hxx index 3680a9341..c9dc992bc 100644 --- a/include/TFEL/Math/ST2toST2/ConvertSpatialModuliToKirchhoffJaumanRateModuli.hxx +++ b/include/TFEL/Math/ST2toST2/ConvertSpatialModuliToKirchhoffJaumanRateModuli.hxx @@ -35,12 +35,12 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto convertSpatialModuliToKirchhoffJaumanRateModuli( - const ST2toST2Type& C_s, - const StensorType& - tau) noexcept requires((getSpaceDimension() == - getSpaceDimension()) && - (std::is_same_v, - numeric_type>)) { + const ST2toST2Type& C_s, const StensorType& tau) noexcept + requires( + (getSpaceDimension() == + getSpaceDimension()) && + (std::is_same_v, numeric_type>)) + { constexpr auto N = getSpaceDimension(); using NumType = numeric_type; if constexpr (N == 1) { diff --git a/include/TFEL/Math/ST2toST2/ConvertT2toST2ToST2toST2Expr.hxx b/include/TFEL/Math/ST2toST2/ConvertT2toST2ToST2toST2Expr.hxx index 5399e44ae..4c5b40001 100644 --- a/include/TFEL/Math/ST2toST2/ConvertT2toST2ToST2toST2Expr.hxx +++ b/include/TFEL/Math/ST2toST2/ConvertT2toST2ToST2toST2Expr.hxx @@ -49,11 +49,11 @@ namespace tfel::math { numeric_type>()); copy<9u>::exe(&A(0, 0), this->v); } // end of Expr - /*! - * \brief access operator - * \param[in] i : line index - * \param[in] j : column index - */ + /*! + * \brief access operator + * \param[in] i : line index + * \param[in] j : column index + */ TFEL_HOST_DEVICE constexpr const value_type& operator()( const unsigned short i, const unsigned short j) const noexcept { return this->v[i * 3 + j]; diff --git a/include/TFEL/Math/ST2toST2/ConvertToTangentModuli.hxx b/include/TFEL/Math/ST2toST2/ConvertToTangentModuli.hxx index ca6e1706e..4f2933607 100644 --- a/include/TFEL/Math/ST2toST2/ConvertToTangentModuli.hxx +++ b/include/TFEL/Math/ST2toST2/ConvertToTangentModuli.hxx @@ -27,8 +27,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto convertToTangentModuli( const T2toST2Type& K, const TensorType& F) noexcept // - requires(getSpaceDimension() == - getSpaceDimension()) { + requires(getSpaceDimension() == + getSpaceDimension()) + { constexpr auto N = getSpaceDimension(); using value_type = result_type, numeric_type, OpMult>; diff --git a/include/TFEL/Math/ST2toST2/ST2toST2Concept.hxx b/include/TFEL/Math/ST2toST2/ST2toST2Concept.hxx index b9fc26262..28d14a5a4 100644 --- a/include/TFEL/Math/ST2toST2/ST2toST2Concept.hxx +++ b/include/TFEL/Math/ST2toST2/ST2toST2Concept.hxx @@ -50,7 +50,7 @@ namespace tfel::math { */ template concept ST2toST2Concept = - (std::is_same_v::ConceptTag, ST2toST2Tag>)&& // + (std::is_same_v::ConceptTag, ST2toST2Tag>) && // (requires(const T t, const unsigned short i, const unsigned short j) { t(i, j); }); @@ -97,8 +97,8 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void computePushForwardDerivative( ST2toST2ResultType&, const TensorType&) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief performs the push_forward of a st2tost2: * \[ @@ -114,10 +114,10 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void push_forward(ST2toST2Type&, const ST2toST2Type2&, const TensorType&) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension()); + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension()); /*! * \brief an helper function which returns if the given type implements the diff --git a/include/TFEL/Math/ST2toST2/ST2toST2Concept.ixx b/include/TFEL/Math/ST2toST2/ST2toST2Concept.ixx index 5708b9e1c..1edc683aa 100644 --- a/include/TFEL/Math/ST2toST2/ST2toST2Concept.ixx +++ b/include/TFEL/Math/ST2toST2/ST2toST2Concept.ixx @@ -81,8 +81,9 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void computePushForwardDerivative( ST2toST2ResultType& r, const TensorType& F) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { constexpr auto N = getSpaceDimension(); static_assert(getSpaceDimension() == N); using value_type = numeric_type; diff --git a/include/TFEL/Math/ST2toST2/ST2toST2ConceptPushForward.ixx b/include/TFEL/Math/ST2toST2/ST2toST2ConceptPushForward.ixx index a6e6a13d0..45358f6f3 100644 --- a/include/TFEL/Math/ST2toST2/ST2toST2ConceptPushForward.ixx +++ b/include/TFEL/Math/ST2toST2/ST2toST2ConceptPushForward.ixx @@ -24,10 +24,11 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void push_forward(ST2toST2Type& Ct, const ST2toST2Type2& C, const TensorType& F) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension()) { + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension()) + { constexpr auto N = getSpaceDimension(); if constexpr (N == 1) { const auto C0 = F[0] * F[0]; diff --git a/include/TFEL/Math/ST2toST2/ST2toST2StensorProductExpr.hxx b/include/TFEL/Math/ST2toST2/ST2toST2StensorProductExpr.hxx index af3603179..bd19293f0 100644 --- a/include/TFEL/Math/ST2toST2/ST2toST2StensorProductExpr.hxx +++ b/include/TFEL/Math/ST2toST2/ST2toST2StensorProductExpr.hxx @@ -128,8 +128,8 @@ namespace tfel::math { return this->v[i]; } // end of operator[] //! \return the runtime properties - TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() const - noexcept { + TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() + const noexcept { return RunTimeProperties(); } }; // end of struct Expr diff --git a/include/TFEL/Math/ST2toST2/ST2toST2TransposeExpr.hxx b/include/TFEL/Math/ST2toST2/ST2toST2TransposeExpr.hxx index 4c6834426..2d89be885 100644 --- a/include/TFEL/Math/ST2toST2/ST2toST2TransposeExpr.hxx +++ b/include/TFEL/Math/ST2toST2/ST2toST2TransposeExpr.hxx @@ -62,9 +62,8 @@ namespace tfel::math { * \param[in] i: row number * \param[in] j: colum number */ - TFEL_HOST_DEVICE constexpr NumType operator()(const IndexType i, - const IndexType j) const - noexcept { + TFEL_HOST_DEVICE constexpr NumType operator()( + const IndexType i, const IndexType j) const noexcept { return this->a(j, i); } // end of operator() //! storage for the object diff --git a/include/TFEL/Math/ST2toST2/StensorSymmetricProductDerivative.hxx b/include/TFEL/Math/ST2toST2/StensorSymmetricProductDerivative.hxx index 532d08408..0b01d9e9a 100644 --- a/include/TFEL/Math/ST2toST2/StensorSymmetricProductDerivative.hxx +++ b/include/TFEL/Math/ST2toST2/StensorSymmetricProductDerivative.hxx @@ -26,10 +26,11 @@ namespace tfel::math { template struct StensorSymmetricProductDerivative<1u, T> { template - TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<1u, T> - exe(const StensorType& s) noexcept requires( - (getSpaceDimension() == 1u) && - (isAssignableTo, T>())) { + TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<1u, T> exe( + const StensorType& s) noexcept + requires((getSpaceDimension() == 1u) && + (isAssignableTo, T>())) + { using real = base_type; constexpr real zero = real(0); return {2 * s[0], zero, zero, zero, 2 * s[1], zero, zero, zero, 2 * s[2]}; @@ -39,10 +40,11 @@ namespace tfel::math { template struct StensorSymmetricProductDerivative<2u, T> { template - TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<2u, T> - exe(const StensorType& s) noexcept requires( - (getSpaceDimension() == 2u) && - (isAssignableTo, T>())) { + TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<2u, T> exe( + const StensorType& s) noexcept + requires((getSpaceDimension() == 2u) && + (isAssignableTo, T>())) + { using real = base_type; constexpr real zero = real(0); return {2 * s[0], zero, zero, s[3], zero, 2 * s[1], @@ -54,10 +56,11 @@ namespace tfel::math { template struct StensorSymmetricProductDerivative<3u, T> { template - TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<3u, T> - exe(const StensorType& s) noexcept requires( - (getSpaceDimension() == 3u) && - (isAssignableTo, T>())) { + TFEL_HOST_DEVICE static constexpr tfel::math::st2tost2<3u, T> exe( + const StensorType& s) noexcept + requires((getSpaceDimension() == 3u) && + (isAssignableTo, T>())) + { using real = base_type; constexpr auto icste = Cste::isqrt2; constexpr auto zero = real(0); diff --git a/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.hxx b/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.hxx index ceadb9411..314d8dcdd 100644 --- a/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.hxx +++ b/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.hxx @@ -27,10 +27,10 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<1u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 1u) && - (getSpaceDimension() == 1u)); + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<1u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 1u) && + (getSpaceDimension() == 1u)); /*! * \brief compute the derivative of the product @@ -41,10 +41,10 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<2u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 2u) && - (getSpaceDimension() == 2u)); + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<2u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 2u) && + (getSpaceDimension() == 2u)); /*! * \brief compute the derivative of the product \(a\,\dot\,b\,\dot\,a\) @@ -54,10 +54,10 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<3u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 3u) && - (getSpaceDimension() == 3u)); + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<3u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 3u) && + (getSpaceDimension() == 3u)); /*! * \brief compute the derivative of the product * \(a\,\dot\,b\,\dot\,a\) with respect to \(b\), where \(a\) and @@ -67,7 +67,7 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<1u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 1u); + requires(getSpaceDimension() == 1u); /*! * \brief compute the derivative of the product * \(a\,\dot\,b\,\dot\,a\) with respect to \(b\), where \(a\) and @@ -77,7 +77,7 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<2u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 2u); + requires(getSpaceDimension() == 2u); /*! * \brief compute the derivative of the product * \(a\,\dot\,b\,\dot\,a\) with respect to \(b\), where \(a\) and @@ -87,7 +87,7 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<3u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 3u); + requires(getSpaceDimension() == 3u); } // end of namespace tfel::math diff --git a/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.ixx b/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.ixx index a07c160f2..4cd16b351 100644 --- a/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.ixx +++ b/include/TFEL/Math/ST2toST2/SymmetricStensorProductDerivative.ixx @@ -18,10 +18,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<1u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 1u) && - (getSpaceDimension() == 1u)) { + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<1u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 1u) && + (getSpaceDimension() == 1u)) + { using NumType = decltype(a[0] * b[0]); using real = base_type; TFEL_HOST_DEVICE constexpr auto zero = real(0); @@ -32,10 +33,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<2u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 2u) && - (getSpaceDimension() == 2u)) { + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<2u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 2u) && + (getSpaceDimension() == 2u)) + { using NumType = decltype(a[0] * b[0]); using real = base_type; TFEL_HOST_DEVICE constexpr auto zero = real(0); @@ -59,10 +61,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_da( - const StensorType1& a, const StensorType2& b) noexcept - -> st2tost2<3u, decltype(a[0] * b[0])> // - requires((getSpaceDimension() == 3u) && - (getSpaceDimension() == 3u)) { + const StensorType1& a, + const StensorType2& b) noexcept -> st2tost2<3u, decltype(a[0] * b[0])> // + requires((getSpaceDimension() == 3u) && + (getSpaceDimension() == 3u)) + { using NumType = decltype(a[0] * b[0]); using real = base_type; TFEL_HOST_DEVICE constexpr auto zero = real(0); @@ -107,7 +110,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<1u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 1u) { + requires(getSpaceDimension() == 1u) + { using NumType = decltype(a[0] * a[0]); using real = base_type; TFEL_HOST_DEVICE constexpr auto zero = real(0); @@ -119,7 +123,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<2u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 2u) { + requires(getSpaceDimension() == 2u) + { using NumType = decltype(a[0] * a[0]); using real = base_type; constexpr auto zero = real(0); @@ -144,7 +149,8 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product_derivative_daba_db( const StensorType& a) noexcept -> st2tost2<3u, decltype(a[0] * a[0])> // - requires(getSpaceDimension() == 3u) { + requires(getSpaceDimension() == 3u) + { using NumType = decltype(a[0] * a[0]); using real = base_type; constexpr auto cste = Cste::sqrt2; diff --git a/include/TFEL/Math/ST2toST2/st2tost2.ixx b/include/TFEL/Math/ST2toST2/st2tost2.ixx index a83492b08..003dc944d 100644 --- a/include/TFEL/Math/ST2toST2/st2tost2.ixx +++ b/include/TFEL/Math/ST2toST2/st2tost2.ixx @@ -33,8 +33,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr st2tost2::st2tost2( ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == StensorDimeToSize::value) && - ((d == StensorDimeToSize::value) && ...)) { + requires((sizeof...(d) == StensorDimeToSize::value) && + ((d == StensorDimeToSize::value) && ...)) + { auto init_row = [this]( const typename st2tost2::size_type i, ValueType const(&values)[StensorDimeToSize::value]) { @@ -49,41 +50,45 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr auto - st2tost2::dsquare(const StensorType& s) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto st2tost2::dsquare( + const StensorType& s) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, StensorSquareDerivativeExpr>(s); } template template - TFEL_HOST_DEVICE constexpr auto st2tost2:: - dsquare(const StensorType& s, const ST2toST2Type& C) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - T>()) { + TFEL_HOST_DEVICE constexpr auto st2tost2::dsquare( + const StensorType& s, const ST2toST2Type& C) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + T>()) + { return Expr, StensorSquareDerivativeExpr>(s, C); } // end of dsquare template template - TFEL_HOST_DEVICE constexpr auto - st2tost2::stpd(const StensorType& s) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto st2tost2::stpd( + const StensorType& s) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return StensorSymmetricProductDerivative::exe(s); } template template - TFEL_HOST_DEVICE constexpr auto - st2tost2::convert(const T2toST2Type& src) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto st2tost2::convert( + const T2toST2Type& src) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, ConvertT2toST2ToST2toST2Expr>(src); } // end of convert @@ -279,9 +284,11 @@ namespace tfel::math { } // end of change_basis template - TFEL_HOST_DEVICE constexpr auto - push_forward(const ST2toST2Type& C, const TensorType& F) noexcept requires( - getSpaceDimension() == getSpaceDimension()) { + TFEL_HOST_DEVICE constexpr auto push_forward(const ST2toST2Type& C, + const TensorType& F) noexcept + requires(getSpaceDimension() == + getSpaceDimension()) + { st2tost2(), BinaryOperationResult, numeric_type, OpMult>> @@ -291,10 +298,10 @@ namespace tfel::math { } // end of push_forward template - TFEL_HOST constexpr auto pull_back( - const ST2toST2Type& C, - const TensorType& F) requires(getSpaceDimension() == - getSpaceDimension()) { + TFEL_HOST constexpr auto pull_back(const ST2toST2Type& C, const TensorType& F) + requires(getSpaceDimension() == + getSpaceDimension()) + { const auto iF = invert(F); return push_forward(C, iF); } // end of pull_back diff --git a/include/TFEL/Math/ST2toT2/ST2toT2Concept.hxx b/include/TFEL/Math/ST2toT2/ST2toT2Concept.hxx index 6ac2571c5..cc8748a52 100644 --- a/include/TFEL/Math/ST2toT2/ST2toT2Concept.hxx +++ b/include/TFEL/Math/ST2toT2/ST2toT2Concept.hxx @@ -48,7 +48,7 @@ namespace tfel::math { */ template concept ST2toT2Concept = - (std::is_same_v::ConceptTag, ST2toT2Tag>)&& // + (std::is_same_v::ConceptTag, ST2toT2Tag>) && // (requires(const T t, const unsigned short i, const unsigned short j) { t(i, j); }); diff --git a/include/TFEL/Math/ST2toT2/ST2toT2ConceptOperations.hxx b/include/TFEL/Math/ST2toT2/ST2toT2ConceptOperations.hxx index ade2d7175..7ad3f19d9 100644 --- a/include/TFEL/Math/ST2toT2/ST2toT2ConceptOperations.hxx +++ b/include/TFEL/Math/ST2toT2/ST2toT2ConceptOperations.hxx @@ -178,9 +178,9 @@ namespace tfel::math { }; template - TFEL_HOST_DEVICE constexpr auto - operator|(const T1& a, const T2& b) noexcept requires( - !isInvalid>()) { + TFEL_HOST_DEVICE constexpr auto operator|(const T1& a, const T2& b) noexcept + requires(!isInvalid>()) + { using Handle = BinaryOperationHandler; return Handle(a, b); } // end of operator| diff --git a/include/TFEL/Math/ST2toT2/st2tot2.ixx b/include/TFEL/Math/ST2toT2/st2tot2.ixx index e91114690..03bba4c9b 100644 --- a/include/TFEL/Math/ST2toT2/st2tot2.ixx +++ b/include/TFEL/Math/ST2toT2/st2tot2.ixx @@ -26,46 +26,50 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr auto - st2tot2::tpld(const StensorType& b) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto st2tot2::tpld( + const StensorType& b) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, StensorProductLeftDerivativeExpr>(b); } // end of st2tot2 template template - TFEL_HOST_DEVICE constexpr auto st2tot2:: - tpld(const StensorType& b, const ST2toST2Type& C) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - ValueType>()) { + TFEL_HOST_DEVICE constexpr auto st2tot2::tpld( + const StensorType& b, const ST2toST2Type& C) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + ValueType>()) + { return Expr, StensorProductLeftDerivativeExpr>(b, C); } template template - TFEL_HOST_DEVICE constexpr auto - st2tot2::tprd(const StensorType& a) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto st2tot2::tprd( + const StensorType& a) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, StensorProductRightDerivativeExpr>(a); } template template - TFEL_HOST_DEVICE constexpr auto st2tot2:: - tprd(const StensorType& a, const ST2toST2Type& C) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - T>()) { + TFEL_HOST_DEVICE constexpr auto st2tot2::tprd( + const StensorType& a, const ST2toST2Type& C) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + T>()) + { return Expr, StensorProductRightDerivativeExpr>(a, C); } @@ -73,8 +77,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr st2tot2::st2tot2( ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == TensorDimeToSize::value) && - ((d == StensorDimeToSize::value) && ...)) { + requires((sizeof...(d) == TensorDimeToSize::value) && + ((d == StensorDimeToSize::value) && ...)) + { auto init_row = [this]( const typename st2tot2::size_type i, ValueType const(&values)[StensorDimeToSize::value]) { diff --git a/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.hxx b/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.hxx index 683f3fc55..3732c785b 100644 --- a/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.hxx +++ b/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.hxx @@ -40,13 +40,13 @@ namespace tfel::math { PPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 1u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 1u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()); /*! * \brief compute the decomposition of a symmetric tensor in its @@ -69,13 +69,13 @@ namespace tfel::math { PPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 2u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 2u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()); /*! * \brief compute the decomposition of a symmetric tensor in its @@ -98,13 +98,13 @@ namespace tfel::math { PPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 3u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 3u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()); /*! * \brief compute the decomposition of a symmetric tensor in a * positive and negative parts and their derivatives. @@ -137,18 +137,18 @@ namespace tfel::math { NPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 1u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 1u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()); /*! * \brief compute the decomposition of a symmetric tensor in a @@ -182,18 +182,18 @@ namespace tfel::math { NPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 2u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 2u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()); /*! * \brief compute the decomposition of a symmetric tensor in a @@ -227,18 +227,18 @@ namespace tfel::math { NPType&, const StensorType&, const numeric_type) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 3u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()); + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 3u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.ixx b/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.ixx index 69b3e9ea7..a60ade92b 100644 --- a/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.ixx +++ b/include/TFEL/Math/Stensor/DecompositionInPositiveAndNegativeParts.ixx @@ -41,13 +41,14 @@ namespace tfel::math { PPType& pp, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 1u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 1u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::abs; typedef numeric_type NumType; typedef base_type real; @@ -94,13 +95,14 @@ namespace tfel::math { PPType& pp, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 2u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 2u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::abs; using tfel::math::internals::stensor_pneg; using tfel::math::internals::stensor_ppos; @@ -169,13 +171,14 @@ namespace tfel::math { PPType& pp, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 3u && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 3u && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::internals::stensor_pneg; using tfel::math::internals::stensor_ppos; typedef numeric_type NumType; @@ -324,18 +327,19 @@ namespace tfel::math { NPType& np, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 1u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 1u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::abs; typedef numeric_type NumType; typedef base_type real; @@ -403,18 +407,19 @@ namespace tfel::math { NPType& np, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 2u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 2u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::abs; using tfel::math::internals::stensor_pneg; using tfel::math::internals::stensor_ppos; @@ -505,18 +510,19 @@ namespace tfel::math { NPType& np, const StensorType& s, const numeric_type eps) // - requires( - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == getSpaceDimension() && - getSpaceDimension() == 3u && - isAssignableTo, numeric_type>() && - isAssignableTo, numeric_type>() && - isAssignableTo>, - numeric_type>() && - isAssignableTo>, - numeric_type>()) { + requires( + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == getSpaceDimension() && + getSpaceDimension() == 3u && + isAssignableTo, numeric_type>() && + isAssignableTo, numeric_type>() && + isAssignableTo>, + numeric_type>() && + isAssignableTo>, + numeric_type>()) + { using tfel::math::internals::stensor_pneg; using tfel::math::internals::stensor_ppos; typedef numeric_type NumType; diff --git a/include/TFEL/Math/Stensor/Internals/SortEigenValues.hxx b/include/TFEL/Math/Stensor/Internals/SortEigenValues.hxx index ff5d8ac20..2c76fd932 100644 --- a/include/TFEL/Math/Stensor/Internals/SortEigenValues.hxx +++ b/include/TFEL/Math/Stensor/Internals/SortEigenValues.hxx @@ -61,7 +61,7 @@ namespace tfel::math::internals { } } } // end of exe - }; // end of struct SortEigenValues<2u> + }; // end of struct SortEigenValues<2u> //! \brief partial specialisation of the `SortEigenValues` in 3D template <> struct SortEigenValues<3u> { @@ -96,7 +96,7 @@ namespace tfel::math::internals { swap_if_lesser(vp1, vp2); } } // end of exe - }; // end of struct SortEigenValues<3u> + }; // end of struct SortEigenValues<3u> } // end of namespace tfel::math::internals diff --git a/include/TFEL/Math/Stensor/Internals/SortEigenVectors.hxx b/include/TFEL/Math/Stensor/Internals/SortEigenVectors.hxx index 598c16cf2..3f1488c68 100644 --- a/include/TFEL/Math/Stensor/Internals/SortEigenVectors.hxx +++ b/include/TFEL/Math/Stensor/Internals/SortEigenVectors.hxx @@ -68,7 +68,7 @@ namespace tfel::math::internals { } } } // end of exe - }; // end of struct SortEigenVectors<2u> + }; // end of struct SortEigenVectors<2u> //! \brief partial specialisation of the `SortEigenVectors` in 3D template <> struct SortEigenVectors<3u> { @@ -127,7 +127,7 @@ namespace tfel::math::internals { m2(1, idx(0)), m2(1, idx(1)), m2(1, idx(2)), m2(2, idx(0)), m2(2, idx(1)), m2(2, idx(2))}; } // end of exe - }; // end of struct SortEigenVectors<3u> + }; // end of struct SortEigenVectors<3u> } // end of namespace tfel::math::internals diff --git a/include/TFEL/Math/Stensor/Internals/StensorComputeEigenValuesDerivatives.hxx b/include/TFEL/Math/Stensor/Internals/StensorComputeEigenValuesDerivatives.hxx index 0bf7d56bd..9d19cfa2f 100644 --- a/include/TFEL/Math/Stensor/Internals/StensorComputeEigenValuesDerivatives.hxx +++ b/include/TFEL/Math/Stensor/Internals/StensorComputeEigenValuesDerivatives.hxx @@ -27,7 +27,9 @@ namespace tfel::math::internals { StensorType& n1, StensorType& n2, const rotation_matrix>&) // - noexcept requires(getSpaceDimension() == 1u) { + noexcept + requires(getSpaceDimension() == 1u) + { using real = base_type>; constexpr auto zero = real(0); constexpr auto one = real(1); @@ -45,7 +47,8 @@ namespace tfel::math::internals { StensorType& n1, StensorType& n2, const rotation_matrix>& m) noexcept // - requires(getSpaceDimension() == 2u) { + requires(getSpaceDimension() == 2u) + { using real = base_type>; constexpr auto zero = real(0); constexpr auto one = real(1); @@ -65,7 +68,8 @@ namespace tfel::math::internals { StensorType& n1, StensorType& n2, const rotation_matrix>& m) noexcept // - requires(getSpaceDimension() == 3u) { + requires(getSpaceDimension() == 3u) + { using real = base_type>; const tvector<3u, real> v0 = m.template column_view<0u>(); const tvector<3u, real> v1 = m.template column_view<1u>(); diff --git a/include/TFEL/Math/Stensor/Internals/StensorComputeEigenVectorsDerivatives.hxx b/include/TFEL/Math/Stensor/Internals/StensorComputeEigenVectorsDerivatives.hxx index 6469356b3..e6c7854be 100644 --- a/include/TFEL/Math/Stensor/Internals/StensorComputeEigenVectorsDerivatives.hxx +++ b/include/TFEL/Math/Stensor/Internals/StensorComputeEigenVectorsDerivatives.hxx @@ -49,12 +49,12 @@ namespace tfel::math::internals { const tfel::math::tvector<3u, NumType>&, const tfel::math::rotation_matrix&, const NumType) // - requires( - (getSpaceDimension() == 1u) && - (isAssignableTo, - NumType, - OpDiv>::Result, - numeric_type>())) { + requires((getSpaceDimension() == 1u) && + (isAssignableTo, + NumType, + OpDiv>::Result, + numeric_type>())) + { using namespace tfel::math; using namespace tfel::typetraits; typedef typename ComputeBinaryResult, NumType, @@ -76,12 +76,12 @@ namespace tfel::math::internals { const tfel::math::tvector<3u, NumType>& vp, const tfel::math::rotation_matrix& m, const NumType eps) // - requires( - (getSpaceDimension() == 2u) && - (isAssignableTo, - NumType, - OpDiv>::Result, - numeric_type>())) { + requires((getSpaceDimension() == 2u) && + (isAssignableTo, + NumType, + OpDiv>::Result, + numeric_type>())) + { typedef base_type base; typedef BinaryOperationResult InvNumType; constexpr auto icste = Cste::isqrt2; @@ -107,12 +107,12 @@ namespace tfel::math::internals { const tfel::math::tvector<3u, NumType>& vp, const tfel::math::rotation_matrix& m, const NumType eps) // - requires( - (getSpaceDimension() == 3u) && - (isAssignableTo, - NumType, - OpDiv>::Result, - numeric_type>())) { + requires((getSpaceDimension() == 3u) && + (isAssignableTo, + NumType, + OpDiv>::Result, + numeric_type>())) + { using namespace tfel::math; typedef base_type base; constexpr auto cste = Cste::isqrt2; diff --git a/include/TFEL/Math/Stensor/Internals/StensorComputeIsotropicFunctionDerivative.hxx b/include/TFEL/Math/Stensor/Internals/StensorComputeIsotropicFunctionDerivative.hxx index 85bb90c58..2ea9afb3f 100644 --- a/include/TFEL/Math/Stensor/Internals/StensorComputeIsotropicFunctionDerivative.hxx +++ b/include/TFEL/Math/Stensor/Internals/StensorComputeIsotropicFunctionDerivative.hxx @@ -41,7 +41,8 @@ namespace tfel::math::internals { const tvector<3u, T>& vp, const rotation_matrix&, const T) // - requires(getSpaceDimension() == 1u) { + requires(getSpaceDimension() == 1u) + { using real = numeric_type; constexpr auto zero = real(0); d(0, 0) = df(vp[0]); @@ -51,16 +52,16 @@ namespace tfel::math::internals { d(2, 2) = df(vp[2]); d(2, 0) = d(2, 1) = zero; } // end of exe - /*! - * compute the derivative of an isotropic function - * \param[out] d: result - * \param[in] f: function values - * \param[in] df: values of the derivative of the function - * \param[in] vp: eigen values - * \param[in] m: eigenvectors - * \param[in] eps: criterion value used to judge if two eigenvalues are - * equals - */ + /*! + * compute the derivative of an isotropic function + * \param[out] d: result + * \param[in] f: function values + * \param[in] df: values of the derivative of the function + * \param[in] vp: eigen values + * \param[in] m: eigenvectors + * \param[in] eps: criterion value used to judge if two eigenvalues are + * equals + */ template &, const tmatrix<3u, 3u, base_type>&, const T3) // - requires(getSpaceDimension() == 1u) { + requires(getSpaceDimension() == 1u) + { using real = numeric_type; constexpr auto zero = real(0); d(0, 0) = df[0]; @@ -105,7 +107,8 @@ namespace tfel::math::internals { const tvector<3u, T3>& vp, const tmatrix<3u, 3u, base_type>& m, const T3 eps) // - requires(getSpaceDimension() == 2u) { + requires(getSpaceDimension() == 2u) + { using real = numeric_type; using base = base_type; using tvector = tfel::math::tvector<3u, real>; @@ -145,7 +148,8 @@ namespace tfel::math::internals { const tvector<3u, T>& vp, const rotation_matrix& m, const T eps) // - requires(getSpaceDimension() == 2u) { + requires(getSpaceDimension() == 2u) + { const auto fv = map(f, vp); const auto dfv = map(df, vp); StensorComputeIsotropicFunctionDerivative::exe(d, fv, dfv, vp, m, eps); @@ -174,7 +178,8 @@ namespace tfel::math::internals { const tvector<3u, T3>& vp, const tmatrix<3u, 3u, base_type>& m, const T3 eps) // - requires(getSpaceDimension() == 3u) { + requires(getSpaceDimension() == 3u) + { using real = numeric_type; using base = base_type; using tvector = tfel::math::tvector<3u, real>; @@ -242,16 +247,16 @@ namespace tfel::math::internals { f[0] * dn0 + f[1] * dn1 + f[2] * dn2; } } // end of exe - /*! - * compute the derivative of an isotropic function - * \param[out] d: result - * \param[in] f: function - * \param[in] df: derivative of the function - * \param[in] vp: eigen values - * \param[in] m: eigenvectors - * \param[in] eps: criterion value used to judge if two eigenvalues are - * equals - */ + /*! + * compute the derivative of an isotropic function + * \param[out] d: result + * \param[in] f: function + * \param[in] df: derivative of the function + * \param[in] vp: eigen values + * \param[in] m: eigenvectors + * \param[in] eps: criterion value used to judge if two eigenvalues are + * equals + */ template & vp, const rotation_matrix& m, const T eps) // - requires(getSpaceDimension() == 3u) { + requires(getSpaceDimension() == 3u) + { const auto fv = map(f, vp); const auto dfv = map(df, vp); StensorComputeIsotropicFunctionDerivative::exe(d, fv, dfv, vp, m, eps); diff --git a/include/TFEL/Math/Stensor/Internals/StensorEigenSolver.hxx b/include/TFEL/Math/Stensor/Internals/StensorEigenSolver.hxx index c550cf14e..276e82ac1 100644 --- a/include/TFEL/Math/Stensor/Internals/StensorEigenSolver.hxx +++ b/include/TFEL/Math/Stensor/Internals/StensorEigenSolver.hxx @@ -53,7 +53,7 @@ namespace tfel::math::internals { base_type_cast(v[5]) * icste, // base_type_cast(v[2])}; } // end of as_base_matrix - }; // end of StensorEigenSolverBase<3u, NumType> + }; // end of StensorEigenSolverBase<3u, NumType> /*! * A class for interfacing various eigen solvers. By default, @@ -158,7 +158,7 @@ namespace tfel::math::internals { vp2, m, sm(0, 0), sm(1, 1), sm(2, 2), sm(0, 1), sm(0, 2), sm(1, 2)); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -213,7 +213,7 @@ namespace tfel::math::internals { base_type_cast(v[5]) * icste, base_type_cast(v[2]), b); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -269,7 +269,7 @@ namespace tfel::math::internals { m(1, 2) = real(0); m(2, 2) = real(1); } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -317,7 +317,7 @@ namespace tfel::math::internals { sm); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -377,7 +377,7 @@ namespace tfel::math::internals { fses::syevj3(m, vp2, sm); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -436,7 +436,7 @@ namespace tfel::math::internals { fses::syevq3(m, vp2, sm); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -495,7 +495,7 @@ namespace tfel::math::internals { fses::syevd3(m, vp2, sm); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver /*! * \brief Partial specialisation of the `StensorEigenSolver` @@ -554,7 +554,7 @@ namespace tfel::math::internals { fses::syevh3(m, vp2, sm); vp = {NumType(vp2(0)), NumType(vp2(1)), NumType(vp2(2))}; } // end of computeEigenVectors - }; // end of struct StensorEigenSolver + }; // end of struct StensorEigenSolver } // namespace tfel::math::internals diff --git a/include/TFEL/Math/Stensor/StensorConcept.hxx b/include/TFEL/Math/Stensor/StensorConcept.hxx index 09acb325d..0d3e29024 100644 --- a/include/TFEL/Math/Stensor/StensorConcept.hxx +++ b/include/TFEL/Math/Stensor/StensorConcept.hxx @@ -54,8 +54,8 @@ namespace tfel::math { */ template concept StensorConcept = - (std::is_same_v::ConceptTag, StensorTag>)&& // - (requires(const T t, const unsigned short i) { t[i]; }) && // + (std::is_same_v::ConceptTag, StensorTag>) && // + (requires(const T t, const unsigned short i) { t[i]; }) && // (requires(const T t, const unsigned short i) { t(i); }); //! \brief partial specialisation for symmetric tensors diff --git a/include/TFEL/Math/Stensor/StensorConceptOperations.hxx b/include/TFEL/Math/Stensor/StensorConceptOperations.hxx index e8a6d8e25..e0c98355d 100644 --- a/include/TFEL/Math/Stensor/StensorConceptOperations.hxx +++ b/include/TFEL/Math/Stensor/StensorConceptOperations.hxx @@ -117,9 +117,9 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr BinaryOperationResult - operator|(const T1&, const T2&) noexcept requires( - (getSpaceDimension() == getSpaceDimension()) && - (!isInvalid>())); + operator|(const T1&, const T2&) noexcept + requires((getSpaceDimension() == getSpaceDimension()) && + (!isInvalid>())); } // end of namespace tfel::math diff --git a/include/TFEL/Math/Stensor/StensorConceptOperations.ixx b/include/TFEL/Math/Stensor/StensorConceptOperations.ixx index 819d2fcb0..34bb31343 100644 --- a/include/TFEL/Math/Stensor/StensorConceptOperations.ixx +++ b/include/TFEL/Math/Stensor/StensorConceptOperations.ixx @@ -21,11 +21,13 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr BinaryOperationResult - operator|(const StensorType1& a, const StensorType2& b) noexcept requires( - (getSpaceDimension() == - getSpaceDimension()) && - (!isInvalid< - BinaryOperationResult>())) { + operator|(const StensorType1& a, const StensorType2& b) noexcept + requires( + (getSpaceDimension() == + getSpaceDimension()) && + (!isInvalid< + BinaryOperationResult>())) + { constexpr auto N = getSpaceDimension(); if constexpr (N == 1) { return a(0) * b(0) + a(1) * b(1) + a(2) * b(2); diff --git a/include/TFEL/Math/Stensor/SymmetricStensorProduct.hxx b/include/TFEL/Math/Stensor/SymmetricStensorProduct.hxx index 0c96a96d6..72ed76f4b 100644 --- a/include/TFEL/Math/Stensor/SymmetricStensorProduct.hxx +++ b/include/TFEL/Math/Stensor/SymmetricStensorProduct.hxx @@ -28,8 +28,8 @@ namespace tfel::math { */ template auto symmetric_product_aba(const StensorType1&, const StensorType2&) // - requires(getSpaceDimension() == - getSpaceDimension()); + requires(getSpaceDimension() == + getSpaceDimension()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/Stensor/SymmetricStensorProduct.ixx b/include/TFEL/Math/Stensor/SymmetricStensorProduct.ixx index e8a280f2e..073ec10e4 100644 --- a/include/TFEL/Math/Stensor/SymmetricStensorProduct.ixx +++ b/include/TFEL/Math/Stensor/SymmetricStensorProduct.ixx @@ -19,8 +19,9 @@ namespace tfel::math { template auto symmetric_product_aba(const StensorType1& a, const StensorType2& b) // - requires(getSpaceDimension() == - getSpaceDimension()) { + requires(getSpaceDimension() == + getSpaceDimension()) + { constexpr auto N = getSpaceDimension(); if constexpr (N == 1) { return stensor<1u, decltype(a[0] * b[0] * a[0])>{ diff --git a/include/TFEL/Math/Stensor/stensor.ixx b/include/TFEL/Math/Stensor/stensor.ixx index d0d43193d..c2c886316 100644 --- a/include/TFEL/Math/Stensor/stensor.ixx +++ b/include/TFEL/Math/Stensor/stensor.ixx @@ -33,10 +33,12 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr void - stensor::importVoigt(const InputIterator p) noexcept requires( - std::is_same_v::value_type, - base_type>) { + TFEL_HOST_DEVICE constexpr void stensor::importVoigt( + const InputIterator p) noexcept + requires( + std::is_same_v::value_type, + base_type>) + { tfel::fsalgo::transform<3u>::exe( p, this->begin(), [](const auto& value) { return T(value); }); if constexpr (N == 2) { @@ -53,10 +55,12 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr void - stensor::importTab(const InputIterator p) noexcept requires( - std::is_same_v::value_type, - base_type>) { + TFEL_HOST_DEVICE constexpr void stensor::importTab( + const InputIterator p) noexcept + requires( + std::is_same_v::value_type, + base_type>) + { tfel::fsalgo::transform<3>::exe(p, this->begin(), [](const auto& value) { return T(value); }); if constexpr (N == 2) { @@ -73,10 +77,12 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr void - stensor::import(const InputIterator p) noexcept requires( - std::is_same_v::value_type, - base_type>) { + TFEL_HOST_DEVICE constexpr void stensor::import( + const InputIterator p) noexcept + requires( + std::is_same_v::value_type, + base_type>) + { tfel::fsalgo::transform::value>::exe( p, this->begin(), [](const auto& value) { return T(value); }); } // end of import @@ -227,8 +233,9 @@ namespace tfel::math { StensorType& n1, StensorType& n2, const rotation_matrix& m) noexcept // - requires((getSpaceDimension() == N) && - (isAssignableTo, numeric_type>())) { + requires((getSpaceDimension() == N) && + (isAssignableTo, numeric_type>())) + { return stensor::computeEigenTensors(n0, n1, n2, m); } // end of stensor::computeEigenValuesDerivatives @@ -248,8 +255,9 @@ namespace tfel::math { StensorType& n1, StensorType& n2, const rotation_matrix& m) noexcept // - requires((getSpaceDimension() == N) && - (isAssignableTo, numeric_type>())) { + requires((getSpaceDimension() == N) && + (isAssignableTo, numeric_type>())) + { return tfel::math::internals::StensorComputeEigenValuesDerivatives::exe( n0, n1, n2, m); } // end of stensor::computeEigenTensors @@ -262,10 +270,11 @@ namespace tfel::math { ST2toST2Type& dn2_ds, const tvector<3u, T>& vp, const rotation_matrix& m, - const T eps) requires((getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult, T, OpDiv>, - numeric_type>())) { + const T eps) + requires((getSpaceDimension() == N) && + (isAssignableTo, T, OpDiv>, + numeric_type>())) + { return tfel::math::internals::StensorComputeEigenTensorsDerivatives::exe( dn0_ds, dn1_ds, dn2_ds, vp, m, eps); } @@ -310,10 +319,11 @@ namespace tfel::math { const FunctionDerivative& df, const tvector<3u, T>& vp, const rotation_matrix& m, - const T eps) requires((getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult, T, OpDiv>, - numeric_type>())) { + const T eps) + requires((getSpaceDimension() == N) && + (isAssignableTo, T, OpDiv>, + numeric_type>())) + { tfel::math::internals::StensorComputeIsotropicFunctionDerivative::exe2( d, f, df, vp, m, eps); } // end of computeIsotropicFunctionDerivative @@ -339,10 +349,11 @@ namespace tfel::math { const tvector<3u, T2>& df, const tvector<3u, T>& vp, const rotation_matrix& m, - const T eps) requires((getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult, T, OpDiv>, - numeric_type>())) { + const T eps) + requires((getSpaceDimension() == N) && + (isAssignableTo, T, OpDiv>, + numeric_type>())) + { tfel::math::internals::StensorComputeIsotropicFunctionDerivative::exe( d, f, df, vp, m, eps); } @@ -419,8 +430,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const stensor& s, - OutputIterator p) noexcept requires(isScalar()) { + const stensor& s, OutputIterator p) noexcept + requires(isScalar()) + { tfel::fsalgo::transform::value>::exe( s.cbegin(), p, [](const auto& v) { return base_type_cast(v); }); } @@ -508,9 +520,10 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr auto - stensor::buildFromMatrix(const MatrixType& m) noexcept requires( - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto stensor::buildFromMatrix( + const MatrixType& m) noexcept + requires(isAssignableTo, T>()) + { if constexpr (N == 1) { return stensor{m(0, 0), m(1, 1), m(2, 2)}; } else if constexpr (N == 2) { @@ -532,10 +545,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto stensor::buildFromVectorDiadicProduct( const VectorType& v) noexcept // - requires( - isAssignableTo, - Power<2>>::Result, - T>()) { + requires( + isAssignableTo, + Power<2>>::Result, + T>()) + { if constexpr (N == 1) { return stensor{v(0) * v(0), v(1) * v(1), v(2) * v(2)}; } else if constexpr (N == 2) { @@ -556,10 +570,11 @@ namespace tfel::math { stensor::buildFromVectorsSymmetricDiadicProduct( const VectorType& v1, const VectorType2& v2) noexcept // - requires(isAssignableTo, - numeric_type, - OpMult>, - T>()) { + requires(isAssignableTo, + numeric_type, + OpMult>, + T>()) + { if constexpr (N == 1) { return stensor{2 * v1(0) * v2(0), 2 * v1(1) * v2(1), 2 * v1(2) * v2(2)}; @@ -679,9 +694,10 @@ namespace tfel::math { } // end of buildNegativePartFromEigenValuesAndVectors template - TFEL_HOST_DEVICE auto logarithm(const StensorType& s, const bool b) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + TFEL_HOST_DEVICE auto logarithm(const StensorType& s, const bool b) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using NumType = numeric_type; constexpr auto N = getSpaceDimension(); if constexpr (N == 1) { @@ -696,10 +712,10 @@ namespace tfel::math { } // end of logarithm template - TFEL_HOST_DEVICE auto - absolute_value(const StensorType& s, const bool b) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + TFEL_HOST_DEVICE auto absolute_value(const StensorType& s, const bool b) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using NumType = numeric_type; constexpr auto N = getSpaceDimension(); if constexpr (N == 1) { @@ -715,10 +731,10 @@ namespace tfel::math { } // end of absolute_value template - TFEL_HOST_DEVICE auto - positive_part(const StensorType& s, const bool b) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + TFEL_HOST_DEVICE auto positive_part(const StensorType& s, const bool b) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using NumType = numeric_type; constexpr auto N = getSpaceDimension(); constexpr auto zero = NumType{}; @@ -735,10 +751,10 @@ namespace tfel::math { } // end of positive_part template - TFEL_HOST_DEVICE auto - negative_part(const StensorType& s, const bool b) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + TFEL_HOST_DEVICE auto negative_part(const StensorType& s, const bool b) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using NumType = numeric_type; constexpr auto N = getSpaceDimension(); constexpr auto zero = NumType{}; @@ -828,12 +844,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto convertCorotationnalCauchyStressToSecondPiolaKirchhoffStress( - const T& s, - const T2& - U) noexcept requires((getSpaceDimension() == - getSpaceDimension()) && - (tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond)) { + const T& s, const T2& U) noexcept + requires( + (getSpaceDimension() == getSpaceDimension()) && + (tfel::typetraits::IsFundamentalNumericType>::cond)) + { constexpr auto N = getSpaceDimension(); using Result = stensor>; const auto J = det(U); @@ -909,9 +924,10 @@ namespace tfel::math { convertSecondPiolaKirchhoffStressToCorotationnalCauchyStress( const T& S, const T2& U) noexcept // - requires((getSpaceDimension() == getSpaceDimension()) && - (tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond)) { + requires( + (getSpaceDimension() == getSpaceDimension()) && + (tfel::typetraits::IsFundamentalNumericType>::cond)) + { constexpr auto N = getSpaceDimension(); using Result = stensor>; const auto iJ = 1 / det(U); @@ -978,10 +994,10 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto symmetric_product( - const StensorType1& s1, - const StensorType2& - s2) noexcept requires(getSpaceDimension() == - getSpaceDimension()) { + const StensorType1& s1, const StensorType2& s2) noexcept + requires(getSpaceDimension() == + getSpaceDimension()) + { using Result = stensor(), result_type, numeric_type, OpMult>>; diff --git a/include/TFEL/Math/T2toST2/LeftCauchyGreenTensorDerivativeExpr.hxx b/include/TFEL/Math/T2toST2/LeftCauchyGreenTensorDerivativeExpr.hxx index 565ddab85..7a5162612 100644 --- a/include/TFEL/Math/T2toST2/LeftCauchyGreenTensorDerivativeExpr.hxx +++ b/include/TFEL/Math/T2toST2/LeftCauchyGreenTensorDerivativeExpr.hxx @@ -67,8 +67,8 @@ namespace tfel::math { const unsigned short i, const unsigned short j) const { return this->v[i * 3 + j]; } // end of operator() - }; // end of struct Expr - // > + }; // end of struct Expr + // > /*! * Partial specialisation for 2D tensor @@ -120,8 +120,8 @@ namespace tfel::math { const unsigned short i, const unsigned short j) const { return this->v[i * 5 + j]; } // end of operator() - }; // end of struct Expr - // > + }; // end of struct Expr + // > /*! * Partial specialisation for 3D tensor @@ -201,8 +201,8 @@ namespace tfel::math { const unsigned short i, const unsigned short j) const { return this->v[i * 9 + j]; } // end of operator() - }; // end of struct Expr - // > + }; // end of struct Expr + // > } // end of namespace tfel::math diff --git a/include/TFEL/Math/T2toST2/RightCauchyGreenTensorDerivativeExpr.hxx b/include/TFEL/Math/T2toST2/RightCauchyGreenTensorDerivativeExpr.hxx index 2fbccabe9..356ab9286 100644 --- a/include/TFEL/Math/T2toST2/RightCauchyGreenTensorDerivativeExpr.hxx +++ b/include/TFEL/Math/T2toST2/RightCauchyGreenTensorDerivativeExpr.hxx @@ -58,18 +58,18 @@ namespace tfel::math { this->v[5] = this->v[6] = this->v[7] = zero; this->v[8] = 2 * F[2]; } // end of Expr - /*! - * \brief access operator - * \param[in] i : line index - * \param[in] j : column index - */ + /*! + * \brief access operator + * \param[in] i : line index + * \param[in] j : column index + */ TFEL_MATH_INLINE const value_type& operator()( const unsigned short i, const unsigned short j) const { return this->v[i * 3 + j]; } // end of operator() - /*! - * \return the runtime properties - */ + /*! + * \return the runtime properties + */ TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const { return RunTimeProperties(); } @@ -116,18 +116,18 @@ namespace tfel::math { this->v[18] = cste * F[0]; this->v[19] = cste * F[1]; } // end of Expr - /*! - * \brief access operator - * \param[in] i : line index - * \param[in] j : column index - */ + /*! + * \brief access operator + * \param[in] i : line index + * \param[in] j : column index + */ TFEL_MATH_INLINE const value_type& operator()( const unsigned short i, const unsigned short j) const { return this->v[i * 5 + j]; } // end of operator() - /*! - * \return the runtime properties - */ + /*! + * \return the runtime properties + */ TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const { return RunTimeProperties(); } @@ -204,18 +204,18 @@ namespace tfel::math { this->v[52] = cste * F[1]; this->v[53] = cste * F[2]; } // end of Expr - /*! - * \brief access operator - * \param[in] i : line index - * \param[in] j : column index - */ + /*! + * \brief access operator + * \param[in] i : line index + * \param[in] j : column index + */ TFEL_MATH_INLINE const value_type& operator()( const unsigned short i, const unsigned short j) const { return this->v[i * 9 + j]; } // end of operator() - /*! - * \return the runtime properties - */ + /*! + * \return the runtime properties + */ TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const { return RunTimeProperties(); } diff --git a/include/TFEL/Math/T2toST2/T2toST2Concept.hxx b/include/TFEL/Math/T2toST2/T2toST2Concept.hxx index 022aee39e..2707a755a 100644 --- a/include/TFEL/Math/T2toST2/T2toST2Concept.hxx +++ b/include/TFEL/Math/T2toST2/T2toST2Concept.hxx @@ -50,7 +50,7 @@ namespace tfel::math { */ template concept T2toST2Concept = - (std::is_same_v::ConceptTag, T2toST2Tag>)&& // + (std::is_same_v::ConceptTag, T2toST2Tag>) && // (requires(const T t, const unsigned short i, const unsigned short j) { t(i, j); }); @@ -82,10 +82,10 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void computePushForwardDerivativeWithRespectToDeformationGradient( T2toST2ResultType&, const StensorType&, const TensorType&) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond&& - isAssignableTo, - numeric_type>()); + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type>()); /*! * \brief compute the Cauchy stress derivative from the Kirchhoff * stress derivative with respect to the deformation gradient @@ -104,19 +104,19 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires( - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond && - isAssignableTo, - numeric_type, - OpPlus>::Result, - numeric_type>()); + requires( + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type, + OpPlus>::Result, + numeric_type>()); /*! * \brief compute the Kirchhoff stress derivative from the Cauchy * stress derivative with respect to the deformation gradient @@ -135,19 +135,19 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires( - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond && - isAssignableTo, - numeric_type, - OpPlus>::Result, - numeric_type>()); + requires( + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type, + OpPlus>::Result, + numeric_type>()); /*! * \brief an helper function which returns if the given type implements the * `T2toST2Concept`. diff --git a/include/TFEL/Math/T2toST2/T2toST2Concept.ixx b/include/TFEL/Math/T2toST2/T2toST2Concept.ixx index 24bb0136e..487fb2f18 100644 --- a/include/TFEL/Math/T2toST2/T2toST2Concept.ixx +++ b/include/TFEL/Math/T2toST2/T2toST2Concept.ixx @@ -43,10 +43,11 @@ namespace tfel::math { T2toST2ResultType& dTdF, const StensorType& S, const TensorType& F) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond&& - isAssignableTo, - numeric_type>()) { + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type>()) + { using value_type = numeric_type; constexpr auto N = getSpaceDimension(); static_assert(getSpaceDimension() == N); @@ -154,19 +155,20 @@ namespace tfel::math { const T2toST2Type& dt_K, const StensorType& s, const TensorType& F) noexcept // - requires( - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond && - isAssignableTo, - numeric_type, - OpPlus>::Result, - numeric_type>()) { + requires( + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type, + OpPlus>::Result, + numeric_type>()) + { const auto iJ = 1 / det(F); const auto dJ = computeDeterminantDerivative(F); ds = iJ * (dt_K - (s ^ dJ)); @@ -182,19 +184,20 @@ namespace tfel::math { const T2toST2Type& ds, const StensorType& s, const TensorType& F) noexcept // - requires( - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond && - isAssignableTo, - numeric_type, - OpPlus>::Result, - numeric_type>()) { + requires( + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, + numeric_type, + OpPlus>::Result, + numeric_type>()) + { const auto J = det(F); const auto dJ = computeDeterminantDerivative(F); dt_K = J * ds + (s ^ dJ); diff --git a/include/TFEL/Math/T2toST2/T2toST2ConceptOperations.hxx b/include/TFEL/Math/T2toST2/T2toST2ConceptOperations.hxx index cfbb759af..aa6f5777c 100644 --- a/include/TFEL/Math/T2toST2/T2toST2ConceptOperations.hxx +++ b/include/TFEL/Math/T2toST2/T2toST2ConceptOperations.hxx @@ -147,8 +147,9 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr auto operator|( const StensorConcept auto& a, const T2toST2Concept auto& b) noexcept // - requires(!isInvalid< - BinaryOperationResult>()) { + requires( + !isInvalid>()) + { typedef BinaryOperationHandler Handle; return Handle(a, b); } // end of operator | diff --git a/include/TFEL/Math/T2toST2/t2tost2.ixx b/include/TFEL/Math/T2toST2/t2tost2.ixx index b70f2f12d..fe7841982 100644 --- a/include/TFEL/Math/T2toST2/t2tost2.ixx +++ b/include/TFEL/Math/T2toST2/t2tost2.ixx @@ -28,19 +28,21 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr auto - t2tost2::dCdF(const TensorType& F) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto t2tost2::dCdF( + const TensorType& F) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, RightCauchyGreenTensorDerivativeExpr>(F); } // end of t2tost2::dCdF template template - TFEL_HOST_DEVICE constexpr auto - t2tost2::dBdF(const TensorType& F) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto t2tost2::dBdF( + const TensorType& F) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, LeftCauchyGreenTensorDerivativeExpr>(F); } // end of t2tost2::dBdF @@ -210,12 +212,13 @@ namespace tfel::math { const T2toST2Type& dt, const StensorType& s, const TensorType& F) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using stress = typename ComputeBinaryResult, numeric_type, OpPlus>::Result; @@ -232,12 +235,13 @@ namespace tfel::math { const T2toST2Type& ds, const StensorType& s, const TensorType& F) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using stress = typename ComputeBinaryResult, numeric_type, OpPlus>::Result; @@ -253,12 +257,13 @@ namespace tfel::math { const T2toST2Type& K, const StensorType& S, const TensorType& F) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond) { + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond) + { using stress = typename ComputeBinaryResult, numeric_type, OpPlus>::Result; @@ -276,13 +281,14 @@ namespace tfel::math { const T2toST2Type& dS_dF, const StensorType& S, const TensorType& F) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond&& - isAssignableTo< - typename ComputeBinaryResult, + requires( + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, numeric_type, OpPlus>::Result, - numeric_type>()) { + numeric_type>()) + { constexpr auto N = getSpaceDimension(); static_assert(getSpaceDimension() == N); static_assert(getSpaceDimension() == N); @@ -317,8 +323,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr t2tost2::t2tost2( ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == StensorDimeToSize::value) && - ((d == TensorDimeToSize::value) && ...)) { + requires((sizeof...(d) == StensorDimeToSize::value) && + ((d == TensorDimeToSize::value) && ...)) + { auto init_row = [this]( const typename t2tost2::size_type i, ValueType const(&values)[TensorDimeToSize::value]) { diff --git a/include/TFEL/Math/T2toT2/T2toT2Concept.hxx b/include/TFEL/Math/T2toT2/T2toT2Concept.hxx index 2d78dc0bf..3596c8b35 100644 --- a/include/TFEL/Math/T2toT2/T2toT2Concept.hxx +++ b/include/TFEL/Math/T2toT2/T2toT2Concept.hxx @@ -49,7 +49,7 @@ namespace tfel::math { */ template concept T2toT2Concept = - (std::is_same_v::ConceptTag, T2toT2Tag>)&& // + (std::is_same_v::ConceptTag, T2toT2Tag>) && // (requires(const T t, const unsigned short i, const unsigned short j) { t(i, j); }); diff --git a/include/TFEL/Math/T2toT2/T2toT2ConceptOperations.hxx b/include/TFEL/Math/T2toT2/T2toT2ConceptOperations.hxx index cefc6e05a..c3ab3e781 100644 --- a/include/TFEL/Math/T2toT2/T2toT2ConceptOperations.hxx +++ b/include/TFEL/Math/T2toT2/T2toT2ConceptOperations.hxx @@ -96,8 +96,9 @@ namespace tfel::math { }; template - constexpr auto operator|(const T1& a, const T2& b) noexcept requires( - !isInvalid>()) { + constexpr auto operator|(const T1& a, const T2& b) noexcept + requires(!isInvalid>()) + { typedef BinaryOperationHandler Handle; return Handle(a, b); } diff --git a/include/TFEL/Math/T2toT2/TensorT2toT2ProductExpr.hxx b/include/TFEL/Math/T2toT2/TensorT2toT2ProductExpr.hxx index 702c0e7f6..7d4907e4a 100644 --- a/include/TFEL/Math/T2toT2/TensorT2toT2ProductExpr.hxx +++ b/include/TFEL/Math/T2toT2/TensorT2toT2ProductExpr.hxx @@ -70,8 +70,8 @@ namespace tfel::math { return this->v[i]; } // end of operator() //! \return the runtime properties - TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() const - noexcept { + TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() + const noexcept { return RunTimeProperties(); } }; // end of struct Expr @@ -128,8 +128,8 @@ namespace tfel::math { return this->v[i]; } // end of operator() //! \return the runtime properties - TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() const - noexcept { + TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() + const noexcept { return RunTimeProperties(); } }; // end of struct Expr diff --git a/include/TFEL/Math/T2toT2/t2tot2.ixx b/include/TFEL/Math/T2toT2/t2tot2.ixx index 0d54ae26e..7b57bf761 100644 --- a/include/TFEL/Math/T2toT2/t2tot2.ixx +++ b/include/TFEL/Math/T2toT2/t2tot2.ixx @@ -192,45 +192,51 @@ namespace tfel::math { template template - TFEL_HOST_DEVICE constexpr auto - t2tot2::tpld(const TensorType& B) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto t2tot2::tpld( + const TensorType& B) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, TensorProductLeftDerivativeExpr>(B); } // end of t2tot2 template template - TFEL_HOST_DEVICE constexpr auto t2tot2:: - tpld(const TensorType& B, const T2toT2Type& C) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>::Result, - T>()) { + TFEL_HOST_DEVICE constexpr auto t2tot2::tpld( + const TensorType& B, const T2toT2Type& C) noexcept + requires( + getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>::Result, + T>()) + { return Expr, TensorProductLeftDerivativeExpr>(B, C); } template template - TFEL_HOST_DEVICE constexpr auto - t2tot2::tprd(const TensorType& A) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, T>()) { + TFEL_HOST_DEVICE constexpr auto t2tot2::tprd( + const TensorType& A) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, T>()) + { return Expr, TensorProductRightDerivativeExpr>(A); } template template - TFEL_HOST_DEVICE constexpr auto t2tot2:: - tprd(const TensorType& A, const T2toT2Type& C) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>::Result, - T>()) { + TFEL_HOST_DEVICE constexpr auto t2tot2::tprd( + const TensorType& A, const T2toT2Type& C) noexcept + requires( + getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>::Result, + T>()) + { return Expr, TensorProductRightDerivativeExpr>(A, C); } @@ -362,9 +368,10 @@ namespace tfel::math { template template - constexpr t2tot2::t2tot2(const T2toST2Type& s) noexcept requires( - (isAssignableTo, T>()) && - (getSpaceDimension() == N)) { + constexpr t2tot2::t2tot2(const T2toST2Type& s) noexcept + requires((isAssignableTo, T>()) && + (getSpaceDimension() == N)) + { convert(*this, s); } // end of t2tot2 @@ -372,8 +379,9 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr t2tot2::t2tot2( ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == TensorDimeToSize::value) && - ((d == TensorDimeToSize::value) && ...)) { + requires((sizeof...(d) == TensorDimeToSize::value) && + ((d == TensorDimeToSize::value) && ...)) + { auto init_row = [this]( const typename t2tot2::size_type i, ValueType const(&values)[TensorDimeToSize::value]) { @@ -444,9 +452,10 @@ namespace tfel::math { } template - TFEL_HOST_DEVICE constexpr auto - computeDeterminantSecondDerivative(const TensorType& t) noexcept requires( - isScalar>()) { + TFEL_HOST_DEVICE constexpr auto computeDeterminantSecondDerivative( + const TensorType& t) noexcept + requires(isScalar>()) + { constexpr auto N = getSpaceDimension(); using NumType = numeric_type; constexpr auto zero = NumType{0}; @@ -476,7 +485,8 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr void convert( t2tot2(), T>& d, const T2toST2Type& s) noexcept // - requires(isAssignableTo, T>()) { + requires(isAssignableTo, T>()) + { constexpr auto N = getSpaceDimension(); static_assert((N == 1) || (N == 2) || (N == 3)); if constexpr (N == 1) { diff --git a/include/TFEL/Math/Tensor/TensorConcept.hxx b/include/TFEL/Math/Tensor/TensorConcept.hxx index 1258b1404..1d42526c4 100644 --- a/include/TFEL/Math/Tensor/TensorConcept.hxx +++ b/include/TFEL/Math/Tensor/TensorConcept.hxx @@ -44,8 +44,8 @@ namespace tfel::math { */ template concept TensorConcept = - (std::is_same_v::ConceptTag, TensorTag>)&& // - (requires(const T t, const unsigned short i) { t[i]; }) && // + (std::is_same_v::ConceptTag, TensorTag>) && // + (requires(const T t, const unsigned short i) { t[i]; }) && // (requires(const T t, const unsigned short i) { t(i); }); //! forward declaration diff --git a/include/TFEL/Math/Tensor/TensorConceptOperations.hxx b/include/TFEL/Math/Tensor/TensorConceptOperations.hxx index d8eb8014d..c6a385e4d 100644 --- a/include/TFEL/Math/Tensor/TensorConceptOperations.hxx +++ b/include/TFEL/Math/Tensor/TensorConceptOperations.hxx @@ -214,10 +214,10 @@ namespace tfel::math { * an operation : use of parenthesis is required. */ template - TFEL_HOST_DEVICE constexpr auto - operator|(const TensorType1&, const TensorType2&) noexcept requires( - !isInvalid< - BinaryOperationResult>()); + TFEL_HOST_DEVICE constexpr auto operator|(const TensorType1&, + const TensorType2&) noexcept + requires(!isInvalid< + BinaryOperationResult>()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/Tensor/TensorConceptOperations.ixx b/include/TFEL/Math/Tensor/TensorConceptOperations.ixx index 60002c8d1..c5af70a44 100644 --- a/include/TFEL/Math/Tensor/TensorConceptOperations.ixx +++ b/include/TFEL/Math/Tensor/TensorConceptOperations.ixx @@ -18,10 +18,11 @@ namespace tfel::math { template - TFEL_HOST_DEVICE constexpr auto - operator|(const TensorType1& a, const TensorType2& b) noexcept requires( - !isInvalid< - BinaryOperationResult>()) { + TFEL_HOST_DEVICE constexpr auto operator|(const TensorType1& a, + const TensorType2& b) noexcept + requires(!isInvalid< + BinaryOperationResult>()) + { constexpr auto N = getSpaceDimension(); static_assert((N == 1u) || (N == 2u) || (N == 3u)); static_assert(N == getSpaceDimension()); diff --git a/include/TFEL/Math/Tensor/TensorProduct.hxx b/include/TFEL/Math/Tensor/TensorProduct.hxx index e54641f55..0c8527c0e 100644 --- a/include/TFEL/Math/Tensor/TensorProduct.hxx +++ b/include/TFEL/Math/Tensor/TensorProduct.hxx @@ -62,14 +62,14 @@ namespace tfel::math { : TensorProductExprBase(std::forward(l), std::forward(r)) {} TFEL_HOST_DEVICE constexpr typename TensorProductExprBase::NumType - operator()(const typename TensorProductExprBase::IndexType i) const - noexcept { + operator()(const typename TensorProductExprBase::IndexType i) + const noexcept { return (this->a(i)) * (this->b(i)); } // end of operator() TFEL_HOST_DEVICE constexpr auto operator[]( - const typename TensorProductExprBase::IndexType i) const - noexcept { + const typename TensorProductExprBase::IndexType i) + const noexcept { return this->operator()(i); } // end of operator[] }; @@ -84,8 +84,8 @@ namespace tfel::math { : TensorProductExprBase(std::forward(l), std::forward(r)) {} TFEL_HOST_DEVICE constexpr typename TensorProductExprBase::NumType - operator()(const typename TensorProductExprBase::IndexType i) const - noexcept { + operator()(const typename TensorProductExprBase::IndexType i) + const noexcept { typedef typename TensorProductExprBase::NumType T; switch (i) { case 0: @@ -103,8 +103,8 @@ namespace tfel::math { } // end of operator() TFEL_HOST_DEVICE constexpr auto operator[]( - const typename TensorProductExprBase::IndexType i) const - noexcept { + const typename TensorProductExprBase::IndexType i) + const noexcept { return this->operator()(i); } // end of operator[] }; @@ -116,8 +116,8 @@ namespace tfel::math { : TensorProductExprBase(std::forward(l), std::forward(r)) {} TFEL_HOST_DEVICE constexpr typename TensorProductExprBase::NumType - operator()(const typename TensorProductExprBase::IndexType i) const - noexcept { + operator()(const typename TensorProductExprBase::IndexType i) + const noexcept { using namespace std; typedef typename TensorProductExprBase::NumType T; switch (i) { @@ -153,8 +153,8 @@ namespace tfel::math { } // end of operator() TFEL_HOST_DEVICE constexpr auto operator[]( - const typename TensorProductExprBase::IndexType i) const - noexcept { + const typename TensorProductExprBase::IndexType i) + const noexcept { return this->operator()(i); } // end of operator[] diff --git a/include/TFEL/Math/Tensor/TensorTransposeExpr.hxx b/include/TFEL/Math/Tensor/TensorTransposeExpr.hxx index 91cdd59ec..2d95c8b4e 100644 --- a/include/TFEL/Math/Tensor/TensorTransposeExpr.hxx +++ b/include/TFEL/Math/Tensor/TensorTransposeExpr.hxx @@ -31,8 +31,8 @@ namespace tfel::math { using IndexType = index_type; using NumType = numeric_type; - TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() const - noexcept { + TFEL_HOST_DEVICE constexpr RunTimeProperties getRunTimeProperties() + const noexcept { return EmptyRunTimeProperties(); } @@ -64,8 +64,8 @@ namespace tfel::math { } // end of operator[] TFEL_HOST_DEVICE constexpr typename TensorTransposeExprBase::NumType - operator()(const typename TensorTransposeExprBase::IndexType i) const - noexcept { + operator()( + const typename TensorTransposeExprBase::IndexType i) const noexcept { return this->a(i); } // end of operator() }; @@ -84,8 +84,8 @@ namespace tfel::math { } // end of operator[] TFEL_HOST_DEVICE constexpr typename TensorTransposeExprBase::NumType - operator()(const typename TensorTransposeExprBase::IndexType i) const - noexcept { + operator()( + const typename TensorTransposeExprBase::IndexType i) const noexcept { constexpr typename TensorTransposeExprBase::NumType zero{0}; switch (i) { case 0: @@ -124,8 +124,8 @@ namespace tfel::math { } // end of operator[] TFEL_HOST_DEVICE constexpr typename TensorTransposeExprBase::NumType - operator()(const typename TensorTransposeExprBase::IndexType i) const - noexcept { + operator()( + const typename TensorTransposeExprBase::IndexType i) const noexcept { constexpr typename TensorTransposeExprBase::NumType zero{0}; switch (i) { case 0: diff --git a/include/TFEL/Math/Tensor/tensor.ixx b/include/TFEL/Math/Tensor/tensor.ixx index d5d73bd02..8f64c037e 100644 --- a/include/TFEL/Math/Tensor/tensor.ixx +++ b/include/TFEL/Math/Tensor/tensor.ixx @@ -138,8 +138,10 @@ namespace tfel::math { } // end of copy template - TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const tensor& t, const auto p) noexcept requires(isScalar()) { + TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray(const tensor& t, + const auto p) noexcept + requires(isScalar()) + { tfel::fsalgo::transform::value>::exe( t.cbegin(), p, [](const auto& v) { return base_type_cast(v); }); } diff --git a/include/TFEL/Math/Vector/VectorConcept.hxx b/include/TFEL/Math/Vector/VectorConcept.hxx index 6a65782d2..dea9dcd28 100644 --- a/include/TFEL/Math/Vector/VectorConcept.hxx +++ b/include/TFEL/Math/Vector/VectorConcept.hxx @@ -42,7 +42,7 @@ namespace tfel::math { template concept VectorConcept = (std::is_same_v::ConceptTag, - VectorTag>)&& // + VectorTag>) && // (requires(const VectorType t, const index_type i) { t[i]; }) && // diff --git a/include/TFEL/Math/Vector/VectorConceptOperations.hxx b/include/TFEL/Math/Vector/VectorConceptOperations.hxx index ff88d51a9..35dcd2e83 100644 --- a/include/TFEL/Math/Vector/VectorConceptOperations.hxx +++ b/include/TFEL/Math/Vector/VectorConceptOperations.hxx @@ -93,8 +93,8 @@ namespace tfel::math { * an operation : use of parenthesis is required. */ template - TFEL_HOST_DEVICE constexpr auto operator|(const T1&, const T2&) requires( - !isInvalid>()); + TFEL_HOST_DEVICE constexpr auto operator|(const T1&, const T2&) + requires(!isInvalid>()); /*! * \brief return the euclidian norm of a tvector @@ -102,8 +102,8 @@ namespace tfel::math { * \return const typename tfel::typetraits::RealPartType::type, the result */ template - TFEL_HOST_DEVICE auto norm(const T1& v) requires( - !isInvalid>()); + TFEL_HOST_DEVICE auto norm(const T1& v) + requires(!isInvalid>()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/Vector/VectorConceptOperations.ixx b/include/TFEL/Math/Vector/VectorConceptOperations.ixx index 42fec6190..8ed3cd60a 100644 --- a/include/TFEL/Math/Vector/VectorConceptOperations.ixx +++ b/include/TFEL/Math/Vector/VectorConceptOperations.ixx @@ -18,16 +18,18 @@ namespace tfel::math { template - TFEL_HOST_DEVICE constexpr auto operator|(const T1& a, const T2& b) requires( - !isInvalid>()) { + TFEL_HOST_DEVICE constexpr auto operator|(const T1& a, const T2& b) + requires(!isInvalid>()) + { typedef BinaryOperationResult Result; typedef BinaryOperationHandler Handle; return Handle::template exe(a, b); } template - TFEL_HOST_DEVICE auto norm(const T1& v) requires( - !isInvalid>()) { + TFEL_HOST_DEVICE auto norm(const T1& v) + requires(!isInvalid>()) + { return power<1, 2>(real(v | v)); } diff --git a/include/TFEL/Math/Vector/tvector.ixx b/include/TFEL/Math/Vector/tvector.ixx index c25793caa..09bacd5a5 100644 --- a/include/TFEL/Math/Vector/tvector.ixx +++ b/include/TFEL/Math/Vector/tvector.ixx @@ -61,15 +61,17 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const tvector& v, - OutputIterator p) noexcept requires(isScalar()) { + const tvector& v, OutputIterator p) noexcept + requires(isScalar()) + { tfel::fsalgo::transform::exe( v.begin(), p, [](const auto& value) { return base_type_cast(value); }); } // end of exportToBaseTypePointer template - TFEL_HOST_DEVICE constexpr auto norm( - const tvector& vec) noexcept requires(isScalar()) { + TFEL_HOST_DEVICE constexpr auto norm(const tvector& vec) noexcept + requires(isScalar()) + { typedef result_type squareT; return power<1, 2>( real(dotProduct::exe(vec.begin(), vec.begin(), squareT(0u)))); @@ -192,12 +194,13 @@ namespace tfel::math { } // end of slice template - TFEL_HOST_DEVICE constexpr auto - map(tvector>>& v) noexcept requires( - (!isScalar()) && (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())) { + TFEL_HOST_DEVICE constexpr auto map( + tvector>>& v) noexcept + requires((!isScalar()) && (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())) + { static_assert(N >= getUnderlyingArrayMinimalSize(), "invalid vector size"); return map(v.data()); @@ -206,11 +209,11 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto map( const tvector>>& v) noexcept // - requires((!isScalar()) && - (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())) { + requires((!isScalar()) && (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())) + { static_assert(N >= getUnderlyingArrayMinimalSize(), "invalid vector size"); return map(v.data()); @@ -221,11 +224,13 @@ namespace tfel::math { typename IndexingPolicyType, unsigned short N, typename real> - TFEL_HOST_DEVICE constexpr auto map(tvector& v) noexcept requires( - (!std::is_const_v)&&(IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename MappedType::indexing_policy>())) { + TFEL_HOST_DEVICE constexpr auto map(tvector& v) noexcept + requires((!std::is_const_v) && + (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename MappedType::indexing_policy>())) + { static_assert( N >= offset + getUnderlyingArrayMinimalSize(), "invalid vector size"); @@ -237,12 +242,12 @@ namespace tfel::math { typename IndexingPolicyType, unsigned short N, typename real> - TFEL_HOST_DEVICE constexpr auto - map(const tvector& v) noexcept requires( - (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())) { + TFEL_HOST_DEVICE constexpr auto map(const tvector& v) noexcept + requires((IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())) + { static_assert( N >= offset + getUnderlyingArrayMinimalSize(), "invalid vector size"); @@ -254,9 +259,10 @@ namespace tfel::math { unsigned short offset, unsigned short stride, unsigned short N> - TFEL_HOST_DEVICE constexpr auto - map(tvector>& v) noexcept requires( - !std::is_const_v) { + TFEL_HOST_DEVICE constexpr auto map( + tvector>& v) noexcept + requires(!std::is_const_v) + { constexpr auto mstride = getViewsArrayMinimalStride(); static_assert(stride >= mstride, "invalid stride"); static_assert(N >= offset + M * mstride, "invalid vector size"); diff --git a/include/TFEL/Math/fsarray.hxx b/include/TFEL/Math/fsarray.hxx index 81dad64eb..182e2698b 100644 --- a/include/TFEL/Math/fsarray.hxx +++ b/include/TFEL/Math/fsarray.hxx @@ -80,7 +80,7 @@ namespace tfel::math { // class template argument deduction template - fsarray(T&&... t)->fsarray>; + fsarray(T&&... t) -> fsarray>; /*! * \tparam N: arrray size diff --git a/include/TFEL/Math/matrix.hxx b/include/TFEL/Math/matrix.hxx index b0839eb2c..300b3eeac 100644 --- a/include/TFEL/Math/matrix.hxx +++ b/include/TFEL/Math/matrix.hxx @@ -68,8 +68,8 @@ namespace tfel::math { */ template matrix& operator=( - const std::initializer_list>&) requires(isAssignableTo()); + const std::initializer_list>&) + requires(isAssignableTo()); /*! * \brief swap two matrixs * \param[in,out] the other matrix @@ -97,7 +97,7 @@ namespace tfel::math { */ template matrix(const std::initializer_list>&) - ->matrix; + -> matrix; } // end of namespace tfel::math diff --git a/include/TFEL/Math/power.hxx b/include/TFEL/Math/power.hxx index e3cd5eb4f..8228d4529 100644 --- a/include/TFEL/Math/power.hxx +++ b/include/TFEL/Math/power.hxx @@ -32,7 +32,8 @@ namespace tfel::math { * \tparam D: */ template - requires(D != 0) struct UnaryResultType> { + requires(D != 0) + struct UnaryResultType> { using type = float; }; /*! @@ -43,7 +44,8 @@ namespace tfel::math { * \tparam D: */ template - requires(D != 0) struct UnaryResultType> { + requires(D != 0) + struct UnaryResultType> { using type = double; }; /*! @@ -54,7 +56,8 @@ namespace tfel::math { * \tparam D: */ template - requires(D != 0) struct UnaryResultType> { + requires(D != 0) + struct UnaryResultType> { using type = long double; }; /*! @@ -72,7 +75,7 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE auto power(const std::floating_point auto) noexcept // - requires(D != 0); + requires(D != 0); } // end of namespace tfel::math diff --git a/include/TFEL/Math/power.ixx b/include/TFEL/Math/power.ixx index 56cc7db0f..ebb8189a5 100644 --- a/include/TFEL/Math/power.ixx +++ b/include/TFEL/Math/power.ixx @@ -192,8 +192,9 @@ namespace tfel::math { } template - TFEL_HOST_DEVICE auto power( - const std::floating_point auto x) noexcept requires(D != 0) { + TFEL_HOST_DEVICE auto power(const std::floating_point auto x) noexcept + requires(D != 0) + { return tfel::math::internals::PowerImplSelector::type::exe(x); } diff --git a/include/TFEL/Math/qt.hxx b/include/TFEL/Math/qt.hxx index 3014a304c..14dd0ae5d 100644 --- a/include/TFEL/Math/qt.hxx +++ b/include/TFEL/Math/qt.hxx @@ -54,10 +54,10 @@ namespace tfel::math::internals { */ template TFEL_HOST_DEVICE constexpr explicit QuantityValueOwnershipPolicy( - const T& src) noexcept // - requires((std::is_constructible_v)&& // - (std::is_convertible_v)&& // - (!AllowImplicitConversion)) + const T& src) noexcept // + requires((std::is_constructible_v) && // + (std::is_convertible_v) && // + (!AllowImplicitConversion)) : value(src) {} /*! * \brief constructor from a value @@ -65,10 +65,10 @@ namespace tfel::math::internals { */ template TFEL_HOST_DEVICE constexpr QuantityValueOwnershipPolicy( - const T& src) noexcept // - requires((std::is_constructible_v)&& // - (std::is_convertible_v)&& // - (AllowImplicitConversion)) + const T& src) noexcept // + requires((std::is_constructible_v) && // + (std::is_convertible_v) && // + (AllowImplicitConversion)) : value(src) {} //! \brief return the value TFEL_HOST_DEVICE constexpr ValueType& getValue() noexcept { @@ -89,26 +89,29 @@ namespace tfel::math::internals { * \param src: the src. */ template - TFEL_HOST_DEVICE constexpr QuantityValueOwnershipPolicy& - operator=(const T& src) noexcept requires( - (std::is_constructible_v)&& // - (std::is_convertible_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr QuantityValueOwnershipPolicy& operator=( + const T& src) noexcept + requires((std::is_constructible_v) && // + (std::is_convertible_v) && // + (AllowImplicitConversion)) + { this->value = src; return *this; } //! \brief conversion operator template - TFEL_HOST_DEVICE constexpr operator T&() noexcept requires( - (std::is_same_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr operator T&() noexcept + requires((std::is_same_v) && // + (AllowImplicitConversion)) + { return this->value; } //! \brief conversion operator template - TFEL_HOST_DEVICE constexpr operator T() const - noexcept requires((std::is_same_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr operator T() const noexcept + requires((std::is_same_v) && // + (AllowImplicitConversion)) + { return this->value; } //! \brief destructor @@ -155,26 +158,29 @@ namespace tfel::math::internals { * \param src: the src. */ template - TFEL_HOST_DEVICE constexpr QuantityReferenceOwnershipPolicy& - operator=(const T& src) noexcept requires( - (std::is_constructible_v)&& // - (std::is_convertible_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr QuantityReferenceOwnershipPolicy& operator=( + const T& src) noexcept + requires((std::is_constructible_v) && // + (std::is_convertible_v) && // + (AllowImplicitConversion)) + { this->value = src; return *this; } //! \brief conversion operator template - TFEL_HOST_DEVICE constexpr operator T&() noexcept requires( - (std::is_same_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr operator T&() noexcept + requires((std::is_same_v) && // + (AllowImplicitConversion)) + { return this->value; } //! \brief conversion operator template - TFEL_HOST_DEVICE constexpr operator const T&() const - noexcept requires((std::is_same_v)&& // - (AllowImplicitConversion)) { + TFEL_HOST_DEVICE constexpr operator const T&() const noexcept + requires((std::is_same_v) && // + (AllowImplicitConversion)) + { return this->value; } //! \brief destructor @@ -217,36 +223,34 @@ namespace tfel::math { TFEL_HOST_DEVICE constexpr Quantity( const Quantity& src) noexcept // - requires(std::is_same_v, ValueType>) + requires(std::is_same_v, ValueType>) : OwnershipPolicy(src.getValue()) {} // end of Quantity // using OwnershipPolicy::operator=; //! \brief assignement operator template TFEL_HOST_DEVICE constexpr Quantity& operator=( - const Quantity& - src) noexcept requires(std::is_same_v, - ValueType>) { + const Quantity& src) noexcept + requires(std::is_same_v, ValueType>) + { this->getValue() = src.getValue(); return *this; } //! \brief operator += template TFEL_HOST_DEVICE constexpr Quantity& operator+=( - const Quantity& - src) noexcept requires(std::is_same_v, - ValueType>) { + const Quantity& src) noexcept + requires(std::is_same_v, ValueType>) + { this->getValue() += src.getValue(); return *this; } //! \brief operator -= template TFEL_HOST_DEVICE constexpr Quantity& operator-=( - const Quantity& - src) noexcept requires(std::is_same, - ValueType>::value) { + const Quantity& src) noexcept + requires(std::is_same, ValueType>::value) + { this->getValue() -= src.getValue(); return *this; } @@ -256,9 +260,10 @@ namespace tfel::math { * \param[in] a: a scalar */ template - TFEL_HOST_DEVICE constexpr Quantity& - operator*=(const ValueType2& a) noexcept requires( - IsQtScalarOperationValid::cond) { + TFEL_HOST_DEVICE constexpr Quantity& operator*=( + const ValueType2& a) noexcept + requires(IsQtScalarOperationValid::cond) + { this->getValue() *= a; return *this; } @@ -269,9 +274,9 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr Quantity& operator*=( - const Quantity& - a) noexcept requires(IsQtScalarOperationValid::cond) { + const Quantity& a) noexcept + requires(IsQtScalarOperationValid::cond) + { this->getValue() *= a.getValue(); return *this; } @@ -281,9 +286,10 @@ namespace tfel::math { * \param[in] a: a scalar */ template - TFEL_HOST_DEVICE constexpr Quantity& - operator/=(const ValueType2& a) noexcept requires( - IsQtScalarOperationValid::cond) { + TFEL_HOST_DEVICE constexpr Quantity& operator/=( + const ValueType2& a) noexcept + requires(IsQtScalarOperationValid::cond) + { this->getValue() /= a; return *this; } @@ -294,15 +300,15 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr Quantity& operator/=( - const Quantity& - a) noexcept requires(IsQtScalarOperationValid::cond) { + const Quantity& a) noexcept + requires(IsQtScalarOperationValid::cond) + { this->getValue() /= a.getValue(); return *this; } //! \brief negation operator - TFEL_HOST_DEVICE constexpr qt operator-() const - noexcept { + TFEL_HOST_DEVICE constexpr qt operator-() + const noexcept { return qt(-(this->getValue())); } }; // end of struct Quantity @@ -310,7 +316,7 @@ namespace tfel::math { // class template argument deduction guide line template Quantity(Quantity) - ->Quantity; + -> Quantity; template - TFEL_HOST_DEVICE constexpr auto - power(const Quantity& x) requires( - std::is_floating_point_v) { + TFEL_HOST_DEVICE constexpr auto power( + const Quantity& x) + requires(std::is_floating_point_v) + { using Result = typename UnaryResultType, Power>::type; @@ -435,9 +442,10 @@ namespace tfel::math { typename Unit, typename ValueType, typename OwnershipPolicy> - TFEL_HOST_DEVICE constexpr auto - power(const Quantity& x) requires( - std::is_floating_point_v) { + TFEL_HOST_DEVICE constexpr auto power( + const Quantity& x) + requires(std::is_floating_point_v) + { using Result = typename UnaryResultType, Power>::type; diff --git a/include/TFEL/Math/st2tost2.hxx b/include/TFEL/Math/st2tost2.hxx index 2decaa947..5d6944e19 100644 --- a/include/TFEL/Math/st2tost2.hxx +++ b/include/TFEL/Math/st2tost2.hxx @@ -124,33 +124,31 @@ namespace tfel::math { * \return the derivative of the square of a symmetric tensor */ template - TFEL_HOST_DEVICE static constexpr auto - dsquare(const StensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto dsquare(const StensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] s : tensor squared * \param[in] C : derivative of s * \return the derivative of the square of a symmetric tensor */ template - TFEL_HOST_DEVICE static constexpr auto - dsquare(const StensorType&, const ST2toST2Type&) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - ValueType>()); + TFEL_HOST_DEVICE static constexpr auto dsquare(const StensorType&, + const ST2toST2Type&) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + ValueType>()); /*! * convert a T2toST2 to a ST2toST2 * \param[in] src : T2toST2 to be converted */ template - TFEL_HOST_DEVICE static constexpr auto - convert(const T2toST2Type&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto convert(const T2toST2Type&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * build the equivalent st2tost2 from a rotation matrix * \param[in] r : rotation matrix @@ -165,10 +163,9 @@ namespace tfel::math { * \param[in] s: second tensor of the product */ template - TFEL_HOST_DEVICE static constexpr auto - stpd(const StensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto stpd(const StensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); // static constexpr st2tost2 Id() noexcept; static constexpr st2tost2 IxI() noexcept; @@ -185,8 +182,8 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr st2tost2(ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == StensorDimeToSize::value) && - ((d == StensorDimeToSize::value) && ...)); + requires((sizeof...(d) == StensorDimeToSize::value) && + ((d == StensorDimeToSize::value) && ...)); // inheriting GenericFixedSizeArray' access operators using GenericFixedSizeArrayBase::operator[]; using GenericFixedSizeArrayBase::operator(); @@ -208,7 +205,7 @@ namespace tfel::math { */ template st2tost2(ValueType const (&)[M], ValueType const (&... arrays)[d]) - ->st2tost2::value, ValueType>; + -> st2tost2::value, ValueType>; /*! * \brief a simple alias for backward compatibility @@ -248,20 +245,19 @@ namespace tfel::math { * \param[in] F: deformation gradient */ template - TFEL_HOST_DEVICE constexpr auto push_forward( - const ST2toST2Type&, - const TensorType&) noexcept requires(getSpaceDimension() == - getSpaceDimension()); + TFEL_HOST_DEVICE constexpr auto push_forward(const ST2toST2Type&, + const TensorType&) noexcept + requires(getSpaceDimension() == + getSpaceDimension()); /*! * \return the pull-back of a fourth order tensor * \param[in] C: input * \param[in] F: deformation gradient */ template - TFEL_HOST constexpr auto pull_back( - const ST2toST2Type&, - const TensorType&) requires(getSpaceDimension() == - getSpaceDimension()); + TFEL_HOST constexpr auto pull_back(const ST2toST2Type&, const TensorType&) + requires(getSpaceDimension() == + getSpaceDimension()); /*! * \brief compute the second derivative of determinant of a * \param[in] s: tensor diff --git a/include/TFEL/Math/st2tot2.hxx b/include/TFEL/Math/st2tot2.hxx index cce24db27..56b9d54c4 100644 --- a/include/TFEL/Math/st2tot2.hxx +++ b/include/TFEL/Math/st2tot2.hxx @@ -112,47 +112,45 @@ namespace tfel::math { * \return the left part of the derivative of a tensor product */ template - static TFEL_HOST_DEVICE constexpr auto - tpld(const StensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + static TFEL_HOST_DEVICE constexpr auto tpld(const StensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] B : second tensor of the product * \param[in] C : derivative of the first tensor * \return the left part of the derivative of a tensor product */ template - static TFEL_HOST_DEVICE constexpr auto - tpld(const StensorType&, const ST2toST2Type&) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - ValueType>()); + static TFEL_HOST_DEVICE constexpr auto tpld(const StensorType&, + const ST2toST2Type&) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + ValueType>()); /*! * \param[in] A : first tensor of the product * \return the right part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tprd(const StensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tprd(const StensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] A : first tensor of the product * \param[in] C : derivative of the first tensor * \return the right part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tprd(const StensorType&, const ST2toST2Type&) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>, - ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tprd(const StensorType&, + const ST2toST2Type&) noexcept + requires(getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>, + ValueType>()); // TFEL_MATH_FIXED_SIZE_ARRAY_DEFAULT_METHODS(st2tot2, GenericFixedSizeArrayBase); @@ -163,8 +161,8 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr st2tot2(ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == TensorDimeToSize::value) && - ((d == StensorDimeToSize::value) && ...)); + requires((sizeof...(d) == TensorDimeToSize::value) && + ((d == StensorDimeToSize::value) && ...)); // inheriting GenericFixedSizeArray' access operators using GenericFixedSizeArrayBase::operator[]; using GenericFixedSizeArrayBase::operator(); @@ -183,7 +181,7 @@ namespace tfel::math { */ template st2tot2(ValueType const (&)[M], ValueType const (&... arrays)[d]) - ->st2tot2::value, ValueType>; + -> st2tot2::value, ValueType>; /*! * \brief a simple alias for backward compatibility diff --git a/include/TFEL/Math/stensor.hxx b/include/TFEL/Math/stensor.hxx index fa302b737..ce8e2b5ad 100644 --- a/include/TFEL/Math/stensor.hxx +++ b/include/TFEL/Math/stensor.hxx @@ -102,7 +102,7 @@ namespace tfel::math { //! no ordering UNSORTED }; // end of EigenValuesOrdering - }; // end of struct stensor_common + }; // end of struct stensor_common template struct stensor @@ -125,23 +125,23 @@ namespace tfel::math { //! \brief import from external memory location which uses Voigt notations //! for strains template - TFEL_HOST_DEVICE constexpr void - importVoigt(const InputIterator) noexcept requires( - std::is_same_v::value_type, - base_type>); + TFEL_HOST_DEVICE constexpr void importVoigt(const InputIterator) noexcept + requires(std::is_same_v< + typename std::iterator_traits::value_type, + base_type>); //! \brief import from external memory location which uses Voigt notations //! for stresses template - TFEL_HOST_DEVICE constexpr void - importTab(const InputIterator) noexcept requires( - std::is_same_v::value_type, - base_type>); + TFEL_HOST_DEVICE constexpr void importTab(const InputIterator) noexcept + requires(std::is_same_v< + typename std::iterator_traits::value_type, + base_type>); //! \brief import values from external memory location template - TFEL_HOST_DEVICE constexpr void - import(const InputIterator) noexcept requires( - std::is_same_v::value_type, - base_type>); + TFEL_HOST_DEVICE constexpr void import(const InputIterator) noexcept + requires(std::is_same_v< + typename std::iterator_traits::value_type, + base_type>); /*! * \brief export to external memory location using Voigt notations for0 * stresses @@ -297,9 +297,9 @@ namespace tfel::math { * \param[in] m : matrix */ template - TFEL_HOST_DEVICE static constexpr auto - buildFromMatrix(const MatrixType&) noexcept requires( - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto buildFromMatrix( + const MatrixType&) noexcept + requires(isAssignableTo, ValueType>()); /*! * build a symmetric tensor from the diadic product of a vector with @@ -307,11 +307,12 @@ namespace tfel::math { * \param[in] v : vector */ template - TFEL_HOST_DEVICE static constexpr auto - buildFromVectorDiadicProduct(const VectorType&) noexcept requires( - isAssignableTo, - Power<2>>::Result, - ValueType>()); + TFEL_HOST_DEVICE static constexpr auto buildFromVectorDiadicProduct( + const VectorType&) noexcept + requires( + isAssignableTo, + Power<2>>::Result, + ValueType>()); /*! * build a symmetric tensor from the symmetric diadic product of two @@ -321,11 +322,12 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE static constexpr auto - buildFromVectorsSymmetricDiadicProduct(const VectorType&, const VectorType2&) noexcept requires( - isAssignableTo, - numeric_type, - OpMult>, - ValueType>()); + buildFromVectorsSymmetricDiadicProduct(const VectorType&, + const VectorType2&) noexcept + requires(isAssignableTo, + numeric_type, + OpMult>, + ValueType>()); /*! * build a symmetric tensor from its eigen values and vectors @@ -481,9 +483,9 @@ namespace tfel::math { StensorType&, StensorType&, const rotation_matrix&) noexcept // - requires((getSpaceDimension() == N) && - (isAssignableTo, - numeric_type>())); + requires( + (getSpaceDimension() == N) && + (isAssignableTo, numeric_type>())); /*! * \return the eigentensors * \param[in] m: eigenvectors @@ -503,9 +505,9 @@ namespace tfel::math { StensorType&, StensorType&, const rotation_matrix&) noexcept // - requires((getSpaceDimension() == N) && - (isAssignableTo, - numeric_type>())); + requires( + (getSpaceDimension() == N) && + (isAssignableTo, numeric_type>())); /*! * \brief compute the "eigentensors" derivatives * \param[out] dn0_ds: derivative of the first eigentensor @@ -523,11 +525,11 @@ namespace tfel::math { const tvector<3u, ValueType>&, const rotation_matrix&, const ValueType) // - requires( - (getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult, ValueType, OpDiv>, - numeric_type>())); + requires( + (getSpaceDimension() == N) && + (isAssignableTo< + BinaryOperationResult, ValueType, OpDiv>, + numeric_type>())); /*! * \brief compute an isotropic function * \param[in] f: function @@ -580,13 +582,12 @@ namespace tfel::math { const tvector<3u, T2>&, const tvector<3u, ValueType>&, const rotation_matrix&, - const ValueType) requires((getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult< - base_type, - ValueType, - OpDiv>, - numeric_type>())); + const ValueType) + requires( + (getSpaceDimension() == N) && + (isAssignableTo< + BinaryOperationResult, ValueType, OpDiv>, + numeric_type>())); /*! * compute the derivative of an isotropic function * \param[out] d: result @@ -623,13 +624,12 @@ namespace tfel::math { const FunctionDerivative&, const tvector<3u, ValueType>&, const rotation_matrix&, - const ValueType) requires((getSpaceDimension() == N) && - (isAssignableTo< - BinaryOperationResult< - base_type, - ValueType, - OpDiv>, - numeric_type>())); + const ValueType) + requires( + (getSpaceDimension() == N) && + (isAssignableTo< + BinaryOperationResult, ValueType, OpDiv>, + numeric_type>())); /*! * \return the value of an isotropic function * \param[in] f: function @@ -674,9 +674,8 @@ namespace tfel::math { // class template argument deduction template - stensor(T&&... t) - ->stensor::value, - std::common_type_t>; + stensor(T&&... t) -> stensor::value, + std::common_type_t>; /*! * \brief a simple alias for backward compatibility @@ -696,8 +695,9 @@ namespace tfel::math { * \brief export the given vector to an array */ template - TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const stensor&, OutputIterator) noexcept requires(isScalar()); + TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray(const stensor&, + OutputIterator) noexcept + requires(isScalar()); /*! * compute the tresca stress @@ -770,40 +770,36 @@ namespace tfel::math { * \param b : if true, refinement of eigen values is performed */ template - TFEL_HOST_DEVICE auto - logarithm(const StensorType&, const bool = false) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + TFEL_HOST_DEVICE auto logarithm(const StensorType&, const bool = false) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief compute the absolute value of a symmetric tensor * \param s : tensor * \param b : if true, refinement of eigen values is performed */ template - TFEL_HOST_DEVICE auto - absolute_value(const StensorType&, const bool = false) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + TFEL_HOST_DEVICE auto absolute_value(const StensorType&, const bool = false) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief compute the positive part of a symmetric tensor * \param s : tensor * \param b : if true, refinement of eigen values is performed */ template - TFEL_HOST_DEVICE auto - positive_part(const StensorType&, const bool = false) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + TFEL_HOST_DEVICE auto positive_part(const StensorType&, const bool = false) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief compute the negative part of a symmetric tensor * \param s : tensor * \param b : if true, refinement of eigen values is performed */ template - TFEL_HOST_DEVICE auto - negative_part(const StensorType&, const bool = false) requires( - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + TFEL_HOST_DEVICE auto negative_part(const StensorType&, const bool = false) + requires(tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \return the square of a symmetric stensor * \param[in] s : squared tensor @@ -876,11 +872,10 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto convertCorotationnalCauchyStressToSecondPiolaKirchhoffStress( - const T&, - const T2&) noexcept requires((getSpaceDimension() == - getSpaceDimension()) && - (tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond)); + const T&, const T2&) noexcept + requires( + (getSpaceDimension() == getSpaceDimension()) && + (tfel::typetraits::IsFundamentalNumericType>::cond)); /*! * \brief convert the second Piola-Kirchhoff stress to the * corotationnal cauchy stress: @@ -895,11 +890,10 @@ namespace tfel::math { template TFEL_HOST_DEVICE constexpr auto convertSecondPiolaKirchhoffStressToCorotationnalCauchyStress( - const T&, - const T2&) noexcept requires((getSpaceDimension() == - getSpaceDimension()) && - (tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond)); + const T&, const T2&) noexcept + requires( + (getSpaceDimension() == getSpaceDimension()) && + (tfel::typetraits::IsFundamentalNumericType>::cond)); /*! * \brief return the symmetric product of two stensors as a symmetric tensor: * \f[ @@ -909,9 +903,10 @@ namespace tfel::math { * \param[in] s2: second tensor */ template - TFEL_HOST_DEVICE constexpr auto - symmetric_product(const StensorType1&, const StensorType2&) noexcept requires( - getSpaceDimension() == getSpaceDimension()); + TFEL_HOST_DEVICE constexpr auto symmetric_product( + const StensorType1&, const StensorType2&) noexcept + requires(getSpaceDimension() == + getSpaceDimension()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/t2tost2.hxx b/include/TFEL/Math/t2tost2.hxx index e6d410cda..5d60af592 100644 --- a/include/TFEL/Math/t2tost2.hxx +++ b/include/TFEL/Math/t2tost2.hxx @@ -120,20 +120,20 @@ namespace tfel::math { * with respect to the deformation gradient */ template - TFEL_HOST_DEVICE static TFEL_HOST_DEVICE constexpr auto - dCdF(const TensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static TFEL_HOST_DEVICE constexpr auto dCdF( + const TensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] F : deformation gradient * \return the derivative of the Cauchy left symmetric tensor * with respect to the deformation gradient */ template - TFEL_HOST_DEVICE static TFEL_HOST_DEVICE constexpr auto - dBdF(const TensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static TFEL_HOST_DEVICE constexpr auto dBdF( + const TensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); // TFEL_MATH_FIXED_SIZE_ARRAY_DEFAULT_METHODS(t2tost2, GenericFixedSizeArrayBase); @@ -144,8 +144,8 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr t2tost2(ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == StensorDimeToSize::value) && - ((d == TensorDimeToSize::value) && ...)); + requires((sizeof...(d) == StensorDimeToSize::value) && + ((d == TensorDimeToSize::value) && ...)); // inheriting GenericFixedSizeArray' access operators using GenericFixedSizeArrayBase::operator[]; using GenericFixedSizeArrayBase::operator(); @@ -164,7 +164,7 @@ namespace tfel::math { */ template t2tost2(ValueType const (&)[M], ValueType const (&... arrays)[d]) - ->t2tost2::value, ValueType>; + -> t2tost2::value, ValueType>; /*! * \brief a simple alias for backward compatibility @@ -219,12 +219,12 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief compute the Cauchy stress derivative from the Kirchhoff stress * derivative @@ -240,12 +240,12 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \return the derivative of the push-forward of a symmetric * second order tensor with respect to the deformation gradient @@ -267,12 +267,12 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires(getSpaceDimension() == - getSpaceDimension() && - getSpaceDimension() == - getSpaceDimension() && - tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond); + requires(getSpaceDimension() == + getSpaceDimension() && + getSpaceDimension() == + getSpaceDimension() && + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond); /*! * \brief compute de derivative of the push-forward of a symmetric * second order tensor with respect to the deformation gradient @@ -297,10 +297,10 @@ namespace tfel::math { const T2toST2Type&, const StensorType&, const TensorType&) noexcept // - requires(tfel::typetraits::IsFundamentalNumericType< - numeric_type>::cond&& - isAssignableTo< - typename ComputeBinaryResult, + requires( + tfel::typetraits::IsFundamentalNumericType< + numeric_type>::cond && + isAssignableTo, numeric_type, OpPlus>::Result, numeric_type>()); diff --git a/include/TFEL/Math/t2tot2.hxx b/include/TFEL/Math/t2tot2.hxx index 999d69ec9..6c869d072 100644 --- a/include/TFEL/Math/t2tot2.hxx +++ b/include/TFEL/Math/t2tot2.hxx @@ -123,47 +123,47 @@ namespace tfel::math { * \return the left part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tpld(const TensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tpld(const TensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] B : second tensor of the product * \param[in] C : derivative of the first tensor * \return the left part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tpld(const TensorType&, const T2toT2Type&) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>::Result, - ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tpld(const TensorType&, + const T2toT2Type&) noexcept + requires( + getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>::Result, + ValueType>()); /*! * \param[in] A : first tensor of the product * \return the right part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tprd(const TensorType&) noexcept requires( - getSpaceDimension() == N && - isAssignableTo, ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tprd(const TensorType&) noexcept + requires(getSpaceDimension() == N && + isAssignableTo, ValueType>()); /*! * \param[in] A : first tensor of the product * \param[in] C : derivative of the first tensor * \return the right part of the derivative of a tensor product */ template - TFEL_HOST_DEVICE static constexpr auto - tprd(const TensorType&, const T2toT2Type&) noexcept requires( - getSpaceDimension() == N && - getSpaceDimension() == N && - isAssignableTo, - numeric_type, - OpMult>::Result, - ValueType>()); + TFEL_HOST_DEVICE static constexpr auto tprd(const TensorType&, + const T2toT2Type&) noexcept + requires( + getSpaceDimension() == N && + getSpaceDimension() == N && + isAssignableTo, + numeric_type, + OpMult>::Result, + ValueType>()); /*! * \return the derivative of the transpose of a tensor with respect of * this tensor @@ -183,9 +183,9 @@ namespace tfel::math { * \param[in] v : values */ template - TFEL_HOST_DEVICE constexpr t2tot2(const T2toST2Type&) noexcept requires( - (isAssignableTo, ValueType>()) && - (getSpaceDimension() == N)); + TFEL_HOST_DEVICE constexpr t2tot2(const T2toST2Type&) noexcept + requires((isAssignableTo, ValueType>()) && + (getSpaceDimension() == N)); /*! * \brief constructors from arrays to implement class * template argument deduction. @@ -193,8 +193,8 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr t2tot2(ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == TensorDimeToSize::value) && - ((d == TensorDimeToSize::value) && ...)); + requires((sizeof...(d) == TensorDimeToSize::value) && + ((d == TensorDimeToSize::value) && ...)); // TFEL_MATH_FIXED_SIZE_ARRAY_DEFAULT_METHODS(t2tot2, GenericFixedSizeArrayBase); @@ -216,7 +216,7 @@ namespace tfel::math { */ template t2tot2(ValueType const (&)[M], ValueType const (&... arrays)[d]) - ->t2tot2::value, ValueType>; + -> t2tot2::value, ValueType>; /*! * \brief a simple alias for backward compatibility @@ -260,15 +260,15 @@ namespace tfel::math { * \param[in] s: tensor */ template - TFEL_HOST_DEVICE constexpr auto - computeDeterminantSecondDerivative(const TensorType&) noexcept requires( - isScalar>()); + TFEL_HOST_DEVICE constexpr auto computeDeterminantSecondDerivative( + const TensorType&) noexcept + requires(isScalar>()); template TFEL_HOST_DEVICE constexpr void convert( t2tot2(), T>&, const T2toST2Type&) noexcept // - requires(isAssignableTo, T>()); + requires(isAssignableTo, T>()); } // end of namespace tfel::math diff --git a/include/TFEL/Math/tensor.hxx b/include/TFEL/Math/tensor.hxx index 5f5ce0e87..c9c851022 100644 --- a/include/TFEL/Math/tensor.hxx +++ b/include/TFEL/Math/tensor.hxx @@ -107,8 +107,8 @@ namespace tfel::math { // inheriting GenericFixedSizeArray' access operators using GenericFixedSizeArray< tensor, - FixedSizeVectorPolicy::value, ValueType>>:: - operator[]; + FixedSizeVectorPolicy::value, + ValueType>>::operator[]; /*! * \brief access operator * \param[in] i: index @@ -130,8 +130,8 @@ namespace tfel::math { const typename tensor::size_type, const typename tensor::size_type) const; //! \brief write to an external memory location - TFEL_HOST_DEVICE constexpr void write(base_type* const) const - noexcept; + TFEL_HOST_DEVICE constexpr void write( + base_type* const) const noexcept; //! \brief import values from an external memory location TFEL_HOST_DEVICE constexpr void import( const base_type* const) noexcept; @@ -144,8 +144,8 @@ namespace tfel::math { // class template argument deduction template - tensor(T&&... t) - ->tensor::value, std::common_type_t>; + tensor(T&&... t) -> tensor::value, + std::common_type_t>; /*! * \brief a simple alias for backward compatibility @@ -163,8 +163,9 @@ namespace tfel::math { using ConstTensorView = ConstView>; template - TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const tensor&, const auto) noexcept requires(isScalar()); + TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray(const tensor&, + const auto) noexcept + requires(isScalar()); /*! * \return the invert of a tensor * \param[in] t : tensor to be inverted diff --git a/include/TFEL/Math/tmatrix.hxx b/include/TFEL/Math/tmatrix.hxx index 4e1013764..51ac99ece 100644 --- a/include/TFEL/Math/tmatrix.hxx +++ b/include/TFEL/Math/tmatrix.hxx @@ -252,7 +252,7 @@ namespace tfel::math { */ template TFEL_HOST_DEVICE constexpr tmatrix(ValueType const (&... arrays)[d]) // - requires((sizeof...(d) == N) && ((d == M) && ...)); + requires((sizeof...(d) == N) && ((d == M) && ...)); //! \return the identity matrix TFEL_HOST_DEVICE static constexpr auto Id(); // inheriting GenericFixedSizeArray' access operators @@ -367,7 +367,7 @@ namespace tfel::math { */ template tmatrix(ValueType const (&)[M], ValueType const (&... arrays)[d]) - ->tmatrix<1u + sizeof...(d), M, ValueType>; + -> tmatrix<1u + sizeof...(d), M, ValueType>; /*! * \brief a simple alias for backward compatibility diff --git a/include/TFEL/Math/tvector.hxx b/include/TFEL/Math/tvector.hxx index b3b7c68a9..ea6f06b03 100644 --- a/include/TFEL/Math/tvector.hxx +++ b/include/TFEL/Math/tvector.hxx @@ -168,12 +168,13 @@ namespace tfel::math { * export the given vector to an array of the */ template - TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray( - const tvector&, OutputIterator) noexcept requires(isScalar()); + TFEL_HOST_DEVICE constexpr void exportToBaseTypeArray(const tvector&, + OutputIterator) noexcept + requires(isScalar()); template TFEL_HOST_DEVICE constexpr auto norm(const tvector&) noexcept // - requires(isScalar()); + requires(isScalar()); template TFEL_HOST_DEVICE constexpr auto abs(const tvector& v) noexcept; @@ -249,12 +250,12 @@ namespace tfel::math { typename IndexingPolicyType = typename std::remove_cv_t::indexing_policy, unsigned short N> - TFEL_HOST_DEVICE constexpr auto - map(tvector>>&) noexcept requires( - (!isScalar()) && (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())); + TFEL_HOST_DEVICE constexpr auto map( + tvector>>&) noexcept + requires((!isScalar()) && (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())); /*! * \brief create a constant view of a math object from a tiny vector @@ -267,12 +268,12 @@ namespace tfel::math { typename IndexingPolicyType = typename std::remove_cv_t::indexing_policy, unsigned short N> - TFEL_HOST_DEVICE constexpr auto - map(const tvector>>&) noexcept requires( - (!isScalar()) && (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())); + TFEL_HOST_DEVICE constexpr auto map( + const tvector>>&) noexcept + requires((!isScalar()) && (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())); /*! * \brief create a view of a math object from a tiny vector * \tparam MappedType : type of mapped object @@ -286,11 +287,12 @@ namespace tfel::math { typename IndexingPolicyType = typename MappedType::indexing_policy, unsigned short N, typename real> - TFEL_HOST_DEVICE constexpr auto map(tvector&) noexcept requires( - (!std::is_const_v)&&(IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename MappedType::indexing_policy>())); + TFEL_HOST_DEVICE constexpr auto map(tvector&) noexcept + requires((!std::is_const_v) && + (IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename MappedType::indexing_policy>())); /*! * \brief create a constant view of a math object from a tiny vector @@ -306,12 +308,11 @@ namespace tfel::math { typename std::remove_cv_t::indexing_policy, unsigned short N, typename real> - TFEL_HOST_DEVICE constexpr auto - map(const tvector&) noexcept requires( - (IndexingPolicyType::hasFixedSizes) && - (checkIndexingPoliciesCompatiblity< - IndexingPolicyType, - typename std::remove_cv_t::indexing_policy>())); + TFEL_HOST_DEVICE constexpr auto map(const tvector&) noexcept + requires((IndexingPolicyType::hasFixedSizes) && + (checkIndexingPoliciesCompatiblity< + IndexingPolicyType, + typename std::remove_cv_t::indexing_policy>())); /*! * \brief create a view on an array of fixed sized math objects from a tiny @@ -326,9 +327,9 @@ namespace tfel::math { unsigned short offset = 0u, unsigned short stride = getViewsArrayMinimalStride(), unsigned short N> - TFEL_HOST_DEVICE constexpr auto - map(tvector>&) noexcept requires( - !std::is_const_v); + TFEL_HOST_DEVICE constexpr auto map( + tvector>&) noexcept + requires(!std::is_const_v); /*! * \brief create a const view on an array of fixed sized math objects from a * tiny vector @@ -413,7 +414,7 @@ namespace tfel::math { // class template argument deduction template - tvector(T&&... t)->tvector>; + tvector(T&&... t) -> tvector>; } // end of namespace tfel::math diff --git a/include/TFEL/Metaprogramming/HasRandomAccessConstIterator.hxx b/include/TFEL/Metaprogramming/HasRandomAccessConstIterator.hxx index 423c65bed..8aa84a4f4 100644 --- a/include/TFEL/Metaprogramming/HasRandomAccessConstIterator.hxx +++ b/include/TFEL/Metaprogramming/HasRandomAccessConstIterator.hxx @@ -50,10 +50,10 @@ namespace tfel::meta { * Can only be called if B defines a random access const iterator. */ template - static Small Test(const Subs) requires( - std::is_same::iterator_category, - std::random_access_iterator_tag>::value); + static Small Test(const Subs) + requires(std::is_same::iterator_category, + std::random_access_iterator_tag>::value); /* * A Test fonction which returns a Big. * It is called if B does not defines a random access const iterator. diff --git a/include/TFEL/Metaprogramming/HasRandomAccessIterator.hxx b/include/TFEL/Metaprogramming/HasRandomAccessIterator.hxx index e522d0546..e20b7afe1 100644 --- a/include/TFEL/Metaprogramming/HasRandomAccessIterator.hxx +++ b/include/TFEL/Metaprogramming/HasRandomAccessIterator.hxx @@ -50,10 +50,10 @@ namespace tfel::meta { * Can only be called if B defines a random access iterator. */ template - static Small Test(const Subs) requires( - IsSameType::iterator_category, - std::random_access_iterator_tag>::cond); + static Small Test(const Subs) + requires(IsSameType::iterator_category, + std::random_access_iterator_tag>::cond); /* * A Test fonction which returns a Big. * It is called only if B does not defines a random access iterator. diff --git a/include/TFEL/PhysicalConstants.hxx b/include/TFEL/PhysicalConstants.hxx index 5b372a0d7..6199239b0 100644 --- a/include/TFEL/PhysicalConstants.hxx +++ b/include/TFEL/PhysicalConstants.hxx @@ -91,8 +91,8 @@ namespace tfel { //! Stefan-Boltzmann constant (W.m-2.K-4) static constexpr auto s = quantity<1, 0, -3, 0, -4, 0, 0>(5.67037e-08); }; // end of PhysicalConstants - /*! - * \brief partial specialisation when quantities are not used */ + /*! + * \brief partial specialisation when quantities are not used */ template struct PhysicalConstants { //! Atomic mass constant (kg) diff --git a/include/TFEL/Utilities/Data.hxx b/include/TFEL/Utilities/Data.hxx index 6664cfbb2..711e58563 100644 --- a/include/TFEL/Utilities/Data.hxx +++ b/include/TFEL/Utilities/Data.hxx @@ -115,8 +115,9 @@ namespace tfel::utilities { using CallBack = std::function; //! constructor from a value template - TFEL_INLINE Data(T1&& v) requires( - tfel::meta::TLCountNbrOfT, DataTypes>::value == 1) + TFEL_INLINE Data(T1&& v) + requires(tfel::meta::TLCountNbrOfT, DataTypes>::value == + 1) : GenTypeBase(std::forward(v)) {} /*! * \brief read a JSON-like structure @@ -225,8 +226,9 @@ namespace tfel::utilities { const DataValidator&); //! template - DataMapValidator& addDataTypeValidator(const std::string& k) requires( - tfel::meta::TLCountNbrOfT, DataTypes>::value == 1); + DataMapValidator& addDataTypeValidator(const std::string& k) + requires(tfel::meta::TLCountNbrOfT, DataTypes>::value == + 1); //! \brief validate a data-map void validate(const DataMap&) const; //! \brief destructor diff --git a/include/TFEL/Utilities/Data.ixx b/include/TFEL/Utilities/Data.ixx index 5003f286f..f785ab3e3 100644 --- a/include/TFEL/Utilities/Data.ixx +++ b/include/TFEL/Utilities/Data.ixx @@ -29,7 +29,7 @@ namespace tfel::utilities::internals { static bool is_convertible(const tfel::utilities::Data& d) { return d.template is(); } // end of exe - }; // end of DataConvertorImpl; + }; // end of DataConvertorImpl; /*! * \brief an helper class (in C++-11, no `if constexpr`, so we @@ -131,9 +131,9 @@ namespace tfel::utilities::internals { namespace tfel::utilities { template - DataMapValidator& - DataMapValidator::addDataTypeValidator(const std::string& k) requires( - tfel::meta::TLCountNbrOfT, DataTypes>::value == 1) { + DataMapValidator& DataMapValidator::addDataTypeValidator(const std::string& k) + requires(tfel::meta::TLCountNbrOfT, DataTypes>::value == 1) + { return this->addDataValidator(k, [](const Data& d) { if (!d.template is()) { tfel::raise("invalid type"); diff --git a/include/TFEL/Utilities/FCString.hxx b/include/TFEL/Utilities/FCString.hxx index 5019f03d1..afb848974 100644 --- a/include/TFEL/Utilities/FCString.hxx +++ b/include/TFEL/Utilities/FCString.hxx @@ -141,9 +141,11 @@ namespace tfel::utilities { //! \return an reverse iterator at the end of the string auto rbegin() -> typename std::array::reverse_iterator; //! \return an reverse iterator at the end of the string - auto rbegin() const -> typename std::array::const_reverse_iterator; + auto rbegin() const -> + typename std::array::const_reverse_iterator; //! \return an reverse iterator at the end of the string - auto crbegin() const -> typename std::array::const_reverse_iterator; + auto crbegin() const -> + typename std::array::const_reverse_iterator; //! \return the last character of the string CharT& back(); //! \return the last character of the string diff --git a/include/TFEL/Utilities/FCString.ixx b/include/TFEL/Utilities/FCString.ixx index 5702caee4..36af3a41e 100644 --- a/include/TFEL/Utilities/FCString.ixx +++ b/include/TFEL/Utilities/FCString.ixx @@ -158,42 +158,39 @@ namespace tfel::utilities { } // end of basic_fcstring::size template - auto basic_fcstring::end() -> typename std::array::iterator - { + auto basic_fcstring::end() -> + typename std::array::iterator { return this->begin() + this->size(); } // end of basic_fcstring::end template - auto basic_fcstring::end() const -> typename std::array::const_iterator - { + auto basic_fcstring::end() const -> + typename std::array::const_iterator { return this->begin() + this->size(); } // end of basic_fcstring::end template - auto basic_fcstring::cend() const -> typename std::array::const_iterator - { + auto basic_fcstring::cend() const -> + typename std::array::const_iterator { return this->end(); } // end of basic_fcstring::cend template - auto basic_fcstring::rbegin() - -> typename std::array::reverse_iterator - { + auto basic_fcstring::rbegin() -> + typename std::array::reverse_iterator { return typename std::array::reverse_iterator{this->end()}; } // end of basic_fcstring::rbegin template - auto basic_fcstring::rbegin() const - -> typename std::array::const_reverse_iterator - { + auto basic_fcstring::rbegin() const -> + typename std::array::const_reverse_iterator { return typename std::array::const_reverse_iterator{this->end()}; } // end of basic_fcstring::rbegin template - auto basic_fcstring::crbegin() const - -> typename std::array::const_reverse_iterator - { + auto basic_fcstring::crbegin() const -> + typename std::array::const_reverse_iterator { return typename std::array::const_reverse_iterator{this->end()}; } // end of basic_fcstring::crbegin diff --git a/include/TFEL/Utilities/GenTypeBase.hxx b/include/TFEL/Utilities/GenTypeBase.hxx index b31b05b03..49b17e47e 100644 --- a/include/TFEL/Utilities/GenTypeBase.hxx +++ b/include/TFEL/Utilities/GenTypeBase.hxx @@ -131,7 +131,8 @@ namespace tfel::utilities { GenTypeBase(const GenTypeBase &) = default; //! \brief constructor from a value template - GenTypeBase(T1 &&value) requires(isValidType) + GenTypeBase(T1 &&value) + requires(isValidType) : variant(std::forward(value)) {} // \brief assignement operator GenTypeBase &operator=(GenTypeBase &&) = default; @@ -139,7 +140,9 @@ namespace tfel::utilities { GenTypeBase &operator=(const GenTypeBase &) = default; // \brief assignement operator from a value template - GenTypeBase &operator=(T1 &&value) requires(isValidType) { + GenTypeBase &operator=(T1 &&value) + requires(isValidType) + { variant::operator=(std::forward(value)); return *this; } @@ -159,23 +162,31 @@ namespace tfel::utilities { * \pre T1 must be a type that the GenType can hold. */ template - TFEL_INLINE void set(T1 &&src) requires(isValidType) { + TFEL_INLINE void set(T1 &&src) + requires(isValidType) + { this->operator=(std::forward(src)); } // template - TFEL_INLINE bool is() const requires(isValidType) { + TFEL_INLINE bool is() const + requires(isValidType) + { return std::holds_alternative(*this); } //! \return the value hold by the `GenTypeBase`. template - TFEL_INLINE const T1 &get() const requires(isValidType) { + TFEL_INLINE const T1 &get() const + requires(isValidType) + { tfel::raise_if(!this->template is()); return std::get(*this); } //! \return the value hold by the `GenTypeBase`. template - TFEL_INLINE T1 &get() requires(isValidType) { + TFEL_INLINE T1 &get() + requires(isValidType) + { tfel::raise_if(!this->template is()); return std::get(*this); } @@ -187,7 +198,9 @@ namespace tfel::utilities { TFEL_INLINE void clear() { variant::operator=(std::monostate()); } //! \brief set the value of the GenType. template - TFEL_INLINE void set_uninitialised() requires(isValidType) { + TFEL_INLINE void set_uninitialised() + requires(isValidType) + { this->operator=(T1()); } }; diff --git a/mfm-test-generator/src/MFMTestGeneratorFileExport.cxx b/mfm-test-generator/src/MFMTestGeneratorFileExport.cxx index b15f7d41a..ba222cb10 100644 --- a/mfm-test-generator/src/MFMTestGeneratorFileExport.cxx +++ b/mfm-test-generator/src/MFMTestGeneratorFileExport.cxx @@ -111,6 +111,6 @@ namespace mfmtg { static_cast(d); tfel::raise("write: unsupported file extension '" + ext + "'"); #endif /* MADNEX_MFM_TEST_GENERATOR_TEST_SUPPORT */ - } // end of write + } // end of write } // namespace mfmtg diff --git a/mfm-test-generator/src/mfm-test-generator.cxx b/mfm-test-generator/src/mfm-test-generator.cxx index 064c7fb1f..64a0dfa43 100644 --- a/mfm-test-generator/src/mfm-test-generator.cxx +++ b/mfm-test-generator/src/mfm-test-generator.cxx @@ -119,48 +119,51 @@ namespace mfmtg { //! \brief register the command line call backs void registerCommandLineCallBacks() { this->registerCallBack( - "--verbose", - CallBack("set verbose output", - [this] { - if (this->currentArgument->getOption().empty()) { - mfront::setVerboseMode(mfront::VERBOSE_LEVEL1); - } else { - const auto& l = this->currentArgument->getOption(); - mfront::setVerboseMode(l); - } - }, - true)); + "--verbose", CallBack( + "set verbose output", + [this] { + if (this->currentArgument->getOption().empty()) { + mfront::setVerboseMode(mfront::VERBOSE_LEVEL1); + } else { + const auto& l = + this->currentArgument->getOption(); + mfront::setVerboseMode(l); + } + }, + true)); this->registerCallBack( "--target", - CallBack("specify a target code", - [this] { - const auto& t = this->currentArgument->getOption(); - if (std::find(this->targets.cbegin(), this->targets.cend(), - t) == this->targets.cend()) { - this->targets.push_back(t); - } - }, - true)); + CallBack( + "specify a target code", + [this] { + const auto& t = this->currentArgument->getOption(); + if (std::find(this->targets.cbegin(), this->targets.cend(), + t) == this->targets.cend()) { + this->targets.push_back(t); + } + }, + true)); this->registerCallBack( "--plugins", - CallBack("specify a list of shared libraries containing user defined " - "test cases or generators, separated by a comma ','", - [this] { load_plugins(this->currentArgument->getOption()); }, - true)); + CallBack( + "specify a list of shared libraries containing user defined " + "test cases or generators, separated by a comma ','", + [this] { load_plugins(this->currentArgument->getOption()); }, + true)); this->registerCallBack( "--targets", - CallBack("specify a set targets separated by commas", - [this] { - for (const auto& t : tfel::utilities::tokenize( - this->currentArgument->getOption(), ',')) { - if (std::find(this->targets.cbegin(), - this->targets.cend(), - t) == this->targets.cend()) { - this->targets.push_back(t); - } - } - }, - true)); + CallBack( + "specify a set targets separated by commas", + [this] { + for (const auto& t : tfel::utilities::tokenize( + this->currentArgument->getOption(), ',')) { + if (std::find(this->targets.cbegin(), this->targets.cend(), + t) == this->targets.cend()) { + this->targets.push_back(t); + } + } + }, + true)); #ifdef MFM_TEST_GENERATOR_HAVE_MADNEX auto treatBehaviour = [this] { if (!this->behaviour.empty()) { @@ -487,7 +490,7 @@ namespace mfmtg { //! \brief test name (required for madnex files) std::string test; #endif /* MADNEX_MFM_TEST_GENERATOR_TEST_SUPPORT */ - }; // end of MFMTestGenerator + }; // end of MFMTestGenerator } // end of namespace mfmtg diff --git a/mfm/src/mfm.cxx b/mfm/src/mfm.cxx index a170a0b24..9c8540300 100644 --- a/mfm/src/mfm.cxx +++ b/mfm/src/mfm.cxx @@ -197,14 +197,16 @@ struct MFM : public tfel::utilities::ArgumentParserBase { "--verbose", CallBack("set verbose output", set_verbose_level, true)); this->registerCallBack( "--show-libs", - CallBack("show library name in front " - "of entry points", - [this]() noexcept { this->show_libs = true; }, false)); + CallBack( + "show library name in front " + "of entry points", + [this]() noexcept { this->show_libs = true; }, false)); this->registerCallBack( "--show-sources", - CallBack("show the name of the MFront " - "file used to generate the entry points", - [this]() noexcept { this->show_sources = true; }, false)); + CallBack( + "show the name of the MFront " + "file used to generate the entry points", + [this]() noexcept { this->show_sources = true; }, false)); } // end of registerCommandLineCallBacks const tfel::utilities::Argument& getCurrentCommandLineArgument() const { @@ -275,7 +277,7 @@ struct MFM : public tfel::utilities::ArgumentParserBase { VERBOSE_LEVEL3 = 3, // filters; diff --git a/mfront-doc/src/BehaviourDocumentationGenerator.cxx b/mfront-doc/src/BehaviourDocumentationGenerator.cxx index ed6bfbd39..0043e1e31 100644 --- a/mfront-doc/src/BehaviourDocumentationGenerator.cxx +++ b/mfront-doc/src/BehaviourDocumentationGenerator.cxx @@ -552,15 +552,17 @@ namespace mfront { "add a mandex file to the search paths", true); Parser::registerCallBack( "--standalone", - CallBack("generate a standalone document (false by default)", - [this]() noexcept { this->standalone = true; }, false)); + CallBack( + "generate a standalone document (false by default)", + [this]() noexcept { this->standalone = true; }, false)); Parser::registerNewCallBack("--web", &BehaviourDocumentationGenerator::treatWeb, "output a web version of the file"); Parser::registerCallBack( "--std-output", "--", - CallBack("print the output ont the standard output stream", - [this]() noexcept { this->std_output = true; }, false)); + CallBack( + "print the output ont the standard output stream", + [this]() noexcept { this->std_output = true; }, false)); } // end of BehaviourDocumentationGenerator::registerCommandLineCallBacks void BehaviourDocumentationGenerator::treatUnknownArgument() { diff --git a/mfront-query/src/BehaviourQuery.cxx b/mfront-query/src/BehaviourQuery.cxx index 1d9d6c2f4..3fb204e55 100644 --- a/mfront-query/src/BehaviourQuery.cxx +++ b/mfront-query/src/BehaviourQuery.cxx @@ -178,8 +178,9 @@ namespace mfront { // this->registerCallBack( "--modelling-hypothesis", - CallBack("select a modelling hypothesis", - [this] { this->treatModellingHypothesis(); }, true)); + CallBack( + "select a modelling hypothesis", + [this] { this->treatModellingHypothesis(); }, true)); // standard queries const std::vector> sq = { {"--behaviour-name", "show the behaviour name"}, diff --git a/mfront-query/src/MaterialPropertyQuery.cxx b/mfront-query/src/MaterialPropertyQuery.cxx index 825ab466d..88a1a0084 100644 --- a/mfront-query/src/MaterialPropertyQuery.cxx +++ b/mfront-query/src/MaterialPropertyQuery.cxx @@ -72,8 +72,9 @@ namespace mfront { } this->registerCallBack( "--parameter-default-value", - CallBack("display the default value of a parameter", - [this] { this->treatParameterDefaultValue(); }, true)); + CallBack( + "display the default value of a parameter", + [this] { this->treatParameterDefaultValue(); }, true)); // bounds auto has_bounds = [this] { const auto& q = this->getCurrentCommandLineArgument(); diff --git a/mfront-query/src/QueryHandlerBase.cxx b/mfront-query/src/QueryHandlerBase.cxx index 6239cff70..91cdf002c 100644 --- a/mfront-query/src/QueryHandlerBase.cxx +++ b/mfront-query/src/QueryHandlerBase.cxx @@ -98,46 +98,54 @@ namespace mfront { false); this->registerCallBack( "--dsl-option", - CallBack("allow to define options passed to domain specific languages", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages", + []() noexcept {}, true)); this->registerCallBack( "--dsl-material-property-option", - CallBack("allow to define options passed to domain specific languages " - "related to material properties", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to material properties", + []() noexcept {}, true)); this->registerCallBack( "--dsl-behaviour-option", - CallBack("allow to define options passed to domain specific languages " - "related to behaviours", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to behaviours", + []() noexcept {}, true)); this->registerCallBack( "--dsl-model-option", - CallBack("allow to define options passed to domain specific languages " - "related to models", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to models", + []() noexcept {}, true)); this->registerCallBack( "--dsl-options-file", - CallBack("allow to define options passed to domain specific languages " - "thanks to an external file in a JSON-like format", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "thanks to an external file in a JSON-like format", + []() noexcept {}, true)); this->registerCallBack( "--dsl-material-property-options-file", - CallBack("allow to define options passed to domain specific languages " - "related to material properties thanks to an external file in " - "a JSON-like format", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to material properties thanks to an external file in " + "a JSON-like format", + []() noexcept {}, true)); this->registerCallBack( "--dsl-behaviour-options-file", - CallBack("allow to define options passed to domain specific languages " - "related to behaviours thanks to an external file in a " - "JSON-like format", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to behaviours thanks to an external file in a " + "JSON-like format", + []() noexcept {}, true)); this->registerCallBack( "--dsl-model-options-file", - CallBack("allow to define options passed to domain specific languages " - "related to models thanks to an external file in a JSON-like " - "format", - []() noexcept {}, true)); + CallBack( + "allow to define options passed to domain specific languages " + "related to models thanks to an external file in a JSON-like " + "format", + []() noexcept {}, true)); this->registerNewCallBack( "--include", "-I", &QueryHandlerBase::treatSearchPath, "add a new path at the beginning of the search paths", true); @@ -157,8 +165,9 @@ namespace mfront { true); this->registerCallBack( "--nomelt", - CallBack("don't melt librairies sources", - [this]() noexcept { this->melt_sources = false; }, false)); + CallBack( + "don't melt librairies sources", + [this]() noexcept { this->melt_sources = false; }, false)); this->registerNewCallBack( "--warning", "-W", &QueryHandlerBase::treatWarning, "print warnings"); this->registerNewCallBack("--pedantic", &QueryHandlerBase::treatPedantic, @@ -183,8 +192,9 @@ namespace mfront { #endif /* MFRONT_HAVE_MADNEX */ this->registerCallBack( "--generated-sources", - CallBack("show all the generated sources", - [this] { this->treatGeneratedSources(); }, true)); + CallBack( + "show all the generated sources", + [this] { this->treatGeneratedSources(); }, true)); this->registerCallBack( "--specific-target-generated-sources", CallBack( @@ -192,27 +202,33 @@ namespace mfront { [this] { this->treatSpecificTargetGeneratedSources(); }, true)); this->registerCallBack( "--all-specific-targets-generated-sources", - CallBack("show all the generated sources associated specific targets", - [this] { this->treatAllSpecificTargetsGeneratedSources(); }, - false)); + CallBack( + "show all the generated sources associated specific targets", + [this] { this->treatAllSpecificTargetsGeneratedSources(); }, + false)); this->registerCallBack( "--generated-headers", - CallBack("show all the generated headers", - [this] { this->treatGeneratedHeaders(); }, false)); + CallBack( + "show all the generated headers", + [this] { this->treatGeneratedHeaders(); }, false)); this->registerCallBack("--cppflags", - CallBack("show all the global headers", - [this] { this->treatCppFlags(); }, false)); + CallBack( + "show all the global headers", + [this] { this->treatCppFlags(); }, false)); this->registerCallBack( "--libraries-dependencies", - CallBack("show all the libraries dependencies", - [this] { this->treatLibrariesDependencies(); }, false)); + CallBack( + "show all the libraries dependencies", + [this] { this->treatLibrariesDependencies(); }, false)); this->registerCallBack( "--specific-targets", - CallBack("show all the specific targets", - [this] { this->treatSpecificTargets(); }, false)); - this->registerCallBack("--no-gui", CallBack("do not display errors using " - "a message box (windows only)", - []() noexcept {}, false)); + CallBack( + "show all the specific targets", + [this] { this->treatSpecificTargets(); }, false)); + this->registerCallBack("--no-gui", CallBack( + "do not display errors using " + "a message box (windows only)", + []() noexcept {}, false)); } std::function QueryHandlerBase::generateGeneratedSourcesQuery( diff --git a/mfront/include/CMakeLists.txt b/mfront/include/CMakeLists.txt index c753248bd..4194b780e 100644 --- a/mfront/include/CMakeLists.txt +++ b/mfront/include/CMakeLists.txt @@ -22,6 +22,7 @@ install_mfront_header(MFront GenericData.hxx) install_mfront_header(MFront FileDescription.hxx) install_mfront_header(MFront TargetsDescription.hxx) install_mfront_header(MFront CompiledTargetDescriptionBase.hxx) +install_mfront_header(MFront DataInterpolationUtilities.hxx) install_mfront_header(MFront OverridableImplementation.hxx) install_mfront_header(MFront OverridableImplementation.ixx) install_mfront_header(MFront LibraryDescription.hxx) diff --git a/mfront/include/MFront/Abaqus/AbaqusBehaviourHandler.hxx b/mfront/include/MFront/Abaqus/AbaqusBehaviourHandler.hxx index f726c7a71..dd6d81e67 100644 --- a/mfront/include/MFront/Abaqus/AbaqusBehaviourHandler.hxx +++ b/mfront/include/MFront/Abaqus/AbaqusBehaviourHandler.hxx @@ -141,7 +141,7 @@ namespace abaqus { b.setABAQUSBehaviourDataGradients(STRAN); b.setABAQUSIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef typename BV::BehaviourData BData; @@ -154,7 +154,7 @@ namespace abaqus { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef typename BV::BehaviourData BData; @@ -165,7 +165,7 @@ namespace abaqus { AbaqusTraits::btype, H, AbaqusTraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef typename BV::BehaviourData BData; @@ -186,7 +186,7 @@ namespace abaqus { TFEL_ABAQUS_INLINE static void exe(T& Psi_d, const BV& b) { b.computeDissipatedEnergy(Psi_d); } // end of exe - }; // end of struct DissipatedEnergyComputer + }; // end of struct DissipatedEnergyComputer //! place holder for tag dispatching struct TFEL_VISIBILITY_LOCAL DoNothingEnergyComputer { template diff --git a/mfront/include/MFront/Abaqus/AbaqusComputeStiffnessTensor.hxx b/mfront/include/MFront/Abaqus/AbaqusComputeStiffnessTensor.hxx index ae166c8d0..8e0e1a9c7 100644 --- a/mfront/include/MFront/Abaqus/AbaqusComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/Abaqus/AbaqusComputeStiffnessTensor.hxx @@ -48,9 +48,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + AbaqusComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -58,9 +58,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + AbaqusComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -86,9 +86,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + AbaqusComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane strain, generalised * plane strain and axisymmetrical hypotheses. @@ -96,9 +96,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + AbaqusComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -106,9 +106,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + AbaqusComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -116,9 +116,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + AbaqusComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -126,9 +126,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, float, false>::StiffnessTensor&, - const float* const); + AbaqusComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -136,9 +136,9 @@ namespace abaqus { * \param[in] props : material properties */ MFRONT_ABAQUS_VISIBILITY_EXPORT void - AbaqusComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, double, false>::StiffnessTensor&, - const double* const); + AbaqusComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, double, false>::StiffnessTensor&, + const double* const); /*! * This structure is in charge of computing the Stiffness operator diff --git a/mfront/include/MFront/Abaqus/AbaqusConvert.hxx b/mfront/include/MFront/Abaqus/AbaqusConvert.hxx index f161a626a..cd3e52066 100644 --- a/mfront/include/MFront/Abaqus/AbaqusConvert.hxx +++ b/mfront/include/MFront/Abaqus/AbaqusConvert.hxx @@ -48,7 +48,7 @@ namespace abaqus { const AbaqusReal* const v) { tfel::math::tensor::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct UMATImportGradients + }; // end of struct UMATImportGradients /*! * \brief partial specialisation of the UMATImportGradients * for the plane stress modelling hypothesis. @@ -79,7 +79,7 @@ namespace abaqus { const AbaqusReal* const v) { tfel::math::tensor<2u, T>::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct UMATImportGradients + }; // end of struct UMATImportGradients /*! * \brief class defining the convertion from abaqus to mfront for * thermodynamic forces @@ -100,7 +100,7 @@ namespace abaqus { const AbaqusReal* const v) { s.importTab(v); } // end of exe - }; // end of struct UMATImportThermodynamicForces + }; // end of struct UMATImportThermodynamicForces /*! * \brief partial specialisation of the UMATImportThermodynamicForces * for the plane stress modelling hypothesis. @@ -122,7 +122,7 @@ namespace abaqus { s[2] = AbaqusReal{0}; s[3] = v[2] * cste; } // end of exe - }; // end of struct UMATImportThermodynamicForces + }; // end of struct UMATImportThermodynamicForces /*! * \brief class defining the convertion from mfront to abaqus for * thermodynamic forces @@ -143,7 +143,7 @@ namespace abaqus { const tfel::math::stensor& s) { s.exportTab(v); } // end of exe - }; // end of struct UMATExportThermodynamicForces + }; // end of struct UMATExportThermodynamicForces /*! * \brief partial specialisation of the UMATExportThermodynamicForces * for the plane stress modelling hypothesis. @@ -164,7 +164,7 @@ namespace abaqus { v[1] = s[1]; v[2] = s[3] * icste; } // end of exe - }; // end of struct UMATExportThermodynamicForces + }; // end of struct UMATExportThermodynamicForces } // end of namespace abaqus diff --git a/mfront/include/MFront/Abaqus/AbaqusExplicitInterface.hxx b/mfront/include/MFront/Abaqus/AbaqusExplicitInterface.hxx index 5191f60bc..dfbbbc1cf 100644 --- a/mfront/include/MFront/Abaqus/AbaqusExplicitInterface.hxx +++ b/mfront/include/MFront/Abaqus/AbaqusExplicitInterface.hxx @@ -78,7 +78,7 @@ namespace abaqus { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer //! structure in charge of initializing the stiffness operator struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef typename BV::BehaviourData BData; @@ -89,7 +89,7 @@ namespace abaqus { ATraits::stype>::exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer //! place holder for tag dispatching struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef typename BV::BehaviourData BData; @@ -317,7 +317,7 @@ namespace abaqus { b.setBehaviourDataGradients(e); b.setIntegrationDataGradients(de); } // end of exe - }; // end of struct GradientInitialiserWithStressFreeExpansion + }; // end of struct GradientInitialiserWithStressFreeExpansion //! An helper structure used to initialise the driving variables struct TFEL_VISIBILITY_LOCAL GradientInitialiserWithoutStressFreeExpansion { /*! @@ -337,8 +337,8 @@ namespace abaqus { b.setBehaviourDataGradients(e); b.setIntegrationDataGradients(de); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion - }; // end of struct AbaqusExplicitInterface + }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct AbaqusExplicitInterface } // end of namespace abaqus diff --git a/mfront/include/MFront/Abaqus/AbaqusInterface.hxx b/mfront/include/MFront/Abaqus/AbaqusInterface.hxx index d1d1c96c7..b6134b506 100644 --- a/mfront/include/MFront/Abaqus/AbaqusInterface.hxx +++ b/mfront/include/MFront/Abaqus/AbaqusInterface.hxx @@ -115,7 +115,7 @@ namespace abaqus { i.exe(d); } }; // end of struct CallBehaviour2 - }; // end of struct AbaqusInterface + }; // end of struct AbaqusInterface } // end of namespace abaqus diff --git a/mfront/include/MFront/AbstractBehaviourDSL.hxx b/mfront/include/MFront/AbstractBehaviourDSL.hxx index 4bee4fbb2..f74737aad 100644 --- a/mfront/include/MFront/AbstractBehaviourDSL.hxx +++ b/mfront/include/MFront/AbstractBehaviourDSL.hxx @@ -32,7 +32,8 @@ namespace mfront { struct AbstractBehaviourInterface; struct MaterialPropertyDescription; - //! \brief interface class for all domain specific languages associated with behaviours. + //! \brief interface class for all domain specific languages associated with + //! behaviours. struct MFRONT_VISIBILITY_EXPORT AbstractBehaviourDSL : public virtual AbstractDSL { //! a simple alias diff --git a/mfront/include/MFront/AbstractBehaviourInterface.hxx b/mfront/include/MFront/AbstractBehaviourInterface.hxx index 7f4ce0ae6..669be95bd 100644 --- a/mfront/include/MFront/AbstractBehaviourInterface.hxx +++ b/mfront/include/MFront/AbstractBehaviourInterface.hxx @@ -68,9 +68,9 @@ namespace mfront { * the last token treated. */ virtual std::pair treatKeyword( - BehaviourDescription&, - const std::string&, - const std::vector&, + BehaviourDescription &, + const std::string &, + const std::vector &, tokens_iterator, const tokens_iterator) = 0; /*! @@ -80,13 +80,13 @@ namespace mfront { * \param[in] mb : behaviour description */ virtual bool isBehaviourConstructorRequired( - const Hypothesis, const BehaviourDescription&) const = 0; + const Hypothesis, const BehaviourDescription &) const = 0; /*! * \return the list of modelling hypotheses treated by the interface * \param[in] mb : behaviour description */ virtual std::set getModellingHypothesesToBeTreated( - const BehaviourDescription&) const = 0; + const BehaviourDescription &) const = 0; /*! * \return a pair which first member gives the position of the * material properties in the values given through the interface @@ -105,11 +105,11 @@ namespace mfront { * \param[in] mb : behaviour description */ virtual void writeInterfaceSpecificIncludes( - std::ostream&, const BehaviourDescription&) const = 0; + std::ostream &, const BehaviourDescription &) const = 0; - virtual void exportMechanicalData(std::ostream&, + virtual void exportMechanicalData(std::ostream &, const Hypothesis, - const BehaviourDescription&) const = 0; + const BehaviourDescription &) const = 0; /*! * \brief write the behaviour constructor header associated with * the interface. This method allow the interface to add a new @@ -127,10 +127,10 @@ namespace mfront { * default value (zero) to state * variable increments */ - virtual void writeBehaviourConstructorHeader(std::ostream&, - const BehaviourDescription&, + virtual void writeBehaviourConstructorHeader(std::ostream &, + const BehaviourDescription &, const Hypothesis, - const std::string&) const = 0; + const std::string &) const = 0; /*! * \brief complete the body of the behaviour constructor * associated with the interface. @@ -138,37 +138,41 @@ namespace mfront { * \param[in] mb: behaviour description * \param[in] h: modelling hypothesis */ - virtual void writeBehaviourConstructorBody(std::ostream&, - const BehaviourDescription&, + virtual void writeBehaviourConstructorBody(std::ostream &, + const BehaviourDescription &, const Hypothesis) const = 0; virtual void writeBehaviourDataConstructor( - std::ostream&, const Hypothesis, const BehaviourDescription&) const = 0; + std::ostream &, + const Hypothesis, + const BehaviourDescription &) const = 0; /*! * write the behaviour constructor associated with the law * \param[in] behaviourFile : output file * \param[in] mb : behaviour description */ virtual void writeBehaviourDataMainVariablesSetters( - std::ostream&, const BehaviourDescription&) const = 0; + std::ostream &, const BehaviourDescription &) const = 0; virtual void writeIntegrationDataConstructor( - std::ostream&, const Hypothesis, const BehaviourDescription&) const = 0; + std::ostream &, + const Hypothesis, + const BehaviourDescription &) const = 0; /*! * \brief write the setters associated with the main variables * \param[in] behaviourFile : output file * \param[in] mb : behaviour description */ virtual void writeIntegrationDataMainVariablesSetters( - std::ostream&, const BehaviourDescription&) const = 0; + std::ostream &, const BehaviourDescription &) const = 0; /*! * \brief write the initialize functions * \param[in] os: output stream * \param[in] bd: behaviour description * \param[in] h: modelling hypothesis */ - virtual void writeBehaviourInitializeFunctions(std::ostream&, - const BehaviourDescription&, + virtual void writeBehaviourInitializeFunctions(std::ostream &, + const BehaviourDescription &, const Hypothesis) const = 0; /*! * \brief write the post-processings @@ -176,22 +180,22 @@ namespace mfront { * \param[in] bd: behaviour description * \param[in] h: modelling hypothesis */ - virtual void writeBehaviourPostProcessings(std::ostream&, - const BehaviourDescription&, + virtual void writeBehaviourPostProcessings(std::ostream &, + const BehaviourDescription &, const Hypothesis) const = 0; /*! * \brief write output files * \param[in] mb : behaviour description * \param[in] fd : mfront file description */ - virtual void endTreatment(const BehaviourDescription&, - const FileDescription&) const = 0; + virtual void endTreatment(const BehaviourDescription &, + const FileDescription &) const = 0; /*! * \param[out] d : target description * \param[out] bd : behaviour description */ - virtual void getTargetsDescription(TargetsDescription&, - const BehaviourDescription&) = 0; + virtual void getTargetsDescription(TargetsDescription &, + const BehaviourDescription &) = 0; //! \brief destructor virtual ~AbstractBehaviourInterface(); diff --git a/mfront/include/MFront/Ansys/AnsysBehaviourHandler.hxx b/mfront/include/MFront/Ansys/AnsysBehaviourHandler.hxx index eb1dbbdf9..8fb870289 100644 --- a/mfront/include/MFront/Ansys/AnsysBehaviourHandler.hxx +++ b/mfront/include/MFront/Ansys/AnsysBehaviourHandler.hxx @@ -133,7 +133,7 @@ namespace ansys { b.setANSYSBehaviourDataGradients(STRAN); b.setANSYSIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -147,7 +147,7 @@ namespace ansys { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -159,7 +159,7 @@ namespace ansys { AnsysTraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/Ansys/AnsysComputeStiffnessTensor.hxx b/mfront/include/MFront/Ansys/AnsysComputeStiffnessTensor.hxx index 22c180749..5a65306a2 100644 --- a/mfront/include/MFront/Ansys/AnsysComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/Ansys/AnsysComputeStiffnessTensor.hxx @@ -48,9 +48,9 @@ namespace ansys { * \param[in] props : material properties */ MFRONT_ANSYS_VISIBILITY_EXPORT void - AnsysComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + AnsysComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -58,9 +58,9 @@ namespace ansys { * \param[in] props : material properties */ MFRONT_ANSYS_VISIBILITY_EXPORT void - AnsysComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + AnsysComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -104,9 +104,9 @@ namespace ansys { * \param[in] props : material properties */ MFRONT_ANSYS_VISIBILITY_EXPORT void - AnsysComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + AnsysComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -114,9 +114,9 @@ namespace ansys { * \param[in] props : material properties */ MFRONT_ANSYS_VISIBILITY_EXPORT void - AnsysComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + AnsysComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. diff --git a/mfront/include/MFront/Ansys/AnsysConvert.hxx b/mfront/include/MFront/Ansys/AnsysConvert.hxx index bcd7baf5b..d50f2656b 100644 --- a/mfront/include/MFront/Ansys/AnsysConvert.hxx +++ b/mfront/include/MFront/Ansys/AnsysConvert.hxx @@ -63,7 +63,7 @@ namespace ansys { const AnsysReal* const v) { tfel::math::tensor::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct ImportGradients + }; // end of struct ImportGradients /*! * \brief class defining the convertion from ansys to mfront for * thermodynamic forces @@ -84,7 +84,7 @@ namespace ansys { const AnsysReal* const v) { ImportSymmetricTensor::exe(s, v); } // end of exe - }; // end of struct ImportThermodynamicForces + }; // end of struct ImportThermodynamicForces /*! * \brief class defining the convertion from mfront to ansys for * thermodynamic forces @@ -105,7 +105,7 @@ namespace ansys { const tfel::math::stensor& s) { ExportSymmetricTensor::exe(v, s); } // end of exe - }; // end of struct ExportThermodynamicForces + }; // end of struct ExportThermodynamicForces /*! * \brief partial specialisation of the ImportSymmetricTensor in 1D. diff --git a/mfront/include/MFront/Ansys/AnsysInterface.hxx b/mfront/include/MFront/Ansys/AnsysInterface.hxx index 7212ff15c..a82bd88eb 100644 --- a/mfront/include/MFront/Ansys/AnsysInterface.hxx +++ b/mfront/include/MFront/Ansys/AnsysInterface.hxx @@ -118,7 +118,7 @@ namespace ansys { return i.exe(d); } }; // end of struct CallBehaviour2 - }; // end of struct AnsysInterface + }; // end of struct AnsysInterface } // end of namespace ansys diff --git a/mfront/include/MFront/Aster/AsterBehaviourHandler.hxx b/mfront/include/MFront/Aster/AsterBehaviourHandler.hxx index a4ffddee8..6442213ee 100644 --- a/mfront/include/MFront/Aster/AsterBehaviourHandler.hxx +++ b/mfront/include/MFront/Aster/AsterBehaviourHandler.hxx @@ -186,7 +186,7 @@ namespace aster { b.setASTERBehaviourDataGradients(STRAN); b.setASTERIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -200,7 +200,7 @@ namespace aster { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -212,7 +212,7 @@ namespace aster { AsterTraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/Aster/AsterComputeStiffnessTensor.hxx b/mfront/include/MFront/Aster/AsterComputeStiffnessTensor.hxx index e2e39376b..dd4c456cc 100644 --- a/mfront/include/MFront/Aster/AsterComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/Aster/AsterComputeStiffnessTensor.hxx @@ -40,9 +40,9 @@ namespace aster { * \param[in] props : material properties */ MFRONT_ASTER_VISIBILITY_EXPORT void - AsterComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, AsterReal, false>::StiffnessTensor&, - const AsterReal* const); + AsterComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, AsterReal, false>::StiffnessTensor&, + const AsterReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal @@ -71,9 +71,9 @@ namespace aster { * \param[in] props : material properties */ MFRONT_ASTER_VISIBILITY_EXPORT void - AsterComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, AsterReal, false>::StiffnessTensor&, - const AsterReal* const); + AsterComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, AsterReal, false>::StiffnessTensor&, + const AsterReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal diff --git a/mfront/include/MFront/Aster/AsterConvertStress.hxx b/mfront/include/MFront/Aster/AsterConvertStress.hxx index 737c4b3d3..a066ac71f 100644 --- a/mfront/include/MFront/Aster/AsterConvertStress.hxx +++ b/mfront/include/MFront/Aster/AsterConvertStress.hxx @@ -60,7 +60,7 @@ namespace aster { const auto pk2 = convertCauchyStressToSecondPiolaKirchhoffStress(s, F); pk2.exportTab(STRESS); } // end of exe - }; // end of struct AsterConvertStress + }; // end of struct AsterConvertStress } // end of namespace aster diff --git a/mfront/include/MFront/Aster/AsterInterface.hxx b/mfront/include/MFront/Aster/AsterInterface.hxx index 3c0b8083c..f90a7f289 100644 --- a/mfront/include/MFront/Aster/AsterInterface.hxx +++ b/mfront/include/MFront/Aster/AsterInterface.hxx @@ -391,8 +391,8 @@ namespace aster { } return 0; } // end of CallBehaviour::exe - }; // end of struct CallBehaviour - }; // end of struct AsterInterface + }; // end of struct CallBehaviour + }; // end of struct AsterInterface } // end of namespace aster diff --git a/mfront/include/MFront/Aster/AsterOrthotropicBehaviourHandler.hxx b/mfront/include/MFront/Aster/AsterOrthotropicBehaviourHandler.hxx index de794fa56..1dc4159ea 100644 --- a/mfront/include/MFront/Aster/AsterOrthotropicBehaviourHandler.hxx +++ b/mfront/include/MFront/Aster/AsterOrthotropicBehaviourHandler.hxx @@ -171,7 +171,7 @@ namespace aster { STATEV, STRESS, op, sfeh); handler.exe(DDSOE, STRESS, STATEV, nullptr); } // end of AsterOrthotropicBehaviourHander<1u,Behaviour>::exe - }; // end of struct AsterOrthotropicBehaviourHander<1u,Behaviour> + }; // end of struct AsterOrthotropicBehaviourHander<1u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -226,7 +226,7 @@ namespace aster { m.rotateTangentOperatorBackward(DDSOE); } } // end of AsterOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> + }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> template < template @@ -286,7 +286,7 @@ namespace aster { m.rotateTangentOperatorBackward(DDSOE); } } // end of AsterOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> + }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -404,7 +404,7 @@ namespace aster { STRESS, op, sfeh); handler.exe(DDSOE, STRESS, STATEV, F1); } // end of AsterOrthotropicBehaviourHander<1u,Behaviour>::exe - }; // end of struct AsterOrthotropicBehaviourHander<1u,Behaviour> + }; // end of struct AsterOrthotropicBehaviourHander<1u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -459,7 +459,7 @@ namespace aster { m.rotateTangentOperatorBackward(DDSOE); } } // end of AsterOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> + }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> template < template @@ -519,7 +519,7 @@ namespace aster { m.rotateTangentOperatorBackward(DDSOE); } } // end of AsterOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> + }; // end of AsterOrthotropicBehaviourHander<2u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, diff --git a/mfront/include/MFront/BehaviourBrick/DataIsotropicHardeningRule.hxx b/mfront/include/MFront/BehaviourBrick/DataIsotropicHardeningRule.hxx index 5b238c554..259f53499 100644 --- a/mfront/include/MFront/BehaviourBrick/DataIsotropicHardeningRule.hxx +++ b/mfront/include/MFront/BehaviourBrick/DataIsotropicHardeningRule.hxx @@ -15,6 +15,7 @@ #define LIB_MFRONT_BEHAVIOURBRICK_DATAISOTROPICHARDENINGRULE_HXX #include +#include "MFront/DataInterpolationUtilities.hxx" #include "MFront/BehaviourBrick/IsotropicHardeningRule.hxx" namespace mfront::bbrick { @@ -29,7 +30,9 @@ namespace mfront::bbrick { * - \f$R_{inf}\f$ is the maximal yield strength * - \f$b\f$ is a parameter */ - struct DataIsotropicHardeningRule final : IsotropicHardeningRule { + struct DataIsotropicHardeningRule final + : public IsotropicHardeningRule, + private SingleVariableInterpolatedData { void initialize(BehaviourDescription&, AbstractBehaviourDSL&, const std::string&, @@ -72,26 +75,6 @@ namespace mfront::bbrick { */ virtual void writeCubicSplineInterpolationOfYieldRadius( BehaviourDescription&, const std::string&, const std::string&) const; - /*! - * \brief interpolation algorithm - */ - enum InterpolationType { - LINEAR_INTERPOLATION, - CUBIC_SPLINE_INTERPOLATION - } itype = LINEAR_INTERPOLATION; - /*! - * \brief extrapolation type - * - * If true, extrapolation is allowed and based on the interpolation - * selected. If false, no extrapolation is performed and the value is kept - * constant, egal to the value of the closest point. - */ - bool etype = true; - /*! - * \brief the values of the yield radius as a function of the equivalent - * plastic strain. - */ - std::map values; }; // end of struct DataIsotropicHardeningRule } // end of namespace mfront::bbrick diff --git a/mfront/include/MFront/BehaviourBrick/PorosityEvolutionAlgorithm.hxx b/mfront/include/MFront/BehaviourBrick/PorosityEvolutionAlgorithm.hxx index 736220a7b..c9c71130a 100644 --- a/mfront/include/MFront/BehaviourBrick/PorosityEvolutionAlgorithm.hxx +++ b/mfront/include/MFront/BehaviourBrick/PorosityEvolutionAlgorithm.hxx @@ -22,7 +22,7 @@ namespace mfront::bbrick { enum struct PorosityEvolutionAlgorithm { STANDARD_IMPLICIT_SCHEME, //!< \brief monolithich approach STAGGERED_SCHEME //!< \brief staggered approach - }; // end of enum struct PorosityEvolutionAlgorithm + }; // end of enum struct PorosityEvolutionAlgorithm } // end of namespace mfront::bbrick diff --git a/mfront/include/MFront/BehaviourBrick/PorosityNucleationModelBase.hxx b/mfront/include/MFront/BehaviourBrick/PorosityNucleationModelBase.hxx index 9c5773e6b..f405dd755 100644 --- a/mfront/include/MFront/BehaviourBrick/PorosityNucleationModelBase.hxx +++ b/mfront/include/MFront/BehaviourBrick/PorosityNucleationModelBase.hxx @@ -53,12 +53,12 @@ namespace mfront::bbrick { //! \brief description of the material coefficient std::string description; }; // end of struct MaterialCoefficientDescripion - /*! - * \return a list of material coefficients - * Those material coefficients are: - * - automatically declared as options to the nucleation model - * - initialized in the `@InitLocalVariables` code block - */ + /*! + * \return a list of material coefficients + * Those material coefficients are: + * - automatically declared as options to the nucleation model + * - initialized in the `@InitLocalVariables` code block + */ virtual std::vector getMaterialCoefficientDescriptions() const; /*! diff --git a/mfront/include/MFront/BehaviourDSLBase.ixx b/mfront/include/MFront/BehaviourDSLBase.ixx index 29790cfe5..1c7654275 100644 --- a/mfront/include/MFront/BehaviourDSLBase.ixx +++ b/mfront/include/MFront/BehaviourDSLBase.ixx @@ -31,12 +31,13 @@ namespace mfront { void BehaviourDSLBase::registerNewCallBack(const std::string& k, const MemberFuncPtr f, const bool b) { - this->addCallBack(k, - [this, f] { - auto& c = *(static_cast(this)); - (c.*f)(); - }, - b); + this->addCallBack( + k, + [this, f] { + auto& c = *(static_cast(this)); + (c.*f)(); + }, + b); } // end of registerNewCallBack template diff --git a/mfront/include/MFront/BehaviourData.hxx b/mfront/include/MFront/BehaviourData.hxx index 6f765f8c4..39ac30e84 100644 --- a/mfront/include/MFront/BehaviourData.hxx +++ b/mfront/include/MFront/BehaviourData.hxx @@ -287,10 +287,10 @@ namespace mfront { * to specific positions. This option * is meant to be used internally and * is not accessible from a mfront file*/ - }; // end of enum Mode - /*! - * \brief position of the inserted code - */ + }; // end of enum Mode + /*! + * \brief position of the inserted code + */ enum Position { AT_BEGINNING, BODY, AT_END }; // end of enum Mode /*! * Some dsl may want to avoid the user to declare a variable with diff --git a/mfront/include/MFront/BehaviourDescription.hxx b/mfront/include/MFront/BehaviourDescription.hxx index 3bbe1a167..36938267e 100644 --- a/mfront/include/MFront/BehaviourDescription.hxx +++ b/mfront/include/MFront/BehaviourDescription.hxx @@ -101,10 +101,10 @@ namespace mfront { GREENLAGRANGE, HENCKY }; // end of enum StrainMeasure - /*! - * \brief this structure holds the value of a constant material - * property - */ + /*! + * \brief this structure holds the value of a constant material + * property + */ struct ConstantMaterialProperty { //! \brief parameter name associated with the material property std::string name; @@ -121,10 +121,10 @@ namespace mfront { //! \brief description of a material property std::string f; }; // end of AnalyticMaterialProperty - /*! - * \brief this structure holds the value of a material - * property defined through an mfront file - */ + /*! + * \brief this structure holds the value of a material + * property defined through an mfront file + */ struct ExternalMFrontMaterialProperty { //! \brief description of a material property std::shared_ptr mpd; diff --git a/mfront/include/MFront/CalculiX/CalculiXBehaviourHandler.hxx b/mfront/include/MFront/CalculiX/CalculiXBehaviourHandler.hxx index d62020525..18c529fb9 100644 --- a/mfront/include/MFront/CalculiX/CalculiXBehaviourHandler.hxx +++ b/mfront/include/MFront/CalculiX/CalculiXBehaviourHandler.hxx @@ -152,7 +152,7 @@ namespace calculix { b.setCALCULIXBehaviourDataGradients(DV0); b.setCALCULIXIntegrationDataGradients(DV1); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -162,7 +162,7 @@ namespace calculix { CalculiXComputeStiffnessTensor::etype>::exe( data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -174,7 +174,7 @@ namespace calculix { BV>::stype>::exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/CalculiX/CalculiXConvert.hxx b/mfront/include/MFront/CalculiX/CalculiXConvert.hxx index e725b83a0..8f6a2c078 100644 --- a/mfront/include/MFront/CalculiX/CalculiXConvert.hxx +++ b/mfront/include/MFront/CalculiX/CalculiXConvert.hxx @@ -44,7 +44,7 @@ namespace calculix { const CalculiXReal* const v) { tfel::fsalgo::copy<9u>::exe(v, F.begin()); } // end of exe - }; // end of struct ImportGradients + }; // end of struct ImportGradients /*! * \brief class defining the convertion from calculix to mfront for * thermodynamic forces @@ -60,7 +60,7 @@ namespace calculix { const CalculiXReal* const v) { tfel::fsalgo::copy<6u>::exe(v, s.begin()); } // end of exe - }; // end of struct ImportThermodynamicForces + }; // end of struct ImportThermodynamicForces /*! * \brief class defining the convertion from mfront to calculix for * thermodynamic forces @@ -76,7 +76,7 @@ namespace calculix { const tfel::math::stensor<3u, T>& s) { tfel::fsalgo::copy<6u>::exe(s.begin(), v); } // end of exe - }; // end of struct ExportThermodynamicForces + }; // end of struct ExportThermodynamicForces } // end of namespace calculix diff --git a/mfront/include/MFront/CalculiX/CalculiXInterface.hxx b/mfront/include/MFront/CalculiX/CalculiXInterface.hxx index a8daab5bc..c93360563 100644 --- a/mfront/include/MFront/CalculiX/CalculiXInterface.hxx +++ b/mfront/include/MFront/CalculiX/CalculiXInterface.hxx @@ -124,7 +124,7 @@ namespace calculix { i.exe(d); } }; // end of struct CallBehaviour2 - }; // end of struct CalculiXInterface + }; // end of struct CalculiXInterface } // end of namespace calculix diff --git a/mfront/include/MFront/Castem/CastemBehaviourHandler.hxx b/mfront/include/MFront/Castem/CastemBehaviourHandler.hxx index b6b9df2db..296cd25ab 100644 --- a/mfront/include/MFront/Castem/CastemBehaviourHandler.hxx +++ b/mfront/include/MFront/Castem/CastemBehaviourHandler.hxx @@ -282,15 +282,15 @@ namespace castem { bData.setCASTEMBehaviourDataGradients(STRAN); iData.setCASTEMIntegrationDataGradients(DSTRAN); } // end of exe - /*! - * \param[out] b : b - * \param[in] STRAN : driving variable at the beginning of the - * time step - * \param[in] DSTRAN : driving variable at the end of the - * time step or driving variable increment - * \param[in] sfeh : function handling the stress-free expansion - * at the beginning of the time step - */ + /*! + * \param[out] b : b + * \param[in] STRAN : driving variable at the beginning of the + * time step + * \param[in] DSTRAN : driving variable at the end of the + * time step or driving variable increment + * \param[in] sfeh : function handling the stress-free expansion + * at the beginning of the time step + */ TFEL_CASTEM_INLINE static void exe(BV &b, const CastemReal *const STRAN, const CastemReal *const DSTRAN, @@ -298,7 +298,7 @@ namespace castem { b.setCASTEMBehaviourDataGradients(STRAN); b.setCASTEMIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion /*! * An helper structure which is used to compute the stiffness @@ -314,7 +314,7 @@ namespace castem { CastemComputeStiffnessTensor::exe( data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessTensorInitializer + }; // end of struct StiffnessTensorInitializer /*! * An helper structure which is used to compute the thermal @@ -329,7 +329,7 @@ namespace castem { type, H, CastemTraits::stype>:: exe(props, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer /*! * an helper class which don't do any initialisation diff --git a/mfront/include/MFront/Castem/CastemComputeStiffnessTensor.hxx b/mfront/include/MFront/Castem/CastemComputeStiffnessTensor.hxx index 01964f69a..2644064fa 100644 --- a/mfront/include/MFront/Castem/CastemComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/Castem/CastemComputeStiffnessTensor.hxx @@ -51,9 +51,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal @@ -72,9 +72,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeOrthotropicStiffnessTensor1D( - tfel::config::Types<1u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeOrthotropicStiffnessTensor1D( + tfel::config::Types<1u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief compute the stiffness tensor for plane strain, generalised @@ -83,9 +83,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief compute the stiffness tensor for plane stress modelling @@ -94,9 +94,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief compute the stiffness tensor for plane stress modelling @@ -105,9 +105,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeOrthotropicPlaneStressUnAlteredStiffnessTensor( - tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeOrthotropicPlaneStressUnAlteredStiffnessTensor( + tfel::config::Types<2u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal @@ -116,9 +116,9 @@ namespace castem { * \param[in] props : material properties */ MFRONT_CASTEM_VISIBILITY_EXPORT void - CastemComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, CastemReal, false>::StiffnessTensor&, - const CastemReal* const); + CastemComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, CastemReal, false>::StiffnessTensor&, + const CastemReal* const); /*! * \brief This structure is in charge of computing the elastic diff --git a/mfront/include/MFront/Castem/CastemGenericPlaneStressHandler.hxx b/mfront/include/MFront/Castem/CastemGenericPlaneStressHandler.hxx index 714b1ca8d..b181cde31 100644 --- a/mfront/include/MFront/Castem/CastemGenericPlaneStressHandler.hxx +++ b/mfront/include/MFront/Castem/CastemGenericPlaneStressHandler.hxx @@ -289,7 +289,7 @@ namespace castem { c1, c1, c3, DTIME, DROT, DDSDDE, STRAN, DSTRAN, TEMP, DTEMP, nPROPS, &nb, PREDEF, DPRED, STATEV, NSTATV, STRESS, PNEWDT, op, sfeh); } // end of exe - }; // end of struct TreatPlanStressIsotropicBehaviour + }; // end of struct TreatPlanStressIsotropicBehaviour struct TreatPlaneStressOrthotropicBehaviour { TFEL_CASTEM_INLINE2 static void exe( @@ -373,7 +373,7 @@ namespace castem { nPROPS, NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, PNEWDT, op, sfeh); } // end of exe - }; // end of struct TreatPlanStressOrthotropicBehaviour + }; // end of struct TreatPlanStressOrthotropicBehaviour }; // end of struct CastemGenericPlaneStressHandlerTreatPlaneStrain diff --git a/mfront/include/MFront/Castem/CastemInterfaceDispatch.hxx b/mfront/include/MFront/Castem/CastemInterfaceDispatch.hxx index a14175390..c1a90ed3d 100644 --- a/mfront/include/MFront/Castem/CastemInterfaceDispatch.hxx +++ b/mfront/include/MFront/Castem/CastemInterfaceDispatch.hxx @@ -68,7 +68,7 @@ namespace castem { throwInvalidBehaviourTypeAndModellingHypothesis(type, MH::toString(H)); } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch /*! * \class CastemInterfaceDispatch @@ -130,7 +130,7 @@ namespace castem { STATEV, STRESS, op, sfeh); handler.exe(DDSDDE, STRESS, STATEV, PNEWDT); } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch /*! * \class CastemInterfaceDispatch @@ -181,7 +181,7 @@ namespace castem { NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, PNEWDT, op, sfeh); } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch /*! * \class CastemInterfaceDispatch @@ -291,7 +291,7 @@ namespace castem { NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, PNEWDT, op, sfeh); } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch /* cohesive zones models */ template < @@ -353,7 +353,7 @@ namespace castem { STRESS[0] = t[1]; STRESS[1] = t[0]; } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch template < template @@ -453,7 +453,7 @@ namespace castem { STRESS[1] = t[2]; STRESS[2] = t[0]; } // end of exe - }; // end of struct CastemInterfaceDispatch + }; // end of struct CastemInterfaceDispatch } // end of namespace castem diff --git a/mfront/include/MFront/Castem/CastemOrthotropicBehaviourHandler.hxx b/mfront/include/MFront/Castem/CastemOrthotropicBehaviourHandler.hxx index faaf8b3b3..43118b31b 100644 --- a/mfront/include/MFront/Castem/CastemOrthotropicBehaviourHandler.hxx +++ b/mfront/include/MFront/Castem/CastemOrthotropicBehaviourHandler.hxx @@ -208,7 +208,7 @@ namespace castem { STATEV, STRESS, op, sfeh); handler.exe(DDSDDE, STRESS, STATEV, PNEWDT); } // end of CastemOrthotropicBehaviourHander<1u,Behaviour>::exe - }; // end of struct CastemOrthotropicBehaviourHander<1u,Behaviour> + }; // end of struct CastemOrthotropicBehaviourHander<1u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -280,7 +280,7 @@ namespace castem { m.rotateTangentOperatorBackward(DDSDDE); } } // end of CastemOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> + }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> template < template @@ -355,7 +355,7 @@ namespace castem { m.rotateTangentOperatorBackward(DDSDDE); } } // end of CastemOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> + }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -508,7 +508,7 @@ namespace castem { STRESS, op, sfeh); handler.exe(DDSDDE, STRESS, STATEV, PNEWDT); } // end of CastemOrthotropicBehaviourHander<1u,Behaviour>::exe - }; // end of struct CastemOrthotropicBehaviourHander<1u,Behaviour> + }; // end of struct CastemOrthotropicBehaviourHander<1u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, @@ -581,7 +581,7 @@ namespace castem { m.rotateTangentOperatorBackward(DDSDDE); } } // end of CastemOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> + }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> template < template @@ -658,7 +658,7 @@ namespace castem { m.rotateTangentOperatorBackward(DDSDDE); } } // end of CastemOrthotropicBehaviourHander<2u,Behaviour>::exe - }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> + }; // end of CastemOrthotropicBehaviourHander<2u,Behaviour> template < tfel::material::ModellingHypothesis::Hypothesis H, diff --git a/mfront/include/MFront/Cyrano/CyranoBehaviourHandler.hxx b/mfront/include/MFront/Cyrano/CyranoBehaviourHandler.hxx index ff0060f2d..3bccf496a 100644 --- a/mfront/include/MFront/Cyrano/CyranoBehaviourHandler.hxx +++ b/mfront/include/MFront/Cyrano/CyranoBehaviourHandler.hxx @@ -170,7 +170,7 @@ namespace cyrano { b.setCYRANOBehaviourDataGradients(eto); b.setCYRANOIntegrationDataGradients(deto); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion /*! * An helper structure which is used to compute the stiffness @@ -185,7 +185,7 @@ namespace cyrano { CyranoComputeStiffnessTensor::exe( data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer /*! * An helper structure which is used to compute the thermal @@ -201,7 +201,7 @@ namespace cyrano { CyranoComputeThermalExpansionCoefficientTensor::exe( props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer /*! * an helper class which don't do any initialisation diff --git a/mfront/include/MFront/Cyrano/CyranoGenericPlaneStressHandler.hxx b/mfront/include/MFront/Cyrano/CyranoGenericPlaneStressHandler.hxx index 19b09ef8b..23330a9e6 100644 --- a/mfront/include/MFront/Cyrano/CyranoGenericPlaneStressHandler.hxx +++ b/mfront/include/MFront/Cyrano/CyranoGenericPlaneStressHandler.hxx @@ -254,7 +254,7 @@ namespace cyrano { c1, c1, c3, DTIME, DROT, DDSOE, STRAN, DSTRAN, TEMP, DTEMP, PROPS, NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, op); } // end of exe - }; // end of struct TreatPlanStressIsotropicBehaviour + }; // end of struct TreatPlanStressIsotropicBehaviour struct TreatPlaneStressOrthotropicBehaviour { TFEL_CYRANO_INLINE2 static void exe( @@ -330,7 +330,7 @@ namespace cyrano { c1, c2, S22, DTIME, DROT, DDSOE, STRAN, DSTRAN, TEMP, DTEMP, nPROPS, NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, op); } // end of exe - }; // end of struct TreatPlanStressOrthotropicBehaviour + }; // end of struct TreatPlanStressOrthotropicBehaviour }; // end of struct CyranoGenericPlaneStressHandlerTreatPlaneStrain diff --git a/mfront/include/MFront/Cyrano/CyranoInterfaceDispatch.hxx b/mfront/include/MFront/Cyrano/CyranoInterfaceDispatch.hxx index 18b959944..c68e026c9 100644 --- a/mfront/include/MFront/Cyrano/CyranoInterfaceDispatch.hxx +++ b/mfront/include/MFront/Cyrano/CyranoInterfaceDispatch.hxx @@ -72,7 +72,7 @@ namespace cyrano { Handler::exe(DTIME, DROT, DDSOE, STRAN, DSTRAN, TEMP, DTEMP, PROPS, NPROPS, PREDEF, DPRED, STATEV, NSTATV, STRESS, sfeh, op); } // end of exe - }; // end of struct CyranoInterfaceDispatch + }; // end of struct CyranoInterfaceDispatch } // end of namespace cyrano diff --git a/mfront/include/MFront/DSLBase.hxx b/mfront/include/MFront/DSLBase.hxx index 8ae9ff89c..1b6a28211 100644 --- a/mfront/include/MFront/DSLBase.hxx +++ b/mfront/include/MFront/DSLBase.hxx @@ -113,12 +113,12 @@ namespace mfront { */ virtual ~VariableModifier(); }; // end of struct VariableModifier - /*! - * \brief An helper structure used by the DSLBase class to modify the - * code provided by the user. - * - * These modifiers are called when the parser encounters variables. - */ + /*! + * \brief An helper structure used by the DSLBase class to modify the + * code provided by the user. + * + * These modifiers are called when the parser encounters variables. + */ struct MFRONT_VISIBILITY_EXPORT WordAnalyser { /*! * \param[in] cb : code block being treated @@ -591,6 +591,10 @@ namespace mfront { TargetsDescription td; //! \brief additional linker flags std::vector ldflags; + //! \brief additional link libraries + std::vector link_libraries; + //! \brief additional link directories + std::vector link_directories; //! \brief auxiliary target descriptions std::vector atds; //! \brief current position in the input stream diff --git a/mfront/include/MFront/DataInterpolationUtilities.hxx b/mfront/include/MFront/DataInterpolationUtilities.hxx new file mode 100644 index 000000000..804c5c629 --- /dev/null +++ b/mfront/include/MFront/DataInterpolationUtilities.hxx @@ -0,0 +1,89 @@ +/*! + * \file mfront/include/MFront/DataInterpolationUtilities.hxx + * \brief This file declares a set of classes and methods useful + * to handle data interpolation. + * \author Thomas Helfer + * \brief 17/06/2024 + * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights + * reserved. + * This project is publicly released under either the GNU GPL Licence + * or the CECILL-A licence. A copy of thoses licences are delivered + * with the sources of TFEL. CEA or EDF may also distribute this + * project under specific licensing conditions. + */ + +#include +#include +#include "TFEL/Utilities/Data.hxx" +#include "MFront/MFrontConfig.hxx" + +namespace mfront { + + /*! + * \brief a structure representing the interpolation of data + * of a single variable + */ + struct MFRONT_VISIBILITY_EXPORT SingleVariableInterpolatedData { + //! \brief arguments passed to the writeLinearInterpolationValues function + struct WriteLinearInterpolationValuesArguments { + std::string abscissae_name; + std::string abscissae_type; + std::string ordinates_name; + std::string ordinates_type; + }; + //! \brief arguments passed to the writeCollocationPoints function + struct WriteCollocationPointsArguments { + std::string collocation_points_name; + std::string abscissae_type; + std::string ordinates_type; + std::string ordinates_derivatives_type; + }; + /*! + * \return an object built from the given data map + * \param[in] d: data map + */ + static SingleVariableInterpolatedData extract( + const tfel::utilities::DataMap&); + /*! + * \brief interpolation algorithm + */ + enum InterpolationType { + LINEAR_INTERPOLATION, + CUBIC_SPLINE_INTERPOLATION + } itype = LINEAR_INTERPOLATION; + /*! + * \brief extrapolation type + * + * If true, extrapolation is allowed and based on the interpolation + * selected. If false, no extrapolation is performed and the value is kept + * constant, egal to the value of the closest point. + */ + bool etype = true; + /*! + * \brief the values of the yield radius as a function of the equivalent + * plastic strain. + */ + std::map values; + }; + + /*! + * \brief write the declarations of two constexpr arrays containing the + * abscissaes and the ordinates of interpolation data + * \param[in] idata: interpolated data + * \param[in] args: additional information + */ + MFRONT_VISIBILITY_EXPORT std::string writeLinearInterpolationValues( + const SingleVariableInterpolatedData&, + const SingleVariableInterpolatedData:: + WriteLinearInterpolationValuesArguments&); + /*! + * \brief write the collocations points computed from + * abscissaes and the ordinates of interpolation data + * \param[in] idata: interpolated data + * \param[in] args: additional information + */ + MFRONT_VISIBILITY_EXPORT std::string writeCollocationPoints( + const SingleVariableInterpolatedData&, + const SingleVariableInterpolatedData::WriteCollocationPointsArguments&); + +} // end of namespace mfront \ No newline at end of file diff --git a/mfront/include/MFront/DianaFEA/DianaFEABehaviourHandler.hxx b/mfront/include/MFront/DianaFEA/DianaFEABehaviourHandler.hxx index 73bbf41bf..3d431afd6 100644 --- a/mfront/include/MFront/DianaFEA/DianaFEABehaviourHandler.hxx +++ b/mfront/include/MFront/DianaFEA/DianaFEABehaviourHandler.hxx @@ -123,7 +123,7 @@ namespace dianafea { b.setDIANAFEABehaviourDataGradients(STRAN); b.setDIANAFEAIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -137,7 +137,7 @@ namespace dianafea { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -149,7 +149,7 @@ namespace dianafea { DianaFEATraits::btype, H, DianaFEATraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/DianaFEA/DianaFEAComputeStiffnessTensor.hxx b/mfront/include/MFront/DianaFEA/DianaFEAComputeStiffnessTensor.hxx index d4387641e..3d8876a23 100644 --- a/mfront/include/MFront/DianaFEA/DianaFEAComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/DianaFEA/DianaFEAComputeStiffnessTensor.hxx @@ -30,9 +30,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicStiffnessTensor2D( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeIsotropicStiffnessTensor2D( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane strain, generalised * plane strain and axisymmetrical hypotheses. @@ -40,9 +40,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicStiffnessTensor2D( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeIsotropicStiffnessTensor2D( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -50,9 +50,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -60,9 +60,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -70,9 +70,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicStiffnessTensor3D( - tfel::config::Types<3u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeIsotropicStiffnessTensor3D( + tfel::config::Types<3u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -80,9 +80,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeIsotropicStiffnessTensor3D( - tfel::config::Types<3u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeIsotropicStiffnessTensor3D( + tfel::config::Types<3u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for plane strain, generalised * plane strain and axisymmetrical hypotheses. @@ -90,9 +90,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane strain, generalised * plane strain and axisymmetrical hypotheses. @@ -100,9 +100,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -110,9 +110,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -120,9 +120,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -130,9 +130,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, float, false>::StiffnessTensor&, - const float* const); + DianaFEAComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -140,9 +140,9 @@ namespace dianafea { * \param[in] props : material properties */ MFRONT_DIANAFEA_VISIBILITY_EXPORT void - DianaFEAComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, double, false>::StiffnessTensor&, - const double* const); + DianaFEAComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, double, false>::StiffnessTensor&, + const double* const); /*! * This structure is in charge of computing the Stiffness operator diff --git a/mfront/include/MFront/DianaFEA/DianaFEAConvert.hxx b/mfront/include/MFront/DianaFEA/DianaFEAConvert.hxx index 059935fd0..394a8ab8b 100644 --- a/mfront/include/MFront/DianaFEA/DianaFEAConvert.hxx +++ b/mfront/include/MFront/DianaFEA/DianaFEAConvert.hxx @@ -63,7 +63,7 @@ namespace dianafea { const DianaFEAReal* const v) { tfel::math::tensor::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct ImportGradients + }; // end of struct ImportGradients /*! * \brief class defining the convertion from dianafea to mfront for @@ -85,7 +85,7 @@ namespace dianafea { const DianaFEAReal* const v) { ImportSymmetricTensor::exe(s, v); } // end of exe - }; // end of struct ImportThermodynamicForces + }; // end of struct ImportThermodynamicForces /*! * \brief class defining the convertion from mfront to dianafea for @@ -107,7 +107,7 @@ namespace dianafea { const tfel::math::stensor& s) { ExportSymmetricTensor::exe(v, s); } // end of exe - }; // end of struct ExportThermodynamicForces + }; // end of struct ExportThermodynamicForces /*! * \brief partial specialisation of the ImportSymmetricTensor in 1D. diff --git a/mfront/include/MFront/DianaFEA/DianaFEAInterface.hxx b/mfront/include/MFront/DianaFEA/DianaFEAInterface.hxx index fdf1e34ea..c2ea86ea9 100644 --- a/mfront/include/MFront/DianaFEA/DianaFEAInterface.hxx +++ b/mfront/include/MFront/DianaFEA/DianaFEAInterface.hxx @@ -119,7 +119,7 @@ namespace dianafea { i.exe(d); } }; // end of struct CallBehaviour2 - }; // end of struct DianaFEAInterface + }; // end of struct DianaFEAInterface } // end of namespace dianafea diff --git a/mfront/include/MFront/Europlexus/EuroplexusBehaviourHandler.hxx b/mfront/include/MFront/Europlexus/EuroplexusBehaviourHandler.hxx index 7f34129df..0dd13290a 100644 --- a/mfront/include/MFront/Europlexus/EuroplexusBehaviourHandler.hxx +++ b/mfront/include/MFront/Europlexus/EuroplexusBehaviourHandler.hxx @@ -139,7 +139,7 @@ namespace epx { b.setEUROPLEXUSBehaviourDataGradients(STRAN); b.setEUROPLEXUSIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -153,7 +153,7 @@ namespace epx { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -165,7 +165,7 @@ namespace epx { EuroplexusTraits::btype, H, EuroplexusTraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/Europlexus/EuroplexusComputeStiffnessTensor.hxx b/mfront/include/MFront/Europlexus/EuroplexusComputeStiffnessTensor.hxx index 8511d45cd..1a3524954 100644 --- a/mfront/include/MFront/Europlexus/EuroplexusComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/Europlexus/EuroplexusComputeStiffnessTensor.hxx @@ -40,9 +40,9 @@ namespace epx { * \param[in] props : material properties */ MFRONT_EPX_VISIBILITY_EXPORT void - EuroplexusComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, - const EuroplexusReal* const); + EuroplexusComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, + const EuroplexusReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal @@ -61,9 +61,9 @@ namespace epx { * \param[in] props : material properties */ MFRONT_EPX_VISIBILITY_EXPORT void - EuroplexusComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, - const EuroplexusReal* const); + EuroplexusComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, + const EuroplexusReal* const); /*! * \brief compute the stiffness tensor for plane stress modelling @@ -72,9 +72,9 @@ namespace epx { * \param[in] props : material properties */ MFRONT_EPX_VISIBILITY_EXPORT void - EuroplexusComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, - const EuroplexusReal* const); + EuroplexusComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, EuroplexusReal, false>::StiffnessTensor&, + const EuroplexusReal* const); /*! * \brief compute the stiffness tensor for the tridimensionnal @@ -83,9 +83,9 @@ namespace epx { * \param[in] props : material properties */ MFRONT_EPX_VISIBILITY_EXPORT void - EuroplexusComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, EuroplexusReal, false>::StiffnessTensor&, - const EuroplexusReal* const); + EuroplexusComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, EuroplexusReal, false>::StiffnessTensor&, + const EuroplexusReal* const); /*! * This structure is in charge of computing the Stiffness operator diff --git a/mfront/include/MFront/Europlexus/EuroplexusInterface.hxx b/mfront/include/MFront/Europlexus/EuroplexusInterface.hxx index fce4b0dee..9b77c7f51 100644 --- a/mfront/include/MFront/Europlexus/EuroplexusInterface.hxx +++ b/mfront/include/MFront/Europlexus/EuroplexusInterface.hxx @@ -163,7 +163,7 @@ namespace epx { tfel::fsalgo::copy::exe(de.begin(), dv1); return {dv0, dv1}; } // end of exe - }; // end of struct SmallStrainChangeBasis + }; // end of struct SmallStrainChangeBasis template struct FiniteStrainChangeBasis : public StressChangeBasis { static std::pair forward( @@ -192,9 +192,9 @@ namespace epx { static std::pair forward( const EPXData& d, EuroplexusReal* const, EuroplexusReal* const) { return {d.DV0, d.DV1}; - } // end of forward + } // end of forward static void backward(const EPXData&) {} // end of forward - }; // end of struct DoNothing + }; // end of struct DoNothing template struct CallBehaviour2 { TFEL_EPX_INLINE2 static void exe(const EPXData& d) { @@ -223,7 +223,7 @@ namespace epx { ChangeBasis::backward(d); } }; // end of struct CallBehaviour - }; // end of struct EuroplexusInterface + }; // end of struct EuroplexusInterface } // end of namespace epx diff --git a/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.hxx b/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.hxx index f089302fc..2cdc4421a 100644 --- a/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.hxx @@ -31,11 +31,11 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicUnAlteredElasticStiffnessTensor( - tfel::math::st2tost2<1u, stress>&, - const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 1u); + computeOrthotropicUnAlteredElasticStiffnessTensor( + tfel::math::st2tost2<1u, stress>&, + const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 1u); /*! * \brief compute the unaltered elastic stiffness tensor * \param[out] C: stiffness tensor @@ -45,11 +45,11 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicUnAlteredElasticStiffnessTensor( - tfel::math::st2tost2<2u, stress>&, - const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 2u); + computeOrthotropicUnAlteredElasticStiffnessTensor( + tfel::math::st2tost2<2u, stress>&, + const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 2u); /*! * \brief compute the unaltered elastic stiffness tensor * \param[out] C: stiffness tensor @@ -59,11 +59,11 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicUnAlteredElasticStiffnessTensor( - tfel::math::st2tost2<3u, stress>&, - const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 3u); + computeOrthotropicUnAlteredElasticStiffnessTensor( + tfel::math::st2tost2<3u, stress>&, + const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 3u); /*! * \brief compute the unaltered elastic stiffness tensor * \param[out] C: stiffness tensor @@ -73,11 +73,11 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicAlteredElasticStiffnessTensor( - tfel::math::st2tost2<1u, stress>&, - const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 1u); + computeOrthotropicAlteredElasticStiffnessTensor( + tfel::math::st2tost2<1u, stress>&, + const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 1u); /*! * \brief compute the unaltered elastic stiffness tensor * \param[out] C: stiffness tensor @@ -87,11 +87,11 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicAlteredElasticStiffnessTensor( - tfel::math::st2tost2<2u, stress>&, - const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 2u); + computeOrthotropicAlteredElasticStiffnessTensor( + tfel::math::st2tost2<2u, stress>&, + const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 2u); /*! * \brief compute the unaltered elastic stiffness tensor * \param[out] C: stiffness tensor @@ -101,10 +101,10 @@ namespace mfront::gb { typename stress, typename real> TFEL_HOST_DEVICE constexpr void - computeOrthotropicAlteredElasticStiffnessTensor( - tfel::math::st2tost2<3u, stress>&, const real* const) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 3u); + computeOrthotropicAlteredElasticStiffnessTensor( + tfel::math::st2tost2<3u, stress>&, const real* const) noexcept // + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 3u); } // end of namespace mfront::gb diff --git a/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.ixx b/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.ixx index 7dfeeda04..ca0500992 100644 --- a/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.ixx +++ b/mfront/include/MFront/GenericBehaviour/ComputeStiffnessTensor.ixx @@ -25,8 +25,9 @@ namespace mfront::gb { computeOrthotropicUnAlteredElasticStiffnessTensor( tfel::math::st2tost2<1u, stress>& C, const real* const mps) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 1u) { + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 1u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::UNALTERED; @@ -43,8 +44,9 @@ namespace mfront::gb { computeOrthotropicUnAlteredElasticStiffnessTensor( tfel::math::st2tost2<2u, stress>& C, const real* const mps) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 2u) { + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 2u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::UNALTERED; @@ -59,11 +61,10 @@ namespace mfront::gb { typename real> TFEL_HOST_DEVICE constexpr void computeOrthotropicUnAlteredElasticStiffnessTensor( - tfel::math::st2tost2<3u, stress>& C, - const real* const - mps) noexcept requires(tfel::material:: - ModellingHypothesisToSpaceDimension< - H>::value == 3u) { + tfel::math::st2tost2<3u, stress>& C, const real* const mps) noexcept + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 3u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::UNALTERED; @@ -79,8 +80,9 @@ namespace mfront::gb { computeOrthotropicAlteredElasticStiffnessTensor( tfel::math::st2tost2<1u, stress>& C, const real* const mps) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 1u) { + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 1u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::ALTERED; @@ -97,8 +99,9 @@ namespace mfront::gb { computeOrthotropicAlteredElasticStiffnessTensor( tfel::math::st2tost2<2u, stress>& C, const real* const mps) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 2u) { + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 2u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::ALTERED; @@ -115,8 +118,9 @@ namespace mfront::gb { computeOrthotropicAlteredElasticStiffnessTensor( tfel::math::st2tost2<3u, stress>& C, const real* const mps) noexcept // - requires(tfel::material::ModellingHypothesisToSpaceDimension::value == - 3u) { + requires(tfel::material::ModellingHypothesisToSpaceDimension::value == + 3u) + { using namespace tfel::material; constexpr StiffnessTensorAlterationCharacteristic stac = StiffnessTensorAlterationCharacteristic::ALTERED; diff --git a/mfront/include/MFront/GenericBehaviour/GreenLagrangeStrainIntegrate.hxx b/mfront/include/MFront/GenericBehaviour/GreenLagrangeStrainIntegrate.hxx index d176ed75c..f3e5ef29d 100644 --- a/mfront/include/MFront/GenericBehaviour/GreenLagrangeStrainIntegrate.hxx +++ b/mfront/include/MFront/GenericBehaviour/GreenLagrangeStrainIntegrate.hxx @@ -296,7 +296,7 @@ namespace mfront::gb::green_lagrange_strain { return -1; } } // end of if(bk) - } // end of if(bp) + } // end of if(bp) } return r; } // end of integrate diff --git a/mfront/include/MFront/GenericBehaviour/Integrate.hxx b/mfront/include/MFront/GenericBehaviour/Integrate.hxx index 5dc6374ba..cb0905e27 100644 --- a/mfront/include/MFront/GenericBehaviour/Integrate.hxx +++ b/mfront/include/MFront/GenericBehaviour/Integrate.hxx @@ -255,7 +255,7 @@ namespace mfront::gb { b.computeDissipatedEnergy(e); tfel::math::map(*(d.s1.dissipated_energy)) = e; } // end of exe - }; // end of struct DissipatedEnergyComputer + }; // end of struct DissipatedEnergyComputer //! place holder for tag dispatching struct DoNothingEnergyComputer { //! \brief empty function diff --git a/mfront/include/MFront/GenericBehaviour/LogarithmicStrainIntegrate.hxx b/mfront/include/MFront/GenericBehaviour/LogarithmicStrainIntegrate.hxx index e0e20b1a0..a6cbdaba1 100644 --- a/mfront/include/MFront/GenericBehaviour/LogarithmicStrainIntegrate.hxx +++ b/mfront/include/MFront/GenericBehaviour/LogarithmicStrainIntegrate.hxx @@ -306,7 +306,7 @@ namespace mfront::gb::logarithmic_strain { return -1; } } // end of if(bk) - } // end of if(bp) + } // end of if(bp) } return r; } // end of integrate diff --git a/mfront/include/MFront/IntegrationScheme.hxx b/mfront/include/MFront/IntegrationScheme.hxx index 5f94a4cea..3508fb3f5 100644 --- a/mfront/include/MFront/IntegrationScheme.hxx +++ b/mfront/include/MFront/IntegrationScheme.hxx @@ -31,7 +31,7 @@ namespace mfront { * `MultipleIsotropicMisesFlowsDSL` dsls. */ USERDEFINEDSCHEME, //!< default value. UNDEFINEDINTEGRATIONSCHEME //!< undefined value. - }; // end of enum struct IntegrationScheme + }; // end of enum struct IntegrationScheme } // end of namespace mfront diff --git a/mfront/include/MFront/LSDYNA/LSDYNABehaviourHandler.hxx b/mfront/include/MFront/LSDYNA/LSDYNABehaviourHandler.hxx index bb947a304..dd4bed721 100644 --- a/mfront/include/MFront/LSDYNA/LSDYNABehaviourHandler.hxx +++ b/mfront/include/MFront/LSDYNA/LSDYNABehaviourHandler.hxx @@ -143,7 +143,7 @@ namespace lsdyna { b.setLSDYNABehaviourDataGradients(STRAN); b.setLSDYNAIntegrationDataGradients(DSTRAN); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct GradientInitialiserWithoutStressFreeExpansion struct TFEL_VISIBILITY_LOCAL StiffnessOperatorInitializer { typedef Behaviour BV; @@ -157,7 +157,7 @@ namespace lsdyna { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef Behaviour BV; @@ -169,7 +169,7 @@ namespace lsdyna { LSDYNATraits::btype, H, LSDYNATraits::stype>:: exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef Behaviour BV; diff --git a/mfront/include/MFront/LSDYNA/LSDYNAComputeStiffnessTensor.hxx b/mfront/include/MFront/LSDYNA/LSDYNAComputeStiffnessTensor.hxx index 7ca1ee4d2..95c675397 100644 --- a/mfront/include/MFront/LSDYNA/LSDYNAComputeStiffnessTensor.hxx +++ b/mfront/include/MFront/LSDYNA/LSDYNAComputeStiffnessTensor.hxx @@ -48,9 +48,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + LSDYNAComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -58,9 +58,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeIsotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + LSDYNAComputeIsotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -86,9 +86,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + LSDYNAComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane strain, generalised * plane strain and axisymmetrical hypotheses. @@ -96,9 +96,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicStiffnessTensor2D( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + LSDYNAComputeOrthotropicStiffnessTensor2D( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -106,9 +106,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, float, false>::StiffnessTensor&, - const float* const); + LSDYNAComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for plane stress modelling * hypothesis. @@ -116,9 +116,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicPlaneStressAlteredStiffnessTensor( - tfel::config::Types<2u, double, false>::StiffnessTensor&, - const double* const); + LSDYNAComputeOrthotropicPlaneStressAlteredStiffnessTensor( + tfel::config::Types<2u, double, false>::StiffnessTensor&, + const double* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -126,9 +126,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, float, false>::StiffnessTensor&, - const float* const); + LSDYNAComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, float, false>::StiffnessTensor&, + const float* const); /*! * \brief compute the stiffness tensor for the tridimensionnal * modelling hypothesis. @@ -136,9 +136,9 @@ namespace lsdyna { * \param[in] props : material properties */ MFRONT_LSDYNA_VISIBILITY_EXPORT void - LSDYNAComputeOrthotropicStiffnessTensor3D( - tfel::config::Types<3u, double, false>::StiffnessTensor&, - const double* const); + LSDYNAComputeOrthotropicStiffnessTensor3D( + tfel::config::Types<3u, double, false>::StiffnessTensor&, + const double* const); /*! * This structure is in charge of computing the Stiffness operator diff --git a/mfront/include/MFront/LSDYNA/LSDYNAConvert.hxx b/mfront/include/MFront/LSDYNA/LSDYNAConvert.hxx index 8ccdb723c..5a172673b 100644 --- a/mfront/include/MFront/LSDYNA/LSDYNAConvert.hxx +++ b/mfront/include/MFront/LSDYNA/LSDYNAConvert.hxx @@ -48,7 +48,7 @@ namespace lsdyna { const LSDYNAReal* const v) { tfel::math::tensor::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct UMATImportGradients + }; // end of struct UMATImportGradients /*! * \brief partial specialisation of the UMATImportGradients * for the plane stress modelling hypothesis. @@ -79,7 +79,7 @@ namespace lsdyna { const LSDYNAReal* const v) { tfel::math::tensor<2u, T>::buildFromFortranMatrix(F, v); } // end of exe - }; // end of struct UMATImportGradients + }; // end of struct UMATImportGradients /*! * \brief class defining the convertion from lsdyna to mfront for * thermodynamic forces @@ -100,7 +100,7 @@ namespace lsdyna { const LSDYNAReal* const v) { s.importTab(v); } // end of exe - }; // end of struct UMATImportThermodynamicForces + }; // end of struct UMATImportThermodynamicForces /*! * \brief partial specialisation of the UMATImportThermodynamicForces * for the plane stress modelling hypothesis. @@ -122,7 +122,7 @@ namespace lsdyna { s[2] = LSDYNAReal{0}; s[3] = v[2] * cste; } // end of exe - }; // end of struct UMATImportThermodynamicForces + }; // end of struct UMATImportThermodynamicForces /*! * \brief class defining the convertion from mfront to lsdyna for * thermodynamic forces @@ -143,7 +143,7 @@ namespace lsdyna { const tfel::math::stensor& s) { s.exportTab(v); } // end of exe - }; // end of struct UMATExportThermodynamicForces + }; // end of struct UMATExportThermodynamicForces /*! * \brief partial specialisation of the UMATExportThermodynamicForces * for the plane stress modelling hypothesis. @@ -164,7 +164,7 @@ namespace lsdyna { v[1] = s[1]; v[2] = s[3] * icste; } // end of exe - }; // end of struct UMATExportThermodynamicForces + }; // end of struct UMATExportThermodynamicForces } // end of namespace lsdyna diff --git a/mfront/include/MFront/LSDYNA/LSDYNAExplicitInterface.hxx b/mfront/include/MFront/LSDYNA/LSDYNAExplicitInterface.hxx index fa2d5e898..d3285df68 100644 --- a/mfront/include/MFront/LSDYNA/LSDYNAExplicitInterface.hxx +++ b/mfront/include/MFront/LSDYNA/LSDYNAExplicitInterface.hxx @@ -78,7 +78,7 @@ namespace lsdyna { buas>::exe(data.getStiffnessTensor(), props); } // end of exe - }; // end of struct StiffnessOperatorInitializer + }; // end of struct StiffnessOperatorInitializer //! structure in charge of initializing the stiffness operator struct TFEL_VISIBILITY_LOCAL ThermalExpansionCoefficientTensorInitializer { typedef typename BV::BehaviourData BData; @@ -89,7 +89,7 @@ namespace lsdyna { ATraits::stype>::exe(props + o, data.getThermalExpansionCoefficientTensor()); } // end of exe - }; // end of struct ThermalExpansionCoefficientTensorInitializer + }; // end of struct ThermalExpansionCoefficientTensorInitializer //! place holder for tag dispatching struct TFEL_VISIBILITY_LOCAL DoNothingInitializer { typedef typename BV::BehaviourData BData; @@ -317,7 +317,7 @@ namespace lsdyna { b.setBehaviourDataGradients(e); b.setIntegrationDataGradients(de); } // end of exe - }; // end of struct GradientInitialiserWithStressFreeExpansion + }; // end of struct GradientInitialiserWithStressFreeExpansion //! An helper structure used to initialise the driving variables struct TFEL_VISIBILITY_LOCAL GradientInitialiserWithoutStressFreeExpansion { /*! @@ -337,8 +337,8 @@ namespace lsdyna { b.setBehaviourDataGradients(e); b.setIntegrationDataGradients(de); } // end of exe - }; // end of struct GradientInitialiserWithoutStressFreeExpansion - }; // end of struct LSDYNAExplicitInterface + }; // end of struct GradientInitialiserWithoutStressFreeExpansion + }; // end of struct LSDYNAExplicitInterface } // end of namespace lsdyna diff --git a/mfront/include/MFront/LSDYNA/LSDYNAInterface.hxx b/mfront/include/MFront/LSDYNA/LSDYNAInterface.hxx index d5de9818f..edf04a722 100644 --- a/mfront/include/MFront/LSDYNA/LSDYNAInterface.hxx +++ b/mfront/include/MFront/LSDYNA/LSDYNAInterface.hxx @@ -122,7 +122,7 @@ namespace lsdyna { i.exe(d); } }; // end of struct CallBehaviour2 - }; // end of struct LSDYNAInterface + }; // end of struct LSDYNAInterface } // end of namespace lsdyna diff --git a/mfront/include/MFront/MFrontBase.hxx b/mfront/include/MFront/MFrontBase.hxx index 39df6b856..02c6f0217 100644 --- a/mfront/include/MFront/MFrontBase.hxx +++ b/mfront/include/MFront/MFrontBase.hxx @@ -38,8 +38,8 @@ namespace mfront { * \param[in] dsl_options: options passed to the DSL * \return an abstract dsl that will handle the file */ - static std::shared_ptr getDSL(const std::string&, - const tfel::utilities::DataMap& = {}); + static std::shared_ptr getDSL( + const std::string&, const tfel::utilities::DataMap& = {}); /*! * \return an abstract dsl that will handle the source described by the * given iterators diff --git a/mfront/include/MFront/MFrontLogStream.hxx b/mfront/include/MFront/MFrontLogStream.hxx index 5d0cdaf0a..faeffb29f 100644 --- a/mfront/include/MFront/MFrontLogStream.hxx +++ b/mfront/include/MFront/MFrontLogStream.hxx @@ -33,7 +33,7 @@ namespace mfront { VERBOSE_LEVEL3 = 3, // - T& getAttribute(const std::string_view) requires( - isMaterialKnowledgeAttributeType()); + T& getAttribute(const std::string_view) + requires(isMaterialKnowledgeAttributeType()); /*! * \return the attribute with the given name * \param[in] n : name */ template const T& getAttribute(const std::string_view) const - requires(isMaterialKnowledgeAttributeType()); + requires(isMaterialKnowledgeAttributeType()); /*! * \return the attribute with the given name * \param[in] n: name @@ -102,7 +102,7 @@ namespace mfront { */ template T getAttribute(const std::string_view, const T&) const - requires(isMaterialKnowledgeAttributeType()); + requires(isMaterialKnowledgeAttributeType()); /*! * \return all the attribute registred * \param[in] n : name diff --git a/mfront/include/MFront/MaterialKnowledgeDescription.ixx b/mfront/include/MFront/MaterialKnowledgeDescription.ixx index a61a28336..c2cfe3dff 100644 --- a/mfront/include/MFront/MaterialKnowledgeDescription.ixx +++ b/mfront/include/MFront/MaterialKnowledgeDescription.ixx @@ -18,7 +18,8 @@ namespace mfront { template T& MaterialKnowledgeDescription::getAttribute(const std::string_view n) // - requires(isMaterialKnowledgeAttributeType()) { + requires(isMaterialKnowledgeAttributeType()) + { auto p = this->attributes.find(n); if (p == this->attributes.end()) { p = this->attributes @@ -31,7 +32,8 @@ namespace mfront { template const T& MaterialKnowledgeDescription::getAttribute( const std::string_view n) const // - requires(isMaterialKnowledgeAttributeType()) { + requires(isMaterialKnowledgeAttributeType()) + { const auto p = this->attributes.find(n); if (p == this->attributes.end()) { MaterialKnowledgeDescription::throwUndefinedAttribute(n); @@ -42,7 +44,8 @@ namespace mfront { template T MaterialKnowledgeDescription::getAttribute(const std::string_view n, const T& v) const // - requires(isMaterialKnowledgeAttributeType()) { + requires(isMaterialKnowledgeAttributeType()) + { const auto p = this->attributes.find(n); if (p == this->attributes.end()) { return v; diff --git a/mfront/include/MFront/MaterialPropertyDSL.hxx b/mfront/include/MFront/MaterialPropertyDSL.hxx index 15a2b0d92..dc18fb9aa 100644 --- a/mfront/include/MFront/MaterialPropertyDSL.hxx +++ b/mfront/include/MFront/MaterialPropertyDSL.hxx @@ -12,8 +12,8 @@ * project under specific licensing conditions. */ -#ifndef LIB_MFRONTMATERIALLAWPARSER_HXX -#define LIB_MFRONTMATERIALLAWPARSER_HXX +#ifndef LIB_MATERIALPROPERTYDSL_HXX +#define LIB_MATERIALPROPERTYDSL_HXX #include #include @@ -118,6 +118,12 @@ namespace mfront { virtual void treatLaw(); //! \brief treat the `@Function` keyword virtual void treatFunction(); + //! \brief treat the `@Data` keyword + virtual void treatData(); + //! \brief auxiliary method to treat constant data + void treatDataWithoutInput(); + //! \brief auxiliary method to treat data for one input + void treatDataWithOneInput(); /*! * treat the setGlossaryName and the setEntryName method for * inputs or output. @@ -163,4 +169,4 @@ namespace mfront { } // end of namespace mfront -#endif /* LIB_MFRONTMATERIALLAWPARSER_HXX */ +#endif /* LIB_MATERIALPROPERTYDSL_HXX */ diff --git a/mfront/include/MFront/ModelDescription.hxx b/mfront/include/MFront/ModelDescription.hxx index 7e05f7e78..4c9558801 100644 --- a/mfront/include/MFront/ModelDescription.hxx +++ b/mfront/include/MFront/ModelDescription.hxx @@ -63,10 +63,10 @@ namespace mfront { //! \brief if true, the body of the function uses the time increment dt bool useTimeIncrement = false; }; // end of struct MFrontData::Function - /*! - * \brief decompose a variable name to get the basis and the depth - * of the variable - */ + /*! + * \brief decompose a variable name to get the basis and the depth + * of the variable + */ std::pair decomposeVariableName( const std::string&) const; //! \brief defaut constructor diff --git a/mfront/include/MFront/SymbolsGenerator.hxx b/mfront/include/MFront/SymbolsGenerator.hxx index a561ddc3c..7d39de4ae 100644 --- a/mfront/include/MFront/SymbolsGenerator.hxx +++ b/mfront/include/MFront/SymbolsGenerator.hxx @@ -202,11 +202,10 @@ namespace mfront { * (generally taking into account the material * and the behaviour name) */ - virtual void writeBehaviourKinematicSymbols( - std::ostream &, - const BehaviourInterfaceBase &, - const BehaviourDescription &, - const std::string &) const = 0; + virtual void writeBehaviourKinematicSymbols(std::ostream &, + const BehaviourInterfaceBase &, + const BehaviourDescription &, + const std::string &) const = 0; /*! * \brief write the symbols associated with the source file * \param[in] out : output file @@ -308,12 +307,11 @@ namespace mfront { * and the behaviour name) * \param[in] h : modelling hypothesis */ - virtual void writeMaterialPropertiesSymbols( - std::ostream &, - const BehaviourInterfaceBase &, - const BehaviourDescription &, - const std::string &, - const Hypothesis) const; + virtual void writeMaterialPropertiesSymbols(std::ostream &, + const BehaviourInterfaceBase &, + const BehaviourDescription &, + const std::string &, + const Hypothesis) const; /*! * \param[in] out : output file * \param[in] i : standard behaviour interface @@ -358,12 +356,11 @@ namespace mfront { * \param[in] name : name of the behaviour * \param[in] h : modelling hypothesis */ - virtual void writeInitializeFunctionsSymbols( - std::ostream &, - const BehaviourInterfaceBase &, - const BehaviourDescription &, - const std::string &, - const Hypothesis) const; + virtual void writeInitializeFunctionsSymbols(std::ostream &, + const BehaviourInterfaceBase &, + const BehaviourDescription &, + const std::string &, + const Hypothesis) const; /*! * \param[in] out : output file * \param[in] i : standard behaviour interface @@ -441,11 +438,10 @@ namespace mfront { * \param[in] mb : behaviour description * \param[in] name : behaviour name */ - virtual void writeElasticSymmetryTypeSymbols( - std::ostream &, - const BehaviourInterfaceBase &, - const BehaviourDescription &, - const std::string &) const; + virtual void writeElasticSymmetryTypeSymbols(std::ostream &, + const BehaviourInterfaceBase &, + const BehaviourDescription &, + const std::string &) const; /*! * \param[in] out : output file * \param[in] i : standard behaviour interface diff --git a/mfront/include/MFront/VariableDescription.hxx b/mfront/include/MFront/VariableDescription.hxx index b1a19c253..19b1d87f8 100644 --- a/mfront/include/MFront/VariableDescription.hxx +++ b/mfront/include/MFront/VariableDescription.hxx @@ -114,14 +114,15 @@ namespace mfront { * \param[in] n : name */ template - T& getAttribute(const std::string&) requires(isVariableAttribute); + T& getAttribute(const std::string&) + requires(isVariableAttribute); /*! * \return the attribute with the given name * \param[in] n : name */ template const T& getAttribute(const std::string&) const - requires(isVariableAttribute); + requires(isVariableAttribute); /*! * \return the attribute with the given name or the given default * value if the variable does not exists @@ -130,7 +131,7 @@ namespace mfront { */ template T getAttribute(const std::string&, const T&) const - requires(isVariableAttribute); + requires(isVariableAttribute); /*! * \return all the attribute registred * \param[in] n : name diff --git a/mfront/include/MFront/VariableDescription.ixx b/mfront/include/MFront/VariableDescription.ixx index 4c5343503..ea657d45f 100644 --- a/mfront/include/MFront/VariableDescription.ixx +++ b/mfront/include/MFront/VariableDescription.ixx @@ -17,8 +17,9 @@ namespace mfront { template - T& VariableDescription::getAttribute(const std::string& n) requires( - isVariableAttribute) { + T& VariableDescription::getAttribute(const std::string& n) + requires(isVariableAttribute) + { auto p = this->attributes.find(n); if (p == this->attributes.end()) { p = this->attributes.insert({n, VariableAttribute(T())}).first; @@ -28,7 +29,8 @@ namespace mfront { template const T& VariableDescription::getAttribute(const std::string& n) const - requires(isVariableAttribute) { + requires(isVariableAttribute) + { auto p = this->attributes.find(n); if (p == this->attributes.end()) { VariableDescription::throwUndefinedAttribute(n); @@ -38,7 +40,8 @@ namespace mfront { template T VariableDescription::getAttribute(const std::string& n, const T& v) const - requires(isVariableAttribute) { + requires(isVariableAttribute) + { auto p = this->attributes.find(n); if (p != this->attributes.end()) { return p->second.template get(); diff --git a/mfront/include/MFront/ZMATInterface.hxx b/mfront/include/MFront/ZMATInterface.hxx index 0014bc4aa..179988232 100644 --- a/mfront/include/MFront/ZMATInterface.hxx +++ b/mfront/include/MFront/ZMATInterface.hxx @@ -43,52 +43,52 @@ namespace mfront { std::string getInterfaceName() const override; std::string getInterfaceVersion() const override; std::pair treatKeyword( - BehaviourDescription&, - const std::string&, - const std::vector&, + BehaviourDescription &, + const std::string &, + const std::vector &, tokens_iterator, const tokens_iterator) override; bool isBehaviourConstructorRequired( - const Hypothesis, const BehaviourDescription&) const override; + const Hypothesis, const BehaviourDescription &) const override; std::set getModellingHypothesesToBeTreated( - const BehaviourDescription&) const override; + const BehaviourDescription &) const override; std::pair, SupportedTypes::TypeSize> buildMaterialPropertiesList(const BehaviourDescription &, const Hypothesis) const override; void writeInterfaceSpecificIncludes( - std::ostream&, const BehaviourDescription&) const override; - void exportMechanicalData(std::ostream&, + std::ostream &, const BehaviourDescription &) const override; + void exportMechanicalData(std::ostream &, const Hypothesis, - const BehaviourDescription&) const override; - void writeBehaviourConstructorHeader(std::ostream&, - const BehaviourDescription&, + const BehaviourDescription &) const override; + void writeBehaviourConstructorHeader(std::ostream &, + const BehaviourDescription &, const Hypothesis, - const std::string&) const override; - void writeBehaviourConstructorBody(std::ostream&, - const BehaviourDescription&, + const std::string &) const override; + void writeBehaviourConstructorBody(std::ostream &, + const BehaviourDescription &, const Hypothesis) const override; void writeBehaviourDataConstructor( - std::ostream&, + std::ostream &, const Hypothesis, - const BehaviourDescription&) const override; + const BehaviourDescription &) const override; void writeBehaviourDataMainVariablesSetters( - std::ostream&, const BehaviourDescription&) const override; + std::ostream &, const BehaviourDescription &) const override; void writeIntegrationDataConstructor( - std::ostream&, + std::ostream &, const Hypothesis, - const BehaviourDescription&) const override; + const BehaviourDescription &) const override; void writeIntegrationDataMainVariablesSetters( - std::ostream&, const BehaviourDescription&) const override; - void writeBehaviourInitializeFunctions(std::ostream&, - const BehaviourDescription&, + std::ostream &, const BehaviourDescription &) const override; + void writeBehaviourInitializeFunctions(std::ostream &, + const BehaviourDescription &, const Hypothesis) const override; - void writeBehaviourPostProcessings(std::ostream&, - const BehaviourDescription&, + void writeBehaviourPostProcessings(std::ostream &, + const BehaviourDescription &, const Hypothesis) const override; - void endTreatment(const BehaviourDescription&, - const FileDescription&) const override; - void getTargetsDescription(TargetsDescription&, - const BehaviourDescription&) override; + void endTreatment(const BehaviourDescription &, + const FileDescription &) const override; + void getTargetsDescription(TargetsDescription &, + const BehaviourDescription &) override; //! \brief destructor ~ZMATInterface() override; @@ -99,15 +99,15 @@ namespace mfront { * \param[in] bd: behaviour description */ void checkIfTemperatureIsDefinedAsTheFirstExternalStateVariable( - const BehaviourDescription&) const; + const BehaviourDescription &) const; /*! * \brief write behaviour initialisation for the given hypothesis * \param[out] out : output file * \param[in] mb : mechancial behaviour description * \param[in] h : modelling hypothesis */ - void writeBehaviourInitialisation(std::ostream&, - const BehaviourDescription&, + void writeBehaviourInitialisation(std::ostream &, + const BehaviourDescription &, const ZMATInterface::Hypothesis) const; /*! * \brief write parameters initialisation for the given hypothesis @@ -115,8 +115,8 @@ namespace mfront { * \param[in] mb : mechancial behaviour description * \param[in] h : modelling hypothesis */ - void writeParametersInitialisation(std::ostream&, - const BehaviourDescription&, + void writeParametersInitialisation(std::ostream &, + const BehaviourDescription &, const ZMATInterface::Hypothesis) const; /*! * \brief write material properties initialisation for the given hypothesis @@ -125,8 +125,8 @@ namespace mfront { * \param[in] h : modelling hypothesis */ void writeMaterialPropertiesInitialisation( - std::ostream&, - const BehaviourDescription&, + std::ostream &, + const BehaviourDescription &, const ZMATInterface::Hypothesis) const; /*! * \brief write behaviour initialisation for the given hypothesis @@ -134,8 +134,8 @@ namespace mfront { * \param[in] mb : mechancial behaviour description * \param[in] h : modelling hypothesis */ - void writeCallMFrontBehaviour(std::ostream&, - const BehaviourDescription&, + void writeCallMFrontBehaviour(std::ostream &, + const BehaviourDescription &, const ZMATInterface::Hypothesis) const; }; // end of struct ZMATInterface diff --git a/mfront/src/AmitexInterface.cxx b/mfront/src/AmitexInterface.cxx index 6276b40a9..24a030123 100644 --- a/mfront/src/AmitexInterface.cxx +++ b/mfront/src/AmitexInterface.cxx @@ -55,7 +55,8 @@ namespace mfront { ++nprops; } else { for (unsigned short j = 0; j != pm.arraySize;) { - out << "\n" + out << "\n" << "\n"; ++nprops; diff --git a/mfront/src/BehaviourCodeGeneratorBase.cxx b/mfront/src/BehaviourCodeGeneratorBase.cxx index 6179b80a4..8f3e16ef8 100644 --- a/mfront/src/BehaviourCodeGeneratorBase.cxx +++ b/mfront/src/BehaviourCodeGeneratorBase.cxx @@ -1203,13 +1203,16 @@ namespace mfront { os << "ThermalExpansionCoefficientTensor A;\n"; } for (const auto& mv : this->bd.getMainVariables()) { - if(mv.first.arraySize != mv.second.arraySize){ - tfel::raise("BehaviourCodeGeneratorBase::writeBehaviourDataDefaultMembers: " - "the array size of the gradient '" + mv.first.name + "' is " - "different from the array size of the thermodynamic force '" + - mv.second.name + "'"); - } - if(mv.first.arraySize == 1){ + if (mv.first.arraySize != mv.second.arraySize) { + tfel::raise( + "BehaviourCodeGeneratorBase::writeBehaviourDataDefaultMembers: " + "the array size of the gradient '" + + mv.first.name + + "' is " + "different from the array size of the thermodynamic force '" + + mv.second.name + "'"); + } + if (mv.first.arraySize == 1) { if (Gradient::isIncrementKnown(mv.first)) { os << mv.first.type << " " << mv.first.name << ";\n\n"; } else { @@ -1218,9 +1221,11 @@ namespace mfront { os << mv.second.type << " " << mv.second.name << ";\n\n"; } else { if (Gradient::isIncrementKnown(mv.first)) { - os << "tfel::math::fsarray<" << mv.first.arraySize << ", " << mv.first.type << "> " << mv.first.name << ";\n\n"; + os << "tfel::math::fsarray<" << mv.first.arraySize << ", " + << mv.first.type << "> " << mv.first.name << ";\n\n"; } else { - os << "tfel::math::fsarray<" << mv.first.arraySize << ", " << mv.first.type << "> " << mv.first.name << "0;\n\n"; + os << "tfel::math::fsarray<" << mv.first.arraySize << ", " + << mv.first.type << "> " << mv.first.name << "0;\n\n"; } os << "tfel::math::fsarray<" << mv.second.arraySize << ", " << mv.second.type << "> " << mv.second.name << ";\n\n"; @@ -4677,18 +4682,19 @@ namespace mfront { << ">& " << bn << ";\n"; } } else { - os << "tfel::math::View> " << bn << ";\n"; + os << "tfel::math::View> " << bn << ";\n"; } } else if ((v1.arraySize == 1u) || (v2.arraySize == 1u)) { os << "/*!\n" << " * \\return the derivative of " << v1.name << " with respect " << v2.name << "\n" - << " * \\param[in] mfront_idx: array index relative to "<< v1.name << "\n" + << " * \\param[in] mfront_idx: array index relative to " << v1.name + << "\n" << " */\n" << "auto " << bn << "(const ushort mfront_idx) noexcept {\n" - << "return tfel::math::map>(this->Dt.data() + "; + << "return tfel::math::map>(this->Dt.data() + "; if (!o.isNull()) { os << o << " + "; } @@ -4706,8 +4712,8 @@ namespace mfront { << "decltype(auto) " << bn << "(const ushort mfront_idx, const ushort mfront_idx2) noexcept " << "{\n" - << "return tfel::math::map>(this->Dt.data() + "; + << "return tfel::math::map>(this->Dt.data() + "; if (!o.isNull()) { os << o << " + "; } @@ -4810,29 +4816,34 @@ namespace mfront { this->checkIntegrationDataFile(os); os << "protected: \n\n"; for (const auto& v : this->bd.getMainVariables()) { - if(v.first.arraySize != v.second.arraySize){ - tfel::raise("BehaviourCodeGeneratorBase::writeIntegrationDataDefaultMembers: " - "the array size of the gradient '" + v.first.name + "' is " - "different from the array size of the thermodynamic force '" + - v.second.name + "'"); + if (v.first.arraySize != v.second.arraySize) { + tfel::raise( + "BehaviourCodeGeneratorBase::writeIntegrationDataDefaultMembers: " + "the array size of the gradient '" + + v.first.name + + "' is " + "different from the array size of the thermodynamic force '" + + v.second.name + "'"); } if (Gradient::isIncrementKnown(v.first)) { os << "/*!\n" << " * \\brief " << v.first.name << " increment\n" << " */\n"; - if(v.first.arraySize == 1u){ + if (v.first.arraySize == 1u) { os << v.first.type << " d" << v.first.name << ";\n\n"; } else { - os << v.first.type << " d" << v.first.name << "[" << v.first.arraySize << "];\n\n"; + os << v.first.type << " d" << v.first.name << "[" << v.first.arraySize + << "];\n\n"; } } else { os << "/*!\n" << " * \\brief " << v.first.name << " at the end of the time step\n" << " */\n"; - if(v.first.arraySize == 1u){ + if (v.first.arraySize == 1u) { os << v.first.type << " " << v.first.name << "1;\n\n"; } else { - os << v.first.type << " " << v.first.name << "1[" << v.first.arraySize << "];\n\n"; + os << v.first.type << " " << v.first.name << "1[" << v.first.arraySize + << "];\n\n"; } } } diff --git a/mfront/src/BehaviourDSLCommon.cxx b/mfront/src/BehaviourDSLCommon.cxx index 91602ecb4..2c6b7180d 100644 --- a/mfront/src/BehaviourDSLCommon.cxx +++ b/mfront/src/BehaviourDSLCommon.cxx @@ -1753,23 +1753,22 @@ namespace mfront { using Parameters = AbstractBehaviourBrick::Parameters; auto& f = BehaviourBrickFactory::getFactory(); auto parameters = Parameters{}; - this->checkNotEndOfFile("BehaviourDSLCommon::treatBehaviourBrick", + this->checkNotEndOfFile("BehaviourDSLCommon::treatBrick", "Expected brick name or '<'."); if (this->current->value == "<") { auto options = std::vector{}; - this->readList(options, "BehaviourDSLCommon::treatBehaviourBrick", "<", - ">", true); + this->readList(options, "BehaviourDSLCommon::treatBrick", "<", ">", true); for (const auto& o : options) { const auto pos = o.value.find('='); if (pos != std::string::npos) { if (pos == 0) { - this->throwRuntimeError("BehaviourDSLCommon::treatBehaviourBrick", + this->throwRuntimeError("BehaviourDSLCommon::treatBrick", "no parameter name given"); } // extracting the name const auto& n = o.value.substr(0, pos); if (pos == o.value.size()) { - this->throwRuntimeError("BehaviourDSLCommon::treatBehaviourBrick", + this->throwRuntimeError("BehaviourDSLCommon::treatBrick", "no option given to the " "parameter '" + n + "'"); @@ -1781,11 +1780,11 @@ namespace mfront { } } } - this->checkNotEndOfFile("BehaviourDSLCommon::treatBehaviourBrick", + this->checkNotEndOfFile("BehaviourDSLCommon::treatBrick", "Expected brick name."); const auto b = [this]() -> std::string { if (this->current->flag == tfel::utilities::Token::String) { - return this->readString("BehaviourDSLCommon::treatBehaviourBrick"); + return this->readString("BehaviourDSLCommon::treatBrick"); } const auto r = this->current->value; ++(this->current); @@ -1803,7 +1802,7 @@ namespace mfront { }(); const auto br = f.get(b, *this, this->mb); br->initialize(parameters, d); - this->readSpecifiedToken("BehaviourDSLCommon::treatBehaviourBrick", ";"); + this->readSpecifiedToken("BehaviourDSLCommon::treatBrick", ";"); this->bricks.push_back(std::move(br)); } // end of treatBrick diff --git a/mfront/src/BehaviourInterfaceBase.cxx b/mfront/src/BehaviourInterfaceBase.cxx index 172a537bf..efd82a254 100644 --- a/mfront/src/BehaviourInterfaceBase.cxx +++ b/mfront/src/BehaviourInterfaceBase.cxx @@ -97,18 +97,16 @@ namespace mfront { return header; } // end of getHeaderGuard - void BehaviourInterfaceBase::writeVisibilityDefines( - std::ostream& out) const { + void BehaviourInterfaceBase::writeVisibilityDefines(std::ostream& out) const { mfront::writeExportDirectives(out, false); } // end of writeVisibilityDefines std::pair, SupportedTypes::TypeSize> BehaviourInterfaceBase::buildMaterialPropertiesList( const BehaviourDescription& bd, const Hypothesis h) const { - const auto opts = BuildMaterialPropertiesListOptions { - .useMaterialPropertiesToBuildStiffnessTensor = true, - .useMaterialPropertiesToBuildThermalExpansionCoefficientTensor = true - }; + const auto opts = BuildMaterialPropertiesListOptions{ + .useMaterialPropertiesToBuildStiffnessTensor = true, + .useMaterialPropertiesToBuildThermalExpansionCoefficientTensor = true}; if (h == ModellingHypothesis::UNDEFINEDHYPOTHESIS) { return mfront::buildMaterialPropertiesList( bd, this->getModellingHypothesesToBeTreated(bd), opts); @@ -123,8 +121,7 @@ namespace mfront { << "_setOutOfBoundsPolicy(const int);\n\n"; } - void - BehaviourInterfaceBase::writeGetOutOfBoundsPolicyFunctionImplementation( + void BehaviourInterfaceBase::writeGetOutOfBoundsPolicyFunctionImplementation( std::ostream& out, const BehaviourDescription& bd, const std::string& name) const { @@ -144,8 +141,7 @@ namespace mfront { } } // end of writeGetOutOfBoundsPolicyFunctionImplementation - void - BehaviourInterfaceBase::writeSetOutOfBoundsPolicyFunctionImplementation( + void BehaviourInterfaceBase::writeSetOutOfBoundsPolicyFunctionImplementation( std::ostream& out, const BehaviourDescription& bd, const std::string& name) const { @@ -291,15 +287,15 @@ namespace mfront { void BehaviourInterfaceBase::setGenerateMTestFileOnFailureAttribute( BehaviourDescription& bd, const bool b) const { - const auto a = this->getInterfaceName() + "::" + - BehaviourInterfaceBase::generateMTestFileAttribute; + const auto a = this->getInterfaceName() + + "::" + BehaviourInterfaceBase::generateMTestFileAttribute; bd.setAttribute(a, b, false); } // end of setGenerateMTestFileOnFailureAttribute bool BehaviourInterfaceBase::shallGenerateMTestFileOnFailure( const BehaviourDescription& bd) const { - const auto a = this->getInterfaceName() + "::" + - BehaviourInterfaceBase::generateMTestFileAttribute; + const auto a = this->getInterfaceName() + + "::" + BehaviourInterfaceBase::generateMTestFileAttribute; return bd.getAttribute(a, false); } // end of shallGenerateMTestFileOnFailure diff --git a/mfront/src/CMakeLists.txt b/mfront/src/CMakeLists.txt index 7e8932619..bd532770f 100644 --- a/mfront/src/CMakeLists.txt +++ b/mfront/src/CMakeLists.txt @@ -97,6 +97,7 @@ set(TFELMFront_SOURCES InitInterfaces.cxx InitDSLs.cxx DSLFactory.cxx + DataInterpolationUtilities.cxx Gradient.cxx ThermodynamicForce.cxx LawFunction.cxx diff --git a/mfront/src/DSLBase.cxx b/mfront/src/DSLBase.cxx index 5e49201a3..13f7e738b 100644 --- a/mfront/src/DSLBase.cxx +++ b/mfront/src/DSLBase.cxx @@ -1315,6 +1315,12 @@ namespace mfront { for (auto& l : this->td.libraries) { l.ldflags.insert(l.ldflags.end(), this->ldflags.begin(), this->ldflags.end()); + l.link_libraries.insert(l.link_libraries.end(), + this->link_libraries.begin(), + this->link_libraries.end()); + l.link_directories.insert(l.link_directories.end(), + this->link_directories.begin(), + this->link_directories.end()); } // merging auxiliary target description auto atd = TargetsDescription(); @@ -1337,6 +1343,8 @@ namespace mfront { } mergeTargetsDescription(this->td, atd, false); this->ldflags.clear(); + this->link_libraries.clear(); + this->link_directories.clear(); this->atds.clear(); } // end of completeTargetsDescription diff --git a/mfront/src/DataInterpolationUtilities.cxx b/mfront/src/DataInterpolationUtilities.cxx new file mode 100644 index 000000000..e1ec654a6 --- /dev/null +++ b/mfront/src/DataInterpolationUtilities.cxx @@ -0,0 +1,170 @@ +/*! + * \file mfront/src/DataIsotropicHardeningRule.cxx + * \brief + * \author Thomas Helfer + * \date 25/07/2022 + * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights + * reserved. + * This project is publicly released under either the GNU GPL Licence with + * linking exception or the CECILL-A licence. A copy of thoses licences are + * delivered with the sources of TFEL. CEA or EDF may also distribute this + * project under specific licensing conditions. + */ + +#include +#include "TFEL/Raise.hxx" +#include "TFEL/Math/CubicSpline.hxx" +#include "MFront/DataInterpolationUtilities.hxx" + +namespace mfront { + + SingleVariableInterpolatedData SingleVariableInterpolatedData::extract( + const tfel::utilities::DataMap& d) { + // + for (const auto& [k, v] : d) { + static_cast(v); + if ((k != "interpolation") && (k != "extrapolation") && (k != "values")) { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "unexpected option '" + + k + "'"); + } + } + auto idata = SingleVariableInterpolatedData{}; + // interpolation type + idata.itype = [&d] { + if (d.count("interpolation")) { + const auto& opt = d.at("interpolation"); + if (!opt.is()) { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "unsupported type for option 'interpolation' " + "(must be a string)"); + } + const auto& i = opt.get(); + if (i == "linear") { + return LINEAR_INTERPOLATION; + } else if (i == "cubic_spline") { + return CUBIC_SPLINE_INTERPOLATION; + } else { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "unsupported interpolation '" + + i + "'"); + } + } + return LINEAR_INTERPOLATION; + }(); + idata.etype = [&d] { + if (d.count("extrapolation")) { + const auto& opt = d.at("extrapolation"); + if (opt.is()) { + return opt.get(); + } else if (opt.is()) { + const auto& v = opt.get(); + if ((v == "bound_to_last_value") || (v == "constant")) { + return false; + } else { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "unsupported value for option 'extrapolation' " + "(expected 'bound_to_last_value' or 'constant')"); + } + } else { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "unsupported type for option 'extrapolation' " + "(must be a string or a boolean value)"); + } + } + return true; + }(); + // values + if (!d.count("values")) { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "no values specified"); + } + const auto& opt = d.at("values"); + if (!opt.is>()) { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "invalid type for option 'values'"); + } + idata.values = opt.get>(); + if (idata.values.empty()) { + tfel::raise( + "SingleVariableInterpolatedData::extract: " + "empty values provided"); + } + return idata; + } + + std::string writeLinearInterpolationValues( + const SingleVariableInterpolatedData& idata, + const SingleVariableInterpolatedData:: + WriteLinearInterpolationValuesArguments& args) { + std::ostringstream os; + os.precision(14); + os << "constexpr auto " << args.abscissae_name << " = "; + os << "std::array<" << args.abscissae_type + << ", " + std::to_string(idata.values.size()) + ">"; + os << "{"; + for (auto p = idata.values.begin(); p != idata.values.end();) { + os << "" << args.abscissae_type << "{" << p->first << "}"; + if (++p != idata.values.end()) { + os << ", "; + } + } + os << "};\n"; + os << "constexpr auto " << args.ordinates_name << " = "; + os << "std::array<" << args.ordinates_type + << ", " + std::to_string(idata.values.size()) + ">"; + os << "{"; + for (auto p = idata.values.begin(); p != idata.values.end();) { + os << "" << args.ordinates_type << "{" << p->second << "}"; + if (++p != idata.values.end()) { + os << ", "; + } + } + os << "};\n"; + return os.str(); + } + + std::string writeCollocationPoints( + const SingleVariableInterpolatedData& idata, + const SingleVariableInterpolatedData::WriteCollocationPointsArguments& + args) { + // add collocation points + tfel::math::CubicSpline spline; + const auto points = [&idata] { + auto abscissae = std::vector{}; + auto lvalues = std::vector{}; + for (const auto& v : idata.values) { + abscissae.push_back(v.first); + lvalues.push_back(v.second); + } + return std::make_pair(abscissae, lvalues); + }(); + spline.setCollocationPoints(points.first, points.second); + const auto& pts = spline.getCollocationPoints(); + std::ostringstream os; + os.precision(14); + const auto type = "tfel::math::CubicSplineCollocationPoint<" + + args.abscissae_type + ", " + args.ordinates_type + ">"; + os << "constexpr auto " << args.collocation_points_name << " = " + << "std::array<" << type << ", " << std::to_string(idata.values.size()) + << ">{\n"; + for (auto p = pts.begin(); p != pts.end();) { + os << type << "{" << args.abscissae_type << "{" << p->x << "}, " + << args.ordinates_type << "{" << p->y << "}, " + << args.ordinates_derivatives_type << "{" << p->d << "}}"; + if (++p != pts.end()) { + os << ", "; + } + } + os << "};\n"; + return os.str(); + } // end of + +} // end of namespace mfront \ No newline at end of file diff --git a/mfront/src/DataIsotropicHardeningRule.cxx b/mfront/src/DataIsotropicHardeningRule.cxx index efc316268..c878a4f7d 100644 --- a/mfront/src/DataIsotropicHardeningRule.cxx +++ b/mfront/src/DataIsotropicHardeningRule.cxx @@ -13,7 +13,6 @@ #include #include "TFEL/Raise.hxx" -#include "TFEL/Math/CubicSpline.hxx" #include "MFront/BehaviourBrick/BrickUtilities.hxx" #include "MFront/BehaviourBrick/OptionDescription.hxx" #include "MFront/BehaviourBrick/DataIsotropicHardeningRule.hxx" @@ -26,72 +25,8 @@ namespace mfront::bbrick { const std::string& id, const DataMap& d) { constexpr auto uh = ModellingHypothesis::UNDEFINEDHYPOTHESIS; - // interpolation type - this->itype = [&d] { - if (d.count("interpolation")) { - const auto& opt = d.at("interpolation"); - if (!opt.is()) { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "unsupported type for option 'interpolation' " - "(must be a string)"); - } - const auto& i = opt.get(); - if (i == "linear") { - return LINEAR_INTERPOLATION; - } else if (i == "cubic_spline") { - return CUBIC_SPLINE_INTERPOLATION; - } else { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "unsupported interpolation '" + - i + "'"); - } - } - return LINEAR_INTERPOLATION; - }(); - this->etype = [&d] { - if (d.count("extrapolation")) { - const auto& opt = d.at("extrapolation"); - if (opt.is()) { - return opt.get(); - } else if (opt.is()) { - const auto& v = opt.get(); - if ((v == "bound_to_last_value") || (v == "constant")) { - return false; - } else { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "unsupported value for option 'extrapolation' " - "(expected 'bound_to_last_value' or 'constant')"); - } - } else { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "unsupported type for option 'extrapolation' " - "(must be a string or a boolean value)"); - } - } - return true; - }(); - // values - if (!d.count("values")) { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "no values specified"); - } - const auto& opt = d.at("values"); - if (!opt.is>()) { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "invalid type for option 'values'"); - } - this->values = opt.get>(); - if (this->values.empty()) { - tfel::raise( - "DataIsotropicHardeningRule::initialize: " - "empty values provided"); - } + static_cast(*this) = + SingleVariableInterpolatedData::extract(d); // const auto Rel = id.empty() ? "Rel" + fid : "Rel" + fid + "_" + id; const auto R = id.empty() ? "R" + fid : "R" + fid + "_" + id; @@ -177,31 +112,12 @@ namespace mfront::bbrick { const std::string& id) const { constexpr auto uh = ModellingHypothesis::UNDEFINEDHYPOTHESIS; const auto local_id = id.empty() ? fid : fid + "_" + id; - auto write_values = [this] { - std::ostringstream os; - os.precision(14); - os << "constexpr auto mfront_yield_surface_abscissae = "; - os << "std::arrayvalues.size()) + ">"; - os << "{"; - for (auto p = values.begin(); p != values.end();) { - os << "strain{" << p->first << "}"; - if (++p != values.end()) { - os << ", "; - } - } - os << "};\n"; - os << "constexpr auto mfront_yield_surface_values = "; - os << "std::arrayvalues.size()) + ">"; - os << "{"; - for (auto p = values.begin(); p != values.end();) { - os << "stress{" << p->second << "}"; - if (++p != values.end()) { - os << ", "; - } - } - os << "};\n"; - return os.str(); - }; + const auto args = + SingleVariableInterpolatedData::WriteLinearInterpolationValuesArguments{ + .abscissae_name = "mfront_yield_surface_abscissae", + .abscissae_type = "strain", + .ordinates_name = "mfront_yield_surface_values", + .ordinates_type = "stress"}; const auto etype_value = this->etype ? "true" : "false"; auto m = "stress mfront_computeYieldRadius" + local_id + "(const strain mfront_arg_p) const{\n"; @@ -212,13 +128,13 @@ namespace mfront::bbrick { os << v.second; m += "return stress{" + os.str() + "};\n"; } else { - m += write_values(); + m += writeLinearInterpolationValues(*this, args); m += "return "; m += "tfel::math::computeLinearInterpolation<"; m += etype_value; m += ">("; - m += "mfront_yield_surface_abscissae, "; - m += "mfront_yield_surface_values, "; + m += args.abscissae_name + ", "; + m += args.ordinates_name + ", "; m += "mfront_arg_p);\n"; } m += "}\n"; @@ -231,15 +147,14 @@ namespace mfront::bbrick { os << v.second; m += "return {stress{" + os.str() + "}, stress{0}};\n"; } else { - m += write_values(); + m += writeLinearInterpolationValues(*this, args); m += "return "; m += "tfel::math::computeLinearInterpolationAndDerivative<"; m += etype_value; m += ">("; - m += "mfront_yield_surface_abscissae, "; - m += "mfront_yield_surface_values, "; + m += args.abscissae_name + ", "; + m += args.ordinates_name + ", "; m += "mfront_arg_p);\n"; - m += "return {};\n"; } m += "}\n"; bd.appendToIncludes("#include \"TFEL/Math/LinearInterpolation.hxx\""); @@ -252,38 +167,13 @@ namespace mfront::bbrick { const std::string& id) const { constexpr auto uh = ModellingHypothesis::UNDEFINEDHYPOTHESIS; const auto local_id = id.empty() ? fid : fid + "_" + id; - // add collocation points - tfel::math::CubicSpline spline; - const auto points = [this] { - auto abscissae = std::vector{}; - auto lvalues = std::vector{}; - for (const auto& v : this->values) { - abscissae.push_back(v.first); - lvalues.push_back(v.second); - } - return std::make_pair(abscissae, lvalues); - }(); - spline.setCollocationPoints(points.first, points.second); - auto write_collocation_points = [&spline, this] { - const auto& pts = spline.getCollocationPoints(); - std::ostringstream os; - os.precision(14); - const auto type = - "tfel::math::CubicSplineCollocationPoint"; - os << "constexpr auto mfront_yield_surface_collocation_points = "; - os << "std::array<" << type << ", " << std::to_string(this->values.size()) - << ">{\n"; - for (auto p = pts.begin(); p != pts.end();) { - os << type << "{strain{" << p->x << "}, stress{" << p->y << "}, stress{" - << p->d << "}}"; - if (++p != pts.end()) { - os << ", "; - } - } - os << "};\n"; - return os.str(); - }; - // + const auto args = + SingleVariableInterpolatedData::WriteCollocationPointsArguments{ + .collocation_points_name = + "mfront_yield_surface_collocation_points", + .abscissae_type = "strain", + .ordinates_type = "stress", + .ordinates_derivatives_type = "stress"}; const auto etype_value = this->etype ? "true" : "false"; const auto m1 = "mfront_computeYieldRadius" + local_id; const auto m2 = "mfront_computeYieldRadiusAndDerivative" + local_id; @@ -295,7 +185,7 @@ namespace mfront::bbrick { os << v.second; m += "return stress{" + os.str() + "};\n"; } else { - m += write_collocation_points(); + m += writeCollocationPoints(*this, args); m += "return "; m += "tfel::math::computeCubicSplineInterpolation<"; m += etype_value; @@ -314,12 +204,12 @@ namespace mfront::bbrick { os << v.second; m += "return {stress{" + os.str() + "}, stress{0}};\n"; } else { - m += write_collocation_points(); + m += writeCollocationPoints(*this, args); m += "return "; m += "tfel::math::computeCubicSplineInterpolationAndDerivative<"; m += etype_value; m += ">("; - m += "mfront_yield_surface_collocation_points, "; + m += args.collocation_points_name + ", "; m += "mfront_arg_p);\n"; } m += "} // end of " + m2 + "\n\n"; diff --git a/mfront/src/ExcelMaterialPropertyInterface.cxx b/mfront/src/ExcelMaterialPropertyInterface.cxx index b9afec891..fec25f6af 100644 --- a/mfront/src/ExcelMaterialPropertyInterface.cxx +++ b/mfront/src/ExcelMaterialPropertyInterface.cxx @@ -31,7 +31,7 @@ #include #define F_OK 0 /* Test for existence. */ #ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #endif diff --git a/mfront/src/Fortran03MaterialPropertyInterface.cxx b/mfront/src/Fortran03MaterialPropertyInterface.cxx index 76f474e7c..db13febb1 100644 --- a/mfront/src/Fortran03MaterialPropertyInterface.cxx +++ b/mfront/src/Fortran03MaterialPropertyInterface.cxx @@ -28,7 +28,7 @@ #include #define F_OK 0 /* Test for existence. */ #ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #endif diff --git a/mfront/src/GenericBehaviourInterface.cxx b/mfront/src/GenericBehaviourInterface.cxx index 001f580b7..0ae233cc1 100644 --- a/mfront/src/GenericBehaviourInterface.cxx +++ b/mfront/src/GenericBehaviourInterface.cxx @@ -373,7 +373,7 @@ namespace mfront { << "const mfront_gb_size_type);\n\n"; } } // end of for (const auto h : mhs) - } // end of writeRotationFunctionsDeclarations + } // end of writeRotationFunctionsDeclarations static void writeRotationMatrixDefinition(std::ostream& os, const bool b) { os << "const auto r = [&rv]() -> tfel::math::tmatrix<3,3,mfront::gb::real> " @@ -1045,8 +1045,9 @@ namespace mfront { } } if (hypotheses.empty()) { - tfel::raise("GenericBehaviourInterface::treatKeyword: " - "no hypothesis declared"); + tfel::raise( + "GenericBehaviourInterface::treatKeyword: " + "no hypothesis declared"); } // this->selectedHypotheses = hypotheses; @@ -1679,7 +1680,8 @@ namespace mfront { os << "mg.addMaterialProperty(\"" << m.getExternalName() << "[" << s << "]\",*(d->s1.material_properties));\n"; } else { - os << "mg.addMaterialProperty(\"" << m.getExternalName() << "[" << s << "]\"," + os << "mg.addMaterialProperty(\"" << m.getExternalName() << "[" << s + << "]\"," << "*(d->s1.material_properties+" << offset << "));\n"; } } diff --git a/mfront/src/JavaMaterialPropertyInterface.cxx b/mfront/src/JavaMaterialPropertyInterface.cxx index 71159b97e..79a4401c0 100644 --- a/mfront/src/JavaMaterialPropertyInterface.cxx +++ b/mfront/src/JavaMaterialPropertyInterface.cxx @@ -29,7 +29,7 @@ #include #define F_OK 0 /* Test for existence. */ #ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #endif diff --git a/mfront/src/MFront.cxx b/mfront/src/MFront.cxx index 4c12bcbd4..760f8a987 100644 --- a/mfront/src/MFront.cxx +++ b/mfront/src/MFront.cxx @@ -309,7 +309,7 @@ namespace mfront { #if !(defined _WIN32 || defined _WIN64 || defined __CYGWIN__) void MFront::treatWin32() { this->opts.sys = "win32"; - } // end of MFront::treatWin32 + } // end of MFront::treatWin32 #endif /* __CYGWIN__ */ void MFront::registerArgumentCallBacks() { @@ -468,9 +468,9 @@ namespace mfront { "flags and build libraries", true); this->registerCallBack( - "-g", - CallBack("add debugging symbols", - [this]() noexcept { this->opts.debugFlags = true; }, false)); + "-g", CallBack( + "add debugging symbols", + [this]() noexcept { this->opts.debugFlags = true; }, false)); this->registerNewCallBack( "--target", "-t", &MFront::treatTarget, "generate build file and build the specified target", true); @@ -484,15 +484,15 @@ namespace mfront { this->registerNewCallBack("--generator", "-G", &MFront::treatGenerator, "choose build system", true); - this->registerCallBack( - "--list-material-property-interfaces", - CallBack("list available material property interfaces", - [] { - auto& mpif = MaterialPropertyInterfaceFactory:: - getMaterialPropertyInterfaceFactory(); - displayList(mpif.getRegistredInterfaces()); - }, - false)); + this->registerCallBack("--list-material-property-interfaces", + CallBack( + "list available material property interfaces", + [] { + auto& mpif = MaterialPropertyInterfaceFactory:: + getMaterialPropertyInterfaceFactory(); + displayList(mpif.getRegistredInterfaces()); + }, + false)); this->registerCallBack( "--list-behaviour-interfaces", CallBack( @@ -505,34 +505,34 @@ namespace mfront { false)); this->registerCallBack( "--list-model-interfaces", - CallBack("list available model interfaces", - [] { - auto& mif = - ModelInterfaceFactory::getModelInterfaceFactory(); - displayList(mif.getRegistredInterfaces()); - }, - false)); + CallBack( + "list available model interfaces", + [] { + auto& mif = ModelInterfaceFactory::getModelInterfaceFactory(); + displayList(mif.getRegistredInterfaces()); + }, + false)); // stress potentials this->registerCallBack( "--list-stress-potentials", - CallBack("list available stress potentials", - [] { - auto& spf = - mfront::bbrick::StressPotentialFactory::getFactory(); - displayList("stress-potentials", - spf.getRegistredStressPotentials()); - }, - false)); + CallBack( + "list available stress potentials", + [] { + auto& spf = mfront::bbrick::StressPotentialFactory::getFactory(); + displayList("stress-potentials", + spf.getRegistredStressPotentials()); + }, + false)); this->registerCallBack( "--help-stress-potential", - CallBack("display the help associated with the given stress potential", - [this] { - const auto& sp = this->currentArgument->getOption(); - const auto fp = - getDocumentationFilePath("stress-potentials", sp); - displayHelpFile(fp, "stress potential", sp); - }, - true)); + CallBack( + "display the help associated with the given stress potential", + [this] { + const auto& sp = this->currentArgument->getOption(); + const auto fp = getDocumentationFilePath("stress-potentials", sp); + displayHelpFile(fp, "stress potential", sp); + }, + true)); // inelastic flows this->registerCallBack( "--list-inelastic-flows", @@ -545,14 +545,14 @@ namespace mfront { false)); this->registerCallBack( "--help-inelastic-flow", - CallBack("display the help associated with the given inelastic flow", - [this] { - const auto& sp = this->currentArgument->getOption(); - const auto fp = - getDocumentationFilePath("inelastic-flows", sp); - displayHelpFile(fp, "inelastic flow", sp); - }, - true)); + CallBack( + "display the help associated with the given inelastic flow", + [this] { + const auto& sp = this->currentArgument->getOption(); + const auto fp = getDocumentationFilePath("inelastic-flows", sp); + displayHelpFile(fp, "inelastic flow", sp); + }, + true)); // stress criteria this->registerCallBack( "--list-stress-criteria", @@ -565,14 +565,14 @@ namespace mfront { false)); this->registerCallBack( "--help-stress-criterion", - CallBack("display the help associated with the given stress criterion", - [this] { - const auto& sp = this->currentArgument->getOption(); - const auto fp = - getDocumentationFilePath("stress-criteria", sp); - displayHelpFile(fp, "stress criterion", sp); - }, - true)); + CallBack( + "display the help associated with the given stress criterion", + [this] { + const auto& sp = this->currentArgument->getOption(); + const auto fp = getDocumentationFilePath("stress-criteria", sp); + displayHelpFile(fp, "stress criterion", sp); + }, + true)); // isotropic hardening rule this->registerCallBack( "--list-isotropic-hardening-rules", @@ -587,15 +587,16 @@ namespace mfront { false)); this->registerCallBack( "--help-isotropic-hardening-rule", - CallBack("display the help associated with the given isotropic " - "hardening rule", - [this] { - const auto& sp = this->currentArgument->getOption(); - const auto fp = getDocumentationFilePath( - "isotropic-hardening-rules", sp); - displayHelpFile(fp, "isotropic hardening rule", sp); - }, - true)); + CallBack( + "display the help associated with the given isotropic " + "hardening rule", + [this] { + const auto& sp = this->currentArgument->getOption(); + const auto fp = + getDocumentationFilePath("isotropic-hardening-rules", sp); + displayHelpFile(fp, "isotropic hardening rule", sp); + }, + true)); // kinematic hardening rule this->registerCallBack( "--list-kinematic-hardening-rules", @@ -610,24 +611,26 @@ namespace mfront { false)); this->registerCallBack( "--help-kinematic-hardening-rule", - CallBack("display the help associated with the given kinematic " - "hardening rule", - [this] { - const auto& sp = this->currentArgument->getOption(); - const auto fp = getDocumentationFilePath( - "kinematic-hardening-rules", sp); - displayHelpFile(fp, "kinematic hardening rule", sp); - }, - true)); + CallBack( + "display the help associated with the given kinematic " + "hardening rule", + [this] { + const auto& sp = this->currentArgument->getOption(); + const auto fp = + getDocumentationFilePath("kinematic-hardening-rules", sp); + displayHelpFile(fp, "kinematic hardening rule", sp); + }, + true)); this->registerCallBack( "--list-behaviour-bricks", - CallBack("list available behaviour bricks", - [] { - auto& bbf = BehaviourBrickFactory::getFactory(); - displayList("bricks", bbf.getRegistredBricks()); - }, - false)); + CallBack( + "list available behaviour bricks", + [] { + auto& bbf = BehaviourBrickFactory::getFactory(); + displayList("bricks", bbf.getRegistredBricks()); + }, + false)); #if (defined _WIN32 || defined _WIN64 || defined __CYGWIN__) this->registerNewCallBack("--nodeps", &MFront::treatNoDeps, "don't generate compilation dependencies"); @@ -638,7 +641,7 @@ namespace mfront { this->registerNewCallBack("--win32", &MFront::treatWin32, "specify that the target system is win32"); #endif /* __CYGWIN__ */ - } // end of MFront::registerArgumentCallBacks + } // end of MFront::registerArgumentCallBacks MFront::MFront() = default; @@ -763,7 +766,7 @@ namespace mfront { "empty library specified."); this->defs.insert(l); } - } // end of void MFront::treatDefFile + } // end of void MFront::treatDefFile #endif /* (defined _WIN32 || defined _WIN64 ||defined __CYGWIN__) */ TargetsDescription MFront::treatFile(const std::string& f) const { @@ -850,7 +853,7 @@ namespace mfront { std::copy(l.epts.begin(), l.epts.end(), std::ostream_iterator(def, "\n")); } - } // end of MFront::generateDefsFile + } // end of MFront::generateDefsFile #endif /* (defined _WIN32 || defined _WIN64 ||defined __CYGWIN__) */ void MFront::writeTargetsDescription() const { diff --git a/mfront/src/MFrontBase.cxx b/mfront/src/MFrontBase.cxx index 357235093..7e18cef23 100644 --- a/mfront/src/MFrontBase.cxx +++ b/mfront/src/MFrontBase.cxx @@ -78,10 +78,11 @@ namespace mfront { throw_if(pt == pte, "unexpected end of file (exepected dsl name)"); if (pt->value == "{") { const auto o = tfel::utilities::DataParsingOptions{}; - ldsl_options = tfel::utilities::merge(ldsl_options, - tfel::utilities::Data::read(pt, pte, o) - .get(), - false); + ldsl_options = + tfel::utilities::merge(ldsl_options, + tfel::utilities::Data::read(pt, pte, o) + .get(), + false); } throw_if(pt == pte, "unexpected end of file (exepected ';' or library name)"); @@ -146,7 +147,8 @@ namespace mfront { return dsl; } // end of getDSL - std::shared_ptr MFrontBase::getDSL(const std::string& f, const tfel::utilities::DataMap& dsl_options) { + std::shared_ptr MFrontBase::getDSL( + const std::string& f, const tfel::utilities::DataMap& dsl_options) { tfel::utilities::CxxTokenizer file; if ((tfel::utilities::starts_with(f, "madnex:")) || (tfel::utilities::starts_with(f, "mdnx:")) || diff --git a/mfront/src/MFrontLogStream.cxx b/mfront/src/MFrontLogStream.cxx index b58c93347..74954f095 100644 --- a/mfront/src/MFrontLogStream.cxx +++ b/mfront/src/MFrontLogStream.cxx @@ -118,7 +118,7 @@ namespace mfront { static bool b = true; return b; } // end of getUnicodeOutputOption() - } // end of namespace internals + } // end of namespace internals void setUnicodeOutputOption(const bool b) { mfront::internals::getUnicodeOutputOption() = b; diff --git a/mfront/src/MaterialPropertyDSL.cxx b/mfront/src/MaterialPropertyDSL.cxx index ad21af0a0..8f50d29ec 100644 --- a/mfront/src/MaterialPropertyDSL.cxx +++ b/mfront/src/MaterialPropertyDSL.cxx @@ -20,6 +20,8 @@ #include #include "TFEL/Raise.hxx" +#include "TFEL/Config/GetInstallPath.hxx" +#include "TFEL/Utilities/Data.hxx" #include "TFEL/Utilities/Token.hxx" #include "TFEL/System/System.hxx" #include "TFEL/Glossary/Glossary.hxx" @@ -36,6 +38,7 @@ #include "MFront/DSLFactory.hxx" #include "MFront/MaterialPropertyDSL.hxx" #include "MFront/TargetsDescription.hxx" +#include "MFront/DataInterpolationUtilities.hxx" #include "MFront/MaterialPropertyInterfaceFactory.hxx" // fixing a bug on current glibc++ cygwin versions (19/08/2015) @@ -100,6 +103,7 @@ namespace mfront { &MaterialPropertyDSL::treatInput); this->registerNewCallBack("@Output", &MaterialPropertyDSL::treatOutput); this->registerNewCallBack("@Function", &MaterialPropertyDSL::treatFunction); + this->registerNewCallBack("@Data", &MaterialPropertyDSL::treatData); this->registerNewCallBack("@Import", &MaterialPropertyDSL::treatImport); this->registerNewCallBack("@Interface", &MaterialPropertyDSL::treatInterface); @@ -516,6 +520,127 @@ namespace mfront { this->md.checkAndCompletePhysicalBoundsDeclaration(); } // end of finalizeVariablesDeclaration + static std::string getFunctionAssociatedWithAValue( + const VariableDescription& output, const double value) { + auto body = std::string{}; + std::ostringstream os; + os.precision(14); + os << value; + body += output.name + " = "; + body += output.type + "{" + os.str() + "};\n"; + return body; + } // end of getFunctionAssociatedWithAValue + + void MaterialPropertyDSL::treatDataWithoutInput() { + using namespace tfel::utilities; + const auto opts = + Data::read(this->current, this->tokens.end()).get(); + for (const auto& [k, v] : opts) { + if (k != "value") { + this->throwRuntimeError("MaterialPropertyDSL::treatData", + "unexpected option '" + k + "'"); + } + if (!v.is()) { + this->throwRuntimeError("MaterialPropertyDSL::treatData", + "invalid type for option '" + k + "'"); + } + } + if (opts.empty()) { + this->throwRuntimeError("MaterialPropertyDSL::treatData", + "no option 'value' defined"); + } + const auto v = opts.at("value"); + this->md.f.body += + getFunctionAssociatedWithAValue(this->md.output, v.get()); + } // end of treatDataWithoutInput + + void MaterialPropertyDSL::treatDataWithOneInput() { + using namespace tfel::utilities; + const auto tfel_config = tfel::getTFELConfigExecutableName(); + auto& body = this->md.f.body; + const auto& v = this->md.inputs[0]; + const auto idata = SingleVariableInterpolatedData::extract( + Data::read(this->current, this->tokens.end()).get()); + if (idata.itype == SingleVariableInterpolatedData::LINEAR_INTERPOLATION) { + if (idata.values.size() == 1) { + const auto value = idata.values.begin()->second; + body += getFunctionAssociatedWithAValue(this->md.output, value); + } else { + this->md.f.used_inputs.insert(v.name); + this->md.appendToIncludes( + "#include \"TFEL/Math/LinearInterpolation.hxx\""); + const auto args = SingleVariableInterpolatedData:: + WriteLinearInterpolationValuesArguments{ + .abscissae_name = "mfront_" + v.name + "_values", + .abscissae_type = v.type, + .ordinates_name = "mfront_" + this->md.output.name + "_values", + .ordinates_type = this->md.output.type}; + const auto etype_value = idata.etype ? "true" : "false"; + body += writeLinearInterpolationValues(idata, args); + body += this->md.output.name + " = "; + body += "tfel::math::computeLinearInterpolation<"; + body += etype_value; + body += ">("; + body += args.abscissae_name + ", "; + body += args.ordinates_name + ", "; + body += v.name + ");\n"; + } + } else { + if (idata.values.size() == 1) { + const auto value = idata.values.begin()->second; + body += getFunctionAssociatedWithAValue(this->md.output, value); + } else { + this->md.appendToIncludes("#include \"TFEL/Math/CubicSpline.hxx\""); + insert_if(this->link_directories, + "$(shell " + tfel_config + " --library-path)"); + insert_if(this->link_libraries, + "$(shell " + tfel_config + + " --library-dependency --math-cubic-spline)"); + this->md.f.used_inputs.insert(v.name); + const auto etype_value = idata.etype ? "true" : "false"; + const auto args = + SingleVariableInterpolatedData::WriteCollocationPointsArguments{ + .collocation_points_name = "mfront_collocation_points", + .abscissae_type = v.type, + .ordinates_type = this->md.output.type, + .ordinates_derivatives_type = "tfel::math::derivative_type<" + + this->md.output.type + ", " + + v.type + ">"}; + body += writeCollocationPoints(idata, args); + body += this->md.output.name + " = "; + body += "tfel::math::computeCubicSplineInterpolation<"; + body += etype_value; + body += ">("; + body += args.collocation_points_name + ", "; + body += v.name + ");\n"; + } + } + } // end of treatDataWithOneInput + + void MaterialPropertyDSL::treatData() { + auto throw_if = [this](const bool b, const std::string& m) { + if (b) { + this->throwRuntimeError("MaterialPropertyDSL::treatData", m); + } + }; + this->finalizeVariablesDeclaration(); + if (this->md.output.name.empty()) { + this->reserveName("res"); + this->md.output = VariableDescription{"real", "res", 1u, 0u}; + } + throw_if(!this->md.f.body.empty(), "function already defined"); + if (this->md.inputs.empty()) { + this->treatDataWithoutInput(); + } else if (this->md.inputs.size() == 1) { + this->treatDataWithOneInput(); + } else { + this->throwRuntimeError( + "MaterialPropertyDSL::treatData", + "data with multiple inputs are not supported yet"); + } + this->md.f.modified = true; + } + void MaterialPropertyDSL::treatFunction() { auto throw_if = [this](const bool b, const std::string& m) { if (b) { @@ -638,7 +763,7 @@ namespace mfront { "parenthesis still opened at the end of function"); throw_if(this->md.f.body.empty(), "empty function"); throw_if(!this->md.f.modified, "function does not modifiy output."); - } // end of treatFunction() + } // end of treatFunction void MaterialPropertyDSL::treatMethod() { using namespace tfel::utilities; diff --git a/mfront/src/ModelDSLCommon.cxx b/mfront/src/ModelDSLCommon.cxx index a8b694cf0..a66da9dd2 100644 --- a/mfront/src/ModelDSLCommon.cxx +++ b/mfront/src/ModelDSLCommon.cxx @@ -112,7 +112,7 @@ namespace mfront { "unimplemented feature"); } // end of getOverridableVariableNameByExternalName - void ModelDSLCommon::overrideByAParameter(const std::string&, const double){ + void ModelDSLCommon::overrideByAParameter(const std::string&, const double) { #pragma message("unimplemented") } // end of overrideByAParameter diff --git a/mfront/src/OverridableImplementation.cxx b/mfront/src/OverridableImplementation.cxx index 3b9e6a7c6..6fab40254 100644 --- a/mfront/src/OverridableImplementation.cxx +++ b/mfront/src/OverridableImplementation.cxx @@ -237,7 +237,7 @@ namespace mfront { } // madnex::write(g, impl); - } // end of writeMadnexFile + } // end of writeMadnexFile #endif /* MFRONT_HAVE_MADNEX */ void write(const OverridableImplementation& i, const std::string& f) { @@ -258,7 +258,7 @@ namespace mfront { static_cast(i); tfel::raise("write: unsupported file extension '" + ext + "'"); #endif /* MFRONT_HAVE_MADNEX */ - } // end of write + } // end of write void write(const OverridableImplementation& i, const std::string& t, diff --git a/mfront/src/PathSpecifier.cxx b/mfront/src/PathSpecifier.cxx index e91e7ab10..d29175244 100644 --- a/mfront/src/PathSpecifier.cxx +++ b/mfront/src/PathSpecifier.cxx @@ -258,7 +258,7 @@ namespace mfront { } } return inputs; - } // end of getImplementationsPathsInMadnexFiles + } // end of getImplementationsPathsInMadnexFiles #endif /* MFRONT_HAVE_MADNEX */ std::vector getImplementationsPaths( diff --git a/mfront/src/PythonMaterialPropertyInterface.cxx b/mfront/src/PythonMaterialPropertyInterface.cxx index e778ca4e7..d733a19fa 100644 --- a/mfront/src/PythonMaterialPropertyInterface.cxx +++ b/mfront/src/PythonMaterialPropertyInterface.cxx @@ -30,7 +30,7 @@ #include #define F_OK 0 /* Test for existence. */ #ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #endif diff --git a/mfront/src/SearchPathsHandler.cxx b/mfront/src/SearchPathsHandler.cxx index 85cb17da2..40cf944ff 100644 --- a/mfront/src/SearchPathsHandler.cxx +++ b/mfront/src/SearchPathsHandler.cxx @@ -116,7 +116,7 @@ namespace mfront { if (std::holds_alternative(p)) { #ifdef MFRONT_HAVE_MADNEX using ptr = std::vector // - (madnex::DataBase::*)(const std::string&)const; + (madnex::DataBase::*)(const std::string&) const; const auto& madnex_path = std::get(p); const auto name = [&f] { const auto ext = getFileExtension(f); @@ -242,7 +242,7 @@ namespace mfront { "SearchPathsHandler::addMadnexSearchPaths: " "madnex support is not enabled"); #endif /* MFRONT_HAVE_MADNEX */ - } // end of addMadnexSearchPath + } // end of addMadnexSearchPath void SearchPathsHandler::addSearchPaths(const std::string& p) { auto& msf = SearchPathsHandler::getSearchPathsHandler(); diff --git a/mfront/src/SupportedTypes.cxx b/mfront/src/SupportedTypes.cxx index bde93d85e..68151f7a2 100644 --- a/mfront/src/SupportedTypes.cxx +++ b/mfront/src/SupportedTypes.cxx @@ -89,10 +89,11 @@ namespace mfront { default; SupportedTypes::TypeParsingOptions::TypeParsingOptions( const TypeParsingOptions&) = default; - SupportedTypes::TypeParsingOptions& SupportedTypes::TypeParsingOptions:: - operator=(TypeParsingOptions&&) = default; - SupportedTypes::TypeParsingOptions& SupportedTypes::TypeParsingOptions:: - operator=(const TypeParsingOptions&) = default; + SupportedTypes::TypeParsingOptions& + SupportedTypes::TypeParsingOptions::operator=(TypeParsingOptions&&) = default; + SupportedTypes::TypeParsingOptions& + SupportedTypes::TypeParsingOptions::operator=(const TypeParsingOptions&) = + default; SupportedTypes::TypeParsingOptions::~TypeParsingOptions() = default; SupportedTypes::TypeSize SupportedTypes::TypeSize::getDerivativeSize( diff --git a/mfront/src/SymbolsGenerator.cxx b/mfront/src/SymbolsGenerator.cxx index 68a31ec41..22661120d 100644 --- a/mfront/src/SymbolsGenerator.cxx +++ b/mfront/src/SymbolsGenerator.cxx @@ -30,23 +30,21 @@ namespace mfront { return bd.isTemperatureDefinedAsTheFirstExternalStateVariable(); } // end of shallRemoveTemperatureFromExternalStateVariables - std::string SymbolsGenerator::getSymbolName( - const BehaviourInterfaceBase& i, - const std::string& n, - const Hypothesis h) const { + std::string SymbolsGenerator::getSymbolName(const BehaviourInterfaceBase& i, + const std::string& n, + const Hypothesis h) const { if (h != ModellingHypothesis::UNDEFINEDHYPOTHESIS) { return i.getFunctionNameBasis(n) + "_" + ModellingHypothesis::toString(h); } return i.getFunctionNameBasis(n); } // end of getSymbolName - void SymbolsGenerator::generateGeneralSymbols( - std::ostream& out, - const BehaviourInterfaceBase& i, - const BehaviourDescription& bd, - const FileDescription& fd, - const std::set& mhs, - const std::string& name) const { + void SymbolsGenerator::generateGeneralSymbols(std::ostream& out, + const BehaviourInterfaceBase& i, + const BehaviourDescription& bd, + const FileDescription& fd, + const std::set& mhs, + const std::string& name) const { this->writeFileDescriptionSymbols(out, i, fd, name); this->writeValidatorSymbol(out, i, bd, name); this->writeBuildIdentifierSymbol(out, i, bd, name); @@ -77,11 +75,10 @@ namespace mfront { mfront::writeFileDescriptionSymbols(out, i.getFunctionNameBasis(n), fd); } // end of writeFileDescriptionSymbols - void SymbolsGenerator::writeValidatorSymbol( - std::ostream& out, - const BehaviourInterfaceBase& i, - const BehaviourDescription& d, - const std::string& n) const { + void SymbolsGenerator::writeValidatorSymbol(std::ostream& out, + const BehaviourInterfaceBase& i, + const BehaviourDescription& d, + const std::string& n) const { mfront::writeValidatorSymbol(out, i.getFunctionNameBasis(n), d); } // end of writeValidatorSymbol @@ -93,17 +90,15 @@ namespace mfront { mfront::writeBuildIdentifierSymbol(out, i.getFunctionNameBasis(n), d); } // end of writeBuildIdentifierSymbol - void SymbolsGenerator::writeEntryPointSymbol( - std::ostream& out, - const BehaviourInterfaceBase& i, - const std::string& n) const { + void SymbolsGenerator::writeEntryPointSymbol(std::ostream& out, + const BehaviourInterfaceBase& i, + const std::string& n) const { mfront::writeEntryPointSymbol(out, i.getFunctionNameBasis(n)); } // end of writeEntryPointSymbol - void SymbolsGenerator::writeTFELVersionSymbol( - std::ostream& out, - const BehaviourInterfaceBase& i, - const std::string& n) const { + void SymbolsGenerator::writeTFELVersionSymbol(std::ostream& out, + const BehaviourInterfaceBase& i, + const std::string& n) const { mfront::writeTFELVersionSymbol(out, i.getFunctionNameBasis(n)); } // end of writeTFELVersionSymbol @@ -115,11 +110,10 @@ namespace mfront { mfront::writeUnitSystemSymbol(out, i.getFunctionNameBasis(n), bd); } // end of writeUnitSystemSymbol - void SymbolsGenerator::writeMaterialSymbol( - std::ostream& out, - const BehaviourInterfaceBase& i, - const BehaviourDescription& mb, - const std::string& n) const { + void SymbolsGenerator::writeMaterialSymbol(std::ostream& out, + const BehaviourInterfaceBase& i, + const BehaviourDescription& mb, + const std::string& n) const { mfront::writeMaterialSymbol(out, i.getFunctionNameBasis(n), mb.getMaterialName()); } // end of writeEntryPointSymbol @@ -245,20 +239,22 @@ namespace mfront { auto default_impl = [&bd, &write_impl] { std::vector bns; for (const auto& b : bd.getTangentOperatorBlocks()) { - const auto& f = b.first; // function - const auto& v = b.second; // variable + const auto& f = b.first; // function + const auto& v = b.second; // variable if ((v.arraySize == 1u) && (f.arraySize == 1u)) { bns.push_back(f.getExternalName()); bns.push_back(v.getExternalName()); } else if (v.arraySize == 1u) { for (unsigned short idx = 0; idx != f.arraySize; ++idx) { - bns.push_back(f.getExternalName() + '[' + std::to_string(idx) + ']'); + bns.push_back(f.getExternalName() + '[' + std::to_string(idx) + + ']'); bns.push_back(v.getExternalName()); } } else if (f.arraySize == 1u) { for (unsigned short idx = 0; idx != v.arraySize; ++idx) { bns.push_back(f.getExternalName()); - bns.push_back(v.getExternalName() + '[' + std::to_string(idx) + ']'); + bns.push_back(v.getExternalName() + '[' + std::to_string(idx) + + ']'); } } else { for (unsigned short idx = 0; idx != f.arraySize; ++idx) { @@ -555,12 +551,11 @@ namespace mfront { const std::string&, const Hypothesis) const {} // end of writePostProcessingsSymbols - void SymbolsGenerator::writeParametersSymbols( - std::ostream& out, - const BehaviourInterfaceBase& i, - const BehaviourDescription& mb, - const std::string& name, - const Hypothesis h) const { + void SymbolsGenerator::writeParametersSymbols(std::ostream& out, + const BehaviourInterfaceBase& i, + const BehaviourDescription& mb, + const std::string& name, + const Hypothesis h) const { if (!areParametersTreatedAsStaticVariables(mb)) { mfront::writeParametersDeclarationSymbols( out, this->getSymbolName(i, name, h), diff --git a/mfront/src/ZMATInterface.cxx b/mfront/src/ZMATInterface.cxx index 507cc65ac..caa91f35f 100644 --- a/mfront/src/ZMATInterface.cxx +++ b/mfront/src/ZMATInterface.cxx @@ -216,10 +216,9 @@ namespace mfront { std::pair, SupportedTypes::TypeSize> ZMATInterface::buildMaterialPropertiesList( const BehaviourDescription& bd, const Hypothesis h) const override { - const auto opts = BuildMaterialPropertiesListOptions { - .useMaterialPropertiesToBuildStiffnessTensor = false, - .useMaterialPropertiesToBuildThermalExpansionCoefficientTensor = false - }; + const auto opts = BuildMaterialPropertiesListOptions{ + .useMaterialPropertiesToBuildStiffnessTensor = false, + .useMaterialPropertiesToBuildThermalExpansionCoefficientTensor = false}; if (h == ModellingHypothesis::UNDEFINEDHYPOTHESIS) { return mfront::buildMaterialPropertiesList( bd, this->getModellingHypothesesToBeTreated(bd), opts); diff --git a/mfront/tests/properties/CMakeLists.txt b/mfront/tests/properties/CMakeLists.txt index 6511beef6..be4778ce2 100644 --- a/mfront/tests/properties/CMakeLists.txt +++ b/mfront/tests/properties/CMakeLists.txt @@ -152,7 +152,17 @@ set(mfront_SOURCES T91MartensiticSteel_Rinf_ROUX2007 T91MartensiticSteel_ThermalExpansion_ROUX2007 T91MartensiticSteel_YieldStress_ROUX2007 - T91MartensiticSteel_YoungModulus_ROUX2007) + T91MartensiticSteel_YoungModulus_ROUX2007 + LinearDataInterpolationTest + LinearDataInterpolationTest2 + LinearDataInterpolationTest3 + LinearDataInterpolationTest4 + LinearDataInterpolationTest5 + CubicSplineDataInterpolationTest + CubicSplineDataInterpolationTest2 + CubicSplineDataInterpolationTest3 + CubicSplineDataInterpolationTest4 + CubicSplineDataInterpolationTest5) mfront_dependencies(MFrontMaterialProperties-generic MaterialLawDSLOptionsTest diff --git a/mfront/tests/properties/CubicSplineDataInterpolationTest.mfront b/mfront/tests/properties/CubicSplineDataInterpolationTest.mfront new file mode 100644 index 000000000..ff047158a --- /dev/null +++ b/mfront/tests/properties/CubicSplineDataInterpolationTest.mfront @@ -0,0 +1,16 @@ +@DSL MaterialProperty; +@Law CubicSplineDataInterpolationTest; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "cubic_spline" +} \ No newline at end of file diff --git a/mfront/tests/properties/CubicSplineDataInterpolationTest2.mfront b/mfront/tests/properties/CubicSplineDataInterpolationTest2.mfront new file mode 100644 index 000000000..eefc19229 --- /dev/null +++ b/mfront/tests/properties/CubicSplineDataInterpolationTest2.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law CubicSplineDataInterpolationTest2; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation: "cubic_spline", + extrapolation: false +} \ No newline at end of file diff --git a/mfront/tests/properties/CubicSplineDataInterpolationTest3.mfront b/mfront/tests/properties/CubicSplineDataInterpolationTest3.mfront new file mode 100644 index 000000000..60f552d17 --- /dev/null +++ b/mfront/tests/properties/CubicSplineDataInterpolationTest3.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law CubicSplineDataInterpolationTest3; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation: "cubic_spline", + extrapolation: true +} \ No newline at end of file diff --git a/mfront/tests/properties/CubicSplineDataInterpolationTest4.mfront b/mfront/tests/properties/CubicSplineDataInterpolationTest4.mfront new file mode 100644 index 000000000..079ba751b --- /dev/null +++ b/mfront/tests/properties/CubicSplineDataInterpolationTest4.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law CubicSplineDataInterpolationTest4; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation: "cubic_spline", + extrapolation: "constant" +} \ No newline at end of file diff --git a/mfront/tests/properties/CubicSplineDataInterpolationTest5.mfront b/mfront/tests/properties/CubicSplineDataInterpolationTest5.mfront new file mode 100644 index 000000000..78586db75 --- /dev/null +++ b/mfront/tests/properties/CubicSplineDataInterpolationTest5.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law CubicSplineDataInterpolationTest5; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation: "cubic_spline", + extrapolation: "bound_to_last_value" +} \ No newline at end of file diff --git a/mfront/tests/properties/LinearDataInterpolationTest.mfront b/mfront/tests/properties/LinearDataInterpolationTest.mfront new file mode 100644 index 000000000..92ff6112d --- /dev/null +++ b/mfront/tests/properties/LinearDataInterpolationTest.mfront @@ -0,0 +1,16 @@ +@DSL MaterialProperty; +@Law LinearDataInterpolationTest; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear" +} \ No newline at end of file diff --git a/mfront/tests/properties/LinearDataInterpolationTest2.mfront b/mfront/tests/properties/LinearDataInterpolationTest2.mfront new file mode 100644 index 000000000..05a7c755e --- /dev/null +++ b/mfront/tests/properties/LinearDataInterpolationTest2.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law LinearDataInterpolationTest2; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear", + extrapolation : true +} \ No newline at end of file diff --git a/mfront/tests/properties/LinearDataInterpolationTest3.mfront b/mfront/tests/properties/LinearDataInterpolationTest3.mfront new file mode 100644 index 000000000..0ecbd1062 --- /dev/null +++ b/mfront/tests/properties/LinearDataInterpolationTest3.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law LinearDataInterpolationTest3; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear", + extrapolation : false +} \ No newline at end of file diff --git a/mfront/tests/properties/LinearDataInterpolationTest4.mfront b/mfront/tests/properties/LinearDataInterpolationTest4.mfront new file mode 100644 index 000000000..2fee3c2e9 --- /dev/null +++ b/mfront/tests/properties/LinearDataInterpolationTest4.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law LinearDataInterpolationTest4; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear", + extrapolation : "constant" +} \ No newline at end of file diff --git a/mfront/tests/properties/LinearDataInterpolationTest5.mfront b/mfront/tests/properties/LinearDataInterpolationTest5.mfront new file mode 100644 index 000000000..c8c033973 --- /dev/null +++ b/mfront/tests/properties/LinearDataInterpolationTest5.mfront @@ -0,0 +1,17 @@ +@DSL MaterialProperty; +@Law LinearDataInterpolationTest5; + +@UseQt true; +@UnitSystem SI; + +@Output stress E; +E.setGlossaryName("YoungModulus"); + +@StateVariable temperature T; +T.setGlossaryName("Temperature"); + +@Data { + values: { 293.15 : 240e9, 693.15 : 180e9, 893.15 : 170e9 }, + interpolation : "linear", + extrapolation : "bound_to_last_value" +} \ No newline at end of file diff --git a/mtest/include/MTest/NonLinearConstraint.hxx b/mtest/include/MTest/NonLinearConstraint.hxx index ba3063c3d..becb58e7d 100644 --- a/mtest/include/MTest/NonLinearConstraint.hxx +++ b/mtest/include/MTest/NonLinearConstraint.hxx @@ -50,13 +50,13 @@ namespace mtest { */ THERMODYNAMICFORCECONSTRAINT }; // end of enum NormalisationPolicy - /*! - * constructor - * \param[in] b_: behaviour - * \param[in] f: analytic defintion of the constraint - * \param[in] evm: evolution manager - * \param[in] p: normalisation policy - */ + /*! + * constructor + * \param[in] b_: behaviour + * \param[in] f: analytic defintion of the constraint + * \param[in] evm: evolution manager + * \param[in] p: normalisation policy + */ NonLinearConstraint(const Behaviour&, const std::string&, const EvolutionManager&, diff --git a/mtest/include/MTest/PipeTest.hxx b/mtest/include/MTest/PipeTest.hxx index 998cbcd4b..d3f5abf89 100644 --- a/mtest/include/MTest/PipeTest.hxx +++ b/mtest/include/MTest/PipeTest.hxx @@ -78,7 +78,7 @@ namespace mtest { * This option may be useful when * optimizing material parameters. */ - }; // end of FailurePolicy + }; // end of FailurePolicy //! \brief base class for tests struct UTest { /*! diff --git a/mtest/include/MTest/SolverOptions.hxx b/mtest/include/MTest/SolverOptions.hxx index 732b381f2..492fc8ff9 100644 --- a/mtest/include/MTest/SolverOptions.hxx +++ b/mtest/include/MTest/SolverOptions.hxx @@ -63,9 +63,9 @@ namespace mtest { //! default value UNSPECIFIEDSTIFFNESSUPDATINGPOLICY }; // end of enum struct StiffnessUpdatingPolicy - /*! - * \brief possible prediction policies - */ + /*! + * \brief possible prediction policies + */ enum struct PredictionPolicy { NOPREDICTION, LINEARPREDICTION, diff --git a/mtest/include/MTest/StudyCurrentState.hxx b/mtest/include/MTest/StudyCurrentState.hxx index 720dd9e60..d81449f72 100644 --- a/mtest/include/MTest/StudyCurrentState.hxx +++ b/mtest/include/MTest/StudyCurrentState.hxx @@ -47,7 +47,8 @@ namespace mtest { /*! * \brief make a deep copy of the object * Contrary to standard copy which shares pointers to the structure current - * states with the original object, those states are duplicated in a deep copy. + * states with the original object, those states are duplicated in a deep + * copy. */ StudyCurrentState makeDeepCopy() const; /*! diff --git a/mtest/src/GasEquationOfState.cxx b/mtest/src/GasEquationOfState.cxx index 2b2e25fe7..116b80da5 100644 --- a/mtest/src/GasEquationOfState.cxx +++ b/mtest/src/GasEquationOfState.cxx @@ -58,11 +58,11 @@ namespace mtest { this->ds_dP = std::dynamic_pointer_cast( s.differentiate("P")); } // end of GasEquationOfStateMembers - /*! - * \param[in] P: pressure - * \param[in] V: volume - * \param[in] T: temperature - */ + /*! + * \param[in] P: pressure + * \param[in] V: volume + * \param[in] T: temperature + */ double computeNumberOfMoles(const double P, const double V, const double T) { diff --git a/mtest/src/MTestFileExport.cxx b/mtest/src/MTestFileExport.cxx index a086eba77..d922df3d6 100644 --- a/mtest/src/MTestFileExport.cxx +++ b/mtest/src/MTestFileExport.cxx @@ -115,6 +115,6 @@ namespace mtest { static_cast(d); tfel::raise("write: unsupported file extension '" + ext + "'"); #endif /* MADNEX_MTEST_TEST_SUPPORT */ - } // end of write + } // end of write } // namespace mtest diff --git a/mtest/src/MTestMain.cxx b/mtest/src/MTestMain.cxx index 2fd352dcd..5dbfd9cec 100644 --- a/mtest/src/MTestMain.cxx +++ b/mtest/src/MTestMain.cxx @@ -570,7 +570,7 @@ namespace mtest { } } this->addTest(t, test_name); - } // end of appendTestFromMadnexFile + } // end of appendTestFromMadnexFile #endif /* MADNEX_MTEST_TEST_SUPPORT */ void MTestMain::treatMadnexInputFile(const std::string& i) { @@ -627,7 +627,7 @@ namespace mtest { "MTestMain::treatMadnexInputFile: " "madnex support is not available"); #endif /* MADNEX_MTEST_TEST_SUPPORT */ - } // end of treatMadnexInputFile + } // end of treatMadnexInputFile void MTestMain::treatStandardInputFile(const std::string& i) { #ifdef MTEST_HAVE_MADNEX diff --git a/mtest/src/NonLinearConstraint.cxx b/mtest/src/NonLinearConstraint.cxx index 61bae4a72..7aa92723b 100644 --- a/mtest/src/NonLinearConstraint.cxx +++ b/mtest/src/NonLinearConstraint.cxx @@ -40,10 +40,10 @@ namespace mtest { //! \brief position unsigned short p; }; // end of struct Variable - /*! - * A structure containing the constraint derivative and the second - * derivative of the constraint - */ + /*! + * A structure containing the constraint derivative and the second + * derivative of the constraint + */ struct ConstraintDerivative { //! variable used to differentiate the constraint std::shared_ptr v; diff --git a/mtest/src/StudyCurrentState.cxx b/mtest/src/StudyCurrentState.cxx index b048f2847..aafd5b6f8 100644 --- a/mtest/src/StudyCurrentState.cxx +++ b/mtest/src/StudyCurrentState.cxx @@ -70,8 +70,8 @@ namespace mtest { this->failure_criterion_status.resize(n, false); } // end of setNumberOfFailureCriterionStatus - std::size_t StudyCurrentState::getNumberOfFailureCriterionStatus() const - noexcept { + std::size_t StudyCurrentState::getNumberOfFailureCriterionStatus() + const noexcept { return this->failure_criterion_status.size(); } // end of getNumberOfFailureCriterionStatus diff --git a/src/Math/Discretization1D.cxx b/src/Math/Discretization1D.cxx index 8737f8193..757e94897 100644 --- a/src/Math/Discretization1D.cxx +++ b/src/Math/Discretization1D.cxx @@ -29,8 +29,8 @@ namespace tfel::math { GeometricDiscretizationInvalidLength:: ~GeometricDiscretizationInvalidLength() noexcept = default; - const char* GeometricDiscretizationInvalidNumberOfElements::what() const - noexcept { + const char* GeometricDiscretizationInvalidNumberOfElements::what() + const noexcept { return "geometricDiscretization : invalid number of elements"; } // end of GeometricDiscretizationInvalidNumberOfElements::what diff --git a/src/Math/FactorizedKriging1D2D.cxx b/src/Math/FactorizedKriging1D2D.cxx index 65271df98..908787095 100644 --- a/src/Math/FactorizedKriging1D2D.cxx +++ b/src/Math/FactorizedKriging1D2D.cxx @@ -75,7 +75,7 @@ namespace tfel::math { const double vy, const double vz) const { const tvector<2u> v = {this->a1 * (vy) + b1, this->a2 * (vz) + b2}; - return FK::operator()(this->a0* vx + this->b0, v); + return FK::operator()(this->a0 * vx + this->b0, v); } // end of FactorizedKriging1D2D::operator() FactorizedKriging1D2D::~FactorizedKriging1D2D() = default; diff --git a/src/Math/FactorizedKriging1D3D.cxx b/src/Math/FactorizedKriging1D3D.cxx index 2515dd176..5c83fa948 100644 --- a/src/Math/FactorizedKriging1D3D.cxx +++ b/src/Math/FactorizedKriging1D3D.cxx @@ -89,7 +89,7 @@ namespace tfel::math { const double vz) const { const tvector<3u> v = {this->a1 * (vx) + b1, this->a2 * (vy) + b2, this->a3 * (vz) + b3}; - return FK::operator()(this->a0* vt + this->b0, v); + return FK::operator()(this->a0 * vt + this->b0, v); } // end of FactorizedKriging1D3D::operator() FactorizedKriging1D3D::~FactorizedKriging1D3D() = default; diff --git a/src/Math/Kriging1D.cxx b/src/Math/Kriging1D.cxx index 50d32219b..319ca4e93 100644 --- a/src/Math/Kriging1D.cxx +++ b/src/Math/Kriging1D.cxx @@ -48,7 +48,7 @@ namespace tfel::math { } double Kriging1D::operator()(const double vx) const { - return Kriging<1u, double>::operator()(this->a* vx + this->b); + return Kriging<1u, double>::operator()(this->a * vx + this->b); } // end of Kriging1D::operator() Kriging1D::~Kriging1D() = default; diff --git a/src/NUMODIS/Crystallo.cxx b/src/NUMODIS/Crystallo.cxx index eb280a254..56466a4f0 100644 --- a/src/NUMODIS/Crystallo.cxx +++ b/src/NUMODIS/Crystallo.cxx @@ -98,7 +98,7 @@ namespace numodis { if (gsystem1.getIPlane() == gsystem2.getIPlane()) { if (Coincide(gsystem1.getIBurgers(), gsystem2.getIBurgers()) != 0) { // self junction - throw - 1; + throw -1; } // add Burgers vectors IBurgers iburgers3a(gsystem1.getIBurgers() + gsystem2.getIBurgers()); @@ -114,7 +114,7 @@ namespace numodis { } if (Coincide(gsystem1.getIBurgers(), gsystem2.getIBurgers()) != 0) { // colinear situation - throw - 2; + throw -2; } // compute junction direction IDirection ijunction(this->getNindices()); diff --git a/src/NUMODIS/FrankRead.cxx b/src/NUMODIS/FrankRead.cxx index a556a288e..1f45e9e9d 100644 --- a/src/NUMODIS/FrankRead.cxx +++ b/src/NUMODIS/FrankRead.cxx @@ -55,12 +55,12 @@ namespace numodis { // range for betaF double bFmin = beta0 - pi; double bFmax = 0.0; - if (bFmin > bFmax) throw - 1; // throw: ill-defined beta0 value + if (bFmin > bFmax) throw -1; // throw: ill-defined beta0 value double Eq4min = this->Equation4(alpha, beta0, bFmin); double Eq4max = this->Equation4(alpha, beta0, bFmax); if (Eq4min * Eq4max > 0.0) - throw - 2; // throw: both sides have positive values + throw -2; // throw: both sides have positive values // find betaF using a simple bisection method int N = 0; @@ -81,7 +81,7 @@ namespace numodis { Eq4max = Eq4mid; } } - throw - 3; // throw: calculation did not converge + throw -3; // throw: calculation did not converge } //================================================================= diff --git a/src/NUMODIS/TripleNode.cxx b/src/NUMODIS/TripleNode.cxx index 8f8571b8b..65df20ff6 100644 --- a/src/NUMODIS/TripleNode.cxx +++ b/src/NUMODIS/TripleNode.cxx @@ -68,7 +68,7 @@ namespace numodis { double Eqmin = this->computeFx(phimin, 0.0, phimin, 0.0); double Eqmax = this->computeFx(phimax, 0.0, phimax, 0.0); if (Eqmin * Eqmax > 0.0) - throw - 1; // throw: both sides have positive values + throw -1; // throw: both sides have positive values // find phi using a simple bisection method int N = 0; @@ -89,7 +89,7 @@ namespace numodis { } } - throw - 2; // throw: calculation did not converge + throw -2; // throw: calculation did not converge } //=================================================================== @@ -122,7 +122,7 @@ namespace numodis { beta0 = this->computeEquilibriumBeta0(phi); } catch (int) { std::cerr << "=> could not find beta0 at equilibrium" << std::endl; - throw - 1; + throw -1; } // compute betaF from beta0 @@ -131,7 +131,7 @@ namespace numodis { betaF = _lt0.computeBetaF(_alpha0 - phi, beta0, tol, Nmax); } catch (int) { std::cerr << "=> could not find betaF from beta0" << std::endl; - throw - 2; + throw -2; } // compute the corresponding stress double sigma = @@ -171,7 +171,7 @@ namespace numodis { double Fxmin = this->computeFx(phi, beta0min, phi, 0.0); double Fxmax = this->computeFx(phi, beta0max, phi, 0.0); if (Fxmin * Fxmax > 0.0) - throw - 1; // throw: both sides have the same values + throw -1; // throw: both sides have the same values // find beta0 using a simple bisection method int N = 0; @@ -191,7 +191,7 @@ namespace numodis { Fxmax = Fxmid; } } - throw - 2; // throw: calculation did not converge + throw -2; // throw: calculation did not converge } } // end of namespace numodis diff --git a/src/System/ExternalLibraryManager.cxx b/src/System/ExternalLibraryManager.cxx index 6afea71ff..1c65941e5 100644 --- a/src/System/ExternalLibraryManager.cxx +++ b/src/System/ExternalLibraryManager.cxx @@ -66,7 +66,7 @@ namespace tfel::system { } return ""; #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of getErrorMessage + } // end of getErrorMessage static void ExternalLibraryManagerCheckModellingHypothesisName( const std::string& h) { @@ -134,7 +134,7 @@ namespace tfel::system { #else return ::dlopen(l.c_str(), RTLD_NOW); #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of load_library + } // end of load_library #if (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) static std::pair @@ -249,7 +249,7 @@ namespace tfel::system { "can't find library '" + l + "'"); #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of getLibraryPath + } // end of getLibraryPath #if (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) HINSTANCE__* @@ -332,7 +332,7 @@ namespace tfel::system { void* p = ::dlsym(lib, s.c_str()); return p != nullptr; #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of contains + } // end of contains std::string ExternalLibraryManager::getString(const std::string& l, const std::string& s) { @@ -361,7 +361,7 @@ namespace tfel::system { #else return *(static_cast(p)); #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of ExternalLibraryManager::getStringIfDefined + } // end of ExternalLibraryManager::getStringIfDefined std::string ExternalLibraryManager::getAuthor(const std::string& l, const std::string& s) { @@ -419,7 +419,7 @@ namespace tfel::system { #else return *(static_cast(p)); #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of getInterface + } // end of getInterface std::string ExternalLibraryManager::getLaw(const std::string& l, const std::string& f) { diff --git a/src/System/ExternalMaterialKnowledgeDescription.cxx b/src/System/ExternalMaterialKnowledgeDescription.cxx index ecfd5e560..bd73edcbb 100644 --- a/src/System/ExternalMaterialKnowledgeDescription.cxx +++ b/src/System/ExternalMaterialKnowledgeDescription.cxx @@ -43,10 +43,12 @@ namespace tfel::system { ExternalMaterialKnowledgeDescription&&) = default; ExternalMaterialKnowledgeDescription::ExternalMaterialKnowledgeDescription( const ExternalMaterialKnowledgeDescription&) = default; - ExternalMaterialKnowledgeDescription& ExternalMaterialKnowledgeDescription:: - operator=(const ExternalMaterialKnowledgeDescription&) = default; - ExternalMaterialKnowledgeDescription& ExternalMaterialKnowledgeDescription:: - operator=(ExternalMaterialKnowledgeDescription&&) = default; + ExternalMaterialKnowledgeDescription& + ExternalMaterialKnowledgeDescription::operator=( + const ExternalMaterialKnowledgeDescription&) = default; + ExternalMaterialKnowledgeDescription& + ExternalMaterialKnowledgeDescription::operator=( + ExternalMaterialKnowledgeDescription&&) = default; ExternalMaterialKnowledgeDescription:: ~ExternalMaterialKnowledgeDescription() = default; diff --git a/src/System/ExternalMaterialPropertyDescription.cxx b/src/System/ExternalMaterialPropertyDescription.cxx index 337931a8e..73145c2fe 100644 --- a/src/System/ExternalMaterialPropertyDescription.cxx +++ b/src/System/ExternalMaterialPropertyDescription.cxx @@ -108,10 +108,12 @@ namespace tfel::system { ExternalMaterialPropertyDescription&&) = default; ExternalMaterialPropertyDescription::ExternalMaterialPropertyDescription( const ExternalMaterialPropertyDescription&) = default; - ExternalMaterialPropertyDescription& ExternalMaterialPropertyDescription:: - operator=(const ExternalMaterialPropertyDescription&) = default; - ExternalMaterialPropertyDescription& ExternalMaterialPropertyDescription:: - operator=(ExternalMaterialPropertyDescription&&) = default; + ExternalMaterialPropertyDescription& + ExternalMaterialPropertyDescription::operator=( + const ExternalMaterialPropertyDescription&) = default; + ExternalMaterialPropertyDescription& + ExternalMaterialPropertyDescription::operator=( + ExternalMaterialPropertyDescription&&) = default; ExternalMaterialPropertyDescription::~ExternalMaterialPropertyDescription() = default; diff --git a/src/System/RecursiveFind.cxx b/src/System/RecursiveFind.cxx index 14d91bb75..b5c3bb3f8 100644 --- a/src/System/RecursiveFind.cxx +++ b/src/System/RecursiveFind.cxx @@ -143,6 +143,6 @@ namespace tfel::system { } } #endif /* (defined _WIN32 || defined _WIN64) && (!defined __CYGWIN__) */ - } // end of recursiveFind + } // end of recursiveFind } // end of namespace tfel::system diff --git a/src/System/System.cxx b/src/System/System.cxx index e17d45ca2..54a8a1866 100644 --- a/src/System/System.cxx +++ b/src/System/System.cxx @@ -38,24 +38,24 @@ #include #include #ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif #ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #ifndef S_ISCHR -#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #endif /* S_ISCHR */ /* Not in MS Visual Studio 2008 Express */ #ifndef S_IFBLK #ifndef S_ISBLK -#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #endif /* S_ISBLK */ #define S_IFBLK(m) (0) #endif /* S_IFBLK */ #ifndef S_IFIFO #ifndef S_ISFIFO -#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #endif /* S_ISFIFO */ #define S_IFFIFO(m) (0) #endif /* S_IFIFO */ @@ -315,7 +315,7 @@ namespace tfel::system { systemCall::fileType(destInfos.st_mode)); } #endif /* defined _WIN32 || _WIN64 */ - } // end of systemCall::copy + } // end of systemCall::copy #if defined _WIN32 || defined _WIN64 void systemCall::mkdir(const std::string& dir) @@ -457,7 +457,7 @@ namespace tfel::system { r = static_cast(r - w); b += w; } - } // end of systemCall::write + } // end of systemCall::write #endif /* !(defined _WIN32 || defined _WIN64 ) */ std::string systemCall::fileType(const mode_t mode) { @@ -622,7 +622,7 @@ namespace tfel::system { std::string systemCall::getUserName() { const auto l = ::getlogin(); return l != nullptr ? l : ""; - } // end of systemCall::getUserName + } // end of systemCall::getUserName #endif /* !(defined _WIN32 || defined _WIN64 ) */ std::string systemCall::getAbsolutePath(const std::string& f) { @@ -640,7 +640,7 @@ namespace tfel::system { "can't retrieve full path for for '" + f + "'"); return path; #endif /* (defined _WIN32 || defined _WIN64 ) && (! defined __CYGWIN__) */ - } // end of systemCall::getAbsolutePath + } // end of systemCall::getAbsolutePath void systemCall::changeCurrentWorkingDirectory(const std::string& name) { #if defined _WIN32 || defined _WIN64 diff --git a/src/Utilities/Data.cxx b/src/Utilities/Data.cxx index 76c8b48b8..e066d8e18 100644 --- a/src/Utilities/Data.cxx +++ b/src/Utilities/Data.cxx @@ -294,7 +294,9 @@ namespace tfel::utilities { using return_type = bool; // default implementation template - static bool apply(const T1&, const T2&) requires(!std::is_same_v) { + static bool apply(const T1&, const T2&) + requires(!std::is_same_v) + { return false; } // end of apply static bool apply(const std::string& x1, const std::string& x2) { @@ -335,7 +337,7 @@ namespace tfel::utilities { static bool apply(const double v1, const double v2) { return tfel::math::ieee754::fpclassify(v1 - v2) == FP_ZERO; } // end of apply - }; // end of struct DataComparator + }; // end of struct DataComparator bool operator==(const Data& lhs, const Data& rhs) { if (&lhs == &rhs) { diff --git a/tests/Math/CubicSplineInterpolationTest.cxx b/tests/Math/CubicSplineInterpolationTest.cxx index 3b8b43c46..d0c914110 100644 --- a/tests/Math/CubicSplineInterpolationTest.cxx +++ b/tests/Math/CubicSplineInterpolationTest.cxx @@ -146,7 +146,8 @@ struct CubicSplineInterpolationTest final : public tfel::tests::TestCase { #endif /* __clang__ */ } void test4() { -#if (not defined __INTEL_COMPILER) && (not defined __clang__) && (not defined _MSC_VER) +#if (not defined __INTEL_COMPILER) && (not defined __clang__) && \ + (not defined _MSC_VER) using time = tfel::math::qt; using stress = tfel::math::qt; using stressrate = tfel::math::derivative_type; diff --git a/tests/Math/derivative_view.cxx b/tests/Math/derivative_view.cxx index 45c17385e..514fb42f9 100644 --- a/tests/Math/derivative_view.cxx +++ b/tests/Math/derivative_view.cxx @@ -80,15 +80,13 @@ struct DerivativeViewTest final : public tfel::tests::TestCase { derivative_view_from_tiny_matrix<6, int, int>(r(1, 1)) = 1; derivative_view_from_tiny_matrix<6, int, int>(r(2, 3)) = 2; return r; - } - (); + }(); constexpr auto m2 = []() constexpr { auto r = tmatrix<6, 6, int>{0}; map_derivative<1, 1, int, int>(r) = 1; map_derivative<2, 3, int, int>(r) = 2; return r; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m, expected)); this->checkMatrixValuesAtRuntimeTime(m, expected); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m2, expected)); @@ -110,14 +108,12 @@ struct DerivativeViewTest final : public tfel::tests::TestCase { &(r(1, 1))); s = stensor<2u, int>::Id(); return r; - } - (); + }(); constexpr auto m2 = []() constexpr { auto r = tmatrix<5, 3, int>{0}; map_derivative<1, 1, stensor<2u, int>, int>(r) = stensor<2u, int>::Id(); return r; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m, expected)); this->checkMatrixValuesAtRuntimeTime(m, expected); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m2, expected)); @@ -136,14 +132,12 @@ struct DerivativeViewTest final : public tfel::tests::TestCase { &(r(0, 1))); s = stensor<2u, int>::Id(); return r; - } - (); + }(); constexpr auto m2 = []() constexpr { auto r = tmatrix<2, 5, int>{0}; map_derivative<0, 1, int, stensor<2u, int>>(r) = stensor<2u, int>::Id(); return r; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m, expected)); this->checkMatrixValuesAtRuntimeTime(m, expected); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m2, expected)); @@ -165,15 +159,13 @@ struct DerivativeViewTest final : public tfel::tests::TestCase { stensor<2u, int>>(&(r(1, 1))); s = st2tost2<2u, int>::IxI(); return r; - } - (); + }(); constexpr auto m2 = []() constexpr { auto r = tmatrix<5, 5, int>{0}; map_derivative<1, 1, stensor<2u, int>, stensor<2u, int>>(r) = st2tost2<2u, int>::IxI(); return r; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m, expected)); this->checkMatrixValuesAtRuntimeTime(m, expected); TFEL_TESTS_STATIC_ASSERT(checkMatrixValuesAtCompileTime(m2, expected)); diff --git a/tests/Math/fsarray.cxx b/tests/Math/fsarray.cxx index ea281a757..648aafa3d 100644 --- a/tests/Math/fsarray.cxx +++ b/tests/Math/fsarray.cxx @@ -76,7 +76,7 @@ struct FSArrayTest final : public tfel::tests::TestCase { TFEL_TESTS_STATIC_ASSERT(*(a5.rbegin() + 1) == 3); TFEL_TESTS_STATIC_ASSERT(*(a5.rbegin() + 2) == 5); #endif /* __INTEL_COMPILER */ - } // end of test1 + } // end of test1 void test2() { /* does not compile with icc 2021.1, but compiles with 2021.1 */ #ifndef __INTEL_COMPILER @@ -91,7 +91,7 @@ struct FSArrayTest final : public tfel::tests::TestCase { TFEL_TESTS_STATIC_ASSERT(a2[1] == 3); TFEL_TESTS_STATIC_ASSERT(a2[2] == 4); #endif /* __INTEL_COMPILER */ - } // end of test2 + } // end of test2 void test3() { int values[] = {0, 2, 0}; const int values2[] = {0, 2, -2}; @@ -140,7 +140,7 @@ struct FSArrayTest final : public tfel::tests::TestCase { TFEL_TESTS_STATIC_ASSERT(a[1] == 4); TFEL_TESTS_STATIC_ASSERT(a[2] == -3); #endif /* __INTEL_COMPILER */ - } // end of test6 + } // end of test6 void test7() { using namespace tfel::math; // class template argument deduction diff --git a/tests/Math/levenberg-marquardt5.cxx b/tests/Math/levenberg-marquardt5.cxx index f6d613b85..20b03296a 100644 --- a/tests/Math/levenberg-marquardt5.cxx +++ b/tests/Math/levenberg-marquardt5.cxx @@ -87,7 +87,7 @@ struct LevenbergMarquardtSolver2 J = 2 * x; return true; } // end of computFdF -}; // end of struct LevenbergMarquardtSolver2 +}; // end of struct LevenbergMarquardtSolver2 struct LevenbergMarquardtSolver3 : public tfel::math:: @@ -116,7 +116,7 @@ struct LevenbergMarquardtSolver3 -200 * x(0), 100.}; return true; } // end of computFdF -}; // end of struct LevenbergMarquardtSolver3 +}; // end of struct LevenbergMarquardtSolver3 struct TinyLevenbergMarquardtSolverTest final : public tfel::tests::TestCase { TinyLevenbergMarquardtSolverTest() diff --git a/tests/Math/newton_raphson.cxx b/tests/Math/newton_raphson.cxx index 49526f88e..3939e930b 100644 --- a/tests/Math/newton_raphson.cxx +++ b/tests/Math/newton_raphson.cxx @@ -80,7 +80,7 @@ struct NewtonRaphsonSolver2 J = 2 * x; return true; } // end of computFdF -}; // end of struct NewtonRaphsonSolver2 +}; // end of struct NewtonRaphsonSolver2 struct NewtonRaphsonSolver3 : public tfel::math:: @@ -104,7 +104,7 @@ struct NewtonRaphsonSolver3 -200 * x(0), 100.}; return true; } // end of computFdF -}; // end of struct NewtonRaphsonSolver3 +}; // end of struct NewtonRaphsonSolver3 template struct HeapAllocatedWorkspace { @@ -172,13 +172,13 @@ struct ExternallyAllocatedWorkspace { }; struct NewtonRaphsonSolver5; -using TinyNewtonRaphsonSolver5 = tfel::math::TinyNewtonRaphsonSolver<2u, - double, - NewtonRaphsonSolver5, - ExternallyAllocatedWorkspace>; +using TinyNewtonRaphsonSolver5 = + tfel::math::TinyNewtonRaphsonSolver<2u, + double, + NewtonRaphsonSolver5, + ExternallyAllocatedWorkspace>; -struct NewtonRaphsonSolver5 - : public TinyNewtonRaphsonSolver5 { +struct NewtonRaphsonSolver5 : public TinyNewtonRaphsonSolver5 { NewtonRaphsonSolver5(double* const buffer) : TinyNewtonRaphsonSolver5(buffer) { this->zeros = {0.5, 0.5}; @@ -203,13 +203,13 @@ struct NewtonRaphsonSolver5 }; // end of struct NewtonRaphsonSolver5 struct NewtonRaphsonSolver6; -using TinyNewtonRaphsonSolver6 = tfel::math::TinyNewtonRaphsonSolver<4u, - double, - NewtonRaphsonSolver6, - ExternallyAllocatedWorkspace>; +using TinyNewtonRaphsonSolver6 = + tfel::math::TinyNewtonRaphsonSolver<4u, + double, + NewtonRaphsonSolver6, + ExternallyAllocatedWorkspace>; -struct NewtonRaphsonSolver6 - : public TinyNewtonRaphsonSolver6 { +struct NewtonRaphsonSolver6 : public TinyNewtonRaphsonSolver6 { NewtonRaphsonSolver6(double* const buffer) : TinyNewtonRaphsonSolver6(buffer) { this->zeros = {0.5, 0.5, 1., 1.}; diff --git a/tests/Math/powell_dog_leg_newton_raphson.cxx b/tests/Math/powell_dog_leg_newton_raphson.cxx index 4bd2c79a3..8a203b865 100644 --- a/tests/Math/powell_dog_leg_newton_raphson.cxx +++ b/tests/Math/powell_dog_leg_newton_raphson.cxx @@ -83,7 +83,7 @@ struct PowellDogLegNewtonRaphsonSolver2 J = 2 * x; return true; } // end of computFdF -}; // end of struct PowellDogLegNewtonRaphsonSolver2 +}; // end of struct PowellDogLegNewtonRaphsonSolver2 struct PowellDogLegNewtonRaphsonSolver3 : public tfel::math::TinyPowellDogLegNewtonRaphsonSolver< @@ -110,7 +110,7 @@ struct PowellDogLegNewtonRaphsonSolver3 -200 * x(0), 100.}; return true; } // end of computFdF -}; // end of struct PowellDogLegNewtonRaphsonSolver3 +}; // end of struct PowellDogLegNewtonRaphsonSolver3 struct TinyPowellDogLegNewtonRaphsonSolverTest final : public tfel::tests::TestCase { diff --git a/tests/Math/qt2.cxx b/tests/Math/qt2.cxx index 7b7a74f5f..2165be37b 100644 --- a/tests/Math/qt2.cxx +++ b/tests/Math/qt2.cxx @@ -53,8 +53,7 @@ struct QtRefTest final : public tfel::tests::TestCase { qt_ref m1(v1); qt_ref m2(v2); return m1 + 0.5 * m2; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(m3.getValue() - 100.) < 1.e-14); } // end of test1 void test2() { @@ -65,8 +64,7 @@ struct QtRefTest final : public tfel::tests::TestCase { qt_ref m1(v1); qt_ref m2(v2); return m1 + 0.5 * m2; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(m3.getValue() - 100.) < 1.e-14); } // end of test2 void test3() { @@ -77,8 +75,7 @@ struct QtRefTest final : public tfel::tests::TestCase { const_qt_ref m1(v1); const_qt_ref m2(v2); return m1 + 0.5 * m2; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(m3.getValue() - 100.) < 1.e-14); } // end of test3 void test4() { @@ -89,8 +86,7 @@ struct QtRefTest final : public tfel::tests::TestCase { qt_ref m1(v1); const_qt_ref m2(v2); return m1 + 0.5 * m2; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(m3.getValue() - 100.) < 1.e-14); } // end of test4 void test5() { @@ -100,8 +96,7 @@ struct QtRefTest final : public tfel::tests::TestCase { auto v1 = double{50.}; const_qt_ref m1(v1); return increase_mass(m1); - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(m3.getValue() - 100.) < 1.e-14); } // end of test5 void test6() { @@ -131,8 +126,7 @@ struct QtRefTest final : public tfel::tests::TestCase { auto f = qt_ref(vf); f = m * a; return vf; - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(value - 200.) < eps); } void test8() { diff --git a/tests/Math/qt3.cxx b/tests/Math/qt3.cxx index fcca02317..97c0e1307 100644 --- a/tests/Math/qt3.cxx +++ b/tests/Math/qt3.cxx @@ -56,11 +56,10 @@ struct QtRefTest final : public tfel::tests::TestCase { #if (not defined __INTEL_COMPILER) && (not defined __clang__) using namespace tfel::math; constexpr auto eps = double{1e-14}; - constexpr auto s = []() constexpr->stensor<3, qt> { + constexpr auto s = []() constexpr -> stensor<3, qt> { double stress_values[6] = {0, 1, 2, 3, 4, 5}; return map>>(stress_values); - } - (); + }(); TFEL_TESTS_STATIC_ASSERT(my_abs(s[0].getValue()) < eps); TFEL_TESTS_STATIC_ASSERT(my_abs(s[1].getValue() - 1) < eps); TFEL_TESTS_STATIC_ASSERT(my_abs(s[2].getValue() - 2) < eps); @@ -68,7 +67,7 @@ struct QtRefTest final : public tfel::tests::TestCase { TFEL_TESTS_STATIC_ASSERT(my_abs(s[4].getValue() - 4) < eps); TFEL_TESTS_STATIC_ASSERT(my_abs(s[5].getValue() - 5) < eps); #endif /* (not defined __INTEL_COMPILER) && (not defined __clang__) */ - } // end of test2 + } // end of test2 void test3() { using namespace tfel::math; using stress = qt; diff --git a/tests/Math/st2tost2/ST2toST2FromTinyMatrixView.cxx b/tests/Math/st2tost2/ST2toST2FromTinyMatrixView.cxx index 41a518825..e7edd525f 100644 --- a/tests/Math/st2tost2/ST2toST2FromTinyMatrixView.cxx +++ b/tests/Math/st2tost2/ST2toST2FromTinyMatrixView.cxx @@ -50,7 +50,7 @@ struct ST2toST2FromTinyMatrixViewTest final : public tfel::tests::TestCase { } return this->result; } // end of execute -}; // end of ST2toST2FromTinyMatrixViewTest +}; // end of ST2toST2FromTinyMatrixViewTest TFEL_TESTS_GENERATE_PROXY(ST2toST2FromTinyMatrixViewTest, "ST2toST2FromTinyMatrixViewTest"); diff --git a/tests/Math/stensor/stensor_isotropic_function.cxx b/tests/Math/stensor/stensor_isotropic_function.cxx index a84782786..d485c7aec 100644 --- a/tests/Math/stensor/stensor_isotropic_function.cxx +++ b/tests/Math/stensor/stensor_isotropic_function.cxx @@ -86,10 +86,11 @@ struct StensorIsotropicFunctionDerivativeTest final } template void test2(const tfel::math::stensor& v) { - this->test(v, [](const double x) { return std::abs(x); }, - [](const double x) { - return std::abs(x) < 1.e-12 ? 0.5 : ((x < 0) ? -1 : 1); - }); + this->test( + v, [](const double x) { return std::abs(x); }, + [](const double x) { + return std::abs(x) < 1.e-12 ? 0.5 : ((x < 0) ? -1 : 1); + }); } }; diff --git a/tests/Math/tmatrix.cxx b/tests/Math/tmatrix.cxx index a41e1af11..c6f291603 100644 --- a/tests/Math/tmatrix.cxx +++ b/tests/Math/tmatrix.cxx @@ -23,60 +23,55 @@ int main() { using namespace tfel::math; // - constexpr auto m2 = []() constexpr->tfel::math::tmatrix<2, 2, int> { + constexpr auto m2 = []() constexpr -> tfel::math::tmatrix<2, 2, int> { auto m = tfel::math::tmatrix<2, 2, int>{}; m(0, 0) = 0; m(0, 1) = 1; m(1, 0) = 2; m(1, 1) = 3; return 2 * m; - } - (); + }(); static_assert(m2(0, 0) == 0); static_assert(m2(0, 1) == 2); static_assert(m2(1, 0) == 4); static_assert(m2(1, 1) == 6); // - constexpr auto m3 = []() constexpr->tfel::math::tmatrix<2, 2, int> { + constexpr auto m3 = []() constexpr -> tfel::math::tmatrix<2, 2, int> { const auto m = tfel::math::tmatrix<2, 2, int>{0, 1, // 2, 3}; return 2 * m; - } - (); + }(); static_assert(m3(0, 0) == 0); static_assert(m3(0, 1) == 2); static_assert(m3(1, 0) == 4); static_assert(m3(1, 1) == 6); // - constexpr auto m4 = []() constexpr->tfel::math::tmatrix<2, 2, int> { + constexpr auto m4 = []() constexpr -> tfel::math::tmatrix<2, 2, int> { const auto m = tfel::math::tmatrix<2, 2, int>{{0, 1}, // {2, 3}}; return 2 * m; - } - (); + }(); static_assert(m4(0, 0) == 0); static_assert(m4(0, 1) == 2); static_assert(m4(1, 0) == 4); static_assert(m4(1, 1) == 6); // - constexpr auto m5 = []() constexpr->tfel::math::tmatrix<2, 2, int> { + constexpr auto m5 = []() constexpr -> tfel::math::tmatrix<2, 2, int> { const auto m = tfel::math::tmatrix{{0, 1}, // {2, 3}}; return 2 * m; - } - (); + }(); static_assert(m5(0, 0) == 0); static_assert(m5(0, 1) == 2); static_assert(m5(1, 0) == 4); static_assert(m5(1, 1) == 6); // - constexpr auto m6 = []() constexpr->tfel::math::tmatrix<2, 2, int> { + constexpr auto m6 = []() constexpr -> tfel::math::tmatrix<2, 2, int> { auto m = tfel::math::tmatrix<2, 2, int>{}; m = {{0, 1}, // {2, 3}}; return 2 * m; - } - (); + }(); static_assert(m6(0, 0) == 0); static_assert(m6(0, 1) == 2); static_assert(m6(1, 0) == 4); diff --git a/tests/MetaProgramming/typelist2.cxx b/tests/MetaProgramming/typelist2.cxx index 621077910..22346f479 100644 --- a/tests/MetaProgramming/typelist2.cxx +++ b/tests/MetaProgramming/typelist2.cxx @@ -49,7 +49,8 @@ class generic_container : public generic_container_ { public: template typename tfel::meta::TLFindNthElt::type get() const - requires(N < tfel::meta::TLSize::value) { + requires(N < tfel::meta::TLSize::value) + { return static_cast< const holder::type>*>( this) @@ -57,8 +58,9 @@ class generic_container : public generic_container_ { } template - void set(const typename tfel::meta::TLFindNthElt::type& src) requires( - N < tfel::meta::TLSize::value) { + void set(const typename tfel::meta::TLFindNthElt::type& src) + requires(N < tfel::meta::TLSize::value) + { static_cast::type>*>(this) ->set(src); } diff --git a/tfel-check/src/tfel-check.cxx b/tfel-check/src/tfel-check.cxx index 39d878e3a..c3add3b53 100644 --- a/tfel-check/src/tfel-check.cxx +++ b/tfel-check/src/tfel-check.cxx @@ -95,7 +95,7 @@ namespace tfel::check { #ifdef TFEL_PYTHON_EXECUTABLE c.addSubstitution("@python@", TFEL_PYTHON_EXECUTABLE, false); #endif /* */ - } // end of declareTFELExecutables + } // end of declareTFELExecutables /*! * \brief main entry point @@ -184,25 +184,26 @@ namespace tfel::check { this->registerCallBack(n, a, c); }; declare2("--config", "-c", - CallBack("add a configuration file", - [this] { - const auto f = this->currentArgument->getOption(); - parse(this->configurations, f); - }, - true)); - this->registerCallBack( - "--list-default-components", - CallBack("list all default components", + CallBack( + "add a configuration file", [this] { - auto global_configuration = - this->configurations.getConfiguration(""); - for (const auto& c : - global_configuration.available_components) { - std::cout << "- " << c << '\n'; - } - std::exit(EXIT_SUCCESS); + const auto f = this->currentArgument->getOption(); + parse(this->configurations, f); }, - false)); + true)); + this->registerCallBack( + "--list-default-components", + CallBack( + "list all default components", + [this] { + auto global_configuration = + this->configurations.getConfiguration(""); + for (const auto& c : global_configuration.available_components) { + std::cout << "- " << c << '\n'; + } + std::exit(EXIT_SUCCESS); + }, + false)); } // end of TFELCheck::registerArgumentCallBacks std::string TFELCheck::getVersionDescription() const { return VERSION; } diff --git a/tfel-config/src/tfel-config.cxx b/tfel-config/src/tfel-config.cxx index 6a7c121db..7de1db0f8 100644 --- a/tfel-config/src/tfel-config.cxx +++ b/tfel-config/src/tfel-config.cxx @@ -300,119 +300,144 @@ int main(const int argc, const char* const* const argv) { try { #endif /* __CYGWIN__ */ - registerCallBack("--quiet-failure", [] { /*do nothing*/ }, - "quietly fails without error message"); - registerCallBack("--compiler-flags", [] { compilerflags = true; }, - "return TFEL's recommended compiler flags."); - registerCallBack("--debug-flags", [] { debugflags = true; }, - "return flags adding debugging symbols."); - registerCallBack("--oflags0", [] { oflags0 = true; }, - "return tfel recommended optimisation " - "flags without architecture specific flags."); - registerCallBack("--oflags", [] { oflags0 = oflags = true; }, - "return tfel recommended optimisation " - "flags with architecture specific flags."); - registerCallBack("--oflags2", [] { oflags2 = true; }, - "return some aggressive optimisation flags, " - "possibly at the expense of numerical precision. " - "This shall be added to `--oflags` results."); - registerCallBack("--warning", [] { warning = true; }, - "return tfel recommended warnings."); - registerCallBack("--includes", [] { incs = true; }, - "return tfel include path."); - registerCallBack("--cppflags", [] { cppflags = true; }, - "return preprocessor flags."); - registerCallBack("--ldflags", [] { ldflags = true; }, - "return linking flags."); + registerCallBack( + "--quiet-failure", [] { /*do nothing*/ }, + "quietly fails without error message"); + registerCallBack( + "--compiler-flags", [] { compilerflags = true; }, + "return TFEL's recommended compiler flags."); + registerCallBack( + "--debug-flags", [] { debugflags = true; }, + "return flags adding debugging symbols."); + registerCallBack( + "--oflags0", [] { oflags0 = true; }, + "return tfel recommended optimisation " + "flags without architecture specific flags."); + registerCallBack( + "--oflags", [] { oflags0 = oflags = true; }, + "return tfel recommended optimisation " + "flags with architecture specific flags."); + registerCallBack( + "--oflags2", [] { oflags2 = true; }, + "return some aggressive optimisation flags, " + "possibly at the expense of numerical precision. " + "This shall be added to `--oflags` results."); + registerCallBack( + "--warning", [] { warning = true; }, + "return tfel recommended warnings."); + registerCallBack( + "--includes", [] { incs = true; }, "return tfel include path."); + registerCallBack( + "--cppflags", [] { cppflags = true; }, "return preprocessor flags."); + registerCallBack( + "--ldflags", [] { ldflags = true; }, "return linking flags."); registerCallBack("--libs", [] { ldflags = true; }, "return linking flags."); - registerCallBack("--include-path", [] { incspath = true; }, - "return the path to the `TFEL` headers."); - registerCallBack("--library-path", [] { libspath = true; }, - "return the path to the `TFEL` library."); - registerCallBack("--library-dependency", [] { libsdeps = true; }, - "return the dependencies of a `TFEL` library."); + registerCallBack( + "--include-path", [] { incspath = true; }, + "return the path to the `TFEL` headers."); + registerCallBack( + "--library-path", [] { libspath = true; }, + "return the path to the `TFEL` library."); + registerCallBack( + "--library-dependency", [] { libsdeps = true; }, + "return the dependencies of a `TFEL` library."); registerCallBack("--help", &treatHelp, "print this help message."); #ifdef HAVE_CASTEM - registerCallBack("--castem", [] { castem = true; }, - "request flags for castem."); + registerCallBack( + "--castem", [] { castem = true; }, "request flags for castem."); #endif /* HAVE_CASTEM */ #ifdef HAVE_ZMAT registerCallBack("--zmat", [] { zmat = true; }, "request flags for zmat."); #endif /* HAVE_ZMAT */ - registerCallBack("--exceptions", [] { exceptions = true; }, - "request flags for TFELException."); - registerCallBack("--math", [] { math = exceptions = true; }, - "request flags for TFELMath."); - registerCallBack("--math-kriging", - [] { mathKriging = math = exceptions = true; }, - "request flags for TFELMathKriging."); - registerCallBack("--math-cubic-spline", - [] { mathCubicSpline = math = exceptions = true; }, - "request flags for TFELMathCubicSpline."); - registerCallBack("--math-parser", - [] { - math = exceptions = true; - unicodeSupport = true; - mathParser = mathKriging = true; - }, - "request flags for TFELMathParser."); - registerCallBack("--tests", [] { tests = true; }, - "request flags for TFELTests."); - registerCallBack("--system", [] { lsystem = exceptions = true; }, - "request flags for TFELSystem."); - registerCallBack("--utilities", [] { utilities = true; }, - "request flags for TFELUtilities."); - registerCallBack("--unicode-support", [] { unicodeSupport = true; }, - "request flags for TFELUnicodeSupport."); - registerCallBack("--glossary", [] { glossary = true; }, - "request flags for TFELGlossary."); - registerCallBack("--material", - [] { - exceptions = numodis = true; - material = utilities = math = true; - }, - "request flags for TFELMaterial."); - registerCallBack("--numodis", [] { numodis = true; }, - "request flags for TFELNUMODIS."); - registerCallBack("--mfront-profiling", [] { mfront_profiling = true; }, - "request flags for libMFrontProfiling."); - registerCallBack("--all", - [] { - exceptions = math = numodis = material = true; - utilities = glossary = lsystem = tests = true; - unicodeSupport = true; - mfront_profiling = true; - }, - "request flags for all librairies."); + registerCallBack( + "--exceptions", [] { exceptions = true; }, + "request flags for TFELException."); + registerCallBack( + "--math", [] { math = exceptions = true; }, + "request flags for TFELMath."); + registerCallBack( + "--math-kriging", [] { mathKriging = math = exceptions = true; }, + "request flags for TFELMathKriging."); + registerCallBack( + "--math-cubic-spline", + [] { mathCubicSpline = math = exceptions = true; }, + "request flags for TFELMathCubicSpline."); + registerCallBack( + "--math-parser", + [] { + math = exceptions = true; + unicodeSupport = true; + mathParser = mathKriging = true; + }, + "request flags for TFELMathParser."); + registerCallBack( + "--tests", [] { tests = true; }, "request flags for TFELTests."); + registerCallBack( + "--system", [] { lsystem = exceptions = true; }, + "request flags for TFELSystem."); + registerCallBack( + "--utilities", [] { utilities = true; }, + "request flags for TFELUtilities."); + registerCallBack( + "--unicode-support", [] { unicodeSupport = true; }, + "request flags for TFELUnicodeSupport."); + registerCallBack( + "--glossary", [] { glossary = true; }, + "request flags for TFELGlossary."); + registerCallBack( + "--material", + [] { + exceptions = numodis = true; + material = utilities = math = true; + }, + "request flags for TFELMaterial."); + registerCallBack( + "--numodis", [] { numodis = true; }, "request flags for TFELNUMODIS."); + registerCallBack( + "--mfront-profiling", [] { mfront_profiling = true; }, + "request flags for libMFrontProfiling."); + registerCallBack( + "--all", + [] { + exceptions = math = numodis = material = true; + utilities = glossary = lsystem = tests = true; + unicodeSupport = true; + mfront_profiling = true; + }, + "request flags for all librairies."); registerCallBack("--version", &treatVersion, "print tfel version and svn revision."); - registerCallBack("--major-number", - [] { - const auto v = tokenize(VERSION, '.'); - if (v.size() >= 1) { - std::cout << v[0] << " "; - } - }, - "print tfel major version."); - registerCallBack("--minor-number", - [] { - const auto v = tokenize(VERSION, '.'); - if (v.size() >= 2) { - std::cout << v[1] << " "; - } - }, - "print tfel minor version."); - registerCallBack("--revision-number", - [] { - const auto v = tokenize(VERSION, '.'); - if (v.size() >= 3) { - std::cout << v[2] << " "; - } - }, - "print tfel revision version."); - registerCallBack("--cxx-standard", [] { std::cout << "20"; }, - "print the version of the C++ standard " - "used to compile TFEL."); + registerCallBack( + "--major-number", + [] { + const auto v = tokenize(VERSION, '.'); + if (v.size() >= 1) { + std::cout << v[0] << " "; + } + }, + "print tfel major version."); + registerCallBack( + "--minor-number", + [] { + const auto v = tokenize(VERSION, '.'); + if (v.size() >= 2) { + std::cout << v[1] << " "; + } + }, + "print tfel minor version."); + registerCallBack( + "--revision-number", + [] { + const auto v = tokenize(VERSION, '.'); + if (v.size() >= 3) { + std::cout << v[2] << " "; + } + }, + "print tfel revision version."); + registerCallBack( + "--cxx-standard", [] { std::cout << "20"; }, + "print the version of the C++ standard " + "used to compile TFEL."); registerCallBack("--licence", &treatLicences, "print TFEL licences."); registerCallBack( "--python-bindings-support", @@ -439,9 +464,9 @@ int main(const int argc, const char* const* const argv) { #endif }, "print if mandex support is enabled (display `true` or `false`)."); - registerCallBack("--mfront-doc-has-standalone-option", - [] { std::cout << "true "; }, - "print if mfront-doc has the standalone option"); + registerCallBack( + "--mfront-doc-has-standalone-option", [] { std::cout << "true "; }, + "print if mfront-doc has the standalone option"); if (argc == 1) { treatHelp();