Skip to content

Commit

Permalink
Merge pull request #485 from thelfer/483-tfel-math-introduce-the-conc…
Browse files Browse the repository at this point in the history
…ept-t2tot2concept

483 tfel math introduce the concept t2tot2concept
  • Loading branch information
thelfer authored Jan 25, 2024
2 parents 70e630f + 0db2d64 commit e090bed
Show file tree
Hide file tree
Showing 21 changed files with 458 additions and 538 deletions.
20 changes: 19 additions & 1 deletion docs/web/bibliography.bib
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
@article{lorenzo_exploring_2024,
title = {Exploring the inner hygro-mechanical behaviour of historical panel paintings: a novel approach using digital twins},
volume = {12},
issn = {2050-7445},
url = {https://doi.org/10.1186/s40494-023-01106-z},
doi = {10.1186/s40494-023-01106-z},
shorttitle = {Exploring the inner hygro-mechanical behaviour of historical panel paintings},
abstract = {Wooden Panel Paintings ({WPPs}) stand as invaluable cultural artefacts from the past. These works present an intriguing challenge in understanding their complex mechanical behaviour and ensuring their long-term preservation. The present study assumes as founding paradigm the unicity of each {WPP}, in terms of its material composition, historical background, physical dimensions, and the specific environmental conditions it has been subjected to over time, and their complex behaviour, which requires the knowledge of both mechanical and materials specificity. These characteristics need to be considered, and studied in-depth for each individual {WPP}, particularly if the aim is to develop a comprehensive understanding of its individual mechanical behaviour. The study provides new computational models calibrated to reproduce the physical and mechanical behaviour of artworks and acting as their 'digital twins'. The models developed contribute significantly to the understanding of the mechanics of these artworks, including the impact of environmental thermo-hygrometric fluctuations and the role of structural elements such as crossbeams. The results, corroborated by experimental analyses, indicate that environmental variations, both short and long term, exert specific and quantifiable effects on the {WPPs}, and that the presence of crossbeams significantly influences the distribution of stresses within the panel, particularly affecting the pictorial layers that are often the most susceptible to damage. In this context the generated digital twins serve as an invaluable tool, offering the potential to simulate various risk scenarios or to evaluate the effectiveness of engineered conservation interventions on the {WPPs}.},
pages = {27},
number = {1},
journaltitle = {Heritage Science},
shortjournal = {Herit Sci},
author = {Lorenzo, Riparbelli and Paola, Mazzanti and Thomas, Helfer and Chiara, Manfriani and Luca, Uzielli and Ciro, Castelli and Andrea, Santacesaria and Luciano, Ricciardi and Sandra, Rossi and Joseph, Gril and Marco, Fioravanti},
urldate = {2024-01-25},
date = {2024-01-25},
langid = {english},
keywords = {Conservation, Experimental tests, Numerical modelling, Paint layer emissivity, Paint layer stiffness, Panel painting deformation tendencies, Wooden panel paintings},
file = {Full Text PDF:/home/th202608/.zotero/zotero/vzpzva46.default/zotero/storage/SC87NUHA/Lorenzo et al. - 2024 - Exploring the inner hygro-mechanical behaviour of .pdf:application/pdf},
}

@article{simo_novel_2024,
title = {A novel approach of using existing implementations of constitutive material models in any numerical codes interfacing with {MFront}},
Expand All @@ -15,7 +34,6 @@ @article{simo_novel_2024
note = {Publisher: The Geological Society of London},
}


@article{singh_irradiation_2024,
title = {Irradiation dose and temperature effects on {BCC} material with dislocation based crystal plasticity},
volume = {198},
Expand Down
1 change: 1 addition & 0 deletions docs/web/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ eqnPrefixTemplate: "($$i$$)"

---
nocite: |
@lorenzo_exploring_2024
@simo_novel_2024
@singh_irradiation_2024
@fokam_implementation_2023
Expand Down
16 changes: 7 additions & 9 deletions include/TFEL/Math/ST2toST2/ST2toST2Concept.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ namespace tfel::math {
struct ST2toST2Tag {};
/*!
* \brief an helper class that simply exposes publically a member named
* ConceptTag as an alias to StensorTag.
* ConceptTag as an alias to ST2toST2Tag.
*
* The main reason for this alias is to properly implement the `ConceptRebind`
* metafunction.
*/
template <class T>
template <typename T>
struct ST2toST2ConceptBase {
using ConceptTag = ST2toST2Tag;
};
/*!
* \brief definition of the StensorConcept
* a class matching the stensor concept must expose the `StensorTag` and have
* \brief definition of the ST2toST2Concept
* a class matching the stensor concept must expose the `ST2toST2Tag` and have
* access operators.
*/
template <typename T>
Expand All @@ -54,17 +54,15 @@ namespace tfel::math {
(requires(const T t, const unsigned short i, const unsigned short j) {
t(i, j);
});
//! a simple alias
template <ST2toST2Concept A>
struct ST2toST2TransposeExpr;

//! \brief partial specialisation for symmetric tensors
template <typename T>
struct ConceptRebind<ST2toST2Tag, T> {
//! \brief a simple alias
using type = ST2toST2ConceptBase<T>;
};

// \forward declaration
template <ST2toST2Concept A>
struct ST2toST2TransposeExpr;
/*!
* \return the sum of the absolute values of all components of an
* linear application transforming a symmetric tensor in a symmetric tensor
Expand Down
6 changes: 3 additions & 3 deletions include/TFEL/Math/ST2toT2/ST2toT2T2toST2ProductExpr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace tfel::math {
template <typename T2toT2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<1u>>
: public T2toT2Concept<
: public T2toT2ConceptBase<
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<1u>>>,
public array_holder<
TensorDimeToSize<getSpaceDimension<T2toT2ResultType>()>::value *
Expand Down Expand Up @@ -88,7 +88,7 @@ namespace tfel::math {
template <typename T2toT2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<2u>>
: public T2toT2Concept<
: public T2toT2ConceptBase<
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<2u>>>,
public array_holder<
TensorDimeToSize<getSpaceDimension<T2toT2ResultType>()>::value *
Expand Down Expand Up @@ -183,7 +183,7 @@ namespace tfel::math {
template <typename T2toT2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<3u>>
: public T2toT2Concept<
: public T2toT2ConceptBase<
Expr<T2toT2ResultType, ST2toT2T2toST2ProductExpr<3u>>>,
public array_holder<
TensorDimeToSize<getSpaceDimension<T2toT2ResultType>()>::value *
Expand Down
48 changes: 21 additions & 27 deletions include/TFEL/Math/ST2toT2/T2toT2ST2toT2ProductExpr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toT2Type, typename ST2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toT2Type& a, const ST2toT2Type2& b) {
static_assert(implementsT2toT2Concept<T2toT2Type>());
template <T2toT2Concept T2toT2Type, typename ST2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toT2Type& a,
const ST2toT2Type2& b) noexcept {
static_assert(implementsST2toT2Concept<ST2toT2Type2>());
static_assert(getSpaceDimension<T2toT2Type>() == 1u);
static_assert(getSpaceDimension<ST2toT2Type2>() == 1u);
Expand All @@ -71,14 +71,12 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 3 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
//! \return the runtime properties
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<ST2toT2ResultType,T2toT2ST2toT2ProductExpr>
Expand All @@ -105,9 +103,9 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toT2Type, typename ST2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toT2Type& a, const ST2toT2Type2& b) {
static_assert(implementsT2toT2Concept<T2toT2Type>());
template <T2toT2Concept T2toT2Type, typename ST2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toT2Type& a,
const ST2toT2Type2& b) noexcept {
static_assert(implementsST2toT2Concept<ST2toT2Type2>());
static_assert(getSpaceDimension<T2toT2Type>() == 2u);
static_assert(getSpaceDimension<ST2toT2Type2>() == 2u);
Expand Down Expand Up @@ -157,14 +155,12 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 4 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
//! \return the runtime properties
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<ST2toT2ResultType,T2toT2ST2toT2ProductExpr>
Expand Down Expand Up @@ -192,9 +188,9 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toT2Type, typename ST2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toT2Type& a, const ST2toT2Type2& b) {
static_assert(implementsT2toT2Concept<T2toT2Type>());
template <T2toT2Concept T2toT2Type, typename ST2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toT2Type& a,
const ST2toT2Type2& b) noexcept {
static_assert(implementsST2toT2Concept<ST2toT2Type2>());
static_assert(getSpaceDimension<T2toT2Type>() == 3u);
static_assert(getSpaceDimension<ST2toT2Type2>() == 3u);
Expand Down Expand Up @@ -366,14 +362,12 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 6 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
//! \return the runtime properties
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<ST2toT2ResultType,T2toT2ST2toT2ProductExpr>
Expand Down
62 changes: 27 additions & 35 deletions include/TFEL/Math/T2toST2/T2toST2T2toT2ProductExpr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

namespace tfel::math {

//! Empty structure used for partial specialisation of the
//! Expr class
/*!
* \brief empty structure used for partial specialisation of the
* Expr class
*/
template <unsigned short N>
struct TFEL_VISIBILITY_LOCAL T2toST2T2toT2ProductExpr {
}; // end of struct T2toST2T2toT2ProductExpr

/*!
* Partial specialisation
*/
//! \brief partial specialisation in 1D
template <typename T2toST2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toST2ResultType, T2toST2T2toT2ProductExpr<1u>>
Expand All @@ -49,10 +49,10 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toST2Type, typename T2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toST2Type& a, const T2toT2Type2& b) {
template <typename T2toST2Type, T2toT2Concept T2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toST2Type& a,
const T2toT2Type2& b) noexcept {
static_assert(implementsT2toST2Concept<T2toST2Type>());
static_assert(implementsT2toT2Concept<T2toT2Type2>());
static_assert(getSpaceDimension<T2toST2Type>() == 1u);
static_assert(getSpaceDimension<T2toT2Type2>() == 1u);
this->v[0] = a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0);
Expand All @@ -70,21 +70,17 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 3 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
//! \return the runtime properties
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<T2toST2ResultType,T2toST2T2toT2ProductExpr>

/*!
* Partial specialisation
*/
//! \brief partial specialisation in 2D
template <typename T2toST2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toST2ResultType, T2toST2T2toT2ProductExpr<2u>>
Expand All @@ -103,10 +99,10 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toST2Type, typename T2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toST2Type& a, const T2toT2Type2& b) {
template <typename T2toST2Type, T2toT2Concept T2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toST2Type& a,
const T2toT2Type2& b) noexcept {
static_assert(implementsT2toST2Concept<T2toST2Type>());
static_assert(implementsT2toT2Concept<T2toT2Type2>());
static_assert(getSpaceDimension<T2toST2Type>() == 2u);
static_assert(getSpaceDimension<T2toT2Type2>() == 2u);
this->v[0] = a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0) +
Expand Down Expand Up @@ -155,21 +151,17 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 5 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
//! \return the runtime properties
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<T2toST2ResultType,T2toST2T2toT2ProductExpr>

/*!
* Partial specialisation
*/
//! \brief partial specialisation in 3D
template <typename T2toST2ResultType>
struct TFEL_VISIBILITY_LOCAL
Expr<T2toST2ResultType, T2toST2T2toT2ProductExpr<3u>>
Expand All @@ -188,10 +180,10 @@ namespace tfel::math {
* \param[in] a : first term of the product
* \param[in] b : second term of the product
*/
template <typename T2toST2Type, typename T2toT2Type2>
TFEL_MATH_INLINE Expr(const T2toST2Type& a, const T2toT2Type2& b) {
template <typename T2toST2Type, T2toT2Concept T2toT2Type2>
TFEL_HOST_DEVICE constexpr Expr(const T2toST2Type& a,
const T2toT2Type2& b) noexcept {
static_assert(implementsT2toST2Concept<T2toST2Type>());
static_assert(implementsT2toT2Concept<T2toT2Type2>());
static_assert(getSpaceDimension<T2toST2Type>() == 3u);
static_assert(getSpaceDimension<T2toT2Type2>() == 3u);
this->v[0] = a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0) +
Expand Down Expand Up @@ -362,14 +354,14 @@ namespace tfel::math {
* \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 {
TFEL_HOST_DEVICE constexpr const value_type& operator()(
const unsigned short i, const unsigned short j) const noexcept {
return this->v[i * 9 + j];
} // end of operator()
/*!
* \return the runtime properties
*/
TFEL_MATH_INLINE RunTimeProperties getRunTimeProperties() const {
TFEL_HOST_DEVICE constexpr auto getRunTimeProperties() const noexcept {
return RunTimeProperties();
}
}; // end of struct Expr<T2toST2ResultType,T2toST2T2toT2ProductExpr>
Expand Down
Loading

0 comments on commit e090bed

Please sign in to comment.