Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/python/src/State.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ static pybind11::object State_getExternalStateVariables(
} // end of State_getExternalStateVariables

static void State_setMaterialProperty(mgis::behaviour::State& s,
const std::string& n,
const mgis::real v) {
const std::string& n,
const mgis::real v) {
mgis::behaviour::setMaterialProperty(s, n, v);
} // end of State_setMaterialProperty

Expand Down
2 changes: 2 additions & 0 deletions docs/web/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ if(MGIS_HAVE_PANDOC)
mgis_pandoc_generate_html_page(release-notes-3.0.2 "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(release-notes-3.0.3 "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(release-notes-3.1 "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(release-notes-3.1.1 "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(release-notes-3.2 "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(orthotropic-behaviours "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(behaviour-integration-failure-analysis "--toc" "--toc-depth=3")
mgis_pandoc_generate_html_page(functions "--toc" "--toc-depth=3")
Expand Down
5 changes: 5 additions & 0 deletions docs/web/mgis-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
<li><a>Version 3.1.x</a>
<ul>
<li><a href="release-notes-3.1.html">Version 3.1</a></li>
<li><a href="release-notes-3.1.1.html">Version 3.1.1</a></li>
</ul>
<li><a>Version 3.2.x</a>
<ul>
<li><a href="release-notes-3.2.html">Version 3.2</a></li>
</ul>
</li>
</ul>
Expand Down
28 changes: 28 additions & 0 deletions docs/web/release-notes-3.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: MFrontGenericInterfaceSupport Version 3.1.1
author: Thomas Helfer
date: 2026
lang: en-EN
numbersections: true
documentclass: article
from: markdown+tex_math_single_backslash
geometry:
- margin=2cm
papersize: a4
link-citations: true
colorlinks: true
figPrefixTemplate: "$$i$$"
tabPrefixTemplate: "$$i$$"
secPrefixTemplate: "$$i$$"
eqnPrefixTemplate: "($$i$$)"
bibliography: bibliography.bib
---

The page describes the new functionalities of Version 3.1.1 of the
`MFrontGenericInterfaceSupport` project.

# Issues fixed

## Issue 197: [MGIS/Function] Fix `CoalescedMemoryAccessCompositeTensorsView` for scalar values

For more details, see <https://github.com/thelfer/MFrontGenericInterfaceSupport/issues/197>
90 changes: 90 additions & 0 deletions docs/web/release-notes-3.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: MFrontGenericInterfaceSupport Version 3.2
author: Thomas Helfer
date: 2026
lang: en-EN
numbersections: true
documentclass: article
from: markdown+tex_math_single_backslash
geometry:
- margin=2cm
papersize: a4
link-citations: true
colorlinks: true
figPrefixTemplate: "$$i$$"
tabPrefixTemplate: "$$i$$"
secPrefixTemplate: "$$i$$"
eqnPrefixTemplate: "($$i$$)"
bibliography: bibliography.bib
---

This version is meant to be used with `TFEL` Version 5.2.

# New features of the `MGIS/Function` library

## Functions using a strided memory access

The following classes have been introduced:

- `StridedCoalescedMemoryAccessTensorView`
- `StridedCoalescedMemoryAccessCompositeTensorsView`

### `StridedCoalescedMemoryAccessTensorView`

`StridedCoalescedMemoryAccessTensorView` is a tensorial function view
which stores its components in non interleaved manner using the
following scheme:

~~~~
| <------- Component 1 ---------> |....| <----- Component Nc ---------> |
+-------++-------++------++-------+----+-------++------++------++-------+
| Elt 1 || Elt 2 || .... || Elt N |....| Elt 1 ||Elt 2 || .... || Elt N |
+-------++-------++------++-------+----+-------++------++------++-------+
~~~~

#### Example of usage

~~~~{.cxx}
constexpr auto ne = size_type{2};
auto space = BasicLinearSpace{ne};
std::array<const real, 4 * ne> values = {1, 10, 2, 20, 3, 30, 4, 40};
const auto f = StridedCoalescedMemoryAccessTensorView<
BasicLinearSpace, tfel::math::stensor<2, real>, false>{space, values};
const auto e1 = f(0);
// e1 = {1, 2, 3, 4}
const auto e2 = f(1);
// e2 = {10, 20, 30, 40}
~~~~

## `StridedCoalescedMemoryAccessCompositeTensorsView`

`StridedCoalescedMemoryAccessCompositeTensorsView` allows retrieving
scalar or tensorial objects which are stored in a non interleaved
manner.

#### Example of usage

~~~~{.cxx}
using CompositeFunctionView =
StridedCoalescedMemoryAccessCompositeTensorsView<BasicLinearSpace, 4,
false>;
constexpr auto ne = size_type{2};
auto space = BasicLinearSpace{ne};
std::array<const real, 4 * ne> values = {1, 10, 2, 20, 3, 30, 4, 40};
const auto f = CompositeFunctionView{space, values};
const auto e1 = f.get<0, tfel::math::stensor<2, real>>(0);
// e1 = {1, 2, 3, 4}
const auto e2 = f.get<0, tfel::math::stensor<2, real>>(1);
// e2 = {10, 20, 30, 40}
~~~~

# Acknowledgements

The authors are grateful to the many contributors to the `TFEL/MFront`
project. This research was conducted in the framework of the PLEIADES
project, which was supported financially by the CEA (Commissariat à
l’Énergie Atomique et aux Énergies Alternatives), EDF (Électricité de
France) and Framatome. Work on `MGIS/Function` was performed as part of
the EURATOM OperaHPC Project co-funded by the European Union.

# Issues fixed
6 changes: 6 additions & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,10 @@ if(enable-mgis-function)
mgis_header(MGIS/Function/Tensors CoalescedMemoryAccessTensorView.ixx)
mgis_header(MGIS/Function/Tensors CoalescedMemoryAccessCompositeTensorsView.hxx)
mgis_header(MGIS/Function/Tensors CoalescedMemoryAccessCompositeTensorsView.ixx)
mgis_header(MGIS/Function StridedCoalescedMemoryAccessFunctionViewBase.hxx)
mgis_header(MGIS/Function StridedCoalescedMemoryAccessFunctionViewBase.ixx)
mgis_header(MGIS/Function/Tensors StridedCoalescedMemoryAccessTensorView.hxx)
mgis_header(MGIS/Function/Tensors StridedCoalescedMemoryAccessTensorView.ixx)
mgis_header(MGIS/Function/Tensors StridedCoalescedMemoryAccessCompositeTensorsView.hxx)
mgis_header(MGIS/Function/Tensors StridedCoalescedMemoryAccessCompositeTensorsView.ixx)
endif(enable-mgis-function)
123 changes: 123 additions & 0 deletions include/MGIS/Function/StridedCoalescedMemoryAccessFunctionViewBase.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*!
* \file MGIS/Function/StridedCoalescedMemoryAccessFunctionViewBase.hxx
* \brief
* \author Thomas Helfer
* \date 17/01/2026
* \copyright (C) Copyright Thomas Helfer 2018.
* Use, modification and distribution are subject
* to one of the following licences:
* - GNU Lesser General Public License (LGPL), Version 3.0. (See accompanying
* file LGPL-3.0.txt)
* - CECILL-C, Version 1.0 (See accompanying files
* CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt).
*/

#ifndef LIB_MGIS_FUNCTION_STRIDEDCOALESCEDMEMORYACCESSFUNCTIONVIEWBASE_HXX
#define LIB_MGIS_FUNCTION_STRIDEDCOALESCEDMEMORYACCESSFUNCTIONVIEWBASE_HXX

#include <span>
#include <array>
#include "MGIS/Config.hxx"
#include "MGIS/Contract.hxx"
#include "MGIS/Function/SpaceConcept.hxx"
#include "MGIS/Function/FunctionConcept.hxx"
#include "MGIS/Function/Function.hxx"
#include "MGIS/Function/Evaluator.hxx"

namespace mgis::function {

/*!
* \brief a class meant to describe a function, each component of which is
* stored contiguously in non interleaved manner using the following scheme:
*
* ~~~~
* | <------- Component 1 ---------> |....| <----- Component Nc ---------> |
* +-------++-------++------++-------+----+-------++------++------++-------+
* | Elt 1 || Elt 2 || .... || Elt N |....| Elt 1 ||Elt 2 || .... || Elt N |
* +-------++-------++------++-------+----+-------++------++------++-------+
* ~~~~
*/
template <FunctionalSpaceConcept Space, size_type N, bool is_mutable = true>
requires(N > 0) struct StridedCoalescedMemoryAccessFunctionViewBase
: private PreconditionsChecker<
StridedCoalescedMemoryAccessFunctionViewBase<Space,
N,
is_mutable>> {
/*!
* \brief check that the preconditions to build the view are met
* \param[in] eh: error handler.
* \param[in] space: space
* \param[in] values: values
*/
[[nodiscard]] static constexpr bool checkPreconditions(
AbstractErrorHandler&,
const Space& space,
std::span<const real>) requires(!is_mutable);
/*!
* \param[in] space: space
* \param[in] values: values
*/
constexpr StridedCoalescedMemoryAccessFunctionViewBase(
const Space&, std::span<const real>) requires(!is_mutable);
/*!
* \brief check that the preconditions to build the view are met
* \param[in] eh: error handler.
* \param[in] space: space
* \param[in] values: values
*/
[[nodiscard]] static constexpr bool checkPreconditions(
AbstractErrorHandler&, const Space&, std::span<real>);
/*!
* \param[in] space: space
* \param[in] values: values
*/
constexpr StridedCoalescedMemoryAccessFunctionViewBase(const Space&,
std::span<real>);
/*!
* \return the data associated with an integration point
* \param[in] o: offset associated with the integration point
*/
[[nodiscard]] constexpr std::array<real, N> getValues(const size_type) const
requires(LinearElementSpaceConcept<Space>);
/*!
* \return the data associated with an integration point
* \param[in] e: element index
* \param[in] i: quadrature point index
*/
[[nodiscard]] constexpr std::array<real, N> getValues(const size_type,
const size_type) const
requires(LinearQuadratureSpaceConcept<Space>);
//! \return the underlying quadrature space
[[nodiscard]] constexpr const Space& getSpace() const noexcept;

protected:
/*!
* \param[in] space: space
* \param[in] values: values
*/
template <bool doPreconditionsCheck>
constexpr StridedCoalescedMemoryAccessFunctionViewBase(
const PreconditionsCheck<doPreconditionsCheck>&,
const Space&,
std::span<const real>) requires(!is_mutable);
/*!
* \param[in] space: space
* \param[in] values: values
*/
template <bool doPreconditionsCheck>
constexpr StridedCoalescedMemoryAccessFunctionViewBase(
const PreconditionsCheck<doPreconditionsCheck>&,
const Space&,
std::span<real>);
//! \brief underlying discretization space
const Space space;
//! \brief pointer to the first component
const std::conditional_t<is_mutable, real*, const real*> data_pointer;
};

} // namespace mgis::function

#include "MGIS/Function/StridedCoalescedMemoryAccessFunctionViewBase.ixx"

#endif /* LIB_MGIS_FUNCTION_STRIDEDCOALESCEDMEMORYACCESSFUNCTIONVIEWBASE_HXX \
*/
Loading
Loading