Reference

template<class T>
class ArangeContainer
#include <iterators.hh>

helper class to generate range iterators

Public Types

using iterator = iterators::ArangeIterator<T>

undocumented

Public Functions

inline constexpr ArangeContainer(T start, T stop, T step = 1)

undocumented

inline explicit constexpr ArangeContainer(T stop)

undocumented

inline constexpr T operator[](size_t i)

undocumented

inline constexpr T size()

undocumented

inline constexpr iterator begin()

undocumented

inline constexpr iterator end()

undocumented

Private Members

const T start = {0}
const T stop = {0}
const T step = {1}
template<class T>
class ArangeIterator
#include <iterators.hh>

emulates python’s range iterator

Public Types

using value_type = T

undocumented

using pointer = T*

undocumented

using reference = T&

undocumented

using iterator_category = std::input_iterator_tag

undocumented

Public Functions

inline constexpr ArangeIterator(T value, T step)

undocumented

constexpr ArangeIterator(const ArangeIterator&) = default

undocumented

inline constexpr ArangeIterator &operator++()

undocumented

inline constexpr const T &operator*() const

undocumented

inline constexpr bool operator==(const ArangeIterator &other) const

undocumented

inline constexpr bool operator!=(const ArangeIterator &other) const

undocumented

Private Members

T value = {0}
const T step = {1}
template<Dim_t order, typename Fun_t, Dim_t dim, Dim_t... args>
struct CallSizesHelper
#include <eigen_tools.hh>

Call a passed lambda with the unpacked sizes as arguments.

Public Static Functions

static inline decltype(auto) call(Fun_t &&fun)

applies the call

template<typename Fun_t, Dim_t dim, Dim_t... args>
struct CallSizesHelper<0, Fun_t, dim, args...>
#include <eigen_tools.hh>

Call a passed lambda with the unpacked sizes as arguments.

Public Static Functions

static inline decltype(auto) call(Fun_t &&fun)

applies the call

class Cell
#include <cell.hh>

Base class for the representation of a homogenisatonion problem in µSpectre. The muSpectre::Cell holds the global strain, stress and (optionally) tangent moduli fields of the problem, maintains the list of materials present, as well as the projection operator.

Subclassed by muSpectre::CellSplit

Public Types

using Material_ptr = std::unique_ptr<MaterialBase>

materials handled through std::unique_ptrs

using Material_sptr = std::shared_ptr<MaterialBase>
using Projection_ptr = std::unique_ptr<ProjectionBase>

projections handled through std::unique_ptrs

using Matrix_t = Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>

short-hand for matrices

using Eigen_cmap = muGrid::RealField::Eigen_cmap

ref to constant vector

using Eigen_map = muGrid::RealField::Eigen_map

ref to vector

using EigenVec_t = Eigen::Ref<Eigen::Matrix<Real, Eigen::Dynamic, 1>>

Ref to input/output vector.

using EigenCVec_t = Eigen::Ref<const Eigen::Matrix<Real, Eigen::Dynamic, 1>>

Ref to input vector.

using Adaptor = CellAdaptor<Cell>

adaptor to represent the cell as an Eigen sparse matrix

Public Functions

Cell() = delete

Deleted default constructor.

explicit Cell(Projection_ptr projection, SplitCell is_cell_split = SplitCell::no)

Constructor from a projection operator.

Cell(const Cell &other) = delete

Copy constructor.

Cell(Cell &&other) = default

Move constructor.

virtual ~Cell() = default

Destructor.

Cell &operator=(const Cell &other) = delete

Copy assignment operator.

Cell &operator=(Cell &&other) = delete

Move assignment operator.

bool is_initialised() const

for handling double initialisations right

Dim_t get_nb_dof() const

returns the number of degrees of freedom in the cell

size_t get_nb_pixels() const

number of pixels on this processor

const muFFT::Communicator &get_communicator() const

return the communicator object

const Formulation &get_formulation() const

formulation is hard set by the choice of the projection class

Dim_t get_material_dim() const

returns the material dimension of the problem

void set_uniform_strain(const Eigen::Ref<const Matrix_t>&)

set uniform strain (typically used to initialise problems

virtual MaterialBase &add_material(Material_ptr mat)

add a new material to the cell

void complete_material_assignment_simple(MaterialBase &material)

By taking a material as input this function assigns all the untouched(not-assigned) pixels to that material

void make_pixels_precipitate_for_laminate_material(const std::vector<DynRcoord_t> &precipitate_vertices, MaterialBase &mat_laminate, MaterialBase &mat_precipitate_cell, Material_sptr mat_precipitate, Material_sptr mat_matrix)

Given the vertices of polygonal/Polyhedral precipitate, this function assign pixels 1. inside precipitate->mat_precipitate_cell, material at the interface of precipitae-> to mat_precipitate & mat_matrix according to the intersection of pixels with the precipitate

template<Dim_t Dim>
void make_pixels_precipitate_for_laminate_material_helper(const std::vector<DynRcoord_t> &precipitate_vertices, MaterialBase &mat_laminate, MaterialBase &mat_precipitate_cell, Material_sptr mat_precipitate, Material_sptr mat_matrix)
Adaptor get_adaptor()

get a sparse matrix view on the cell

void save_history_variables()

freezes all the history variables of the materials

std::array<Dim_t, 2> get_strain_shape() const

returns the number of rows and cols for the strain matrix type (for full storage, the strain is stored in material_dim × material_dim matrices, but in symmetric storage, it is a column vector)

Dim_t get_strain_size() const

returns the number of components for the strain matrix type (for full storage, the strain is stored in material_dim × material_dim matrices, but in symmetric storage, it is a column vector)

const Dim_t &get_spatial_dim() const

return the spatial dimension of the discretisation grid

const Dim_t &get_nb_quad() const

return the number of quadrature points stored per pixel

virtual void check_material_coverage() const

makes sure every pixel has been assigned to exactly one material

void initialise(muFFT::FFT_PlanFlags flags = muFFT::FFT_PlanFlags::estimate)

initialise the projection, the materials and the global fields

const muGrid::CcoordOps::DynamicPixels &get_pixels() const

return a const reference to the grids pixels iterator

muGrid::FieldCollection::IndexIterable get_quad_pt_indices() const

return an iterable proxy to this cell’s field collection, iterable by quadrature point

muGrid::FieldCollection::PixelIndexIterable get_pixel_indices() const

return an iterable proxy to this cell’s field collection, iterable by pixel

muGrid::RealField &get_strain()

return a reference to the cell’s strain field

const muGrid::RealField &get_stress() const

return a const reference to the cell’s stress field

const muGrid::RealField &get_tangent(bool do_create = false)

return a const reference to the cell’s field of tangent moduli

virtual const muGrid::RealField &evaluate_stress()

evaluates and returns the stress for the currently set strain

Eigen_cmap evaluate_stress_eigen()

evaluates and returns the stress for the currently set strain

virtual std::tuple<const muGrid::RealField&, const muGrid::RealField&> evaluate_stress_tangent()

evaluates and returns the stress and tangent moduli for the currently set strain

std::tuple<const Eigen_cmap, const Eigen_cmap> evaluate_stress_tangent_eigen()

evaluates and returns the stress and tangent moduli for the currently set strain

muGrid::RealField &globalise_real_internal_field(const std::string &unique_name)

collect the real-valued fields of name unique_name of each material in the cell and write their values into a global field of same type and name

muGrid::IntField &globalise_int_internal_field(const std::string &unique_name)

collect the integer-valued fields of name unique_name of each material in the cell and write their values into a global field of same type and name

muGrid::UintField &globalise_uint_internal_field(const std::string &unique_name)

collect the unsigned integer-valued fields of name unique_name of each material in the cell and write their values into a global field of same type and name

muGrid::ComplexField &globalise_complex_internal_field(const std::string &unique_name)

collect the complex-valued fields of name unique_name of each material in the cell and write their values into a global field of same type and name

muGrid::GlobalFieldCollection &get_fields()

return a reference to the cell’s global fields

void apply_projection(muGrid::TypedFieldBase<Real> &field)

apply the cell’s projection operator to field field (i.e., return G:f)

void evaluate_projected_directional_stiffness(const muGrid::TypedFieldBase<Real> &delta_strain, muGrid::TypedFieldBase<Real> &del_stress)

evaluates the directional and projected stiffness (this corresponds to G:K:δF (note the negative sign in de Geus 2017, http://dx.doi.org/10.1016/j.cma.2016.12.032).

void add_projected_directional_stiffness(EigenCVec_t delta_strain, const Real &alpha, EigenVec_t del_stress)

evaluates the directional and projected stiffness (this corresponds to G:K:δF (note the negative sign in de Geus 2017, http://dx.doi.org/10.1016/j.cma.2016.12.032). and then adds it do the values already in del_stress, scaled by alpha (i.e., del_stress += alpha*Q:K:δStrain. This function should not be used directly, as it does absolutely no input checking. Rather, it is meant to be called by the scaleAndAddTo function in the CellAdaptor

inline SplitCell get_splitness() const

transitional function, use discouraged

const ProjectionBase &get_projection() const

return a const ref to the projection implementation

bool is_point_inside(const DynRcoord_t &point) const

check if the pixel is inside of the cell

bool is_pixel_inside(const DynCcoord_t &pixel) const

check if the point is inside of the cell

Protected Functions

template<typename T>
muGrid::TypedField<T> &globalise_internal_field(const std::string &unique_name)

helper function for the globalise_<T>_internal_field() functions

Protected Attributes

bool initialised = {false}

to handle double initialisations right

std::vector<Material_ptr> materials = {}

container of the materials present in the cell

Projection_ptr projection

handle for the projection operator

std::unique_ptr<muGrid::GlobalFieldCollection> fields

handle for the global fields associated with this cell

muGrid::RealField &strain

ref to strain field

muGrid::RealField &stress

ref to stress field

optional<std::reference_wrapper<muGrid::RealField>> tangent = {}

Tangent field might not even be required; so this is an optional ref_wrapper instead of a ref

SplitCell is_cell_split = {SplitCell::no}

Protected Static Functions

template<Dim_t DimM>
static void apply_directional_stiffness(const muGrid::TypedFieldBase<Real> &delta_strain, const muGrid::TypedFieldBase<Real> &tangent, muGrid::TypedFieldBase<Real> &delta_stress)

statically dimensioned worker for evaluating the tangent operator

template<Dim_t DimM>
static void add_projected_directional_stiffness_helper(const muGrid::TypedFieldBase<Real> &delta_strain, const muGrid::TypedFieldBase<Real> &tangent, const Real &alpha, muGrid::TypedFieldBase<Real> &delta_stress)

statically dimensioned worker for evaluating the incremental tangent operator

template<class Cell>
class CellAdaptor : public Eigen::EigenBase<CellAdaptor<Cell>>
#include <cell.hh>

Cell adaptors implement the matrix-vector multiplication and allow the system to be used like a sparse matrix in conjugate-gradient-type solvers

lightweight resource handle wrapping a muSpectre::Cell or a subclass thereof into Eigen::EigenBase, so it can be interpreted as a sparse matrix by Eigen solvers

Public Types

enum [anonymous]

Values:

enumerator ColsAtCompileTime
enumerator MaxColsAtCompileTime
enumerator RowsAtCompileTime
enumerator MaxRowsAtCompileTime
enumerator IsRowMajor
using Scalar = double

sparse matrix traits

using RealScalar = double

sparse matrix traits

using StorageIndex = int

sparse matrix traits

Public Functions

inline explicit CellAdaptor(Cell &cell)

constructor

inline Eigen::Index rows() const

returns the number of logical rows

inline Eigen::Index cols() const

returns the number of logical columns

template<typename Rhs>
inline Eigen::Product<CellAdaptor, Rhs, Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs> &x) const

implementation of the evaluation

Public Members

Cell &cell

ref to the cell

class CellSplit : public muSpectre::Cell
#include <cell_split.hh>

DimS spatial dimension (dimension of problem DimM material_dimension (dimension of constitutive law)

Public Types

using Parent = Cell

base class

using Projection_ptr = std::unique_ptr<ProjectionBase>

projections handled through std::unique_ptrs

using FullResponse_t = std::tuple<const muGrid::RealField&, const muGrid::RealField&>

combined stress and tangent field

Public Functions

CellSplit() = delete

Default constructor.

explicit CellSplit(Projection_ptr projection)

constructor using sizes and resolution

CellSplit(const CellSplit &other) = delete

Copy constructor.

CellSplit(CellSplit &&other) = default

Move constructor.

virtual ~CellSplit() = default

Destructor.

CellSplit &operator=(const CellSplit &other) = delete

Copy assignment operator.

CellSplit &operator=(CellSplit &&other) = delete

Move assignment operator.

virtual MaterialBase &add_material(Material_ptr mat) final

add a new material to the cell

void complete_material_assignment(MaterialBase &material)

completes the assignmnet of material with a specific material so all the under-assigned pixels would be assigned to a material.

std::vector<Real> get_assigned_ratios()
void make_automatic_precipitate_split_pixels(const std::vector<DynRcoord_t> &preciptiate_vertices, MaterialBase &material)
std::vector<Real> get_unassigned_ratios_incomplete_pixels() const
std::vector<int> get_index_incomplete_pixels() const
std::vector<DynCcoord_t> get_unassigned_pixels()
IncompletePixels make_incomplete_pixels()
virtual void check_material_coverage() const final

makes sure every pixel has been assigned to materials whose ratios add up to 1.0

virtual const muGrid::RealField &evaluate_stress() final

evaluates and returns the stress for the currently set strain

virtual std::tuple<const muGrid::RealField&, const muGrid::RealField&> evaluate_stress_tangent() final

evaluates and returns the stress and tangent moduli for the currently set strain

Protected Functions

void set_p_k_zero()

Friends

friend class Cell
class Communicator
#include <communicator.hh>

stub communicator object that doesn’t communicate anything

Public Functions

inline Communicator()
inline ~Communicator()
inline int rank() const

get rank of present process

inline int size() const

get total number of processes

template<typename T>
inline T sum(const T &arg) const

sum reduction on scalar types

template<typename T>
inline Matrix_t<T> sum_mat(const Eigen::Ref<Matrix_t<T>> &arg) const

sum reduction on EigenMatrix types

template<typename T>
inline Matrix_t<T> gather(const Eigen::Ref<Matrix_t<T>> &arg) const

gather on EigenMatrix types

template<typename T>
auto sum_mat(const Eigen::Ref<Matrix_t<T>> &arg) const -> Matrix_t<T>

sum reduction on EigenMatrix types

template<typename T>
auto gather(const Eigen::Ref<Matrix_t<T>> &arg) const -> Matrix_t<T>

gather on EigenMatrix types

Public Static Functions

static inline bool has_mpi()

find whether the underlying communicator is mpi

class ConvergenceError : public muSpectre::SolverError
template<ElasticModulus Out, ElasticModulus In1, ElasticModulus In2>
struct Converter

Base template for elastic modulus conversion.

Public Static Functions

static inline constexpr Real compute(const Real&, const Real&)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Bulk, ElasticModulus::lambda, ElasticModulus::Shear>

Specialisation K(λ, µ)

Public Static Functions

static inline constexpr Real compute(const Real &lambda, const Real &G)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Bulk, ElasticModulus::Young, ElasticModulus::Poisson>

Specialisation K(E, ν)

Public Static Functions

static inline constexpr Real compute(const Real &E, const Real &nu)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::lambda, ElasticModulus::Bulk, ElasticModulus::Shear>

Specialisation λ(K, µ)

Public Static Functions

static inline constexpr Real compute(const Real &K, const Real &mu)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::lambda, ElasticModulus::Young, ElasticModulus::Poisson>

Specialisation λ(E, ν)

Public Static Functions

static inline constexpr Real compute(const Real &E, const Real &nu)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Poisson, ElasticModulus::Bulk, ElasticModulus::Shear>

Specialisation ν(K, µ)

Public Static Functions

static inline constexpr Real compute(const Real &K, const Real &G)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Shear, ElasticModulus::Young, ElasticModulus::Poisson>

Specialisation μ(E, ν)

Public Static Functions

static inline constexpr Real compute(const Real &E, const Real &nu)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Young, ElasticModulus::Bulk, ElasticModulus::Shear>

Specialisation E(K, µ)

Public Static Functions

static inline constexpr Real compute(const Real &K, const Real &G)

wrapped function (raison d’être)

template<>
struct Converter<ElasticModulus::Young, ElasticModulus::lambda, ElasticModulus::Shear>

Specialisation E(λ, µ)

Public Static Functions

static inline constexpr Real compute(const Real &lambda, const Real &G)

wrapped function (raison d’être)

template<ElasticModulus Out, ElasticModulus In>
struct Converter<Out, In, Out>

Spectialisation for when the output is the second input

Public Static Functions

static inline constexpr Real compute(const Real&, const Real &B)

wrapped function (raison d’être)

template<ElasticModulus Out, ElasticModulus In>
struct Converter<Out, Out, In>

Spectialisation for when the output is the first input

Public Static Functions

static inline constexpr Real compute(const Real &A, const Real&)

wrapped function (raison d’être)

template<StrainMeasure In, StrainMeasure Out = In>
struct ConvertStrain

Structure for functions returning one strain measure as a function of another

Public Static Functions

template<class Strain_t>
static inline decltype(auto) compute(Strain_t &&input)

returns the converted strain

template<>
struct ConvertStrain<StrainMeasure::Gradient, StrainMeasure::GreenLagrange>

Specialisation for getting Green-Lagrange strain from the transformation gradient E = ¹/₂ (C - I) = ¹/₂ (Fᵀ·F - I)

Public Static Functions

template<class Strain_t>
static inline decltype(auto) compute(Strain_t &&F)

returns the converted strain

template<>
struct ConvertStrain<StrainMeasure::Gradient, StrainMeasure::LCauchyGreen>

Specialisation for getting Left Cauchy-Green strain from the transformation gradient B = F·Fᵀ = V²

Public Static Functions

template<class Strain_t>
static inline decltype(auto) compute(Strain_t &&F)

returns the converted strain

template<>
struct ConvertStrain<StrainMeasure::Gradient, StrainMeasure::Log>

Specialisation for getting logarithmic (Hencky) strain from the transformation gradient E₀ = ¹/₂ ln C = ¹/₂ ln (Fᵀ·F)

Public Static Functions

template<class Strain_t>
static inline decltype(auto) compute(Strain_t &&F)

returns the converted strain

template<>
struct ConvertStrain<StrainMeasure::Gradient, StrainMeasure::RCauchyGreen>

Specialisation for getting Right Cauchy-Green strain from the transformation gradient C = Fᵀ·F = U²

Public Static Functions

template<class Strain_t>
static inline decltype(auto) compute(Strain_t &&F)

returns the converted strain

template<Dim_t DimS>
class Correction

Public Static Functions

static Rcoord_t<3> correct_origin(const Rcoord_t<DimS> &array)
static Rcoord_t<3> correct_length(const Rcoord_t<DimS> &array)
static std::vector<Rcoord_t<3>> correct_vector(const std::vector<Rcoord_t<DimS>> &vector)
template<>
class Correction<2>

Public Static Functions

static inline std::vector<Rcoord_t<3>> correct_vector(const std::vector<Rcoord_t<2>> &vertices)
static inline Rcoord_t<3> correct_origin(const Rcoord_t<2> &array)
static inline Rcoord_t<3> correct_length(const Rcoord_t<2> &array)
template<>
class Correction<3>

Public Static Functions

static inline Rcoord_t<3> correct_origin(const Rcoord_t<3> &array)
static inline Rcoord_t<3> correct_length(const Rcoord_t<3> &array)
static inline std::vector<Rcoord_t<3>> correct_vector(const std::vector<Rcoord_t<3>> &vertices)
template<Dim_t Dim>
struct DefaultOrder
#include <geometry.hh>

convenience structure providing the default order of rotations around (in order) the z, x, and y axis

Public Static Attributes

static constexpr RotationOrder value = {RotationOrder::ZXYTaitBryan}

holds the value of the rotation order

template<>
struct DefaultOrder<twoD>
#include <geometry.hh>

specialisation for two-dimensional problems

Public Static Attributes

static constexpr RotationOrder value = {RotationOrder::Z}

holds the value of the rotation order

class DerivativeBase
#include <derivative.hh>

Representation of a derivative

Subclassed by muFFT::DiscreteDerivative, muFFT::FourierDerivative

Public Types

using Vector = Eigen::Matrix<Real, Eigen::Dynamic, 1>

convenience alias

Public Functions

DerivativeBase() = delete

Deleted default constructor.

explicit DerivativeBase(Dim_t spatial_dimension)

constructor with spatial dimension

DerivativeBase(const DerivativeBase &other) = default

Copy constructor.

DerivativeBase(DerivativeBase &&other) = default

Move constructor.

virtual ~DerivativeBase() = default

Destructor.

DerivativeBase &operator=(const DerivativeBase &other) = delete

Copy assignment operator.

DerivativeBase &operator=(DerivativeBase &&other) = delete

Move assignment operator.

virtual Complex fourier(const Vector &phase) const = 0

Return Fourier representation of the derivative as a function of the phase. The phase is the wavevector times cell dimension, but lacking a factor of 2 π.

Protected Attributes

Dim_t spatial_dimension

spatial dimension of the problem

class DerivativeError : public runtime_error
#include <derivative.hh>

base class for projection related exceptions

Public Functions

inline explicit DerivativeError(const std::string &what)

constructor

inline explicit DerivativeError(const char *what)

constructor

template<class Derived>
struct DimCounter
template<class Derived>
struct DimCounter<Eigen::MatrixBase<Derived>>
#include <T4_map_proxy.hh>

Convenience structure to determine the spatial dimension of a tensor represented by a fixed-size Eigen::Matrix. used to derive spatial dimension from input arguments of template functions thus avoiding the need for redundant explicit specification.

Public Static Attributes

static constexpr Dim_t value = {ct_sqrt(Rows)}

storage for the dimension

Private Types

using Type = Eigen::MatrixBase<Derived>

Private Static Attributes

static constexpr Dim_t Rows = {Type::RowsAtCompileTime}
class DiscreteDerivative : public muFFT::DerivativeBase
#include <derivative.hh>

Representation of a finite-differences stencil

Public Types

using Parent = DerivativeBase

base class

using Vector = typename Parent::Vector

convenience alias

Public Functions

DiscreteDerivative() = delete

Default constructor.

DiscreteDerivative(DynCcoord_t nb_pts, DynCcoord_t lbounds, const std::vector<Real> &stencil)

Constructor with raw stencil information

Parameters
  • nb_pts – stencil size

  • lbounds – relative starting point of stencil

  • stencil – stencil coefficients

DiscreteDerivative(DynCcoord_t nb_pts, DynCcoord_t lbounds, const Eigen::ArrayXd &stencil)

Constructor with raw stencil information.

DiscreteDerivative(const DiscreteDerivative &other) = default

Copy constructor.

DiscreteDerivative(DiscreteDerivative &&other) = default

Move constructor.

virtual ~DiscreteDerivative() = default

Destructor.

DiscreteDerivative &operator=(const DiscreteDerivative &other) = delete

Copy assignment operator.

DiscreteDerivative &operator=(DiscreteDerivative &&other) = delete

Move assignment operator.

inline Real operator()(const DynCcoord_t &dcoord) const

Return stencil value.

inline const DynCcoord_t &get_nb_pts() const

Return number of grid points in stencil.

inline const DynCcoord_t &get_lbounds() const

Return lower stencil bound.

inline virtual Complex fourier(const Vector &phase) const

Any translationally invariant linear combination of grid values (as expressed through a “stencil”) becomes a multiplication with a number in Fourier space. This method returns the Fourier representation of this stencil.

DiscreteDerivative rollaxes(int distance = 1) const

Return a new stencil rolled axes. Given a stencil on a three-dimensional grid with axes (x, y, z), the stencil that has been “rolled” by distance one has axes (z, x, y). This is a simple implementation of a rotation operation. For example, given a stencil that described the derivative in the x-direction, rollaxes(1) gives the derivative in the y-direction and rollaxes(2) gives the derivative in the z-direction.

Protected Attributes

const DynCcoord_t nb_pts

Number of stencil points.

const DynCcoord_t lbounds

Lower bound of the finite-differences stencil.

const Eigen::ArrayXd stencil

Finite-differences stencil.

template<Dim_t Dim, Dim_t Rank1, Dim_t Rank2>
struct Dotter
template<Dim_t Dim>
struct Dotter<Dim, fourthOrder, fourthOrder>
#include <tensor_algebra.hh>

Double contraction between two fourth-rank tensors A and B returns a fourth-rank tensor Cᵢⱼₖₗ = Aᵢⱼₐₑ·Bₐₑₖₗ

Public Static Functions

template<class T1, class T2>
static inline decltype(auto) constexpr ddot(T1 &&t1, T2 &&t2)

raison d’être

template<Dim_t Dim>
struct Dotter<Dim, fourthOrder, secondOrder>
#include <tensor_algebra.hh>

Tensor-product between a fourth-rank tensor A and a second-rank tensor B. Returns a fourth-rank Cᵢⱼₖₗ = Aᵢⱼₖₐ·Bₐₗ

Public Static Functions

template<class T4, class T2>
static inline decltype(auto) constexpr dot(T4 &&t4, T2 &&t2)

raison d’être

template<Dim_t Dim>
struct Dotter<Dim, secondOrder, fourthOrder>
#include <tensor_algebra.hh>

Tensor-product between a second-rank tensor A and a fourth-rank tensor B. Returns a fourth-rank Cᵢⱼₖₗ = Aᵢₐ·Bₐⱼₖₗ

Public Static Functions

template<class T1, class T2>
static inline decltype(auto) constexpr dot(T1 &&t1, T2 &&t2)

raison d’être

template<Dim_t Dim>
struct Dotter<Dim, secondOrder, secondOrder>
#include <tensor_algebra.hh>

Double contraction between two second-rank tensors A and B returns a scalar c = AᵢⱼBᵢⱼ

Public Static Functions

template<class T1, class T2>
static inline decltype(auto) constexpr ddot(T1 &&t1, T2 &&t2)

raison d’être

class DynamicPixels

Iteration over square (or cubic) discretisation grids. Duplicates capabilities of muGrid::Ccoordops::Pixels without needing to be templated with the spatial dimension. Iteration is slower, though.

Subclassed by muGrid::CcoordOps::Pixels< Dim >

Public Functions

DynamicPixels()
explicit DynamicPixels(const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations = DynCcoord_t{})

Constructor with default strides (column-major pixel storage order)

DynamicPixels(const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations, const DynCcoord_t &strides)

Constructor with custom strides (any, including partially transposed pixel storage order)

template<size_t Dim>
explicit DynamicPixels(const Ccoord_t<Dim> &nb_grid_pts, const Ccoord_t<Dim> &locations = Ccoord_t<Dim>{})

Constructor with default strides from statically sized coords.

template<size_t Dim>
DynamicPixels(const Ccoord_t<Dim> &nb_grid_pts, const Ccoord_t<Dim> &locations, const Ccoord_t<Dim> &strides)

Constructor with custom strides from statically sized coords.

DynamicPixels(const DynamicPixels &other) = default

Copy constructor.

DynamicPixels(DynamicPixels &&other) = default

Move constructor.

virtual ~DynamicPixels() = default

Destructor.

DynamicPixels &operator=(const DynamicPixels &other) = default

Copy assignment operator.

DynamicPixels &operator=(DynamicPixels &&other) = default

Move assignment operator.

inline Dim_t get_index(const DynCcoord_t &ccoord) const

evaluate and return the linear index corresponding to dynamic ccoord

template<size_t Dim>
inline Dim_t get_index(const Ccoord_t<Dim> &ccoord) const

evaluate and return the linear index corresponding to ccoord

template<size_t Dim>
const Pixels<Dim> &get_dimensioned_pixels() const

return a reference to the Pixels object cast into a statically dimensioned grid. the statically dimensioned version duplicates muGrid::Ccoordops::DynamicPixels’s capabilities, but iterates much more efficiently.

iterator begin() const

stl conformance

iterator end() const

stl conformance

size_t size() const

stl conformance

inline const Dim_t &get_dim() const

return spatial dimension

inline const DynCcoord_t &get_nb_grid_pts() const

return the resolution of the discretisation grid in each spatial dim

inline const DynCcoord_t &get_locations() const

return the ccoordinates of the bottom, left, (front) pixel/voxel of this processors partition of the discretisation grid. For sequential calculations, this is alvays the origin

inline const DynCcoord_t &get_strides() const

return the strides used for iterating over the pixels

Enumerator enumerate() const

iterates in tuples of pixel index ond coordinate. Useful in parallel problems, where simple enumeration of the pixels would be incorrect

Protected Attributes

Dim_t dim

spatial dimension

DynCcoord_t nb_grid_pts

nb_grid_pts of this domain

DynCcoord_t locations

locations of this domain

DynCcoord_t strides

strides of memory layout

template<size_t MaxDim, typename T = Dim_t>
class DynCcoord
#include <grid_common.hh>

Class to represent integer (cell-) coordinates or real-valued coordinates. This class can dynamically accept any spatial-dimension between 1 and MaxDim, and DynCcoord references can be cast to muGrid::Ccoord_t & or muGrid::Rcoord_t & references. These are used when templating with the spatial dimension of the problem is undesireable/impossible.

Public Types

using iterator = typename std::array<T, MaxDim>::iterator

iterator type

using const_iterator = typename std::array<T, MaxDim>::const_iterator

constant iterator type

Public Functions

inline DynCcoord()

default constructor

inline DynCcoord(std::initializer_list<T> init_list)

constructor from an initialiser list for compound initialisation.

Parameters

init_list – The length of the initialiser list becomes the spatial dimension of the coordinate, therefore the list must have a length between 1 and MaxDim

inline explicit DynCcoord(Dim_t dim)

Constructor only setting the dimension. WARNING: This constructor needs regular (round) braces ‘()’, using curly braces ‘{}’ results in the initialiser list constructor being called and creating a DynCcoord with spatial dimension 1

Parameters

dim – spatial dimension. Needs to be between 1 and MaxDim

template<size_t Dim>
inline explicit DynCcoord(const std::array<T, Dim> &ccoord)

Constructor from a statically sized coord.

inline explicit DynCcoord(const std::vector<T> &ccoord)
DynCcoord(const DynCcoord &other) = default

Copy constructor.

DynCcoord(DynCcoord &&other) = default

Move constructor.

~DynCcoord() = default

nonvirtual Destructor

template<size_t Dim>
inline DynCcoord &operator=(const std::array<T, Dim> &ccoord)

Assign arrays.

DynCcoord &operator=(const DynCcoord &other) = default

Copy assignment operator.

DynCcoord &operator=(DynCcoord &&other) = default

Move assignment operator.

template<size_t Dim2>
inline bool operator==(const std::array<T, Dim2> &other) const

comparison operator

inline bool operator==(const DynCcoord &other) const

comparison operator

template<typename T2>
inline DynCcoord<MaxDim, decltype(T{} / T2{})> operator/(const DynCcoord<MaxDim, T2> &other) const

element-wise division

inline T &operator[](const size_t &index)

access operator

inline const T &operator[](const size_t &index) const

access operator

template<size_t Dim>
inline operator std::array<T, Dim>() const

conversion operator

template<Dim_t Dim>
inline std::array<T, Dim> &get()

cast to a reference to a statically sized array

template<Dim_t Dim>
inline const std::array<T, Dim> &get() const

cast to a const reference to a statically sized array

inline const Dim_t &get_dim() const

return the spatial dimension of this coordinate

inline iterator begin()

iterator to the first entry for iterating over only the valid entries

inline iterator end()

iterator past the dim-th entry for iterating over only the valid entries

inline const_iterator begin() const

const iterator to the first entry for iterating over only the valid entries

inline const_iterator end() const

const iterator past the dim-th entry for iterating over only the valid entries

inline T *data()

return the underlying data pointer

inline const T *data() const

return the underlying data pointer

inline T &back()

return a reference to the last valid entry

inline const T &back() const

return a const reference to the last valid entry

Protected Attributes

Dim_t dim

spatial dimension of the coordinate

std::array<T, MaxDim> long_array

storage for coordinate components

Private Functions

template<size_t Dim>
inline constexpr std::array<T, MaxDim> fill_front(const std::array<T, Dim> &ccoord)

Private Static Functions

template<size_t Dim, size_t... Indices>
static inline constexpr std::array<T, MaxDim> fill_front_helper(const std::array<T, Dim> &ccoord, std::index_sequence<Indices...>)
template<typename T, class EigenPlain>
struct EigenMap

Internal struct for handling the matrix-shaped iterates of muGrid::FieldMap

Public Types

using PlainType = EigenPlain

Eigen type of the iterate.

using value_type = std::conditional_t<MutIter == Mapping::Const, Eigen::Map<const PlainType>, Eigen::Map<PlainType>>

stl (const-correct)

using ref_type = value_type<MutIter>

stl (const-correct)

using Return_t = value_type<MutIter>

for direct access through operator[]

using storage_type = value_type<MutIter>

stored type (cannot always be same as ref_type)

Public Static Functions

static inline constexpr bool IsValidStaticMapType()

check at compile time whether the type is meant to be a map with statically sized iterates.

static inline constexpr bool IsScalarMapType()

check at compiler time whether this map is scalar

template<Mapping MutIter>
static inline constexpr value_type<MutIter> &provide_ref(storage_type<MutIter> &storage)

return the return_type version of the iterate from storage_type

template<Mapping MutIter>
static inline constexpr const value_type<MutIter> &provide_const_ref(const storage_type<MutIter> &storage)

return the const return_type version of the iterate from storage_type

template<Mapping MutIter>
static inline constexpr value_type<MutIter> *provide_ptr(storage_type<MutIter> &storage)

return a pointer to the iterate from storage_type

template<Mapping MutIter>
static inline constexpr Return_t<MutIter> from_data_ptr(std::conditional_t<MutIter == Mapping::Const, const T*, T*> data)

return a return_type version of the iterate from its pointer

template<Mapping MutIter>
static inline constexpr storage_type<MutIter> to_storage(value_type<MutIter> &&value)

return a storage_type version of the iterate from its value

static inline constexpr Dim_t stride()

return the nb of components of the iterate (known at compile time)

static inline std::string shape()

return the iterate’s shape as text, mostly for error messages

static inline constexpr Dim_t NbRow()
class Enumerator

enumerator class for muSpectre::DynamicPixels

Public Functions

Enumerator() = delete

Default constructor.

explicit Enumerator(const DynamicPixels &pixels)

Constructor.

Enumerator(const Enumerator &other) = default

Copy constructor.

Enumerator(Enumerator &&other) = default

Move constructor.

virtual ~Enumerator() = default

Destructor.

Enumerator &operator=(const Enumerator &other) = delete

Copy assignment operator.

Enumerator &operator=(Enumerator &&other) = delete

Move assignment operator.

iterator begin() const

stl conformance

iterator end() const

stl conformance

size_t size() const

stl conformance

Protected Attributes

const DynamicPixels &pixels
template<Dim_t dim>
class FFT_freqs
#include <fft_utils.hh>

simple class encapsulating the creation, and retrieval of wave vectors

Public Types

using CcoordVector = Eigen::Matrix<Dim_t, dim, 1>

Eigen variant equivalent to Ccoord_t.

using Vector = Eigen::Matrix<Real, dim, 1>

return type for wave vectors

using VectorComplex = Eigen::Matrix<Complex, dim, 1>

return type for complex wave vectors

Public Functions

FFT_freqs() = delete

Default constructor.

inline explicit FFT_freqs(Ccoord_t<dim> nb_grid_pts)

constructor with just number of grid points

inline FFT_freqs(Ccoord_t<dim> nb_grid_pts, std::array<Real, dim> lengths)

constructor with domain length

FFT_freqs(const FFT_freqs &other) = delete

Copy constructor.

FFT_freqs(FFT_freqs &&other) = default

Move constructor.

virtual ~FFT_freqs() = default

Destructor.

FFT_freqs &operator=(const FFT_freqs &other) = delete

Copy assignment operator.

FFT_freqs &operator=(FFT_freqs &&other) = default

Move assignment operator.

inline Vector get_xi(const Ccoord_t<dim> ccoord) const

get unnormalised wave vector (in sampling units)

inline VectorComplex get_complex_xi(const Ccoord_t<dim> ccoord) const

get unnormalised complex wave vector (in sampling units)

inline Vector get_unit_xi(const Ccoord_t<dim> ccoord) const

get normalised wave vector

inline Dim_t get_nb_grid_pts(Dim_t i) const

Protected Attributes

const std::array<std::valarray<Real>, dim> freqs

container for frequencies ordered by spatial dimension

class FFTEngineBase
#include <fft_engine_base.hh>

Virtual base class for FFT engines. To be implemented by all FFT_engine implementations.

Subclassed by muFFT::FFTWEngine, muFFT::FFTWMPIEngine

Public Types

using GFieldCollection_t = muGrid::GlobalFieldCollection

global FieldCollection

using Pixels = typename GFieldCollection_t::DynamicPixels

pixel iterator

using Field_t = muGrid::TypedFieldBase<Real>

Field type on which to apply the projection. This is a TypedFieldBase because it need to be able to hold either TypedField or a WrappedField.

using Workspace_t = muGrid::ComplexField

Field type holding a Fourier-space representation of a real-valued second-order tensor field

using iterator = typename GFieldCollection_t::DynamicPixels::iterator

iterator over Fourier-space discretisation point

Public Functions

FFTEngineBase() = delete

Default constructor.

FFTEngineBase(DynCcoord_t nb_grid_pts, Dim_t nb_dof_per_pixel, Communicator comm = Communicator())

Constructor with the domain’s number of grid points in each direciton, the number of components to transform, and the communicator

FFTEngineBase(const FFTEngineBase &other) = delete

Copy constructor.

FFTEngineBase(FFTEngineBase &&other) = delete

Move constructor.

virtual ~FFTEngineBase() = default

Destructor.

FFTEngineBase &operator=(const FFTEngineBase &other) = delete

Copy assignment operator.

FFTEngineBase &operator=(FFTEngineBase &&other) = delete

Move assignment operator.

virtual void initialise(FFT_PlanFlags)

compute the plan, etc

virtual Workspace_t &fft(Field_t&) = 0

forward transform (dummy for interface)

virtual void ifft(Field_t&) const = 0

inverse transform (dummy for interface)

inline virtual bool is_active() const

return whether this engine is active

const Pixels &get_pixels() const

iterators over only those pixels that exist in frequency space (i.e. about half of all pixels, see rfft)

size_t size() const

nb of pixels (mostly for debugging)

size_t fourier_size() const

nb of pixels in Fourier space

size_t workspace_size() const

nb of pixels in the work space (may contain a padding region)

inline const Communicator &get_communicator() const

return the communicator object

inline const DynCcoord_t &get_nb_subdomain_grid_pts() const

returns the process-local number of grid points in each direction of the cell

inline const DynCcoord_t &get_nb_domain_grid_pts() const

returns the process-local number of grid points in each direction of the cell

inline const DynCcoord_t &get_subdomain_locations() const

returns the process-local locations of the cell

inline const DynCcoord_t &get_nb_fourier_grid_pts() const

returns the process-local number of grid points in each direction of the cell in Fourier space

inline const DynCcoord_t &get_fourier_locations() const

returns the process-local locations of the cell in Fourier space

inline GFieldCollection_t &get_field_collection()

only required for testing and debugging

inline Workspace_t &get_work_space()

only required for testing and debugging

inline Real normalisation() const

factor by which to multiply projection before inverse transform (this is typically 1/nb_pixels for so-called unnormalized transforms (see, e.g. http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data or https://docs.scipy.org/doc/numpy-1.13.0/reference/routines.fft.html . Rather than scaling the inverse transform (which would cost one more loop), FFT engines provide this value so it can be used in the projection operator (where no additional loop is required)

const Dim_t &get_nb_dof_per_pixel() const

return the number of components per pixel

const Dim_t &get_dim() const

return the number of spatial dimensions

const Dim_t &get_nb_quad() const

returns the number of quadrature points

inline bool is_initialised() const

has this engine been initialised?

Protected Attributes

Dim_t spatial_dimension

spatial dimension of the grid

Communicator comm

Field collection in which to store fields associated with Fourier-space pointscommunicator

GFieldCollection_t work_space_container

Field collection to store the fft workspace.

DynCcoord_t nb_subdomain_grid_pts

nb_grid_pts of the process-local (subdomain) portion of the cell

DynCcoord_t subdomain_locations

location of the process-local (subdomain) portion of the cell

DynCcoord_t nb_fourier_grid_pts

nb_grid_pts of the process-local (subdomain) portion of the Fourier transformed data

DynCcoord_t fourier_locations

location of the process-local (subdomain) portion of the Fourier transformed data

const DynCcoord_t nb_domain_grid_pts

nb_grid_pts of the full domain of the cell

Workspace_t &work

field to store the Fourier transform of P

const Real norm_factor

normalisation coefficient of fourier transform

Dim_t nb_dof_per_pixel

number of degrees of freedom per pixel. Corresponds to the number of quadrature points per pixel multiplied by the number of components per quadrature point

bool initialised = {false}

to prevent double initialisation

class FFTWEngine : public muFFT::FFTEngineBase
#include <fftw_engine.hh>

implements the muFFT::FftEngine_Base interface using the FFTW library

Public Types

using Parent = FFTEngineBase

base class

using Workspace_t = typename Parent::Workspace_t

field for Fourier transform of second-order tensor

using Field_t = typename Parent::Field_t

real-valued second-order tensor

Public Functions

FFTWEngine() = delete

Default constructor.

FFTWEngine(const DynCcoord_t &nb_grid_pts, Dim_t nb_dof_per_pixel, Communicator comm = Communicator())

Constructor with the domain’s number of grid points in each direciton, the number of components to transform, and the communicator

FFTWEngine(const FFTWEngine &other) = delete

Copy constructor.

FFTWEngine(FFTWEngine &&other) = delete

Move constructor.

virtual ~FFTWEngine() noexcept

Destructor.

FFTWEngine &operator=(const FFTWEngine &other) = delete

Copy assignment operator.

FFTWEngine &operator=(FFTWEngine &&other) = delete

Move assignment operator.

virtual void initialise(FFT_PlanFlags plan_flags) override

compute the plan, etc

virtual Workspace_t &fft(Field_t &field) override

forward transform

virtual void ifft(Field_t &field) const override

inverse transform

Protected Attributes

fftw_plan plan_fft = {}

holds the plan for forward fourier transform

fftw_plan plan_ifft = {}

holds the plan for inverse fourier transform

class FFTWMPIEngine : public muFFT::FFTEngineBase
#include <fftwmpi_engine.hh>

implements the muFFT::FFTEngineBase interface using the FFTW library

Public Types

using Parent = FFTEngineBase

base class

using Workspace_t = typename Parent::Workspace_t

field for Fourier transform of second-order tensor

using Field_t = typename Parent::Field_t

real-valued second-order tensor

Public Functions

FFTWMPIEngine() = delete

Default constructor.

FFTWMPIEngine(DynCcoord_t nb_grid_pts, Dim_t nb_dof_per_pixel, Communicator comm = Communicator())

Constructor with the domain’s number of grid points in each direciton, the number of components to transform, and the communicator

FFTWMPIEngine(const FFTWMPIEngine &other) = delete

Copy constructor.

FFTWMPIEngine(FFTWMPIEngine &&other) = delete

Move constructor.

virtual ~FFTWMPIEngine() noexcept

Destructor.

FFTWMPIEngine &operator=(const FFTWMPIEngine &other) = delete

Copy assignment operator.

FFTWMPIEngine &operator=(FFTWMPIEngine &&other) = delete

Move assignment operator.

virtual void initialise(FFT_PlanFlags plan_flags) override

compute the plan, etc

virtual Workspace_t &fft(Field_t &field) override

forward transform

virtual void ifft(Field_t &field) const override

inverse transform

inline virtual bool is_active() const override

return whether this engine is active

Protected Attributes

fftw_plan plan_fft = {}

holds the plan for forward fourier transform

fftw_plan plan_ifft = {}

holds the plan for inverse fourier transform

ptrdiff_t workspace_size = {}

size of workspace buffer returned by planner

Real *real_workspace = {}

temporary real workspace that is correctly padded

bool active = {true}

FFTWMPI sometimes assigns zero grid points.

Protected Static Attributes

static int nb_engines = {0}

number of times this engine has been instatiated

class Field
#include <field.hh>

Abstract base class for all fields. A field provides storage discretising a mathematical (scalar, vectorial, tensorial) (real-valued, integer-valued, complex-valued) field on a fixed number of quadrature points per pixel/voxel of a regular grid. Fields defined on the same domains are grouped within muGrid::FieldCollections.

Subclassed by muGrid::TypedFieldBase< T >

Public Functions

Field() = delete

Default constructor.

Field(const Field &other) = delete

Copy constructor.

Field(Field &&other) = default

Move constructor.

virtual ~Field() = default

Destructor.

Field &operator=(const Field &other) = delete

Copy assignment operator.

Field &operator=(Field &&other) = delete

Move assignment operator.

const std::string &get_name() const

return the field’s unique name

FieldCollection &get_collection() const

return a const reference to the field’s collection

const Dim_t &get_nb_components() const

return the number of components stored per quadrature point

std::vector<Dim_t> get_shape(Iteration iter_type) const

evaluate and return the overall shape of the field (for passing the field to generic multidimensional array objects such as numpy.ndarray)

std::vector<Dim_t> get_pixels_shape() const

evaluate and return the overall shape of the pixels portion of the field (for passing the field to generic multidimensional array objects such as numpy.ndarray)

virtual std::vector<Dim_t> get_components_shape(Iteration iter_type) const

evaluate and return the shape of the data contained in a single pixel or quadrature point (for passing the field to generic multidimensional array objects such as numpy.ndarray)

Dim_t get_stride(Iteration iter_type) const

evaluate and return the number of components in an iterate when iterating over this field

virtual const std::type_info &get_stored_typeid() const = 0

return the type information of the stored scalar (for compatibility checking)

size_t size() const

number of entries in the field (= nb_pixel × nb_quad)

virtual size_t buffer_size() const = 0

size of the internal buffer including the pad region (in scalars)

virtual void set_pad_size(size_t pad_size_) = 0

add a pad region to the end of the field buffer; required for using this as e.g. an FFT workspace

const size_t &get_pad_size() const

pad region size

virtual void set_zero() = 0

initialise field to zero (do more complicated initialisations through fully typed maps)

bool is_global() const

checks whether this field is registered in a global FieldCollection

Protected Functions

Field(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components)

Fields are supposed to only exist in the form of std::unique_ptrs held by a FieldCollection. The Field constructor is protected to ensure this.

Parameters
  • unique_name – unique field name (unique within a collection)

  • nb_components – number of components to store per quadrature point

  • collection – reference to the holding field collection.

virtual void resize(size_t size) = 0

resizes the field to the given size

Protected Attributes

friend FieldCollection

gives field collections the ability to resize() fields

size_t current_size = {}

maintains a tally of the current size, as it cannot be reliably determined from either values or alt_values alone.

const std::string name

the field’s unique name

FieldCollection &collection

reference to the collection this field belongs to

const Dim_t nb_components

number of components stored per quadrature point (e.g., 3 for a three-dimensional vector, or 9 for a three-dimensional second-rank tensor)

size_t pad_size = {}

size of padding region at end of buffer

class FieldCollection

Base class for both muGrid::GlobalFieldCollection and muGrid::LocalFieldCollection. Manages the a group of fields with the same domain of validitiy (i.e., global fields, or local fields defined on the same pixels).

Subclassed by muGrid::GlobalFieldCollection, muGrid::LocalFieldCollection

Public Types

enum ValidityDomain

domain of validity of the managed fields

Values:

enumerator Global
enumerator Local
using Field_ptr = std::unique_ptr<Field, FieldDestructor<Field>>

unique_ptr for holding fields

using StateField_ptr = std::unique_ptr<StateField, FieldDestructor<StateField>>

unique_ptr for holding state fields

using QuadPtIndexIterable = IndexIterable

convenience alias

Public Functions

FieldCollection() = delete

Default constructor.

FieldCollection(const FieldCollection &other) = delete

Copy constructor.

FieldCollection(FieldCollection &&other) = default

Move constructor.

virtual ~FieldCollection() = default

Destructor.

FieldCollection &operator=(const FieldCollection &other) = delete

Copy assignment operator.

FieldCollection &operator=(FieldCollection &&other) = default

Move assignment operator.

template<typename T>
inline TypedField<T> &register_field(const std::string &unique_name, const Dim_t &nb_components)

place a new field in the responsibility of this collection (Note, because fields have protected constructors, users can’t create them

Technically, these explicit instantiations are not necessary, as they are implicitly instantiated when the register_<T>field(…) member functions are compiled.

Parameters
  • unique_name – unique identifier for this field

  • nb_components – number of components to be stored per quadrature point (e.g., 4 for a two-dimensional second-rank tensor, or 1 for a scalar field)

TypedField<Real> &register_real_field(const std::string &unique_name, const Dim_t &nb_components)

place a new real-valued field in the responsibility of this collection (Note, because fields have protected constructors, users can’t create them

Parameters
  • unique_name – unique identifier for this field

  • nb_components – number of components to be stored per quadrature point (e.g., 4 for a two-dimensional second-rank tensor, or 1 for a scalar field)

TypedField<Complex> &register_complex_field(const std::string &unique_name, const Dim_t &nb_components)

place a new complex-valued field in the responsibility of this collection (Note, because fields have protected constructors, users can’t create them

Parameters
  • unique_name – unique identifier for this field

  • nb_components – number of components to be stored per quadrature point (e.g., 4 for a two-dimensional second-rank tensor, or 1 for a scalar field)

TypedField<Int> &register_int_field(const std::string &unique_name, const Dim_t &nb_components)

place a new integer-valued field in the responsibility of this collection (Note, because fields have protected constructors, users can’t create them

Parameters
  • unique_name – unique identifier for this field

  • nb_components – number of components to be stored per quadrature point (e.g., 4 for a two-dimensional second-rank tensor, or 1 for a scalar field)

TypedField<Uint> &register_uint_field(const std::string &unique_name, const Dim_t &nb_components)

place a new unsigned integer-valued field in the responsibility of this collection (Note, because fields have protected constructors, users can’t create them

Parameters
  • unique_name – unique identifier for this field

  • nb_components – number of components to be stored per quadrature point (e.g., 4 for a two-dimensional second-rank tensor, or 1 for a scalar field)

template<typename T>
inline TypedStateField<T> &register_state_field(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

place a new state field in the responsibility of this collection (Note, because state fields have protected constructors, users can’t create them

TypedStateField<Real> &register_real_state_field(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

place a new real-valued state field in the responsibility of this collection (Note, because state fields have protected constructors, users can’t create them

Parameters
  • unique_prefix – unique idendifier for this state field

  • nb_memory – number of previous values of this field to store

  • nb_components – number of scalar components to store per quadrature point

TypedStateField<Complex> &register_complex_state_field(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

place a new complex-valued state field in the responsibility of this collection (Note, because state fields have protected constructors, users can’t create them

Parameters
  • unique_prefix – unique idendifier for this state field

  • nb_memory – number of previous values of this field to store

  • nb_components – number of scalar components to store per quadrature point

TypedStateField<Int> &register_int_state_field(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

place a new integer-valued state field in the responsibility of this collection (Note, because state fields have protected constructors, users can’t create them

Parameters
  • unique_prefix – unique idendifier for this state field

  • nb_memory – number of previous values of this field to store

  • nb_components – number of scalar components to store per quadrature point

TypedStateField<Uint> &register_uint_state_field(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

place a new unsigned integer-valued state field in the responsibility of this collection (Note, because state fields have protected constructors, users can’t create them

Parameters
  • unique_prefix – unique idendifier for this state field

  • nb_memory – number of previous values of this field to store

  • nb_components – number of scalar components to store per quadrature point

bool field_exists(const std::string &unique_name) const

check whether a field of name ‘unique_name’ has already been registered

bool state_field_exists(const std::string &unique_prefix) const

check whether a field of name ‘unique_name’ has already been registered

const Dim_t &get_nb_entries() const

returns the number of entries held by any given field in this collection. This corresponds to nb_pixels × nb_quad_pts, (I.e., a scalar field field and a vector field sharing the the same collection have the same number of entries, even though the vector field has more scalar values.)

size_t get_nb_pixels() const

returns the number of pixels present in the collection

bool has_nb_quad() const

check whether the number of quadrature points per pixel/voxel has ben set

void set_nb_quad(Dim_t nb_quad_pts_per_pixel)

set the number of quadrature points per pixel/voxel. Can only be done once.

const Dim_t &get_nb_quad() const

return the number of quadrature points per pixel

const Dim_t &get_spatial_dim() const

return the spatial dimension of the underlying discretisation grid

const ValidityDomain &get_domain() const

return the domain of validity (i.e., wher the fields are defined globally (muGrid::FieldCollection::ValidityDomain::Global) or locally (muGrid::FieldCollection::ValidityDomain::Local)

bool is_initialised() const

whether the collection has been properly initialised (i.e., it knows the number of quadrature points and all its pixels/voxels

PixelIndexIterable get_pixel_indices_fast() const

return an iterable proxy to the collection which allows to efficiently iterate over the indices fo the collection’s pixels

IndexIterable get_pixel_indices() const

return an iterable proxy to the collection which allows to iterate over the indices fo the collection’s pixels

IndexIterable get_quad_pt_indices() const

return an iterable proxy to the collection which allows to iterate over the indices fo the collection’s quadrature points

inline std::vector<size_t> get_pixel_ids()
Field &get_field(const std::string &unique_name)

returns a (base-type) reference to the field identified by unique_name. Throws a muGrid::FieldCollectionError if the field does not exist.

StateField &get_state_field(const std::string &unique_prefix)

returns a (base-type) reference to the state field identified by unique_prefix. Throws a muGrid::FieldCollectionError if the state field does not exist.

std::vector<std::string> list_fields() const

returns a vector of all field names

void preregister_map(std::shared_ptr<std::function<void()>> &call_back)

preregister a map for latent initialisation

Protected Functions

FieldCollection(ValidityDomain domain, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Constructor (not called by user, who constructs either a LocalFieldCollection or a GlobalFieldCollection

Parameters
  • domain – Domain of validity, can be global or local

  • spatial_dimension – spatial dimension of the field (can be muGrid::Unknown, e.g., in the case of the local fields for storing internal material variables)

  • nb_quad_pts – number of quadrature points per pixel/voxel

template<typename T>
TypedField<T> &register_field_helper(const std::string &unique_name, const Dim_t &nb_components)

internal worker function called by register_<T>_field

template<typename T>
TypedStateField<T> &register_state_field_helper(const std::string &unique_prefix, const Dim_t &nb_memory, const Dim_t &nb_components)

internal worker function called by register_<T>_state_field

void allocate_fields()

loop through all fields and allocate their memory. Is exclusively called by the daughter classes’ initialise member function.

void initialise_maps()

initialise all preregistered maps

Protected Attributes

std::map<std::string, Field_ptr> fields = {}

storage container for fields

std::map<std::string, StateField_ptr> state_fields = {}

storage container for state fields

std::vector<std::weak_ptr<std::function<void()>>> init_callbacks = {}

Maps registered before initialisation which will need their data_ptr set.

ValidityDomain domain

domain of validity

Dim_t spatial_dim

spatial dimension

Dim_t nb_quad_pts

number of quadrature points per pixel/voxel

Dim_t nb_entries = {Unknown}

total number of entries

bool initialised = {false}

keeps track of whether the collection has already been initialised

std::vector<size_t> pixel_indices = {}

Storage for indices of the stored quadrature points in the global field collection. Note that these are not truly global indices, but rather absolute indices within the domain of the local processor. I.e., they are universally valid to address any quadrature point on the local processor, and not for any quadrature point located on anothe processor.

class FieldCollectionError : public runtime_error

base class for field collection-related exceptions

Public Functions

inline explicit FieldCollectionError(const std::string &what)

constructor

inline explicit FieldCollectionError(const char *what)

constructor

template<class DefaultDestroyable>
struct FieldDestructor

forward declacation of the field’s destructor-functor

Public Functions

void operator()(DefaultDestroyable *field)

deletes the held field

class FieldError : public runtime_error
#include <field.hh>

base class for field-related exceptions

Public Functions

inline explicit FieldError(const std::string &what)

constructor

inline explicit FieldError(const char *what)

constructor

template<typename T, Mapping Mutability>
class FieldMap
#include <field_map.hh>

forward declaration

Dynamically sized field map. Field maps allow iterating over the pixels or quadrature points of a field and to select the shape (in a matrix sense) of the iterate. For example, it allows to iterate in 2×2 matrices over the quadrature points of a strain field for a two-dimensional problem.

Subclassed by muGrid::StaticFieldMap< T, Mutability, MapType, IterationType >

Public Types

using Scalar = T

stored scalar type

using Field_t = std::conditional_t<Mutability == Mapping::Const, const TypedFieldBase<T>, TypedFieldBase<T>>

const-correct field depending on mapping mutability

using PlainType = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>

dynamically mapped eigen type

using Return_t = std::conditional_t<MutVal == Mapping::Const, Eigen::Map<const PlainType>, Eigen::Map<PlainType>>

return type for iterators over this- map

using EigenRef = Eigen::Ref<const PlainType>

Input type for matrix-like values (used for setting uniform values)

using PixelEnumeration_t = akantu::containers::ZipContainer<FieldCollection::PixelIndexIterable, FieldMap&>

zip-container for iterating over pixel index and stored value simultaneously

using Enumeration_t = akantu::containers::ZipContainer<FieldCollection::IndexIterable, FieldMap&>

zip-container for iterating over pixel or quadrature point index and stored value simultaneously

using iterator = Iterator<(Mutability == Mapping::Mut) ? Mapping::Mut : Mapping::Const>

stl

using const_iterator = Iterator<Mapping::Const>

stl

Public Functions

FieldMap() = delete

Default constructor.

explicit FieldMap(Field_t &field, Iteration iter_type = Iteration::QuadPt)

Constructor from a field. The default case is a map iterating over quadrature points with a matrix of shape (nb_components × 1) per field entry

FieldMap(Field_t &field, Dim_t nb_rows, Iteration iter_type = Iteration::QuadPt)

Constructor from a field with explicitly chosen shape of iterate. (the number of columns is inferred).

FieldMap(const FieldMap &other) = delete

Copy constructor.

FieldMap(FieldMap &&other)

Move constructor.

virtual ~FieldMap() = default

Destructor.

FieldMap &operator=(const FieldMap &other) = delete

Copy assignment operator (delete because of reference member)

FieldMap &operator=(FieldMap &&other) = delete

Move assignment operator (delete because of reference member)

template<bool IsMutableField = Mutability == Mapping::Mut>
inline std::enable_if_t<IsMutableField, FieldMap> &operator=(const EigenRef &val)

Assign a matrix-like value to every entry.

template<bool IsMutableField = Mutability == Mapping::Mut>
inline std::enable_if_t<IsMutableField, FieldMap> &operator=(const Scalar &val)

Assign a scalar value to every entry.

iterator begin()

stl

iterator end()

stl

const_iterator cbegin()

stl

const_iterator cend()

stl

const_iterator begin() const

stl

const_iterator end() const

stl

size_t size() const

returns the number of iterates produced by this map (corresponds to the number of field entries if Iteration::Quadpt, or the number of pixels/voxels if Iteration::Pixel);

inline Return_t<Mutability> operator[](size_t index)

random acces operator

inline Return_t<Mapping::Const> operator[](size_t index) const

random const acces operator

void set_data_ptr()

query the size from the field’s collection and set data_ptr

PixelEnumeration_t enumerate_pixel_indices_fast()

return an iterable proxy over pixel indices and stored values simultaneously. Throws a muGrid::FieldMapError if the iteration type is over quadrature points

Enumeration_t enumerate_indices()

return an iterable proxy over pixel/quadrature indices and stored values simultaneously

PlainType mean() const

evaluate and return the mean value of the map

Public Static Functions

static inline constexpr Mapping FieldMutability()

determine whether a field is mutably mapped at compile time

static inline constexpr bool IsStatic()

determine whether a field map is statically sized at compile time

Protected Attributes

const Field_t &field

mapped field. Needed for query at initialisations

const Iteration iteration

type of map iteration

const Dim_t stride

precomputed stride

const Dim_t nb_rows

number of rows of the iterate

const Dim_t nb_cols

number of columns fo the iterate

T *data_ptr = {nullptr}

Pointer to mapped data; is also unknown at construction and set in the map’s begin function

bool is_initialised = {false}

keeps track of whether the map has been initialised.

std::shared_ptr<std::function<void()>> callback = {nullptr}

shared_ptr used for latent initialisation

class FieldMapError : public runtime_error
#include <field_map.hh>

base class for field map-related exceptions

Public Functions

inline explicit FieldMapError(const std::string &what)

constructor

inline explicit FieldMapError(const char *what)

constructor

template<size_t N>
struct Foreach
#include <iterators.hh>

static for loop

Public Static Functions

template<class Tuple>
static inline bool not_equal(Tuple &&a, Tuple &&b)

undocumented

template<>
struct Foreach<0>
#include <iterators.hh>

static comparison

Public Static Functions

template<class Tuple>
static inline bool not_equal(Tuple &&a, Tuple &&b)

undocumented

class FourierDerivative : public muFFT::DerivativeBase
#include <derivative.hh>

Representation of a derivative computed by Fourier interpolation

Public Types

using Parent = DerivativeBase

base class

using Vector = typename Parent::Vector

convenience alias

Public Functions

FourierDerivative() = delete

Default constructor.

explicit FourierDerivative(Dim_t spatial_dimension, Dim_t direction)

Constructor with raw FourierDerivative information.

FourierDerivative(const FourierDerivative &other) = default

Copy constructor.

FourierDerivative(FourierDerivative &&other) = default

Move constructor.

virtual ~FourierDerivative() = default

Destructor.

FourierDerivative &operator=(const FourierDerivative &other) = delete

Copy assignment operator.

FourierDerivative &operator=(FourierDerivative &&other) = delete

Move assignment operator.

inline virtual Complex fourier(const Vector &phase) const

Return Fourier representation of the Fourier interpolated derivative. This here simply returns I*2*pi*phase. (I*2*pi*wavevector is the Fourier representation of the derivative.)

Protected Attributes

Dim_t direction

spatial direction in which to perform differentiation

template<typename Rhs, class CellAdaptor>
struct generic_product_impl<CellAdaptor, Rhs, SparseShape, DenseShape, GemvProduct> : public generic_product_impl_base<CellAdaptor, Rhs, generic_product_impl<CellAdaptor, Rhs>>
#include <cell_adaptor.hh>

Implementation of muSpectre::CellAdaptor * Eigen::DenseVector through a specialization of Eigen::internal::generic_product_impl:

Public Types

typedef Product<CellAdaptor, Rhs>::Scalar Scalar

undocumented

Public Static Functions

template<typename Dest>
static inline void scaleAndAddTo(Dest &dst, const CellAdaptor &lhs, const Rhs &rhs, const Scalar &alpha)

undocumented

class GlobalFieldCollection : public muGrid::FieldCollection

muGrid::GlobalFieldCollection derives from muGrid::FieldCollection and stores global fields that live throughout the whole computational domain, i.e. are defined for every pixel/voxel.

Public Types

using Parent = FieldCollection

alias of base class

using DynamicPixels = CcoordOps::DynamicPixels

pixel iterator

Public Functions

GlobalFieldCollection() = delete

Default constructor.

GlobalFieldCollection(Dim_t spatial_dimension, Dim_t nb_quad_pts)

Constructor

Parameters
  • spatial_dimension – number of spatial dimensions, must be 1, 2, 3, or Unknown

  • nb_quad_pts – number of quadrature points per pixel/voxel

GlobalFieldCollection(Dim_t spatial_dimension, Dim_t nb_quad_pts, const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations = {})

Constructor with initialization

Parameters
  • spatial_dimension – number of spatial dimensions, must be 1, 2, 3, or Unknown

  • nb_quad_pts – number of quadrature points per pixel/voxel

GlobalFieldCollection(const GlobalFieldCollection &other) = delete

Copy constructor.

GlobalFieldCollection(GlobalFieldCollection &&other) = default

Move constructor.

virtual ~GlobalFieldCollection() = default

Destructor.

GlobalFieldCollection &operator=(const GlobalFieldCollection &other) = delete

Copy assignment operator.

GlobalFieldCollection &operator=(GlobalFieldCollection &&other) = delete

Move assignment operator.

const DynamicPixels &get_pixels() const

Return the pixels class that allows to iterator over pixels.

template<size_t Dim>
inline Dim_t get_index(const Ccoord_t<Dim> &ccoord) const

Return index for a ccoord.

inline DynCcoord_t get_ccoord(const Dim_t &index) const

return coordinates of the i-th pixel

void initialise(const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations = {})

freeze the problem size and allocate memory for all fields of the collection. Fields added later on will have their memory allocated upon construction.

template<size_t Dim>
inline void initialise(const Ccoord_t<Dim> &nb_grid_pts, const Ccoord_t<Dim> &locations = {})

freeze the problem size and allocate memory for all fields of the collection. Fields added later on will have their memory allocated upon construction.

void initialise(const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations, const DynCcoord_t &strides)

freeze the problem size and allocate memory for all fields of the collection. Fields added later on will have their memory allocated upon construction.

template<size_t Dim>
inline void initialise(const Ccoord_t<Dim> &nb_grid_pts, const Ccoord_t<Dim> &locations, const Ccoord_t<Dim> &strides)

freeze the problem size and allocate memory for all fields of the collection. Fields added later on will have their memory allocated upon construction.

GlobalFieldCollection get_empty_clone() const

obtain a new field collection with the same domain and pixels

Protected Attributes

DynamicPixels pixels = {}

helper to iterate over the grid

template<Dim_t Dim, class Strain_t, class Tangent_t>
struct Hooke

static inline implementation of Hooke’s law

Public Static Functions

static inline constexpr Real compute_lambda(const Real &young, const Real &poisson)

compute Lamé’s first constant

Parameters
  • young – Young’s modulus

  • poisson – Poisson’s ratio

static inline constexpr Real compute_mu(const Real &young, const Real &poisson)

compute Lamé’s second constant (i.e., shear modulus)

Parameters
  • young – Young’s modulus

  • poisson – Poisson’s ratio

static inline constexpr Real compute_K(const Real &young, const Real &poisson)

compute the bulk modulus

Parameters
  • young – Young’s modulus

  • poisson – Poisson’s ratio

static inline Eigen::TensorFixedSize<Real, Eigen::Sizes<Dim, Dim, Dim, Dim>> compute_C(const Real &lambda, const Real &mu)

compute the stiffness tensor

Parameters
  • lambda – Lamé’s first constant

  • mu – Lamé’s second constant (i.e., shear modulus)

static inline T4Mat<Real, Dim> compute_C_T4(const Real &lambda, const Real &mu)

compute the stiffness tensor

Parameters
  • lambda – Lamé’s first constant

  • mu – Lamé’s second constant (i.e., shear modulus)

template<class s_t>
static inline auto evaluate_stress(const Real &lambda, const Real &mu, s_t &&E) -> decltype(auto)

return stress

Parameters
  • lambda – First Lamé’s constant

  • mu – Second Lamé’s constant (i.e. shear modulus)

  • E – Green-Lagrange or small strain tensor

template<class T_t, class s_t>
static inline auto evaluate_stress(const T_t C, s_t &&E) -> decltype(auto)

return stress

Parameters
  • C – stiffness tensor (Piola-Kirchhoff 2 (or σ) w.r.t to E)

  • E – Green-Lagrange or small strain tensor

template<class s_t>
static inline auto evaluate_stress(const Real &lambda, const Real &mu, Tangent_t &&C, s_t &&E) -> decltype(auto)

return stress and tangent stiffness

Parameters
  • lambda – First Lamé’s constant

  • mu – Second Lamé’s constant (i.e. shear modulus)

  • E – Green-Lagrange or small strain tensor

  • C – stiffness tensor (Piola-Kirchhoff 2 (or σ) w.r.t to E)

class IncompletePixels

Public Functions

explicit IncompletePixels(const CellSplit &cell)

constructor

IncompletePixels(const IncompletePixels &other) = default

copy constructor

IncompletePixels(IncompletePixels &other) = default

move constructor

virtual ~IncompletePixels() = default
inline iterator begin() const

stl conformance

inline iterator end() const

stl conformance

inline size_t size() const

stl conformance

Protected Attributes

const CellSplit &cell
std::vector<Real> incomplete_assigned_ratios
std::vector<Dim_t> index_incomplete_pixels
class IndexIterable

Iterate class for iterating over quadrature point indices of a field collection (i.e. the iterate you get when iterating over the result of muGrid::FieldCollection::get_quad_pt_indices).

Public Functions

IndexIterable() = delete

Default constructor.

IndexIterable(const IndexIterable &other) = delete

Copy constructor.

IndexIterable(IndexIterable &&other) = default

Move constructor.

virtual ~IndexIterable() = default

Destructor.

IndexIterable &operator=(const IndexIterable &other) = delete

Copy assignment operator.

IndexIterable &operator=(IndexIterable &&other) = delete

Move assignment operator.

iterator begin() const

stl

iterator end() const

stl

size_t size() const

stl

Protected Functions

inline Dim_t get_stride() const

evaluate and return the stride with with the fast index of the iterators over the indices of this collection rotate

IndexIterable(const FieldCollection &collection, const Iteration &iteration_type)

Constructor is protected, because no one ever need to construct this except the fieldcollection

Protected Attributes

friend FieldCollection

allow the field collection to create muGrid::FieldCollection::IndexIterables

const FieldCollection &collection

reference back to the proxied collection

const Iteration iteration_type

whether to iterate over pixels or quadrature points

template<class Derived>
struct is_fixed
#include <eigen_tools.hh>

Helper class to check whether an Eigen::Array or Eigen::Matrix is statically sized

Public Types

using T = std::remove_cv_t<std::remove_reference_t<Derived>>

raw type for testing

Public Static Attributes

static constexpr bool value = {T::SizeAtCompileTime != Eigen::Dynamic}

evaluated test

template<class TestClass>
struct is_matrix
#include <eigen_tools.hh>

Structure to determine whether an expression can be evaluated into a Eigen::Matrix, Eigen::Array, etc. and which helps determine compile-time size

Public Types

using T = std::remove_cv_t<std::remove_reference_t<TestClass>>

Public Static Attributes

static constexpr bool value{std::is_base_of<Eigen::MatrixBase<T>, T>::value}
template<class Derived>
struct is_matrix<Eigen::Map<Derived>>

Public Static Attributes

static constexpr bool value = {is_matrix<Derived>::value}
template<class Derived>
struct is_matrix<Eigen::Ref<Derived>>

Public Static Attributes

static constexpr bool value = {is_matrix<Derived>::value}
template<class T>
struct is_reference_wrapper : public false_type
template<class U>
struct is_reference_wrapper<std::reference_wrapper<U>> : public true_type
template<class Derived>
struct is_square
#include <eigen_tools.hh>

Helper class to check whether an Eigen::Array or Eigen::Matrix is a static-size and square.

Public Types

using T = std::remove_cv_t<std::remove_reference_t<Derived>>

raw type for testing

Public Static Attributes

static constexpr bool value{(T::RowsAtCompileTime == T::ColsAtCompileTime) && is_fixed<T>::value}

true if the object is square and statically sized

template<class T, Dim_t order>
struct is_tensor
#include <tensor_algebra.hh>

Check whether a given expression represents a Tensor specified order.

Public Static Attributes

static constexpr bool value = (std::is_convertible<T, Eigen::Tensor<Real, order>>::value || std::is_convertible<T, Eigen::Tensor<Int, order>>::value || std::is_convertible<T, Eigen::Tensor<Complex, order>>::value)

evaluated test

template<class Strains_t, class Stresses_t, SplitCell is_cell_split = SplitCell::no>
class iterable_proxy
#include <iterable_proxy.hh>

this iterator class is a default for simple laws that just take a strain

Public Types

using Strain_t = typename internal::StrainsTComputer<Strains_t>::type

expected type for strain values

using Stress_t = typename internal::StressesTComputer<Stresses_t>::type

expected type for stress values

using StrainFieldTup = std::conditional_t<(std::tuple_size<Strains_t>::value == 2), std::tuple<const muGrid::RealField&, const muGrid::RealField&>, std::tuple<const muGrid::RealField&>>

tuple containing a strain and possibly a strain-rate field

using StressFieldTup = std::conditional_t<(std::tuple_size<Stresses_t>::value == 2), std::tuple<muGrid::RealField&, muGrid::RealField&>, std::tuple<muGrid::RealField&>>

tuple containing a stress and possibly a tangent stiffness field

Public Functions

iterable_proxy() = delete

Default constructor.

template<bool DoNeedTgt = std::tuple_size<Stresses_t>::value == 2, bool DoNeedRate = std::tuple_size<Strain_t>::value == 2>
inline iterable_proxy(MaterialBase &mat, const muGrid::RealField &F, std::enable_if_t<DoNeedRate, const muGrid::RealField> &F_rate, muGrid::RealField &P, std::enable_if_t<DoNeedTgt, muGrid::RealField> &K)

Iterator uses the material’s internal variables field collection to iterate selectively over the global fields (such as the transformation gradient F and first Piola-Kirchhoff stress P.

template<bool DontNeedTgt = std::tuple_size<Stresses_t>::value == 1, bool DoNeedRate = std::tuple_size<Strain_t>::value == 2>
inline iterable_proxy(MaterialBase &mat, const muGrid::RealField &F, std::enable_if_t<DoNeedRate, const muGrid::RealField> &F_rate, std::enable_if_t<DontNeedTgt, muGrid::RealField> &P)
template<bool DoNeedTgt = std::tuple_size<Stresses_t>::value == 2, bool DontNeedRate = std::tuple_size<Strain_t>::value == 1>
inline iterable_proxy(MaterialBase &mat, std::enable_if_t<DontNeedRate, const muGrid::RealField> &F, muGrid::RealField &P, std::enable_if_t<DoNeedTgt, muGrid::RealField> &K)
template<bool DontNeedTgt = std::tuple_size<Stresses_t>::value == 1, bool DontNeedRate = std::tuple_size<Strain_t>::value == 1>
inline iterable_proxy(MaterialBase &mat, std::enable_if_t<DontNeedRate, const muGrid::RealField> &F, std::enable_if_t<DontNeedTgt, muGrid::RealField> &P)
iterable_proxy(const iterable_proxy &other) = default

Copy constructor.

iterable_proxy(iterable_proxy &&other) = default

Move constructor.

virtual ~iterable_proxy() = default

Destructor.

iterable_proxy &operator=(const iterable_proxy &other) = default

Copy assignment operator.

iterable_proxy &operator=(iterable_proxy &&other) = default

Move assignment operator.

inline iterator begin()

returns iterator to first pixel if this material

inline iterator end()

returns iterator past the last pixel in this material

Protected Attributes

MaterialBase &material

reference to the proxied material

StrainFieldTup strain_field

cell’s global strain field

StressFieldTup stress_tup

references to the global stress field and perhaps tangent

class iterator
#include <iterable_proxy.hh>

dereferences into a tuple containing strains, and internal variables, as well as maps to the stress and potentially stiffness maps where to write the response of a pixel

Public Types

using value_type = std::tuple<Strain_t, Stress_t, const size_t&, Real>

return type contains a tuple of strain and possibly strain rate, stress and possibly stiffness, and a refererence to the pixel index

using iterator_category = std::forward_iterator_tag

stl conformance

Public Functions

iterator() = delete

Default constructor.

inline explicit iterator(const iterable_proxy &proxy, bool begin = true)

Iterator uses the material’s internal variables field collection to iterate selectively over the global fields (such as the transformation gradient F and first Piola-Kirchhoff stress P.

iterator(const iterator &other) = default

Copy constructor.

iterator(iterator &&other) = default

Move constructor.

virtual ~iterator() = default

Destructor.

iterator &operator=(const iterator &other) = default

Copy assignment operator.

iterator &operator=(iterator &&other) = default

Move assignment operator.

inline iterator &operator++()

pre-increment

inline value_type operator*()

dereference

inline bool operator!=(const iterator &other) const

inequality

Protected Attributes

const iterable_proxy &proxy

ref to the proxy

Strains_t strain_map

map onto the global strain field

Stresses_t stress_map

map onto the global stress field and possibly tangent stiffness

size_t index

counter of current iterate (quad point). This value is the look-up index for the local field collection

muGrid::FieldCollection::IndexIterable::iterator quad_pt_iter

iterator over quadrature point. This value is the look-up index for the global field collection

class iterator

iterator class for iterating over quadrature point indices or pixel indices of a muGrid::FieldCollection::IndexIterable. Dereferences to an index.

Public Types

using PixelIndexIterator_t = typename std::vector<size_t>::const_iterator

convenience alias

Public Functions

iterator() = delete

Default constructor.

iterator(const PixelIndexIterator_t &pixel_index_iterator, const size_t &stride)

constructor

iterator(const iterator &other) = default

Copy constructor.

iterator(iterator &&other) = default

Move constructor.

~iterator() = default

Destructor.

iterator &operator=(const iterator &other) = default

Copy assignment operator.

iterator &operator=(iterator &&other) = default

Move assignment operator.

inline iterator &operator++()

pre-increment

inline bool operator!=(const iterator &other) const

comparison

inline bool operator==(const iterator &other) const

comparison (required by akantu::iterators)

inline size_t operator*()

dereference

Protected Attributes

size_t stride

stride for the slow moving index

size_t offset = {}

fast-moving index

PixelIndexIterator_t pixel_index_iterator

iterator of slow moving index

template<Mapping MutIter>
class Iterator
#include <field_map.hh>

forward-declaration for mugrid::FieldMap’s iterator

Public Types

using FieldMap_t = std::conditional_t<MutIter == Mapping::Const, const FieldMap, FieldMap>

convenience alias

using value_type = typename FieldMap<T, Mutability>::template Return_t<MutIter>

stl

using cvalue_type = typename FieldMap<T, Mutability>::template Return_t<Mapping::Const>

stl

Public Functions

Iterator() = delete

Default constructor.

inline Iterator(FieldMap_t &map, bool end)

Constructor to beginning, or to end.

Iterator(const Iterator &other) = delete

Copy constructor.

Iterator(Iterator &&other) = default

Move constructor.

virtual ~Iterator() = default

Destructor.

Iterator &operator=(const Iterator &other) = default

Copy assignment operator.

Iterator &operator=(Iterator &&other) = default

Move assignment operator.

inline Iterator &operator++()

pre-increment

inline value_type operator*()

dereference

inline cvalue_type operator*() const

dereference

inline bool operator==(const Iterator &other) const

equality

inline bool operator!=(const Iterator &other) const

inequality

Protected Attributes

FieldMap_t &map

FieldMap being iterated over.

size_t index

current iteration index

template<Mapping MutIter>
class Iterator

Iterator class for muGrid::StaticFieldMap

Public Types

using value_type = typename MapType::template value_type<MutIter>

type returned by iterator

using storage_type = typename MapType::template storage_type<MutIter>

type stored

Public Functions

Iterator() = delete

Default constructor.

inline Iterator(const StaticFieldMap &map, bool end)

Constructor to beginning, or to end.

Iterator(const Iterator &other) = default

Copy constructor.

Iterator(Iterator &&other) = default

Move constructor.

virtual ~Iterator() = default

Destructor.

Iterator &operator=(const Iterator &other) = default

Copy assignment operator.

Iterator &operator=(Iterator &&other) = default

Move assignment operator.

inline Iterator &operator++()

pre-increment

inline value_type &operator*()

dereference

inline value_type *operator->()

pointer to member

inline bool operator==(const Iterator &other) const

equality

inline bool operator!=(const Iterator &other) const

inequality

Protected Attributes

const StaticFieldMap &map

FieldMap being iterated over.

size_t index

current iteration index

storage_type iterate

map which is being returned per iterate

class iterator

Iterator class for muSpectre::DynamicPixels

Subclassed by muGrid::CcoordOps::DynamicPixels::Enumerator::iterator

Public Types

using value_type = DynCcoord<threeD>

stl

using const_value_type = const value_type

stl conformance

using pointer = value_type*

stl conformance

using difference_type = std::ptrdiff_t

stl conformance

using iterator_category = std::forward_iterator_tag

stl conformance

Public Functions

inline iterator(const DynamicPixels &pixels, size_t index)

constructor

iterator() = delete

Default constructor.

iterator(const iterator &other) = default

Copy constructor.

iterator(iterator &&other) = default

Move constructor.

~iterator() = default

Destructor.

iterator &operator=(const iterator &other) = delete

Copy assignment operator.

iterator &operator=(iterator &&other) = delete

Move assignment operator.

inline value_type operator*() const

dereferencing

inline iterator &operator++()

pre-increment

inline bool operator!=(const iterator &other) const

inequality

inline bool operator==(const iterator &other) const

equality

Protected Attributes

const DynamicPixels &pixels

ref to pixels in cell

size_t index

index of currently pointed-to pixel

class iterator : public muGrid::CcoordOps::DynamicPixels::iterator

Public Types

using Parent = DynamicPixels::iterator

Public Functions

inline std::tuple<Dim_t, Parent::value_type> operator*() const
class iterator

iterators over Pixels dereferences to cell coordinates

Public Types

using value_type = Ccoord

stl conformance

using const_value_type = const value_type

stl conformance

using pointer = value_type*

stl conformance

using difference_type = std::ptrdiff_t

stl conformance

using iterator_category = std::forward_iterator_tag

stl conformance

using reference = value_type

stl conformance

Public Functions

explicit iterator(const Pixels &pixels, bool begin = true)

constructor

virtual ~iterator() = default
inline value_type operator*() const

dereferencing

inline iterator &operator++()

pre-increment

inline bool operator!=(const iterator &other) const

inequality

inline bool operator==(const iterator &other) const

equality

Protected Attributes

const Pixels &pixels

ref to pixels in cell

size_t index

index of currently pointed-to pixel

class iterator : public std::vector::iterator<T*>
#include <ref_vector.hh>

iterator over muGrid::RefVector

Public Functions

inline iterator(Parent &iterator)

copy constructor

inline iterator(Parent &&iterator)

move constructor

inline T &operator*()

dereference

Private Types

using Parent = typename std::vector<T*>::iterator
class iterator

Public Types

using value_type = Eigen::Map<Vector_t>
using value_type_const = Eigen::Map<const Vector_t>

Public Functions

inline explicit iterator(const Vectors_t &data, const Dim_t &dim, bool begin = true)

constructor

virtual ~iterator() = default
inline value_type_const operator*() const

dereferencing

inline iterator &operator++()

pre-increment

inline iterator &operator--()
inline bool operator!=(const iterator &other)

inequality

inline bool operator==(const iterator &other) const

equality

Protected Attributes

const Vectors_t &vectors
Dim_t dim
size_t index
template<Mapping MutIter>
class Iterator
#include <state_field_map.hh>

iterator type

Iterator class for muGrid::StateFieldMap

Public Types

using StateFieldMap_t = std::conditional_t<MutIter == Mapping::Const, const StateFieldMap, StateFieldMap>

convenience alias

using StateWrapper_t = typename StateFieldMap::template StateWrapper<MutIter>

const-correct proxy for iterates

Public Functions

Iterator() = delete

Deleted default constructor.

Iterator(StateFieldMap_t &state_field_map, size_t index)

constructor (should never have to be called by the user)

Iterator(const Iterator &other) = delete

Copy constructor.

Iterator(Iterator &&other) = default

Move constructor.

virtual ~Iterator() = default

destructor

Iterator &operator=(const Iterator &other) = delete

Copy assignment operator.

Iterator &operator=(Iterator &&other) = default

Move assignment operator.

inline bool operator!=(const Iterator &other)

comparison

inline Iterator &operator++()

pre-increment

inline StateWrapper_t operator*()

dereference

Protected Attributes

StateFieldMap_t &state_field_map

reference back to the iterated map

size_t index

current iteration progress

template<Mapping MutIter>
class Iterator

froward declaration of iterator class

Public Types

using StaticStateFieldMap_t = std::conditional_t<MutIter == Mapping::Const, const StaticStateFieldMap, StaticStateFieldMap>

const correct iterated map

using StateWrapper_t = typename StaticStateFieldMap::template StaticStateWrapper<MutIter>

convenience alias to dererencing return type

Public Functions

Iterator() = delete

Default constructor.

Iterator(const Iterator &other) = delete

Copy constructor.

inline Iterator(StaticStateFieldMap_t &state_field_map, size_t index)

constructor with field map and index, not for user to call

Iterator(Iterator &&other) = default

Move constructor.

virtual ~Iterator() = default

Destructor.

Iterator &operator=(const Iterator &other) = delete

Copy assignment operator.

Iterator &operator=(Iterator &&other) = default

Move assignment operator.

inline bool operator!=(const Iterator &other) const

comparison

inline bool operator==(const Iterator &other) const

comparison (needed by akantu::iterator

inline Iterator &operator++()

pre-increment

inline StateWrapper_t operator*()

dereference

Protected Attributes

StaticStateFieldMap_t &state_field_map

reference bap to iterated map

size_t index

current progress in iteration

class iterator
#include <cell_split.hh>

iterator type over all incompletetedly assigned pixel’s

Public Types

using value_type = std::tuple<DynCcoord_t, Real>

stl conformance

Public Functions

iterator(const IncompletePixels &pixels, Dim_t dim, bool begin = true)

constructor

virtual ~iterator() = default
value_type operator*() const

dereferencing

template<Dim_t DimS>
value_type deref_helper() const
iterator &operator++()

pre-increment

bool operator!=(const iterator &other)

inequality

inline bool operator==(const iterator &other) const

equality

template<Dim_t DimS>
auto deref_helper() const -> value_type

Protected Attributes

const IncompletePixels &incomplete_pixels
Dim_t dim
size_t index
template<Dim_t Dim, StressMeasure StressM, StrainMeasure StrainM>
struct Kirchhoff_stress

Structure for functions returning Kirchhoff stress from other stress measures

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&)

returns the converted stress

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&, Tangent_t&&)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct Kirchhoff_stress<Dim, StressMeasure::PK2, StrainM> : public muSpectre::MatTB::internal::Kirchhoff_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-2, PK2) and we need to have Kirchhoff stress (τ)

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&S)

returns the converted stress

template<Dim_t Dim>
class LamCombination

Public Types

using Stiffness_t = typename LamHomogen<Dim, Formulation::small_strain>::Stiffness_t
using Stress_t = typename LamHomogen<Dim, Formulation::small_strain>::Stress_t

Public Functions

template<>
auto lam_C_combine(const Eigen::MatrixBase<Derived1> &C_1, const Eigen::MatrixBase<Derived2> &C_2, const Real &ratio) -> Stiffness_t
template<>
auto lam_C_combine(const Eigen::MatrixBase<Derived1> &C_1, const Eigen::MatrixBase<Derived2> &C_2, const Real &ratio) -> Stiffness_t
template<class Derived1, class Derived2>
auto lam_S_combine(const Eigen::MatrixBase<Derived1> &S_1, const Eigen::MatrixBase<Derived2> &S_2, const Real &ratio) -> Stress_t

Public Static Functions

template<class Derived1, class Derived2>
static inline Stress_t lam_S_combine(const Eigen::MatrixBase<Derived1> &S_1, const Eigen::MatrixBase<Derived2> &S_2, const Real &ratio)

This functions calculate the resultant stress and tangent matrices according to the computed E_1 and E_2 from the solver.

template<class Derived1, class Derived2>
static Stiffness_t lam_C_combine(const Eigen::MatrixBase<Derived1> &C_1, const Eigen::MatrixBase<Derived2> &C_2, const Real &ratio)
template<Dim_t Dim, Formulation Form>
class LamHomogen

Public Types

using Vec_t = Eigen::Matrix<Real, Dim, 1>

typedefs for data handled by this interface

using Stiffness_t = muGrid::T4Mat<Real, Dim>
using Strain_t = Eigen::Matrix<Real, Dim, Dim>
using Stress_t = Strain_t
using Equation_index_t = std::array<std::array<Dim_t, 2>, Dim>
using Equation_stiffness_t = Eigen::Matrix<Real, Dim, Dim>
using Equation_strain_t = Eigen::Matrix<Real, Dim, 1>
using Equation_stress_t = Equation_strain_t
using Parallel_index_t = std::conditional_t<Form == Formulation::finite_strain, std::array<std::array<Dim_t, 2>, Dim * (Dim - 1)>, std::array<std::array<Dim_t, 2>, (Dim - 1) * (Dim - 1)>>
using Parallel_strain_t = std::conditional_t<Form == Formulation::finite_strain, Eigen::Matrix<Real, Dim * (Dim - 1), 1>, Eigen::Matrix<Real, (Dim - 1) * (Dim - 1), 1>>
using Parallel_stress_t = Parallel_strain_t
using Function_t = std::function<std::tuple<Stress_t, Stiffness_t>(const Eigen::Ref<const Strain_t>&)>

Public Functions

template<class Derived1, class Derived2>
auto make_total_strain(const Eigen::MatrixBase<Derived1> &E_eq, const Eigen::MatrixBase<Derived2> &E_para) -> Strain_t
template<class Derived>
auto get_equation_stiffness(const Eigen::MatrixBase<Derived> &C) -> Equation_stiffness_t
template<class Derived1, class Derived2>
auto delta_equation_stress_stiffness_eval(const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Eigen::MatrixBase<Derived1> &strain_1, const Eigen::MatrixBase<Derived2> &strain_2, const RotatorNormal<Dim> &rotator, const Real &ratio) -> std::tuple<Equation_stress_t, Equation_stiffness_t, Real>
template<class Derived1, class Derived2>
auto delta_equation_stress_stiffness_eval_strain_1(const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Eigen::MatrixBase<Derived1> &strain_0_rot, const Eigen::MatrixBase<Derived2> &strain_1_rot, const RotatorNormal<Dim> &rotator, const Real &ratio) -> std::tuple<Equation_stress_t, Equation_stiffness_t, Real>
template<class Derived1, class Derived2>
auto lam_stress_combine(const Eigen::MatrixBase<Derived1> &stress_1, const Eigen::MatrixBase<Derived2> &stress_2, const Real &ratio) -> Stress_t

These functions are used as intrface for combination functions, They are also used for carrying out the stress transformation necessary for combining stifness matrix in Finite-Strain formulation because the combining formula from the bokk “Theory of Composites” written by “Graeme

Miltonare” for symmetric stifness matrices such as C and we have to transform stress to PK2 in order to be able to use it

template<>
constexpr auto get_equation_indices() -> Equation_index_t
template<>
constexpr auto get_equation_indices() -> Equation_index_t
template<>
constexpr auto get_equation_indices() -> Equation_index_t
template<>
constexpr auto get_equation_indices() -> Equation_index_t
template<>
constexpr auto get_parallel_indices() -> Parallel_index_t
template<>
constexpr auto get_parallel_indices() -> Parallel_index_t
template<>
constexpr auto get_parallel_indices() -> Parallel_index_t
template<>
constexpr auto get_parallel_indices() -> Parallel_index_t
template<class Derived>
auto get_equation_stress(const Eigen::MatrixBase<Derived> &S_total) -> Equation_stress_t
template<class Derived>
auto get_parallel_stress(const Eigen::MatrixBase<Derived> &S_total) -> Parallel_stress_t
template<class Derived>
auto get_parallel_strain(const Eigen::MatrixBase<Derived> &E_total) -> Parallel_strain_t
template<class Derived>
auto get_equation_strain(const Eigen::MatrixBase<Derived> &E_total) -> Equation_strain_t
template<class Derived1, class Derived2>
auto linear_eqs(const Real &ratio, const Eigen::MatrixBase<Derived1> &E_0_eq, const Eigen::MatrixBase<Derived2> &E_1_eq) -> Equation_strain_t
template<class Derived1, class Derived2>
auto make_total_stress(const Eigen::MatrixBase<Derived1> &S_eq, const Eigen::MatrixBase<Derived2> &S_para) -> Stress_t

Public Static Functions

static inline constexpr Parallel_index_t get_parallel_indices()
static inline constexpr Equation_index_t get_equation_indices()
template<class Derived>
static inline Equation_strain_t get_equation_strain(const Eigen::MatrixBase<Derived> &E_total)
template<class Derived>
static inline Equation_stress_t get_equation_stress(const Eigen::MatrixBase<Derived> &S_total)
template<class Derived>
static Equation_stiffness_t get_equation_stiffness(const Eigen::MatrixBase<Derived> &C)
template<class Derived1>
static inline Parallel_strain_t get_parallel_strain(const Eigen::MatrixBase<Derived1> &E)
template<class Derived1>
static inline Parallel_stress_t get_parallel_stress(const Eigen::MatrixBase<Derived1> &S)
template<class Derived1, class Derived2>
static Strain_t make_total_strain(const Eigen::MatrixBase<Derived1> &E_eq, const Eigen::MatrixBase<Derived2> &E_para)
template<class Derived1, class Derived2>
static inline Stress_t make_total_stress(const Eigen::MatrixBase<Derived1> &S_eq, const Eigen::MatrixBase<Derived2> &S_para)
template<class Derived1, class Derived2>
static inline Equation_strain_t linear_eqs(const Real &ratio, const Eigen::MatrixBase<Derived1> &E_0, const Eigen::MatrixBase<Derived2> &E_1)
template<class Derived1, class Derived2>
static std::tuple<Equation_stress_t, Equation_stiffness_t, Real> delta_equation_stress_stiffness_eval(const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Eigen::MatrixBase<Derived1> &E_1, const Eigen::MatrixBase<Derived2> &E_2, const RotatorNormal<Dim> &rotator, const Real &ratio)

the objective in homogenisation of a single laminate pixel is equating the stress in the serial directions so the difference of stress between their layers should tend to zero. this function return the stress difference and the difference of Stiffness matrices which is used as the Jacobian in the solution process

template<class Derived1, class Derived2>
static std::tuple<Equation_stress_t, Equation_stiffness_t, Real> delta_equation_stress_stiffness_eval_strain_1(const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Eigen::MatrixBase<Derived1> &E_0, const Eigen::MatrixBase<Derived2> &E_1_rot, const RotatorNormal<Dim> &rotator, const Real &ratio)
static inline Real del_energy_eval(const Real &del_E_norm, const Real &delta_S_norm)

the following functions claculate the energy computation error of the solution. it will be used in each step of the solution to determine the relevant difference that implementation of that step has had on convergence to the solution.

template<class Derived1, class Derived2>
static Stress_t lam_stress_combine(const Eigen::MatrixBase<Derived1> &stress_1, const Eigen::MatrixBase<Derived2> &stress_2, const Real &ratio)

These functions are used as intrface for combination functions, They are also used for carrying out the stress transformation necessary for combining stifness matrix in Finite-Strain formulation because the combining formula from the bokk “Theory of Composites” are for symmetric stifness matrices such as C and we have to transform stress to PK2 in order to be able to use it

static Stiffness_t lam_stiffness_combine(const Eigen::Ref<Stiffness_t> &stiffness_1, const Eigen::Ref<Stiffness_t> &stiffness_2, const Real &ratio, const Eigen::Ref<Strain_t> &F_1, const Eigen::Ref<Stress_t> &F_2, const Eigen::Ref<Strain_t> &P_1, const Eigen::Ref<Stress_t> &P_2, const Eigen::Ref<Strain_t> &F, const Eigen::Ref<Stress_t> &P)
static std::tuple<Dim_t, Real, Strain_t, Strain_t> laminate_solver(const Eigen::Ref<Strain_t> &strain_coord, const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Real &ratio, const Eigen::Ref<Vec_t> &normal_vec, const Real tol = 1e-10, const Dim_t max_iter = 1000)

This is the main solver function that might be called staically from an external file. this will return the resultant stress and stiffness tensor according to interanl “equilibrium” of the lamiante. The inputs are : 1- global Strain 2- stress calculation function of the layer 1 3- stress calculation function of the layer 2 4- the ratio of the first material in the laminate sturucture of the pixel 5- the normal vector of the interface of two layers 6- the tolerance error for the internal solution of the laminate pixel 7- the maximum iterations for the internal solution of the laminate pixel

static Stress_t evaluate_stress(const Eigen::Ref<Strain_t> &strain_coord, const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Real &ratio, const Eigen::Ref<Vec_t> &normal_vec, const Real tol = 1e-10, const Dim_t max_iter = 1000)
static std::tuple<Stress_t, Stiffness_t> evaluate_stress_tangent(const Eigen::Ref<Strain_t> &strain_coord, const Function_t &mat_1_stress_eval, const Function_t &mat_2_stress_eval, const Real &ratio, const Eigen::Ref<Vec_t> &normal_vec, const Real tol = 1e-10, const Dim_t max_iter = 1000)
class LocalFieldCollection : public muGrid::FieldCollection

muGrid::LocalFieldCollection derives from muGrid::FieldCollection and stores local fields, i.e. fields that are only defined for a subset of all pixels/voxels in the computational domain. The coordinates of these active pixels are explicitly stored by this field collection. muGrid::LocalFieldCollection::add_pixel allows to add individual pixels/voxels to the field collection.

Public Types

using Parent = FieldCollection

alias for base class

Public Functions

LocalFieldCollection() = delete

Default constructor.

LocalFieldCollection(Dim_t spatial_dimension, Dim_t nb_quad_pts)

Constructor

Parameters
  • spatial_dimension – spatial dimension of the field (can be muGrid::Unknown, e.g., in the case of the local fields for storing internal material variables)

  • nb_quad_pts – number of quadrature points per pixel/voxel

LocalFieldCollection(const LocalFieldCollection &other) = delete

Copy constructor.

LocalFieldCollection(LocalFieldCollection &&other) = default

Move constructor.

virtual ~LocalFieldCollection() = default

Destructor.

LocalFieldCollection &operator=(const LocalFieldCollection &other) = delete

Copy assignment operator.

LocalFieldCollection &operator=(LocalFieldCollection &&other) = delete

Move assignment operator.

void add_pixel(const size_t &global_index)

Insert a new pixel/voxel into the collection.

Parameters

global_index – refers to the linear index this pixel has in the global field collection defining the problem space

void initialise()

Freeze the set of pixels this collection is responsible for and allocate memory for all fields of the collection. Fields added lateron will have their memory allocated upon construction

LocalFieldCollection get_empty_clone() const

obtain a new field collection with the same domain and pixels

inline std::map<size_t, size_t> &get_global_to_local_index_map()

Protected Attributes

std::map<size_t, size_t> global_to_local_index_map = {}
template<class FieldMapType>
class MappedField
#include <mapped_field.hh>

MappedFields are a combination of a field and an associated map, and as such it does not introduce any new functionality that Fields and FieldMaps do not already possess. They provide a convenience structure for the default use case of internal variables, which are typically used only by a single material and always the same way.

Public Types

using Scalar = typename FieldMapType::Scalar

stored scalar type

using Return_t = typename FieldMapType::template Return_t<FieldMapType::FieldMutability()>

return type for iterators over this- map

using iterator = typename FieldMapType::iterator

iterator over this map

using const_iterator = typename FieldMapType::const_iterator

constant iterator over this map

Public Functions

MappedField() = delete

Default constructor.

template<bool StaticConstructor = IsStatic(), std::enable_if_t<StaticConstructor, int> = 0>
inline MappedField(const std::string &unique_name, FieldCollection &collection)

Constructor with name and collection for statically sized mapped fields

template<bool StaticConstructor = IsStatic(), std::enable_if_t<not StaticConstructor, int> = 0>
inline MappedField(const std::string &unique_name, const Dim_t &nb_rows, const Dim_t &nb_cols, const Iteration &iter_type, FieldCollection &collection)

Constructor for dynamically sized mapped field

Parameters
  • unique_name – unique identifier for this field

  • nb_rows – number of rows for the iterates

  • nb_cols – number of columns for the iterates

  • iter_type – whether to iterate over pixels or quadrature points

  • collection – collection where the field is to be registered

MappedField(const MappedField &other) = delete

Copy constructor.

MappedField(MappedField &&other) = default

Move constructor.

virtual ~MappedField() = default

Destructor.

MappedField &operator=(const MappedField &other) = delete

Copy assignment operator.

MappedField &operator=(MappedField &&other) = default

Move assignment operator.

inline Return_t operator[](size_t index)

random access operator

inline iterator begin()

stl

inline iterator end()

stl

inline const_iterator begin() const

stl

inline const_iterator end() const

stl

inline TypedField<Scalar> &get_field()

return a reference to the mapped field

inline FieldMapType &get_map()

return a reference to the map

Public Static Functions

static inline constexpr bool IsStatic()

detemine at compile time whether the field map is statically sized

Protected Attributes

Dim_t nb_components

number of components stored per quadrature point

TypedField<Scalar> &field

reference to mapped field

FieldMapType map

associated field map

Protected Static Functions

template<bool StaticConstructor = IsStatic(), std::enable_if_t<not StaticConstructor, int> = 0>
static inline Dim_t compute_nb_components_dynamic(const Dim_t &nb_rows, const Dim_t &nb_cols, const Iteration &iter_type, const std::string &unique_name, FieldCollection &collection)

evaluate and return the number of components the dynamically mapped field needs to store per quadrature point

template<bool StaticConstructor = IsStatic(), std::enable_if_t<StaticConstructor, int> = 0>
static inline Dim_t compute_nb_components_static(const std::string &unique_name, FieldCollection &collection)

evaluate and return the number of components the statically mapped field needs to store per quadrature point

template<class StateFieldMapType>
class MappedStateField

MappedStateFields are a combination of a state field and an associated map, and as such it does not introduce any new functionality that StateFields and StateFieldMaps do not already possess. They provide a convenience structure for the default use case of internal variables, which are typically used only by a single material and always the same way.

Public Types

using Scalar = typename StateFieldMapType::Scalar

stored scalar type

using Return_t = typename StateFieldMapType::template StaticStateWrapper<StateFieldMapType::FieldMutability()>

return type for iterators over this- map

using iterator = typename StateFieldMapType::iterator

iterator over this map

using const_iterator = typename StateFieldMapType::const_iterator

constant iterator over this map

Public Functions

MappedStateField() = delete

Deleted default constructor.

inline MappedStateField(const std::string &unique_name, FieldCollection &collection)

Constructor with name and collection.

MappedStateField(const MappedStateField &other) = delete

Copy constructor.

MappedStateField(MappedStateField &&other) = default

Move constructor.

virtual ~MappedStateField() = default

Destructor.

MappedStateField &operator=(const MappedStateField &other) = delete

Copy assignment operator.

MappedStateField &operator=(MappedStateField &&other) = default

Move assignment operator.

inline Return_t operator[](size_t index)

random access operator

inline iterator begin()

stl

inline iterator end()

stl

inline const_iterator begin() const

stl

inline const_iterator end() const

stl

inline TypedStateField<Scalar> &get_state_field()

return a reference to the mapped state field

inline StateFieldMapType &get_map()

return a reference to the map

Protected Attributes

Dim_t nb_components

number of components stored per quadrature point

TypedStateField<Scalar> &state_field

ref to mapped state field

StateFieldMapType map

associated field map

Protected Static Functions

static inline Dim_t compute_nb_components(const std::string &unique_prefix, FieldCollection &collection)

evaluate and return the number of components the statically mapped state field needs to store per quadrature point

class MaterialBase
#include <material_base.hh>

base class for materials

Subclassed by muSpectre::MaterialMuSpectre< MaterialHyperElastoPlastic1< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialHyperElastoPlastic2< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearAnisotropic< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElastic1< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElastic2< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElastic3< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElastic4< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElasticGeneric1< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialLinearElasticGeneric2< DimM >, DimM >, muSpectre::MaterialMuSpectre< MaterialStochasticPlasticity< DimM >, DimM >, muSpectre::MaterialMuSpectre< STMaterialLinearElasticGeneric1< DimM, StrainM, StressM >, DimM >, muSpectre::MaterialLaminate< DimM >, muSpectre::MaterialMuSpectre< Material, DimM >

Public Types

using DynMatrix_t = Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>

Public Functions

MaterialBase() = delete

Default constructor.

MaterialBase(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &material_dimension, const Dim_t &nb_quad_pts)

Construct by name

Parameters
  • name – of the material

  • spatial_dimension – is the number of spatial dimension, i.e. the grid

  • material_dimension – is the material dimension (i.e., the dimension of constitutive law; even for e.g. two-dimensional problems the constitutive law could live in three-dimensional space for e.g. plane strain or stress problems)

  • nb_quad_pts – is the number of quadrature points per grid cell

MaterialBase(const MaterialBase &other) = delete

Copy constructor.

MaterialBase(MaterialBase &&other) = delete

Move constructor.

virtual ~MaterialBase() = default

Destructor.

MaterialBase &operator=(const MaterialBase &other) = delete

Copy assignment operator.

MaterialBase &operator=(MaterialBase &&other) = delete

Move assignment operator.

virtual void add_pixel(const size_t &pixel_index)

take responsibility for a pixel identified by its cell coordinates WARNING: this won’t work for materials with additional info per pixel (as, e.g. for eigenstrain), we need to pass more parameters. Materials of this type need to overload add_pixel

virtual void add_pixel_split(const size_t &pixel_index, const Real &ratio)
void allocate_optional_fields(SplitCell is_cell_split = SplitCell::no)
virtual void initialise()

allocate memory, etc, but also: wipe history variables!

inline virtual void save_history_variables()

for materials with state variables, these typically need to be saved/updated an the end of each load increment, the virtual base implementation does nothing, but materials with history variables need to implement this

const std::string &get_name() const

return the material’s name

inline Dim_t get_material_dimension()

material dimension for inheritance

virtual void compute_stresses(const muGrid::RealField &F, muGrid::RealField &P, const Formulation &form, SplitCell is_cell_split = SplitCell::no) = 0

computes stress

void compute_stresses(const muGrid::Field &F, muGrid::Field &P, const Formulation &form, SplitCell is_cell_split = SplitCell::no)

Convenience function to compute stresses, mostly for debugging and testing. Has runtime-cost associated with compatibility-checking and conversion of the Field_t arguments that can be avoided by using the version with strongly typed field references

virtual void compute_stresses_tangent(const muGrid::RealField &F, muGrid::RealField &P, muGrid::RealField &K, const Formulation &form, SplitCell is_cell_split = SplitCell::no) = 0

computes stress and tangent moduli

void compute_stresses_tangent(const muGrid::Field &F, muGrid::Field &P, muGrid::Field &K, Formulation form, SplitCell is_cell_split = SplitCell::no)

Convenience function to compute stresses and tangent moduli, mostly for debugging and testing. Has runtime-cost associated with compatibility-checking and conversion of the Field_t arguments that can be avoided by using the version with strongly typed field references

Real get_assigned_ratio(const size_t &pixel_id)
void get_assigned_ratios(std::vector<Real> &pixel_assigned_ratios)
muGrid::RealField &get_assigned_ratio_field()
muGrid::LocalFieldCollection::PixelIndexIterable get_pixel_indices() const

return and iterable proxy over the indices of this material’s pixels

muGrid::LocalFieldCollection::IndexIterable get_quad_pt_indices() const

return and iterable proxy over the indices of this material’s quadrature points

inline Dim_t size() const

number of quadrature points assigned to this material

std::vector<std::string> list_fields() const

list the names of all internal fields

inline muGrid::LocalFieldCollection &get_collection()

gives access to internal fields

virtual std::tuple<DynMatrix_t, DynMatrix_t> constitutive_law_dynamic(const Eigen::Ref<const DynMatrix_t> &strain, const size_t &quad_pt_index, const Formulation &form) = 0

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

Protected Attributes

const std::string name

material’s name (for output and debugging)

muGrid::LocalFieldCollection internal_fields

storage for internal variables

Dim_t material_dimension

spatial dimension of the material

field holding the assigned ratios of the material

std::unique_ptr<muGrid::MappedScalarField<Real, muGrid::Mapping::Mut>> assigned_ratio = {nullptr}
bool is_initialised = {false}
class MaterialError : public runtime_error
#include <material_base.hh>

base class for material-related exceptions

Public Functions

inline explicit MaterialError(const std::string &what)

constructor

inline explicit MaterialError(const char *what)

constructor

template<Dim_t DimM>
class MaterialEvaluator

Small convenience class providing a common interface to evaluate materials without the need to set up an entire homogenisation problem. Useful for debugging material laws.

Template Parameters

DimM – Dimensionality of the material

Public Types

using T2_t = Eigen::Matrix<Real, DimM, DimM>

shorthand for second-rank tensors

using T4_t = muGrid::T4Mat<Real, DimM>

shorthand for fourth-rank tensors

using T2_map = Eigen::Map<T2_t>

map of a second-rank tensor

using T4_map = muGrid::T4MatMap<Real, DimM>

map of a fourth-rank tensor

using T2_const_map = Eigen::Map<const T2_t>

const map of a second-rank tensor

using T4_const_map = muGrid::T4MatMap<Real, DimM, true>

const map of a fourth-rank tensor

using FieldColl_t = muGrid::GlobalFieldCollection

convenience alias

Public Functions

MaterialEvaluator() = delete

Default constructor.

inline explicit MaterialEvaluator(std::shared_ptr<MaterialBase> material)

constructor with a shared pointer to a Material

MaterialEvaluator(const MaterialEvaluator &other) = delete

Copy constructor.

MaterialEvaluator(MaterialEvaluator &&other) = default

Move constructor.

virtual ~MaterialEvaluator() = default

Destructor.

MaterialEvaluator &operator=(const MaterialEvaluator &other) = delete

Copy assignment operator.

MaterialEvaluator &operator=(MaterialEvaluator &&other) = default

Move assignment operator.

inline void save_history_variables()

for materials with state variables. See muSpectre::MaterialBase for details

inline T2_const_map evaluate_stress(const Eigen::Ref<const T2_t> &grad, const Formulation &form)

Evaluates the underlying materials constitutive law and returns the stress P or σ as a function of the placement gradient F or small strain tensor ε depending on the formulation (muSpectre::Formulation::small_strain for σ(ε), muSpectre::Formulation::finite_strain for P(F))

inline std::tuple<T2_const_map, T4_const_map> evaluate_stress_tangent(const Eigen::Ref<const T2_t> &grad, const Formulation &form)

Evaluates the underlying materials constitutive law and returns the the stress P or σ and the tangent moduli K as a function of the placement gradient F or small strain tensor ε depending on the formulation (muSpectre::Formulation::small_strain for σ(ε), muSpectre::Formulation::finite_strain for P(F))

inline T4_t estimate_tangent(const Eigen::Ref<const T2_t> &grad, const Formulation &form, const Real step, const FiniteDiff diff_type = FiniteDiff::centred)

estimate the tangent using finite difference

inline void initialise()

initialise the material and the fields

Protected Functions

void check_init()

throws a runtime error if the material’s per-pixel data has not been set.

Protected Attributes

std::shared_ptr<MaterialBase> material

storage of the material is managed through a shared pointer

std::unique_ptr<FieldColl_t> collection

storage of the strain, stress and tangent fields is managed through a unique pointer

muGrid::MappedT2Field<Real, Mapping::Mut, DimM> strain

strain field (independent variable)

muGrid::MappedT2Field<Real, Mapping::Mut, DimM> stress

stress field (result)

muGrid::MappedT4Field<Real, Mapping::Mut, DimM> tangent

field of tangent moduli (result)

bool is_initialised = {false}

whether the evaluator has been initialised

template<Dim_t DimM>
class MaterialHyperElastoPlastic1 : public muSpectre::MaterialMuSpectre<MaterialHyperElastoPlastic1<DimM>, DimM>

material implementation for hyper-elastoplastic constitutive law. Note for developpers: this law is tested against a reference python implementation in py_comparison_test_material_hyper_elasto_plastic1.py

Public Types

using Parent = MaterialMuSpectre<MaterialHyperElastoPlastic1<DimM>, DimM>

base class

using T2_t = Eigen::Matrix<Real, DimM, DimM>

short-hand for second-rank tensors

using T4_t = muGrid::T4Mat<Real, DimM>

short-hand for fourth-rank tensors

using traits = MaterialMuSpectre_traits<MaterialHyperElastoPlastic1>

shortcut to traits

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

using T2StRef_t = typename muGrid::MappedT2StateField<Real, Mapping::Mut, DimM>::Return_t

type in which the previous strain state is referenced

using ScalarStRef_t = typename muGrid::MappedScalarStateField<Real, Mapping::Mut>::Return_t

type in which the previous plastic flow is referenced

Public Functions

MaterialHyperElastoPlastic1() = delete

Default constructor.

MaterialHyperElastoPlastic1(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const Real &young, const Real &poisson, const Real &tau_y0, const Real &H)

Constructor with name and material properties.

MaterialHyperElastoPlastic1(const MaterialHyperElastoPlastic1 &other) = delete

Copy constructor.

MaterialHyperElastoPlastic1(MaterialHyperElastoPlastic1 &&other) = delete

Move constructor.

virtual ~MaterialHyperElastoPlastic1() = default

Destructor.

MaterialHyperElastoPlastic1 &operator=(const MaterialHyperElastoPlastic1 &other) = delete

Copy assignment operator.

MaterialHyperElastoPlastic1 &operator=(MaterialHyperElastoPlastic1 &&other) = delete

Move assignment operator.

T2_t evaluate_stress(const T2_t &F, T2StRef_t F_prev, T2StRef_t be_prev, ScalarStRef_t plast_flow)

evaluates Kirchhoff stress given the current placement gradient Fₜ, the previous Gradient Fₜ₋₁ and the cumulated plastic flow εₚ

inline T2_t evaluate_stress(const T2_t &F, const size_t &quad_pt_index)

evaluates Kirchhoff stress given the local placement gradient and pixel id.

std::tuple<T2_t, T4_t> evaluate_stress_tangent(const T2_t &F, T2StRef_t F_prev, T2StRef_t be_prev, ScalarStRef_t plast_flow)

evaluates Kirchhoff stress and tangent moduli given the current placement gradient Fₜ, the previous Gradient Fₜ₋₁ and the cumulated plastic flow εₚ

inline std::tuple<T2_t, T4_t> evaluate_stress_tangent(const T2_t &F, const size_t &quad_pt_index)

evaluates Kirchhoff stressstiffness and tangent moduli given the local placement gradient and pixel id.

virtual void save_history_variables() override

The statefields need to be cycled at the end of each load increment

virtual void initialise() final

set the previous gradients to identity

inline muGrid::MappedScalarStateField<Real, Mapping::Mut> &get_plast_flow_field()

getter for internal variable field εₚ

inline muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> &get_F_prev_field()

getter for previous gradient field Fᵗ

inline muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> &get_be_prev_field()

getterfor elastic left Cauchy-Green deformation tensor bₑᵗ

Protected Types

using Worker_t = std::tuple<T2_t, Real, Real, T2_t, bool, muGrid::Decomp_t<DimM>>

result type of the stress calculation with intermediate results for tangent moduli calculation

Protected Functions

Worker_t stress_n_internals_worker(const T2_t &F, T2StRef_t &F_prev, T2StRef_t &be_prev, ScalarStRef_t &plast_flow)

worker function computing stresses and internal variables

Protected Attributes

muGrid::MappedScalarStateField<Real, Mapping::Mut> plast_flow_field

storage for cumulated plastic flow εₚ

muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> F_prev_field

storage for previous gradient Fᵗ

muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> be_prev_field

storage for elastic left Cauchy-Green deformation tensor bₑᵗ

const Real young

Young’s modulus.

const Real poisson

Poisson’s ratio.

const Real lambda

first Lamé constant

const Real mu

second Lamé constant (shear modulus)

const Real K

Bulk modulus.

const Real tau_y0

initial yield stress

const Real H

hardening modulus

std::unique_ptr<const muGrid::T4Mat<Real, DimM>> C_holder

stiffness tensor

const muGrid::T4Mat<Real, DimM> &C

ref to elastic tensor

template<Dim_t DimM>
class MaterialHyperElastoPlastic2 : public muSpectre::MaterialMuSpectre<MaterialHyperElastoPlastic2<DimM>, DimM>

material implementation for hyper-elastoplastic constitutive law.

Public Types

using Parent = MaterialMuSpectre<MaterialHyperElastoPlastic2<DimM>, DimM>

base class

using T2_t = Eigen::Matrix<Real, DimM, DimM>
using T4_t = muGrid::T4Mat<Real, DimM>
using traits = MaterialMuSpectre_traits<MaterialHyperElastoPlastic2>

shortcut to traits

using Field_t = muGrid::MappedScalarField<Real, Mapping::Const>

storage type for scalar material constant fields

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

using FlowField_t = muGrid::MappedScalarStateField<Real, Mapping::Mut>
using FlowField_ref = typename FlowField_t::Return_t
using PrevStrain_t = muGrid::MappedT2StateField<Real, Mapping::Mut, DimM>
using PrevStrain_ref = typename PrevStrain_t::Return_t

Public Functions

MaterialHyperElastoPlastic2() = delete

Default constructor.

MaterialHyperElastoPlastic2(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Constructor with name.

MaterialHyperElastoPlastic2(const MaterialHyperElastoPlastic2 &other) = delete

Copy constructor.

MaterialHyperElastoPlastic2(MaterialHyperElastoPlastic2 &&other) = delete

Move constructor.

virtual ~MaterialHyperElastoPlastic2() = default

Destructor.

MaterialHyperElastoPlastic2 &operator=(const MaterialHyperElastoPlastic2 &other) = delete

Copy assignment operator.

MaterialHyperElastoPlastic2 &operator=(MaterialHyperElastoPlastic2 &&other) = delete

Move assignment operator.

T2_t evaluate_stress(const T2_t &F, PrevStrain_ref F_prev, PrevStrain_ref be_prev, FlowField_ref plast_flow, const Real lambda, const Real mu, const Real tau_y0, const Real H)

evaluates Kirchhoff stress given the current placement gradient Fₜ, the previous Gradient Fₜ₋₁ and the cumulated plastic flow εₚ

inline T2_t evaluate_stress(const T2_t &F, const size_t &pixel_index)

evaluates Kirchhoff stress given the local placement gradient and pixel id.

std::tuple<T2_t, T4_t> evaluate_stress_tangent(const T2_t &F, PrevStrain_ref F_prev, PrevStrain_ref be_prev, FlowField_ref plast_flow, const Real lambda, const Real mu, const Real tau_y0, const Real H, const Real K)

evaluates Kirchhoff stress and tangent moduli given the current placement gradient Fₜ, the previous Gradient Fₜ₋₁ and the cumulated plastic flow εₚ

inline std::tuple<T2_t, T4_t> evaluate_stress_tangent(const T2_t &F, const size_t &pixel_index)

evaluates Kirchhoff stressstiffness and tangent moduli given the local placement gradient and pixel id.

virtual void save_history_variables() override

The statefields need to be cycled at the end of each load increment

virtual void initialise() final

set the previous gradients to identity

virtual void add_pixel(const size_t &pixel_id) final

overload add_pixel to write into loacal stiffness tensor

void add_pixel(const size_t &pixel_id, const Real &Youngs_modulus, const Real &Poisson_ratio, const Real &tau_y0, const Real &H)

overload add_pixel to write into local stiffness tensor

inline muGrid::MappedScalarStateField<Real, Mapping::Mut> &get_plast_flow_field()

getter for internal variable field εₚ

inline muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> &get_F_prev_field()

getter for previous gradient field Fᵗ

inline muGrid::MappedT2StateField<Real, Mapping::Mut, DimM> &get_be_prev_field()

getterfor elastic left Cauchy-Green deformation tensor bₑᵗ

Protected Types

using Worker_t = std::tuple<T2_t, Real, Real, T2_t, bool, muGrid::Decomp_t<DimM>>

worker function computing stresses and internal variables

Protected Functions

Worker_t stress_n_internals_worker(const T2_t &F, PrevStrain_ref &F_prev, PrevStrain_ref &be_prev, FlowField_ref &plast_flow, const Real lambda, const Real mu, const Real tau_y0, const Real H)

Protected Attributes

FlowField_t plast_flow_field

storage for cumulated plastic flow εₚ

PrevStrain_t F_prev_field

storage for previous gradient Fᵗ

PrevStrain_t be_prev_field

storage for elastic left Cauchy-Green deformation tensor bₑᵗ

Field_t lambda_field

storage for first Lamé constant λ

Field_t mu_field

storage for second Lamé constant (shear modulus) μ

Field_t tau_y0_field

storage for initial yield stress

Field_t H_field

storage for hardening modulus

Field_t K_field

storage for Bulk modulus

template<Dim_t DimM>
class MaterialLaminate : public muSpectre::MaterialBase

Public Types

using Parent = MaterialBase

base class

using RealField = muGrid::RealField
using DynMatrix_t = Parent::DynMatrix_t
using MatBase_t = MaterialBase
using MatPtr_t = std::shared_ptr<MatBase_t>
using T2_t = Eigen::Matrix<Real, DimM, DimM>
using T4_t = muGrid::T4Mat<Real, DimM>
using VectorField_t = muGrid::RealField
using MappedVectorField_t = muGrid::MappedT1Field<Real, Mapping::Mut, DimM>
using VectorFieldMap_t = muGrid::T1FieldMap<Real, Mapping::Mut, DimM>
using ScalarField_t = muGrid::RealField
using MappedScalarField_t = muGrid::MappedScalarField<Real, Mapping::Mut>
using ScalarFieldMap_t = muGrid::ScalarFieldMap<Real, Mapping::Mut>
using Strain_t = Eigen::Matrix<Real, DimM, DimM>
using Stress_t = Strain_t
using Stiffness_t = muGrid::T4Mat<Real, DimM>
using NeedTangent = MatTB::NeedTangent

type used to determine whether the muSpectre::MaterialMuSpectre::iterable_proxy evaluate only stresses or also tangent stiffnesses

using traits = MaterialMuSpectre_traits<MaterialLaminate>

traits of this material

Public Functions

MaterialLaminate() = delete

Default constructor.

MaterialLaminate(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Constructor with name and material properties.

MaterialLaminate(const MaterialLaminate &other) = delete

Copy constructor.

MaterialLaminate(MaterialLaminate &&other) = delete

Move constructor.

virtual ~MaterialLaminate() = default

Destructor.

template<typename Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &pixel_index, const Formulation &form)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor)

template<typename Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t &pixel_index, const Formulation &form)

evaluates second Piola-Kirchhoff stress and its corresponding tangent given the Green-Lagrange strain (or Cauchy stress and its corresponding tangetn if called with a small strain tensor)

template<Formulation Form, class Strains, class Stresses>
void constitutive_law(const Strains &strains, Stresses &stress, const size_t &quad_pt_id)
template<Formulation Form, class Strains, class Stresses>
void constitutive_law(const Strains &strains, Stresses &stress, const size_t &quad_pt_id, const Real &ratio)
template<Formulation Form, class Strains, class Stresses>
void constitutive_law_tangent(const Strains &strains, Stresses &stresses, const size_t &quad_pt_id)
template<Formulation Form, class Strains, class Stresses>
void constitutive_law_tangent(const Strains &strains, Stresses &stresses, const size_t &quad_pt_id, const Real &ratio)
template<Formulation Form, class Strains_t>
decltype(auto) constitutive_law(const Strains_t &Strains, const size_t &quad_pt_id)
template<Formulation Form, class Strains_t>
decltype(auto) constitutive_law_tangent(const Strains_t &Strains, const size_t &quad_pt_id)
virtual void compute_stresses(const RealField &F, RealField &P, const Formulation &form, SplitCell is_cell_split) final

computes stress

virtual void compute_stresses_tangent(const RealField &F, RealField &P, RealField &K, const Formulation &form, SplitCell is_cell_split) final

stress and tangent modulus

virtual void add_pixel(const size_t &pixel_id) final

overload add_pixel to write into volume ratio and normal vectors and …

void add_pixel(const size_t &pixel_id, MatPtr_t mat1, MatPtr_t mat2, const Real &ratio, const Eigen::Ref<const Eigen::Matrix<Real, Eigen::Dynamic, 1>> &normal_Vector)

overload add_pixel to add underlying materials and their ratio and interface direction to the material lamiante

void add_pixels_precipitate(const std::vector<Ccoord_t<DimM>> &intersected_pixels, const std::vector<Dim_t> &intersected_pixels_id, const std::vector<Real> &intersection_ratios, const std::vector<Eigen::Matrix<Real, DimM, 1>> &intersection_normals, MatPtr_t mat1, MatPtr_t mat2)

This function adds pixels according to the precipitate intersected pixels and the materials incolved

virtual std::tuple<DynMatrix_t, DynMatrix_t> constitutive_law_dynamic(const Eigen::Ref<const DynMatrix_t> &strain, const size_t &pixel_index, const Formulation &form) final

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

Public Static Functions

static MaterialLaminate<DimM> &make(Cell &cell, const std::string &name)

Factory.

template<class ...ConstructorArgs>
static std::tuple<std::shared_ptr<MaterialLaminate<DimM>>, MaterialEvaluator<DimM>> make_evaluator(ConstructorArgs&&... args)

Protected Functions

template<Formulation Form, SplitCell IsCellSplit>
inline void compute_stresses_worker(const RealField &F, RealField &P) __attribute__((visibility("default")))

computes stress with the formulation available at compile time attribute required by g++-6 and g++-7 because of this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947

template<Formulation Form, SplitCell IsCellSplit>
inline void compute_stresses_worker(const RealField &F, RealField &P, RealField &K) __attribute__((visibility("default")))

computes stress with the formulation available at compile time attribute required by g++-6 and g++-7 because of this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947

Protected Attributes

MappedVectorField_t normal_vector_field

field holding the normal vector of the interface of the layers

MappedScalarField_t volume_ratio_field

field holding the normal vector

std::vector<MatPtr_t> material_left_vector = {}
std::vector<MatPtr_t> material_right_vector = {}
template<Dim_t DimM>
class MaterialLinearAnisotropic : public muSpectre::MaterialMuSpectre<MaterialLinearAnisotropic<DimM>, DimM>

Material implementation for anisotropic constitutive law

Subclassed by muSpectre::MaterialLinearOrthotropic< DimM >

Public Types

using Parent = MaterialMuSpectre<MaterialLinearAnisotropic, DimM>

base class

using Stiffness_t = muGrid::T4Mat<Real, DimM>
using traits = MaterialMuSpectre_traits<MaterialLinearAnisotropic>

traits of this material

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

Public Functions

MaterialLinearAnisotropic() = delete

Default constructor.

MaterialLinearAnisotropic(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const std::vector<Real> &input_c)
MaterialLinearAnisotropic(const MaterialLinearAnisotropic &other) = delete

Copy constructor.

MaterialLinearAnisotropic(MaterialLinearAnisotropic &&other) = delete

Move constructor.

virtual ~MaterialLinearAnisotropic() = default

Destructor.

template<class s_t>
inline auto evaluate_stress(s_t &&E) -> decltype(auto)
template<class s_t>
inline auto evaluate_stress(s_t &&E, const size_t&) -> decltype(auto)
template<class s_t>
inline auto evaluate_stress_tangent(s_t &&E) -> decltype(auto)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor) and the local stiffness tensor.

template<class s_t>
inline auto evaluate_stress_tangent(s_t &&E, const size_t&) -> decltype(auto)

Public Static Functions

static auto c_maker(std::vector<Real> input) -> Stiffness_t

Protected Attributes

std::unique_ptr<Stiffness_t> C_holder
Stiffness_t &C

memory for stiffness tensor

stiffness tensor

template<Dim_t DimM>
class MaterialLinearElastic1 : public muSpectre::MaterialMuSpectre<MaterialLinearElastic1<DimM>, DimM>

DimM material_dimension (dimension of constitutive law)

implements objective linear elasticity

Public Types

using Parent = MaterialMuSpectre<MaterialLinearElastic1, DimM>

base class

using Stiffness_t = T4Mat<Real, DimM>

short hand for the type of the elastic tensor

using traits = MaterialMuSpectre_traits<MaterialLinearElastic1>

traits of this material

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

Public Functions

MaterialLinearElastic1() = delete

Default constructor.

MaterialLinearElastic1(const MaterialLinearElastic1 &other) = delete

Copy constructor.

MaterialLinearElastic1(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const Real &young, const Real &poisson)

Construct by name, Young’s modulus and Poisson’s ratio.

MaterialLinearElastic1(MaterialLinearElastic1 &&other) = delete

Move constructor.

virtual ~MaterialLinearElastic1() = default

Destructor.

MaterialLinearElastic1 &operator=(const MaterialLinearElastic1 &other) = delete

Copy assignment operator.

MaterialLinearElastic1 &operator=(MaterialLinearElastic1 &&other) = delete

Move assignment operator.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t&)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor)

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t&)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t&) -> decltype(auto)
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t&) -> decltype(auto)

Protected Attributes

const Real young

Young’s modulus.

const Real poisson

Poisson’s ratio.

const Real lambda

first Lamé constant

const Real mu

second Lamé constant (shear modulus)

std::unique_ptr<const Stiffness_t> C_holder

stiffness tensor

const Stiffness_t &C

ref to stiffness tensor

template<Dim_t DimM>
class MaterialLinearElastic2 : public muSpectre::MaterialMuSpectre<MaterialLinearElastic2<DimM>, DimM>

implements objective linear elasticity with an eigenstrain per pixel

Public Types

using Parent = MaterialMuSpectre<MaterialLinearElastic2, DimM>

base class

using traits = MaterialMuSpectre_traits<MaterialLinearElastic2>

traits of this material

using StrainTensor = Eigen::Ref<const Eigen::Matrix<Real, DimM, DimM>>

reference to any type that casts to a matrix

Public Functions

MaterialLinearElastic2() = delete

Default constructor.

MaterialLinearElastic2(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, Real young, Real poisson)

Construct by name, Young’s modulus and Poisson’s ratio.

MaterialLinearElastic2(const MaterialLinearElastic2 &other) = delete

Copy constructor.

MaterialLinearElastic2(MaterialLinearElastic2 &&other) = delete

Move constructor.

virtual ~MaterialLinearElastic2() = default

Destructor.

MaterialLinearElastic2 &operator=(const MaterialLinearElastic2 &other) = delete

Copy assignment operator.

MaterialLinearElastic2 &operator=(MaterialLinearElastic2 &&other) = delete

Move assignment operator.

template<class s_t>
inline decltype(auto) evaluate_stress(s_t &&E, const size_t &quad_pt_index)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor)

template<class s_t>
inline decltype(auto) evaluate_stress_tangent(s_t &&E, const size_t &quad_pt_index)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

virtual void add_pixel(const size_t &pixel_index) final

overload add_pixel to write into eigenstrain

void add_pixel(const size_t &pixel_index, const StrainTensor &E_eig)

overload add_pixel to write into eigenstrain

template<class s_t>
auto evaluate_stress(s_t &&E, const size_t &quad_pt_index) -> decltype(auto)
template<class s_t>
auto evaluate_stress_tangent(s_t &&E, const size_t &quad_pt_index) -> decltype(auto)

Protected Attributes

MaterialLinearElastic1<DimM> material

linear material without eigenstrain used to compute response

muGrid::MappedT2Field<Real, Mapping::Const, DimM> eigen_strains

storage for eigenstrain

template<Dim_t DimM>
class MaterialLinearElastic3 : public muSpectre::MaterialMuSpectre<MaterialLinearElastic3<DimM>, DimM>

implements objective linear elasticity with an eigenstrain per pixel

Public Types

using Parent = MaterialMuSpectre<MaterialLinearElastic3, DimM>

base class

using NeedTangent = typename Parent::NeedTangent

type used to determine whether the muSpectre::MaterialMuSpectre::iterable_proxy evaluate only stresses or also tangent stiffnesses

using traits = MaterialMuSpectre_traits<MaterialLinearElastic3>

global field collection

traits of this material

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

using StiffnessField_t = muGrid::MappedT4Field<Real, Mapping::Const, DimM>

short hand for storage type of elastic tensors

Public Functions

MaterialLinearElastic3() = delete

Default constructor.

MaterialLinearElastic3(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Construct by name.

MaterialLinearElastic3(const MaterialLinearElastic3 &other) = delete

Copy constructor.

MaterialLinearElastic3(MaterialLinearElastic3 &&other) = delete

Move constructor.

virtual ~MaterialLinearElastic3() = default

Destructor.

MaterialLinearElastic3 &operator=(const MaterialLinearElastic3 &other) = delete

Copy assignment operator.

MaterialLinearElastic3 &operator=(MaterialLinearElastic3 &&other) = delete

Move assignment operator.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const typename StiffnessField_t::Return_t &C)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor) and the local stiffness tensor.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor) and the local pixel id.

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const typename StiffnessField_t::Return_t &C)

evaluates both second Piola-Kirchhoff stress and tangent moduli given the Green-Lagrange strain (or Cauchy stress and tangent moduli if called with a small strain tensor) and the local tangent moduli tensor.

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates both second Piola-Kirchhoff stress and tangent moduli given the Green-Lagrange strain (or Cauchy stress and tangent moduli if called with a small strain tensor) and the local pixel id.

virtual void add_pixel(const size_t &pixel_index) final

overload add_pixel to write into loacal stiffness tensor

void add_pixel(const size_t &pixel_index, const Real &Young, const Real &PoissonRatio)

overload add_pixel to write into local stiffness tensor

template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &E, const typename StiffnessField_t::Return_t &C) -> decltype(auto)
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const typename StiffnessField_t::Return_t &C) -> decltype(auto)

Protected Attributes

StiffnessField_t C_field

storage for stiffness tensor

template<Dim_t DimM>
class MaterialLinearElastic4 : public muSpectre::MaterialMuSpectre<MaterialLinearElastic4<DimM>, DimM>

implements objective linear elasticity with an eigenstrain per pixel

Public Types

using Parent = MaterialMuSpectre<MaterialLinearElastic4, DimM>

base class

using NeedTangent = typename Parent::NeedTangent

type used to determine whether the muSpectre::MaterialMuSpectre::iterable_proxy evaluate only stresses or also tangent stiffnesses

using Stiffness_t = Eigen::TensorFixedSize<Real, Eigen::Sizes<DimM, DimM, DimM, DimM>>

global field collection

using traits = MaterialMuSpectre_traits<MaterialLinearElastic4>

traits of this material

using Field_t = muGrid::MappedScalarField<Real, Mapping::Const>

storage type for Lamé constants

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

Public Functions

MaterialLinearElastic4() = delete

Default constructor.

explicit MaterialLinearElastic4(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Construct by name.

MaterialLinearElastic4(const MaterialLinearElastic4 &other) = delete

Copy constructor.

MaterialLinearElastic4(MaterialLinearElastic4 &&other) = delete

Move constructor.

virtual ~MaterialLinearElastic4() = default

Destructor.

MaterialLinearElastic4 &operator=(const MaterialLinearElastic4 &other) = delete

Copy assignment operator.

MaterialLinearElastic4 &operator=(MaterialLinearElastic4 &&other) = delete

Move assignment operator.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const Real &lambda, const Real &mu)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor), the first Lame constant (lambda) and the second Lame constant (shear modulus/mu).

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor), and the local pixel id.

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const Real &lambda, const Real &mu)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor), the first Lame constant (lambda) and the second Lame constant (shear modulus/mu).

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and tangent moduli if called with a small strain tensor), and the local pixel id.

virtual void add_pixel(const size_t &pixel_index) final

overload add_pixel to write into loacal stiffness tensor

void add_pixel(const size_t &pixel_index, const Real &Youngs_modulus, const Real &Poisson_ratio)

overload add_pixel to write into local stiffness tensor

template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &E, const Real &lambda, const Real &mu) -> decltype(auto)
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const Real &lambda, const Real &mu) -> decltype(auto)

Protected Attributes

Field_t lambda_field

storage for first Lamé constant λ

Field_t mu_field

storage for second Lamé constant (shear modulus) μ

template<Dim_t DimM>
class MaterialLinearElasticGeneric1 : public muSpectre::MaterialMuSpectre<MaterialLinearElasticGeneric1<DimM>, DimM>

forward declaration

Linear elastic law defined by a full stiffness tensor. Very generic, but not most efficient. Note: it is template by ImpMaterial to make other materials to inherit form this class without any malfunctioning. i.e. the typeof classes inherits from this class will be passed to MaterialMuSpectre and MAterialMuSpectre will be able to access their types and methods directly without any interference of MaterialLinearElasticGeneric1.

Public Types

using Parent = MaterialMuSpectre<MaterialLinearElasticGeneric1<DimM>, DimM>

parent type

using CInput_t = Eigen::Ref<Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>, 0, Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>>

generic input tolerant to python input

Public Functions

MaterialLinearElasticGeneric1() = delete

Default constructor.

MaterialLinearElasticGeneric1(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const CInput_t &C_voigt)

Constructor by name and stiffness tensor.

Parameters
  • name – unique material name

  • spatial_dimension – spatial dimension of the problem. This corresponds to the dimensionality of the Cell

  • nb_quad_pts – number of quadrature points per pixel

  • C_voigt – elastic tensor in Voigt notation

MaterialLinearElasticGeneric1(const MaterialLinearElasticGeneric1 &other) = delete

Copy constructor.

MaterialLinearElasticGeneric1(MaterialLinearElasticGeneric1 &&other) = delete

Move constructor.

virtual ~MaterialLinearElasticGeneric1() = default

Destructor.

MaterialLinearElasticGeneric1 &operator=(const MaterialLinearElasticGeneric1 &other) = delete

Copy assignment operator.

MaterialLinearElasticGeneric1 &operator=(MaterialLinearElasticGeneric1 &&other) = delete

Move assignment operator.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index = 0)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor). Note: the pixel index is ignored.

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index = 0)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor). Note: the pixel index is ignored.

inline const muGrid::T4Mat<Real, DimM> &get_C() const

return a reference to the stiffness tensor

template<class Derived1, class Derived2>
void make_C_from_C_voigt(const Eigen::MatrixBase<Derived1> &C_voigt, Eigen::MatrixBase<Derived2> &C_holder)
template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t&) -> decltype(auto)
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t&) -> decltype(auto)

Protected Attributes

std::unique_ptr<muGrid::T4Mat<Real, DimM>> C_holder
const muGrid::T4Mat<Real, DimM> &C

stiffness tensor

template<Dim_t DimM>
class MaterialLinearElasticGeneric2 : public muSpectre::MaterialMuSpectre<MaterialLinearElasticGeneric2<DimM>, DimM>

forward declaration

Implementation proper of the class

Public Functions

MaterialLinearElasticGeneric2() = delete

Default constructor.

MaterialLinearElasticGeneric2(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const CInput_t &C_voigt)

Construct by name and elastic stiffness tensor.

MaterialLinearElasticGeneric2(const MaterialLinearElasticGeneric2 &other) = delete

Copy constructor.

MaterialLinearElasticGeneric2(MaterialLinearElasticGeneric2 &&other) = default

Move constructor.

virtual ~MaterialLinearElasticGeneric2() = default

Destructor.

MaterialLinearElasticGeneric2 &operator=(const MaterialLinearElasticGeneric2 &other) = delete

Copy assignment operator.

MaterialLinearElasticGeneric2 &operator=(MaterialLinearElasticGeneric2 &&other) = default

Move assignment operator.

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const Eigen::Map<const Eigen::Matrix<Real, DimM, DimM>> &E_eig)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor)

template<class Derived>
inline decltype(auto) evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor) and the local pixel id

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const Eigen::Map<const Eigen::Matrix<Real, DimM, DimM>> &E_eig)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

template<class Derived>
inline decltype(auto) evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index)

evaluates both second Piola-Kirchhoff stress and tangent moduli given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor) and the local pixel id

inline const muGrid::T4Mat<Real, DimM> &get_C() const

return a reference to the stiffness tensor

virtual void add_pixel(const size_t &pixel_index) final

overload add_pixel to write into eigenstrain

void add_pixel(const size_t &pixel_index, const StrainTensor &E_eig)

overload add_pixel to write into eigenstrain

template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &E, const Eigen::Map<const Eigen::Matrix<Real, DimM, DimM>> &E_eig) -> decltype(auto)
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &E, const Eigen::Map<const Eigen::Matrix<Real, DimM, DimM>> &E_eig) -> decltype(auto)

Protected Attributes

Law_t worker

elastic law without eigenstrain used as worker

muGrid::MappedT2Field<Real, Mapping::Const, DimM> eigen_field

storage for eigenstrain

underlying law to be evaluated

Private Types

using Parent = MaterialMuSpectre<MaterialLinearElasticGeneric2<DimM>, DimM>

parent type

using Law_t = MaterialLinearElasticGeneric1<DimM>

underlying worker class

using CInput_t = typename Law_t::CInput_t

generic input tolerant to python input

using StrainTensor = Eigen::Ref<Eigen::Matrix<Real, DimM, DimM>>

reference to any type that casts to a matrix

using traits = MaterialMuSpectre_traits<MaterialLinearElasticGeneric2>

traits of this material

template<Dim_t DimM>
class MaterialLinearOrthotropic : public muSpectre::MaterialLinearAnisotropic<DimM>

Material implementation for orthotropic constitutive law

Public Types

using Parent = MaterialLinearAnisotropic<DimM>

base class

using Stiffness_t = muGrid::T4Mat<Real, DimM>
using traits = MaterialMuSpectre_traits<MaterialLinearOrthotropic>

traits of this material

Public Functions

MaterialLinearOrthotropic() = delete

Default constructor.

MaterialLinearOrthotropic(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const std::vector<Real> &input)
MaterialLinearOrthotropic(const MaterialLinearOrthotropic &other) = delete

Copy constructor.

MaterialLinearOrthotropic(MaterialLinearOrthotropic &&other) = delete

Move constructor.

virtual ~MaterialLinearOrthotropic() = default

Destructor.

Public Static Functions

static MaterialLinearOrthotropic<DimM> &make(Cell &cell, const std::string &name, const std::vector<Real> &input)

make function needs to be overloaded, because this class does not directly inherit from MaterialMuSpectre. If this overload is not made, calls to make for MaterialLinearOrthotropic would call the constructor for MaterialLinearAnisotropic

Protected Functions

std::vector<Real> input_c_maker(const std::vector<Real> &input)
template<> std::array< bool, 6 > ret_flag
template<> std::array< bool, 21 > ret_flag

Protected Static Attributes

static constexpr std::array<std::size_t, 2> output_size = {6, 21}

these variable are used to determine which elements of the stiffness matrix should be replaced with the inpts for the orthotropic material

static std::array<bool, output_size[DimM - 2]> ret_flag
template<class Material, Dim_t DimM>
class MaterialMuSpectre : public muSpectre::MaterialBase

material traits are used by muSpectre::MaterialMuSpectre to break the circular dependence created by the curiously recurring template parameter. These traits must define

  • these muSpectre::FieldMaps:

    • StrainMap_t: typically a muSpectre::MatrixFieldMap for a constant second-order muSpectre::TensorField

    • StressMap_t: typically a muSpectre::MatrixFieldMap for a writable secord-order muSpectre::TensorField

    • TangentMap_t: typically a muSpectre::T4MatrixFieldMap for a writable fourth-order muSpectre::TensorField

  • strain_measure: the expected strain type (will be replaced by the small-strain tensor ε muspectre::StrainMeasure::Infinitesimal in small strain computations)

  • stress_measure: the measure of the returned stress. Is used by muspectre::MaterialMuSpectre to transform it into Cauchy stress (muspectre::StressMeasure::Cauchy) in small-strain computations and into first Piola-Kirchhoff stress muspectre::StressMeasure::PK1 in finite-strain computations

Base class for most convenient implementation of materials

Public Types

using NeedTangent = MatTB::NeedTangent

type used to determine whether the muSpectre::MaterialBase::iterable_proxy evaluate only stresses or also tangent stiffnesses

using Parent = MaterialBase

base class

using traits = MaterialMuSpectre_traits<Material>

traits for the CRTP subclass

using DynMatrix_t = Parent::DynMatrix_t
using Strain_t = Eigen::Matrix<Real, DimM, DimM>
using Stress_t = Strain_t
using Stiffness_t = muGrid::T4Mat<Real, DimM>

Public Functions

MaterialMuSpectre() = delete

Default constructor.

explicit MaterialMuSpectre(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Construct by name.

MaterialMuSpectre(const MaterialMuSpectre &other) = delete

Copy constructor.

MaterialMuSpectre(MaterialMuSpectre &&other) = delete

Move constructor.

virtual ~MaterialMuSpectre() = default

Destructor.

MaterialMuSpectre &operator=(const MaterialMuSpectre &other) = delete

Copy assignment operator.

MaterialMuSpectre &operator=(MaterialMuSpectre &&other) = delete

Move assignment operator.

template<class ...InternalArgs>
void add_pixel_split(const size_t &pixel_id, Real ratio, InternalArgs... args)
void add_split_pixels_precipitate(const std::vector<size_t> &intersected_pixel_ids, const std::vector<Real> &intersection_ratios)
virtual void compute_stresses(const muGrid::RealField &F, muGrid::RealField &P, const Formulation &form, SplitCell is_cell_split = SplitCell::no) final

computes stress

virtual void compute_stresses_tangent(const muGrid::RealField &F, muGrid::RealField &P, muGrid::RealField &K, const Formulation &form, SplitCell is_cell_split = SplitCell::no) final

computes stress and tangent modulus

virtual std::tuple<DynMatrix_t, DynMatrix_t> constitutive_law_dynamic(const Eigen::Ref<const DynMatrix_t> &strain, const size_t &pixel_index, const Formulation &form) final

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor)

Public Static Functions

template<class ...ConstructorArgs>
static Material &make(Cell &cell, const std::string &name, ConstructorArgs&&... args)

Factory. The ConstructorArgs refer the arguments after name

template<class ...ConstructorArgs>
static std::tuple<std::shared_ptr<Material>, MaterialEvaluator<DimM>> make_evaluator(ConstructorArgs&&... args)

Factory takes all arguments after the name of the underlying Material’s constructor. E.g., if the underlying material is a muSpectre::MaterialLinearElastic1<threeD>, these would be Young’s modulus and Poisson’s ratio.

static inline constexpr Dim_t MaterialDimension()

return the material dimension at compile time

Protected Functions

template<Formulation Form, SplitCell is_cell_split = SplitCell::no>
inline void compute_stresses_worker(const muGrid::RealField &F, muGrid::RealField &P) __attribute__((visibility("default")))

computes stress with the formulation available at compile time attribute required by g++-6 and g++-7 because of this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947

template<Formulation Form, SplitCell is_cell_split = SplitCell::no>
inline void compute_stresses_worker(const muGrid::RealField &F, muGrid::RealField &P, muGrid::RealField &K) __attribute__((visibility("default")))

computes stress with the formulation available at compile time attribute required by g++-6 and g++-7 because of this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947

template<class Material>
struct MaterialMuSpectre_traits
template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialHyperElastoPlastic1<DimM>>

traits for hyper-elastoplastic material

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::Gradient}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::Kirchhoff}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialHyperElastoPlastic2<DimM>>

traits for hyper-elastoplastic material

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::Gradient}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::Kirchhoff}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLaminate<DimM>>

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::Gradient}
static constexpr auto stress_measure = {StressMeasure::PK1}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearAnisotropic<DimM>>

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElastic1<DimM>>

traits for objective linear elasticity

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElastic2<DimM>>

traits for objective linear elasticity with eigenstrain

Public Types

using StrainMap_t = muGrid::T2FieldMap<double, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<double, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<double, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElastic3<DimM>>

traits for objective linear elasticity with eigenstrain

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElastic4<DimM>>

traits for objective linear elasticity with eigenstrain

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElasticGeneric1<DimM>>

traits for use by MaterialMuSpectre for crtp

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

global field collection

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearElasticGeneric2<DimM>>

traits for use by MaterialMuSpectre for crtp

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialLinearOrthotropic<DimM>>

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
struct MaterialMuSpectre_traits<MaterialStochasticPlasticity<DimM>>

traits for stochastic plasticity with eigenstrain

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMeasure::GreenLagrange}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMeasure::PK2}

declare what type of stress measure your law yields as output

template<Dim_t DimM, StrainMeasure StrainMIn, StressMeasure StressMOut>
struct MaterialMuSpectre_traits<STMaterialLinearElasticGeneric1<DimM, StrainMIn, StressMOut>>

traits for use by MaterialMuSpectre for crtp

Public Types

using StrainMap_t = muGrid::T2FieldMap<Real, Mapping::Const, DimM>

expected map type for strain fields

using StressMap_t = muGrid::T2FieldMap<Real, Mapping::Mut, DimM>

expected map type for stress fields

using TangentMap_t = muGrid::T4FieldMap<Real, Mapping::Mut, DimM>

expected map type for tangent stiffness fields

Public Static Attributes

static constexpr auto strain_measure = {StrainMIn}

declare what type of strain measure your law takes as input

static constexpr auto stress_measure = {StressMOut}

declare what type of stress measure your law yields as output

template<Dim_t DimM>
class MaterialStochasticPlasticity : public muSpectre::MaterialMuSpectre<MaterialStochasticPlasticity<DimM>, DimM>

implements stochastic plasticity with an eigenstrain, Lame constants and plastic flow per pixel.

Public Types

using Parent = MaterialMuSpectre<MaterialStochasticPlasticity, DimM>

base class

using Vector_t = Eigen::Matrix<Real, Eigen::Dynamic, 1>

dynamic vector type for interactions with numpy/scipy/solvers etc.

using EigenStrainArg_t = Eigen::Map<Eigen::Matrix<Real, DimM, DimM>>
using traits = MaterialMuSpectre_traits<MaterialStochasticPlasticity>

traits of this material

using Hooke = typename MatTB::Hooke<DimM, typename traits::StrainMap_t::reference, typename traits::TangentMap_t::reference>

Hooke’s law implementation.

Public Functions

MaterialStochasticPlasticity() = delete

Default constructor.

explicit MaterialStochasticPlasticity(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts)

Construct by name.

MaterialStochasticPlasticity(const MaterialStochasticPlasticity &other) = delete

Copy constructor.

MaterialStochasticPlasticity(MaterialStochasticPlasticity &&other) = delete

Move constructor.

virtual ~MaterialStochasticPlasticity() = default

Destructor.

MaterialStochasticPlasticity &operator=(const MaterialStochasticPlasticity &other) = delete

Copy assignment operator.

MaterialStochasticPlasticity &operator=(MaterialStochasticPlasticity &&other) = delete

Move assignment operator.

template<class s_t>
inline decltype(auto) evaluate_stress(s_t &&E, const size_t &pixel_index)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor), and the local pixel id.

template<class s_t>
inline decltype(auto) evaluate_stress(s_t &&E, const Real &lambda, const Real &mu, const EigenStrainArg_t &eigen_strain)

evaluates second Piola-Kirchhoff stress given the Green-Lagrange strain (or Cauchy stress if called with a small strain tensor), the first Lame constant (lambda) and the second Lame constant (shear modulus/mu).

template<class s_t>
inline decltype(auto) evaluate_stress_tangent(s_t &&E, const size_t &pixel_index)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor), and the local pixel id.

template<class s_t>
inline decltype(auto) evaluate_stress_tangent(s_t &&E, const Real &lambda, const Real &mu, const EigenStrainArg_t &eigen_strain)

evaluates both second Piola-Kirchhoff stress and stiffness given the Green-Lagrange strain (or Cauchy stress and stiffness if called with a small strain tensor), the first Lame constant (lambda) and the second Lame constant (shear modulus/mu).

void set_plastic_increment(const size_t &quad_pt_id, const Real &increment)

set the plastic_increment on a single quadrature point

void set_stress_threshold(const size_t &quad_pt_id, const Real &threshold)

set the stress_threshold on a single quadrature point

void set_eigen_strain(const size_t &quad_pt_id, Eigen::Ref<Eigen::Matrix<Real, DimM, DimM>> &eigen_strain)

set the eigen_strain on a single quadrature point

const Real &get_plastic_increment(const size_t &quad_pt_id)

get the plastic_increment on a single quadrature point

const Real &get_stress_threshold(const size_t &quad_pt_id)

get the stress_threshold on a single quadrature point

const Eigen::Ref<Eigen::Matrix<Real, DimM, DimM>> get_eigen_strain(const size_t &quad_pt_id)

get the eigen_strain on a single quadrature point

void reset_overloaded_quad_pts()

reset_overloaded_quadrature points, reset the internal variable overloaded_quad_pts by clear the std::vector

virtual void add_pixel(const size_t &pixel_id) final

overload add_pixel to write into loacal stiffness tensor

void add_pixel(const size_t &pixel_id, const Real &Youngs_modulus, const Real &Poisson_ratio, const Real &plastic_increment, const Real &stress_threshold, const Eigen::Ref<const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>> &eigen_strain)

overload add_pixel to write into local stiffness tensor

inline decltype(auto) identify_overloaded_quad_pts(Cell &cell, Eigen::Ref<Vector_t> &stress_numpy_array)

evaluate how many pixels have a higher stress than their stress threshold

inline std::vector<size_t> &identify_overloaded_quad_pts(const muGrid::TypedFieldBase<Real> &stress_field)
inline decltype(auto) update_eigen_strain_field(Cell &cell, Eigen::Ref<Vector_t> &stress_numpy_array)

Update the eigen_strain_field of overloaded pixels by a discrete plastic step from the plastic_increment_field in the direction of the deviatoric stress tensor

inline void update_eigen_strain_field(const muGrid::TypedFieldBase<Real> &stress_field)
inline void archive_overloaded_quad_pts(std::list<std::vector<size_t>> &avalanche_history)

Archive the overloaded pixels into an avalanche history

archive_overloaded_quad_pts(), archives the overloaded pixels saved in this->overloaded_quad_pts to the input vector avalanche_history and empties overloaded_quad_pts.

inline decltype(auto) relax_overloaded_quad_pts(Cell &cell, Eigen::Ref<Vector_t> &stress_numpy_array)

relax all overloaded pixels, return the new stress field and the avalance history

template<class s_t>
auto evaluate_stress(s_t &&E, const Real &lambda, const Real &mu, const EigenStrainArg_t &eigen_strain) -> decltype(auto)
template<class s_t>
auto evaluate_stress_tangent(s_t &&E, const Real &lambda, const Real &mu, const EigenStrainArg_t &eigen_strain) -> decltype(auto)

Protected Types

using Field_t = muGrid::MappedScalarField<Real, Mapping::Mut>

storage for first Lame constant ‘lambda’, second Lame constant(shear modulus) ‘mu’, plastic strain epsilon_p, and a vector of overloaded (stress>stress_threshold) pixel coordinates

using LTensor_Field_t = muGrid::MappedT2Field<Real, Mapping::Mut, DimM>

Protected Attributes

Field_t lambda_field
Field_t mu_field
Field_t plastic_increment_field
Field_t stress_threshold_field
LTensor_Field_t eigen_strain_field
std::vector<size_t> overloaded_quad_pts = {}
class MaterialsToolboxError : public runtime_error

thrown when generic materials-related runtime errors occur (mostly continuum mechanics problems)

Public Functions

inline explicit MaterialsToolboxError(const std::string &what)

constructor

inline explicit MaterialsToolboxError(const char *what)

constructor

template<Formulation Form>
struct MaterialStressEvaluator

Public Static Functions

template<class Material, class Strain, class Stress, class Op>
static inline decltype(auto) static compute(Material &mat, const Strain &strain, Stress &stress, const size_t &quad_pt_id, const Op &operation)
template<Formulation Form>
struct MaterialStressEvaluator

Public Static Functions

template<class Material, class Strain, class Stress, class Op>
static inline void compute(Material &mat, Strain &&strain, Stress &stress, const size_t &quad_pt_id, const Op &operation)
template<>
struct MaterialStressEvaluator<Formulation::finite_strain>

Public Static Functions

template<class Material, class Strain, class Stress, class Op>
static inline decltype(auto) static compute(Material &mat, const Strain &strain, Stress &stress, const size_t &quad_pt_id, const Op &operation)
template<>
struct MaterialStressEvaluator<Formulation::finite_strain>

Public Static Functions

template<class Material, class Strain, class Stress, class Op>
static inline void compute(Material &mat, Strain &&strain, Stress &stress, const size_t &quad_pt_id, const Op &operation)
template<Formulation Form>
struct MaterialStressTangentEvaluator

Public Static Functions

template<class Material, class Strain, class Stress, class Stiffness, class Op>
static inline decltype(auto) static compute(Material &mat, const Strain &strain, std::tuple<Stress, Stiffness> &stress_stiffness, const size_t &quad_pt_id, const Op &operation)
template<Formulation Form>
struct MaterialStressTangentEvaluator

Public Static Functions

template<class Material, class Strain, class Stress, class Stiffness, class Op>
static inline void compute(Material &mat, Strain &&strain, std::tuple<Stress, Stiffness> &stress_stiffness, const size_t &quad_pt_id, const Op &operation)
template<>
struct MaterialStressTangentEvaluator<Formulation::finite_strain>

Public Static Functions

template<class Material, class Strain, class Stress, class Stiffness, class Op>
static inline decltype(auto) static compute(Material &mat, const Strain &strain, std::tuple<Stress, Stiffness> &stress_stiffness, const size_t &quad_pt_id, const Op &operation)
template<>
struct MaterialStressTangentEvaluator<Formulation::finite_strain>

Public Static Functions

template<class Material, class Strain, class Stress, class Stiffness, class Op>
static inline void compute(Material &mat, Strain &&strain, std::tuple<Stress, Stiffness> &stress_stiffness, const size_t &quad_pt_id, const Op &operation)
struct Negative
#include <field_typed.hh>

Simple structure used to allow for lazy evaluation of the unary ‘-’ sign. When assiging the the negative of a field to another, as in field_a = -field_b, this structure allows to implement this operation without needing a temporary object holding the negative value of field_b.

Public Members

const TypedFieldBase &field

field on which the unary ‘-’ was applied

template<SplitCell IsSplit>
class Node

Subclassed by muSpectre::RootNode< IsSplit >

Public Types

using RootNode_t = RootNode<IsSplit>
using Vector_t = Eigen::Matrix<Real, Eigen::Dynamic, 1>

Public Functions

Node() = delete

Default constructor.

Node(const Dim_t &dim, const DynRcoord_t &new_origin, const DynCcoord_t &new_lenghts, const Dim_t &depth, const Dim_t &max_depth, RootNode_t &root, const bool &is_root)
Node(const Node &other) = delete

Copy constructor.

Node(Node &&other) = default

Move constructor.

virtual ~Node() = default

Destructor.

template<Dim_t DimS>
void check_node_helper()
void check_node()
template<Dim_t DimS>
void split_node_helper(const Real &ratio, const corkpp::IntersectionState &state)
template<Dim_t DimS>
void split_node_helper(const Real &intersection_ratio, const corkpp::vector_t &normal_vector, const corkpp::IntersectionState &state)
void split_node(const Real &ratio, const corkpp::IntersectionState &state)
void split_node(const Real &intersection_ratio, const corkpp::vector_t &normal_vector, const corkpp::IntersectionState &state)
template<Dim_t DimS>
void divide_node_helper()
void divide_node()

Protected Attributes

Dim_t dim
RootNode_t &root_node
DynRcoord_t origin
DynRcoord_t Rlengths = {}
DynCcoord_t Clengths = {}
int depth
bool is_pixel
int children_no
std::vector<Node> children = {}
template<Dim_t Dim, FiniteDiff FinDif>
struct NumericalTangentHelper

implementation-structure for computing numerical tangents. For internal use only.

Template Parameters
  • Dim – dimensionality of the material

  • FinDif – specificaition of the type of finite differences

Public Types

using T4_t = muGrid::T4Mat<Real, Dim>

short-hand for fourth-rank tensors

using T2_t = Eigen::Matrix<Real, Dim, Dim>

short-hand for second-rank tensors

using T2_vec = Eigen::Map<Eigen::Matrix<Real, Dim * Dim, 1>>

short-hand for second-rank tensor reshaped to a vector

Public Static Functions

template<class FunType, class Derived>
static inline T4_t compute(FunType &&fun, const Eigen::MatrixBase<Derived> &strain, Real delta)

compute and return the approximate tangent moduli at strain strain

template<Dim_t Dim>
struct NumericalTangentHelper<Dim, FiniteDiff::centred>

specialisation for centred differences

Public Types

using T4_t = muGrid::T4Mat<Real, Dim>

short-hand for fourth-rank tensors

using T2_t = Eigen::Matrix<Real, Dim, Dim>

short-hand for second-rank tensors

using T2_vec = Eigen::Map<Eigen::Matrix<Real, Dim * Dim, 1>>

short-hand for second-rank tensor reshaped to a vector

Public Static Functions

template<class FunType, class Derived>
static inline T4_t compute(FunType &&fun, const Eigen::MatrixBase<Derived> &strain, Real delta)

compute and return the approximate tangent moduli at strain strain

class NumpyError : public runtime_error
#include <numpy_tools.hh>

base class for numpy related exceptions

Public Functions

inline explicit NumpyError(const std::string &what)

constructor

inline explicit NumpyError(const char *what)

constructor

template<typename T, class Collection_t = GlobalFieldCollection>
class NumpyProxy
#include <numpy_tools.hh>

Wrap a pybind11::array into a WrappedField and check the shape of the array

Public Functions

inline NumpyProxy(DynCcoord_t nb_subdomain_grid_pts, DynCcoord_t subdomain_locations, Dim_t nb_components, pybind11::array_t<T, pybind11::array::f_style> array)

Construct a NumpyProxy given that we only know the number of components of the field. The constructor will complain if the grid dimension differs but will wrap any field whose number of components match. For example, a 3x3 grid with 8 components could look like this:

  1. (8, 3, 3)

  2. (2, 4, 3, 3)

  3. (2, 2, 2, 3, 3) The method get_components_shape return the shape of the component part of the field in this case. For the above examples, it would return:

  1. (8,)

  2. (2, 4)

  3. (2, 2, 2) Note that a field with a single component can be passed either with a shaping having leading dimension of one or without any leading dimension. In the latter case, get_component_shape will return a vector of size 0. The same applies for fields with a single quadrature point, whose dimension can be omitted. In general, the shape of the field needs to look like this: (component_1, component:2, quad_pt, grid_x, grid_y, grid_z) where the number of components and grid indices can be arbitrary.

inline NumpyProxy(DynCcoord_t nb_subdomain_grid_pts, DynCcoord_t subdomain_locations, Dim_t nb_quad_pts, std::vector<Dim_t> components_shape, pybind11::array_t<T, pybind11::array::f_style> array)

Construct a NumpyProxy given that we know the shape of the leading component indices. The constructor will complain if both the grid dimensions and the component dimensions differ. get_component_shape returns exactly the shape passed to this constructor.

In general, the shape of the field needs to look like this: (component_1, component:2, quad_pt, grid_x, grid_y, grid_z) where the number of components and grid indices can be arbitrary. The quad_pt dimension can be omitted if there is only a single quad_pt.

NumpyProxy(NumpyProxy &&other) = default

move constructor

inline WrappedField<T> &get_field()
inline const std::vector<Dim_t> &get_components_shape() const
inline std::vector<Dim_t> get_components_and_quad_pt_shape() const

Protected Attributes

Collection_t collection
WrappedField<T> field
Dim_t quad_pt_shape
std::vector<Dim_t> components_shape

number of quad pts, omit if zero

struct OperationAddition

Public Functions

inline explicit OperationAddition(const Real &ratio)
template<typename Derived1, typename Derived2>
inline void operator()(const Eigen::MatrixBase<Derived1> &material_stress, Eigen::MatrixBase<Derived2> &stored_stress) const

Public Members

const Real &ratio
struct OperationAssignment

Public Functions

template<typename Derived1, typename Derived2>
inline void operator()(const Eigen::MatrixBase<Derived1> &material_stress, Eigen::MatrixBase<Derived2> &stored_stress) const
struct OptimizeResult
#include <solver_common.hh>

emulates scipy.optimize.OptimizeResult

Public Members

Eigen::ArrayXXd grad

Strain ε or Gradient F at solution.

Eigen::ArrayXXd stress

Cauchy stress σ or first Piola-Kirchhoff stress P at solution.

bool success

whether or not the solver exited successfully

Int status

Termination status of the optimizer. Its value depends on the underlying solver. Refer to message for details.

std::string message

Description of the cause of the termination.

Uint nb_it

number of iterations

Uint nb_fev

number of cell evaluations

Formulation formulation

continuum mechanic flag

template<Dim_t DimS>
class PFFTEngine : public muFFT::FFTEngineBase<DimS>
#include <pfft_engine.hh>

implements the muFFT::FFTEngineBase interface using the FFTW library

Public Types

using Parent = FFTEngineBase<DimS>

base class

using Ccoord = typename Parent::Ccoord

cell coordinates type

using Workspace_t = typename Parent::Workspace_t

field for Fourier transform of second-order tensor

using Field_t = typename Parent::Field_t

real-valued second-order tensor

Public Functions

PFFTEngine() = delete

Default constructor.

PFFTEngine(Ccoord nb_grid_pts, Dim_t nb_components, Communicator comm = Communicator())

Constructor with the domain’s number of grid points in each direciton, the number of components to transform, and the communicator

PFFTEngine(const PFFTEngine &other) = delete

Copy constructor.

PFFTEngine(PFFTEngine &&other) = default

Move constructor.

virtual ~PFFTEngine() noexcept

Destructor.

PFFTEngine &operator=(const PFFTEngine &other) = delete

Copy assignment operator.

PFFTEngine &operator=(PFFTEngine &&other) = default

Move assignment operator.

virtual void initialise(FFT_PlanFlags plan_flags) override

compute the plan, etc

Workspace_t &fft(Field_t &field) override

forward transform

void ifft(Field_t &field) const override

inverse transform

Protected Attributes

MPI_Comm mpi_comm

MPI communicator.

pfft_plan plan_fft = {}

holds the plan for forward fourier transform

pfft_plan plan_ifft = {}

holds the plan for inverse fourier transform

ptrdiff_t workspace_size = {}

size of workspace buffer returned by planner

Real *real_workspace = {}

temporary real workspace that is correctly padded

Protected Static Attributes

static int nb_engines = {0}

number of times this engine has been instatiated

class PixelIndexIterable

Lightweight proxy class providing iteration over the pixel indices of a muGrid::FieldCollection

Public Types

using iterator = typename std::vector<size_t>::const_iterator

stl

Public Functions

PixelIndexIterable() = delete

Default constructor.

PixelIndexIterable(const PixelIndexIterable &other) = delete

Copy constructor.

PixelIndexIterable(PixelIndexIterable &&other) = default

Move constructor.

virtual ~PixelIndexIterable() = default

Destructor.

PixelIndexIterable &operator=(const PixelIndexIterable &other) = delete

Copy assignment operator.

PixelIndexIterable &operator=(PixelIndexIterable &&other) = delete

Move assignment operator.

iterator begin() const

stl

iterator end() const

stl

size_t size() const

stl

Protected Functions

explicit PixelIndexIterable(const FieldCollection &collection)

Constructor is protected, because no one ever need to construct this except the fieldcollection

Protected Attributes

friend FieldCollection

allow field collections to call the procted constructor of this iterable

const FieldCollection &collection

reference back to the proxied collection

template<size_t Dim>
class Pixels : public muGrid::CcoordOps::DynamicPixels

forward declaration

Centralised iteration over square (or cubic) discretisation grids.

Public Types

using Parent = DynamicPixels

base class

using Ccoord = Ccoord_t<Dim>

cell coordinates

Public Functions

inline Pixels(const Ccoord &nb_grid_pts = Ccoord{}, const Ccoord &locations = Ccoord{})

constructor

inline Pixels(const Ccoord &nb_grid_pts, const Ccoord &locations, const Ccoord &strides)

constructor with strides

Pixels(const Pixels &other) = default

copy constructor

Pixels &operator=(const Pixels &other) = default

assignment operator

virtual ~Pixels() = default
inline Dim_t get_index(const Ccoord &ccoord) const

return index for a ccoord

inline iterator begin() const

stl conformance

inline iterator end() const

stl conformance

inline size_t size() const

stl conformance

Protected Functions

inline const Ccoord &get_nb_grid_pts() const
inline const Ccoord &get_location() const
inline const Ccoord &get_strides() const
template<Dim_t Dim, StressMeasure StressM, StrainMeasure StrainM>
struct PK1_stress

Structure for functions returning PK1 stress from other stress measures

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&)

returns the converted stress

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&, Tangent_t&&)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct PK1_stress<Dim, StressMeasure::Kirchhoff, StrainM> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the case where we get Kirchhoff stress (τ)

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&tau)

returns the converted stress

template<Dim_t Dim>
struct PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::Gradient> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::no_strain_>

Specialisation for the case where we get Kirchhoff stress (τ) derived with respect to Gradient

Public Types

using Parent = PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::no_strain_>

short-hand

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&tau, Tangent_t &&C)

returns the converted stress and stiffness

template<Dim_t Dim>
struct PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::GreenLagrange> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::no_strain_>

Specialisation for the case where we get Kirchhoff stress (τ) derived with respect to GreenLagrange

Public Types

using Parent = PK1_stress<Dim, StressMeasure::Kirchhoff, StrainMeasure::no_strain_>

short-hand

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&tau, Tangent_t &&C)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct PK1_stress<Dim, StressMeasure::PK1, StrainM> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the transparent case, where we already have Piola-Kirchhoff-1, PK1

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t &&P)

returns the converted stress

template<Dim_t Dim>
struct PK1_stress<Dim, StressMeasure::PK1, StrainMeasure::Gradient> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::PK1, StrainMeasure::no_strain_>

Specialisation for the transparent case, where we already have PK1 stress and stiffness is given with respect to the transformation gradient

Public Types

using Parent = PK1_stress<Dim, StressMeasure::PK1, StrainMeasure::no_strain_>

base class

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t &&P, Tangent_t &&K)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct PK1_stress<Dim, StressMeasure::PK2, StrainM> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-2, PK2)

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&S)

returns the converted stress

template<Dim_t Dim>
struct PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::Gradient> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-2, PK2) derived with respect to the placement Gradient (F)

Public Types

using Parent = PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

base class

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&S, Tangent_t &&C)

returns the converted stress and stiffness

template<Dim_t Dim>
struct PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::GreenLagrange> : public muSpectre::MatTB::internal::PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-2, PK2) derived with respect to Green-Lagrange strain

Public Types

using Parent = PK1_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

base class

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&S, Tangent_t &&C)

returns the converted stress and stiffness

template<Dim_t Dim, StressMeasure StressM, StrainMeasure StrainM>
struct PK2_stress

Structure for functions returning PK2 stress from other stress measures

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&)

returns the converted stress

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t&&, Tangent_t&&)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct PK2_stress<Dim, StressMeasure::Kirchhoff, StrainM> : public muSpectre::MatTB::internal::PK2_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the case where we get Kirchhoff stress (τ) and we need PK2(S)

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&tau)

returns the converted stress

template<Dim_t Dim, StrainMeasure StrainM>
struct PK2_stress<Dim, StressMeasure::PK1, StrainM> : public muSpectre::MatTB::internal::PK2_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-1, PK1)

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&P)

returns the converted stress

template<Dim_t Dim>
struct PK2_stress<Dim, StressMeasure::PK1, StrainMeasure::Gradient> : public muSpectre::MatTB::internal::PK2_stress<Dim, StressMeasure::PK1, StrainMeasure::no_strain_>

Specialisation for the case where we get material stress (Piola-Kirchhoff-1, PK1) derived with respect to the placement Gradient (F)

Public Types

using Parent = PK2_stress<Dim, StressMeasure::PK1, StrainMeasure::no_strain_>

base class

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t &&F, Stress_t &&P, Tangent_t &&K)

returns the converted stress and stiffness

template<Dim_t Dim, StrainMeasure StrainM>
struct PK2_stress<Dim, StressMeasure::PK2, StrainM> : public muSpectre::MatTB::internal::PK2_stress<Dim, StressMeasure::no_stress_, StrainMeasure::no_strain_>

Specialisation for the transparent case, where we already have PK2 stress

Public Static Functions

template<class Strain_t, class Stress_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t &&S)

returns the converted stress

template<Dim_t Dim>
struct PK2_stress<Dim, StressMeasure::PK2, StrainMeasure::GreenLagrange> : public muSpectre::MatTB::internal::PK2_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

Specialisation for the transparent case, where we already have PK2 stress and stiffness is given with respect to the transformation Green-Lagrange

Public Types

using Parent = PK2_stress<Dim, StressMeasure::PK2, StrainMeasure::no_strain_>

base class

Public Static Functions

template<class Strain_t, class Stress_t, class Tangent_t>
static inline decltype(auto) compute(Strain_t&&, Stress_t &&S, Tangent_t &&C)

returns the converted stress and stiffness

template<Dim_t DimS>
class PrecipitateIntersectBase

Public Static Functions

static std::tuple<std::vector<corkpp::point_t>, std::vector<corkpp::point_t>> correct_dimension(const std::vector<Rcoord_t<DimS>> &convex_poly_vertices, const Rcoord_t<DimS> &origin, const Rcoord_t<DimS> &lengths)
static corkpp::VolNormStateIntersection intersect_precipitate(const std::vector<DynRcoord_t> &convex_poly_vertices, const Rcoord_t<DimS> &origin, const Rcoord_t<DimS> &lengths)

this function is the palce that CORK is called to analyze the geometry and make the intersection of the precipitate with a grid

template<Dim_t dim, Dim_t i, Dim_t j = dim - 1>
struct Proj
#include <eigen_tools.hh>

This is a static implementation of the explicit determination of log(Tensor) following Jog, C.S. J Elasticity (2008) 93:

  1. https://doi.org/10.1007/s10659-008-9169-x

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

template<>
struct Proj<1, 0, 0>
#include <eigen_tools.hh>

catch the general tail case

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim>&, const Mat_t<dim>&)

wrapped function (raison d’être)

Public Static Attributes

static constexpr Dim_t dim = {1}

short-hand

static constexpr Dim_t i = {0}

short-hand

static constexpr Dim_t j = {0}

short-hand

template<Dim_t dim>
struct Proj<dim, 0, 1>
#include <eigen_tools.hh>

catch the tail case when the last dimension is i

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

Public Static Attributes

static constexpr Dim_t i = {0}

short-hand

static constexpr Dim_t j = {1}

short-hand

template<Dim_t dim, Dim_t i>
struct Proj<dim, i, 0>
#include <eigen_tools.hh>

catch the normal tail case

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

Public Static Attributes

static constexpr Dim_t j = {0}

short-hand

template<Dim_t dim, Dim_t other>
struct Proj<dim, other, other>
#include <eigen_tools.hh>

catch the case when there’s nothing to do

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

template<class Projection>
struct Projection_traits
class ProjectionBase
#include <projection_base.hh>

defines the interface which must be implemented by projection operators

Subclassed by muSpectre::ProjectionDefault< DimS >, muSpectre::ProjectionFiniteStrainFast< DimS >

Public Types

using Vector_t = Eigen::Matrix<Real, Eigen::Dynamic, 1>

Eigen type to replace fields.

using GFieldCollection_t = typename muFFT::FFTEngineBase::GFieldCollection_t

global FieldCollection

using Field_t = muGrid::TypedFieldBase<Real>

Field type on which to apply the projection.

using iterator = typename muFFT::FFTEngineBase::iterator

iterator over all pixels. This is taken from the FFT engine, because depending on the real-to-complex FFT employed, only roughly half of the pixels are present in Fourier space (because of the hermitian nature of the transform)

Public Functions

ProjectionBase() = delete

Default constructor.

ProjectionBase(muFFT::FFTEngine_ptr engine, DynRcoord_t domain_lengths, Formulation form)

Constructor with cell sizes.

ProjectionBase(const ProjectionBase &other) = delete

Copy constructor.

ProjectionBase(ProjectionBase &&other) = default

Move constructor.

virtual ~ProjectionBase() = default

Destructor.

ProjectionBase &operator=(const ProjectionBase &other) = delete

Copy assignment operator.

ProjectionBase &operator=(ProjectionBase &&other) = delete

Move assignment operator.

virtual void initialise(muFFT::FFT_PlanFlags flags = muFFT::FFT_PlanFlags::estimate)

initialises the fft engine (plan the transform)

virtual void apply_projection(Field_t &field) = 0

apply the projection operator to a field

const DynCcoord_t &get_nb_subdomain_grid_pts() const

returns the process-local number of grid points in each direction of the cell

inline const DynCcoord_t &get_subdomain_locations() const

returns the process-local locations of the cell

const DynCcoord_t &get_nb_domain_grid_pts() const

returns the global number of grid points in each direction of the cell

inline const DynRcoord_t &get_domain_lengths() const

returns the physical sizes of the cell

const DynRcoord_t get_pixel_lengths() const

returns the physical sizes of the pixles of the cell

inline const Formulation &get_formulation() const

return the muSpectre::Formulation that is used in solving this cell. This allows tho check whether a projection is compatible with the chosen formulation

inline const auto &get_communicator() const

return the communicator object

return the raw projection operator. This is mainly intended for maintenance and debugging and should never be required in regular use

virtual std::array<Dim_t, 2> get_strain_shape() const = 0

returns the number of rows and cols for the strain matrix type (for full storage, the strain is stored in material_dim × material_dim matrices, but in symmetric storage, it is a column vector)

virtual Dim_t get_nb_components() const = 0

get number of components to project per pixel

const Dim_t &get_dim() const

return the number of spatial dimensions

const Dim_t &get_nb_quad() const

returns the number of quadrature points

muFFT::FFTEngineBase &get_fft_engine()

return a reference to the fft_engine

Protected Attributes

muFFT::FFTEngine_ptr fft_engine

handle on the fft_engine used

DynRcoord_t domain_lengths

physical sizes of the cell

Formulation form

formulation this projection can be applied to (determines whether the projection enforces gradients, small strain tensor or symmetric smal strain tensor

GFieldCollection_t &projection_container

A local muSpectre::FieldCollection to store the projection operator per k-space point. This is a local rather than a global collection, since the pixels considered depend on the FFT implementation. See http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data for an example

template<Dim_t DimS>
class ProjectionDefault : public muSpectre::ProjectionBase

base class to inherit from if one implements a projection operator that is stored in form of a fourth-order tensor of real values per k-grid point

Subclassed by muSpectre::ProjectionFiniteStrain< DimS >, muSpectre::ProjectionSmallStrain< DimS >

Public Types

using Parent = ProjectionBase

base class

using Vector_t = typename Parent::Vector_t

to represent fields

using Gradient_t = muFFT::Gradient_t

gradient, i.e. derivatives in each Cartesian direction

using Ccoord = Ccoord_t<DimS>

cell coordinates type

using Rcoord = Rcoord_t<DimS>

spatial coordinates type

using GFieldCollection_t = muGrid::GlobalFieldCollection

global field collection

using Field_t = muGrid::TypedFieldBase<Real>

Real space second order tensor fields (to be projected)

using Proj_t = muGrid::ComplexField

fourier-space field containing the projection operator itself

using Proj_map = muGrid::T4FieldMap<Complex, Mapping::Mut, DimS>

iterable form of the operator

using Vector_map = muGrid::MatrixFieldMap<Complex, Mapping::Mut, DimS * DimS, 1>

vectorized version of the Fourier-space second-order tensor field

Public Functions

ProjectionDefault() = delete

Default constructor.

ProjectionDefault(muFFT::FFTEngine_ptr engine, DynRcoord_t lengths, Gradient_t gradient, Formulation form)

Constructor with cell sizes and formulation.

ProjectionDefault(const ProjectionDefault &other) = delete

Copy constructor.

ProjectionDefault(ProjectionDefault &&other) = default

Move constructor.

virtual ~ProjectionDefault() = default

Destructor.

ProjectionDefault &operator=(const ProjectionDefault &other) = delete

Copy assignment operator.

ProjectionDefault &operator=(ProjectionDefault &&other) = delete

Move assignment operator.

virtual void apply_projection(Field_t &field) final

apply the projection operator to a field

Eigen::Map<MatrixXXc> get_operator()
virtual std::array<Dim_t, 2> get_strain_shape() const final

returns the number of rows and cols for the strain matrix type (for full storage, the strain is stored in material_dim × material_dim matrices, but in symmetriy storage, it is a column vector)

inline virtual Dim_t get_nb_components() const

get number of components to project per pixel

Public Static Functions

static inline constexpr Dim_t NbComponents()

get number of components to project per pixel

Protected Attributes

Proj_t &Gfield

field holding the operator

Proj_map Ghat

iterable version of operator

Gradient_t gradient

gradient (nabla) operator, can be computed using Fourier interpolation or through a weighted residual

class ProjectionError : public runtime_error
#include <projection_base.hh>

base class for projection related exceptions

Public Functions

inline explicit ProjectionError(const std::string &what)

constructor

inline explicit ProjectionError(const char *what)

constructor

template<Dim_t DimS>
class ProjectionFiniteStrain : public muSpectre::ProjectionDefault<DimS>

Implements the discrete finite strain gradient projection operator

Public Types

using Parent = ProjectionDefault<DimS>

base class

using Ccoord = typename Parent::Ccoord

cell coordinates type

using Rcoord = typename Parent::Rcoord

spatial coordinates type

using Gradient_t = typename Parent::Gradient_t

gradient, i.e. derivatives in each Cartesian direction

using Proj_map = muGrid::T4FieldMap<Real, Mapping::Mut, DimS>

Field type on which to apply the projection.

using Vector_map = muGrid::MatrixFieldMap<Complex, Mapping::Mut, DimS * DimS, 1>

iterable vectorised version of the Fourier-space tensor field

Public Functions

ProjectionFiniteStrain() = delete

Default constructor.

ProjectionFiniteStrain(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths, Gradient_t gradient)

Constructor with fft_engine and stencil.

ProjectionFiniteStrain(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths)

Constructor with fft_engine and default (Fourier) gradient.

ProjectionFiniteStrain(const ProjectionFiniteStrain &other) = delete

Copy constructor.

ProjectionFiniteStrain(ProjectionFiniteStrain &&other) = default

Move constructor.

virtual ~ProjectionFiniteStrain() = default

Destructor.

ProjectionFiniteStrain &operator=(const ProjectionFiniteStrain &other) = delete

Copy assignment operator.

ProjectionFiniteStrain &operator=(ProjectionFiniteStrain &&other) = default

Move assignment operator.

virtual void initialise(muFFT::FFT_PlanFlags flags = muFFT::FFT_PlanFlags::estimate) final

initialises the fft engine (plan the transform)

template<Dim_t DimS>
class ProjectionFiniteStrainFast : public muSpectre::ProjectionBase

replaces muSpectre::ProjectionFiniteStrain with a faster and less memory-hungry alternative formulation. Use this if you don’t have a very good reason not to (and tell me (author) about it, I’d be interested to hear it).

Public Types

using Parent = ProjectionBase

base class

using Gradient_t = muFFT::Gradient_t

gradient, i.e. derivatives in each Cartesian direction

using Ccoord = Ccoord_t<DimS>

cell coordinates type

using Rcoord = Rcoord_t<DimS>

spatial coordinates type

using Field_t = muGrid::TypedFieldBase<Real>

Real space second order tensor fields (to be projected)

using Proj_t = muGrid::ComplexField

Fourier-space field containing the projection operator itself.

using Proj_map = muGrid::MatrixFieldMap<Complex, Mapping::Mut, DimS, 1, muGrid::Iteration::Pixel>

iterable form of the operator

using Grad_map = muGrid::MatrixFieldMap<Complex, Mapping::Mut, DimS, DimS, muGrid::Iteration::Pixel>

iterable Fourier-space second-order tensor field

Public Functions

ProjectionFiniteStrainFast() = delete

Default constructor.

ProjectionFiniteStrainFast(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths, Gradient_t gradient)

Constructor with FFT engine.

ProjectionFiniteStrainFast(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths)

Constructor with FFT engine and default (Fourier) gradient.

ProjectionFiniteStrainFast(const ProjectionFiniteStrainFast &other) = delete

Copy constructor.

ProjectionFiniteStrainFast(ProjectionFiniteStrainFast &&other) = default

Move constructor.

virtual ~ProjectionFiniteStrainFast() = default

Destructor.

ProjectionFiniteStrainFast &operator=(const ProjectionFiniteStrainFast &other) = delete

Copy assignment operator.

ProjectionFiniteStrainFast &operator=(ProjectionFiniteStrainFast &&other) = default

Move assignment operator.

virtual void initialise(muFFT::FFT_PlanFlags flags = muFFT::FFT_PlanFlags::estimate) final

initialises the fft engine (plan the transform)

virtual void apply_projection(Field_t &field) final

apply the projection operator to a field

Eigen::Map<MatrixXXc> get_operator()
virtual std::array<Dim_t, 2> get_strain_shape() const final

returns the number of rows and cols for the strain matrix type (for full storage, the strain is stored in material_dim × material_dim matrices, but in symmetriy storage, it is a column vector)

inline virtual Dim_t get_nb_components() const

get number of components to project per pixel

Public Static Functions

static inline constexpr Dim_t NbComponents()

get number of components to project per pixel

Protected Attributes

Proj_t &xi_field

field of normalised wave vectors

Proj_map xis

iterable normalised wave vectors

Gradient_t gradient

gradient (nabla) operator, can be computed using Fourier interpolation or through a weighted residual

template<Dim_t DimS>
class ProjectionSmallStrain : public muSpectre::ProjectionDefault<DimS>

Implements the small strain projection operator as defined in Appendix A1 of DOI: 10.1002/nme.5481 (“A finite element perspective on nonlinear FFT-based micromechanical simulations”, Int. J. Numer. Meth. Engng 2017; 111 :903–926)

Public Types

using Parent = ProjectionDefault<DimS>

base class

using Gradient_t = typename Parent::Gradient_t

gradient, i.e. derivatives in each Cartesian direction

using Ccoord = typename Parent::Ccoord

cell coordinates type

using Rcoord = typename Parent::Rcoord

spatial coordinates type

using Proj_t = muGrid::RealField

Fourier-space field containing the projection operator itself.

using Proj_map = muGrid::T4FieldMap<Real, Mapping::Mut, DimS>

iterable operator

using Vector_map = muGrid::MatrixFieldMap<Complex, Mapping::Mut, DimS * DimS, 1>

iterable vectorised version of the Fourier-space tensor field

Public Functions

ProjectionSmallStrain() = delete

Default constructor.

ProjectionSmallStrain(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths, Gradient_t gradient)

Constructor with fft_engine.

ProjectionSmallStrain(muFFT::FFTEngine_ptr engine, const DynRcoord_t &lengths)

Constructor with fft_engine and default (Fourier) gradient.

ProjectionSmallStrain(const ProjectionSmallStrain &other) = delete

Copy constructor.

ProjectionSmallStrain(ProjectionSmallStrain &&other) = default

Move constructor.

virtual ~ProjectionSmallStrain() = default

Destructor.

ProjectionSmallStrain &operator=(const ProjectionSmallStrain &other) = delete

Copy assignment operator.

ProjectionSmallStrain &operator=(ProjectionSmallStrain &&other) = delete

Move assignment operator.

virtual void initialise(muFFT::FFT_PlanFlags flags = muFFT::FFT_PlanFlags::estimate) final

initialises the fft engine (plan the transform)

template<typename T, size_t N>
class RefArray
#include <ref_array.hh>

work-around to allow making a statically sized array of references (which are forbidden by the C++ language

Public Functions

RefArray() = delete

Deleted default constructor.

template<typename ...Vals>
inline explicit RefArray(Vals&... vals)

bulk initialisation constructor

RefArray(const RefArray &other) = default

Copy constructor.

RefArray(RefArray &&other) = default

Move constructor.

virtual ~RefArray() = default

Destructor.

RefArray &operator=(const RefArray &other) = default

Copy assignment operator.

RefArray &operator=(RefArray &&other) = delete

Move assignment operator.

inline T &operator[](size_t index)

random access operator

inline constexpr T &operator[](size_t index) const

random constant access operator

Protected Attributes

std::array<T*, N> values = {}

storage

template<typename T>
class RefVector : protected std::vector<T*>
#include <ref_vector.hh>

work-around to allow using vectors of references (which are forbidden by the C++ stl

Public Functions

RefVector() = default

Default constructor.

RefVector(const RefVector &other) = default

Copy constructor.

RefVector(RefVector &&other) = default

Move constructor.

virtual ~RefVector() = default

Destructor.

RefVector &operator=(const RefVector &other) = default

Copy assignment operator.

RefVector &operator=(RefVector &&other) = default

Move assignment operator.

inline void push_back(T &value)

stl

inline T &at(size_t index)

stl

inline const T &at(size_t index) const

stl

inline T &operator[](size_t index)

random access operator

inline const T &operator[](size_t index) const

random const access operator

inline iterator begin()

stl

inline iterator end()

stl

Private Types

using Parent = std::vector<T*>
template<SplitCell IsSplit>
class RootNode : public muSpectre::Node<IsSplit>

Public Types

using Parent = Node<IsSplit>

base class

using Vector_t = typename Parent::Vector_t

Public Functions

RootNode() = delete

Default Constructor.

RootNode(const Cell &cell, const std::vector<DynRcoord_t> &vert_precipitate)

Constructing a root node for a cell and a preticipate inside that cell.

RootNode(const RootNode &other) = delete

Copy constructor.

RootNode(RootNode &&other) = default

Move constructor.

~RootNode() = default

Destructor.

inline std::vector<DynCcoord_t> get_intersected_pixels()
inline std::vector<size_t> get_intersected_pixels_id()
inline std::vector<Real> get_intersection_ratios()
inline Vectors_t get_intersection_normals()
inline std::vector<corkpp::IntersectionState> get_intersection_status()
Dim_t make_max_resolution(const Cell &cell) const
Dim_t make_max_depth(const Cell &cell) const
void check_root_node()
int compute_squared_circum_square(const Cell &cell) const
DynRcoord_t make_root_origin(const Cell &cell) const

Protected Attributes

const Cell &cell
DynRcoord_t cell_length

the cell to be intersected

DynRcoord_t pixel_lengths

The Real size of the cell.

DynCcoord_t cell_resolution

The Real size of each pixel.

int max_resolution

The nb_grid_pts for the.

int max_depth

The maximum of the nb_grid_pts in all directions.

std::vector<DynRcoord_t> precipitate_vertices = {}

The maximum depth of the branches in the OctTree.

std::vector<DynCcoord_t> intersected_pixels = {}

The coordinates of the vertices of the perticpiate

std::vector<size_t> intersected_pixels_id = {}

The pixels of the cell which intersect with the percipitate

std::vector<Real> intersection_ratios = {}

The index of the intersecting pixels.

Vectors_t intersection_normals

The intesrction ratio of intersecting pixels.

std::vector<corkpp::IntersectionState> intersection_state = {}

The normal vectors of the interface in the intersecting pixels

Friends

friend class Node< IsSplit >
template<Dim_t Rank>
struct RotationHelper
template<>
struct RotationHelper<firstOrder>
#include <geometry.hh>

Specialisation for first-rank tensors (vectors)

Public Static Functions

template<class Derived1, class Derived2>
static inline decltype(auto) rotate(const Eigen::MatrixBase<Derived1> &input, const Eigen::MatrixBase<Derived2> &R)
template<>
struct RotationHelper<fourthOrder>
#include <geometry.hh>

Specialisation for fourth-rank tensors

Public Static Functions

template<class Derived1, class Derived2>
static inline decltype(auto) rotate(const Eigen::MatrixBase<Derived1> &input, const Eigen::MatrixBase<Derived2> &R)
template<>
struct RotationHelper<secondOrder>
#include <geometry.hh>

Specialisation for second-rank tensors

Public Static Functions

template<class Derived1, class Derived2>
static inline decltype(auto) rotate(const Eigen::MatrixBase<Derived1> &input, const Eigen::MatrixBase<Derived2> &R)

raison d’être

template<RotationOrder Order, Dim_t Dim>
struct RotationMatrixComputerAngle
#include <geometry.hh>

internal structure for computing rotation matrices

template<RotationOrder Order>
struct RotationMatrixComputerAngle<Order, threeD>
#include <geometry.hh>

specialisation for three-dimensional problems

Public Types

using RotMat_t = typename RotatorAngle<Dim, Order>::RotMat_t
using Angles_t = typename RotatorAngle<Dim, Order>::Angles_t

Public Static Functions

template<typename Derived>
static inline RotMat_t compute(const Eigen::MatrixBase<Derived> &angles)

compute and return the rotation matrixtemplate <typename derived>=””>

Public Static Attributes

static constexpr Dim_t Dim = {threeD}
template<RotationOrder Order>
struct RotationMatrixComputerAngle<Order, twoD>
#include <geometry.hh>

specialisation for two-dimensional problems

Public Types

using RotMat_t = typename RotatorAngle<Dim, Order>::RotMat_t
using Angles_t = typename RotatorAngle<Dim, Order>::Angles_t

Public Static Functions

template<typename Derived>
static inline RotMat_t compute(const Eigen::MatrixBase<Derived> &angles)

compute and return the rotation matrix

Public Static Attributes

static constexpr Dim_t Dim = {twoD}
template<Dim_t Dim>
struct RotationMatrixComputerNormal
template<>
struct RotationMatrixComputerNormal<threeD>

Public Types

using RotMat_t = typename RotatorTwoVec<Dim>::RotMat_t
using Vec_t = typename RotatorTwoVec<Dim>::Vec_t

Public Static Functions

template<typename Derived>
static inline RotMat_t compute(const Eigen::MatrixBase<Derived> &vec)

Public Static Attributes

static constexpr Dim_t Dim = {threeD}
template<>
struct RotationMatrixComputerNormal<twoD>

Public Types

using RotMat_t = typename RotatorTwoVec<Dim>::RotMat_t
using Vec_t = typename RotatorTwoVec<Dim>::Vec_t

Public Static Functions

template<typename Derived>
static inline RotMat_t compute(const Eigen::MatrixBase<Derived> &vec)

Public Static Attributes

static constexpr Dim_t Dim = {twoD}
template<Dim_t Dim>
struct RotationMatrixComputerTwoVec
template<>
struct RotationMatrixComputerTwoVec<threeD>

Public Types

using RotMat_t = typename RotatorTwoVec<Dim>::RotMat_t
using Vec_t = typename RotatorTwoVec<Dim>::Vec_t

Public Static Functions

template<typename DerivedA, typename DerivedB>
static inline RotMat_t compute(const Eigen::MatrixBase<DerivedA> &vec_ref, const Eigen::MatrixBase<DerivedB> &vec_des)

Public Static Attributes

static constexpr Dim_t Dim = {threeD}
template<>
struct RotationMatrixComputerTwoVec<twoD>

Public Types

using RotMat_t = typename RotatorTwoVec<Dim>::RotMat_t
using Vec_t = typename RotatorTwoVec<Dim>::Vec_t

Public Static Functions

template<typename DerivedA, typename DerivedB>
static inline RotMat_t compute(const Eigen::MatrixBase<DerivedA> &vec_ref, const Eigen::MatrixBase<DerivedB> &vec_des)

Public Static Attributes

static constexpr Dim_t Dim = {twoD}
template<Dim_t Dim, RotationOrder Order = internal::DefaultOrder<Dim>::value>
class RotatorAngle : public muSpectre::RotatorBase<Dim>

Public Types

using Parent = RotatorBase<Dim>
using Angles_t = Eigen::Matrix<Real, (Dim == twoD) ? 1 : 3, 1>
using RotMat_t = Eigen::Matrix<Real, Dim, Dim>

Public Functions

RotatorAngle() = delete

Default constructor.

template<class Derived>
inline explicit RotatorAngle(const Eigen::MatrixBase<Derived> &angles_inp)

constructor given the euler angles:

RotatorAngle(const RotatorAngle &other) = default

Copy constructor.

RotatorAngle(RotatorAngle &&other) = default

Move constructor.

virtual ~RotatorAngle() = default

Destructor.

RotatorAngle &operator=(const RotatorAngle &other) = default

Copy assignment operator.

RotatorAngle &operator=(RotatorAngle &&other) = default

Move assignment operator.

template<typename Derived>
auto compute_rotation_matrix_angle(const Eigen::MatrixBase<Derived> &angles) -> RotMat_t

Protected Functions

template<class Derived>
inline RotMat_t compute_rotation_matrix_angle(const Eigen::MatrixBase<Derived> &angles)
template<Dim_t Dim>
class RotatorBase

Subclassed by muSpectre::RotatorAngle< Dim, Order >, muSpectre::RotatorNormal< Dim >, muSpectre::RotatorTwoVec< Dim >

Public Types

using RotMat_t = Eigen::Matrix<Real, Dim, Dim>
using RotMat_ptr = std::unique_ptr<RotMat_t>

Public Functions

RotatorBase() = delete

Default constructor.

inline explicit RotatorBase(RotMat_t rotation_matrix_input)

constructor with given rotation matrix

RotatorBase(const RotatorBase &other) = default

Copy constructor.

RotatorBase(RotatorBase &&other) = default

Move constructor.

virtual ~RotatorBase() = default

Destructor.

RotatorBase &operator=(const RotatorBase &other) = default

Copy assignment operator.

RotatorBase &operator=(RotatorBase &&other) = default

Move assignment operator.

template<class Derived>
inline decltype(auto) rotate(const Eigen::MatrixBase<Derived> &input) const

Applies the rotation into the frame define my the rotation

matrix

Parameters

input – is a first-, second-, or fourth-rank tensor (column vector, square matrix, or T4Matrix, or a Eigen::Map of either of these, or an expression that evaluates into any of these)

template<class Derived>
inline decltype(auto) rotate_back(const Eigen::MatrixBase<Derived> &input) const

Applies the rotation back out from the frame define my the rotation matrix

Parameters

input – is a first-, second-, or fourth-rank tensor (column vector, square matrix, or T4Matrix, or a Eigen::Map of either of these, or an expression that evaluates into any of these)

inline const RotMat_t &get_rot_mat() const
template<class Derived>
inline void set_rot_mat(const Eigen::MatrixBase<Derived> &mat_inp)

Protected Attributes

RotMat_ptr rot_mat_holder
const RotMat_t &rot_mat
template<Dim_t Dim>
class RotatorNormal : public muSpectre::RotatorBase<Dim>
#include <geometry.hh>

this class is used to make a vector aligned to x-axis of the coordinate system, the input for the constructor is the vector itself and the functions rotate and rotate back would be available as they exist in the parent class (RotatorBase) nad can be used in order to do the functionality of the class

Public Types

using Parent = RotatorBase<Dim>
using Vec_t = Eigen::Matrix<Real, Dim, 1>
using RotMat_t = Eigen::Matrix<Real, Dim, Dim>

Public Functions

RotatorNormal() = delete

Default constructor.

template<typename Derived>
inline explicit RotatorNormal(const Eigen::MatrixBase<Derived> &vec)

constructor

RotatorNormal(const RotatorNormal &other) = default

Copy constructor.

RotatorNormal(RotatorNormal &&other) = default

Move constructor.

virtual ~RotatorNormal() = default

Destructor.

RotatorNormal &operator=(const RotatorNormal &other) = default

Copy assignment operator.

RotatorNormal &operator=(RotatorNormal &&other) = default

Move assignment operator.

template<typename Derived>
auto compute_rotation_matrix_normal(const Eigen::MatrixBase<Derived> &vec) -> RotMat_t

Protected Functions

template<typename Derived>
inline RotMat_t compute_rotation_matrix_normal(const Eigen::MatrixBase<Derived> &vec)
template<Dim_t Dim>
class RotatorTwoVec : public muSpectre::RotatorBase<Dim>
#include <geometry.hh>

this class is used to make the vector a aligned to the vec b by means of a rotation system, the input for the constructor is the vector itself and the functions rotate and rotate back would be available as they exist in the parent class (RotatorBase) nad can be used in order to do the functionality of the class

Public Types

using Parent = RotatorBase<Dim>
using Vec_t = Eigen::Matrix<Real, (Dim == twoD) ? 2 : 3, 1>
using Vec_ptr = std::unique_ptr<Vec_t>
using RotMat_t = Eigen::Matrix<Real, Dim, Dim>

Public Functions

RotatorTwoVec() = delete

Default constructor.

template<typename DerivedA, typename DerivedB>
inline RotatorTwoVec(const Eigen::MatrixBase<DerivedA> &vec_a_inp, const Eigen::MatrixBase<DerivedB> &vec_b_inp)

Constructor given the two vectors.

RotatorTwoVec(const RotatorTwoVec &other) = default

Copy constructor.

RotatorTwoVec(RotatorTwoVec &&other) = default

Move constructor.

virtual ~RotatorTwoVec() = default

Destructor.

RotatorTwoVec &operator=(const RotatorTwoVec &other) = default

Copy assignment operator.

RotatorTwoVec &operator=(RotatorTwoVec &&other) = default

Move assignment operator.

template<typename DerivedA, typename DerivedB>
auto compute_rotation_matrix_TwoVec(const Eigen::MatrixBase<DerivedA> &vec_ref, const Eigen::MatrixBase<DerivedB> &vec_des) -> RotMat_t

Protected Functions

template<typename DerivedA, typename DerivedB>
inline RotMat_t compute_rotation_matrix_TwoVec(const Eigen::MatrixBase<DerivedA> &vec_ref, const Eigen::MatrixBase<DerivedB> &vec_des)
template<typename T>
struct ScalarMap

Internal struct for handling the scalar iterates of muGrid::FieldMap

Public Types

using PlainType = T

Scalar maps don’t have an eigen type representing the iterate, just the raw stored type itsef

using value_type = std::conditional_t<MutIter == Mapping::Const, const T, T>

return type for iterates

using ref_type = value_type<MutIter>&

reference type for iterates

using Return_t = value_type<MutIter>&

for direct access through operator[]

using storage_type = std::conditional_t<MutIter == Mapping::Const, const T*, T*>

need to encapsulate

Public Static Functions

static inline constexpr bool IsValidStaticMapType()

check at compile time whether this map is suitable for statically sized iterates

static inline constexpr bool IsScalarMapType()

check at compiler time whether this map is scalar

template<Mapping MutIter>
static inline constexpr value_type<MutIter> &provide_ref(storage_type<MutIter> storage)

return the return_type version of the iterate from storage_type

template<Mapping MutIter>
static inline constexpr const value_type<MutIter> &provide_const_ref(const storage_type<MutIter> storage)

return the const return_type version of the iterate from storage_type

template<Mapping MutIter>
static inline constexpr storage_type<MutIter> provide_ptr(storage_type<MutIter> storage)

return a pointer to the iterate from storage_type

template<Mapping MutIter>
static inline constexpr Return_t<MutIter> from_data_ptr(std::conditional_t<MutIter == Mapping::Const, const T*, T*> data)

return a return_type version of the iterate from its pointer

template<Mapping MutIter>
static inline constexpr storage_type<MutIter> to_storage(ref_type<MutIter> ref)

return a storage_type version of the iterate from its value

static inline constexpr Dim_t stride()

return the nb of components of the iterate (known at compile time)

static inline std::string shape()

return the iterate’s shape as text, mostly for error messages

static inline constexpr Dim_t NbRow()
template<Dim_t order, Dim_t dim>
struct SizesByOrder
#include <eigen_tools.hh>

Creates a Eigen::Sizes type for a Tensor defined by an order and dim.

Public Types

using Sizes = typename internal::SizesByOrderHelper<order - 1, dim, dim>::Sizes

Eigen::Sizes

template<Dim_t order, Dim_t dim, Dim_t... dims>
struct SizesByOrderHelper
#include <eigen_tools.hh>

Creates a Eigen::Sizes type for a Tensor defined by an order and dim.

Public Types

using Sizes = typename SizesByOrderHelper<order - 1, dim, dim, dims...>::Sizes

type to use

template<Dim_t dim, Dim_t... dims>
struct SizesByOrderHelper<0, dim, dims...>
#include <eigen_tools.hh>

Creates a Eigen::Sizes type for a Tensor defined by an order and dim.

Public Types

using Sizes = Eigen::Sizes<dims...>

type to use

template<class Solver>
struct Solver_traits
template<>
struct Solver_traits<SolverBiCGSTABEigen>
#include <solver_eigen.hh>

traits for the Eigen BiCGSTAB solver

Public Types

using Solver = Eigen::BiCGSTAB<typename Cell::Adaptor, Eigen::IdentityPreconditioner>

Eigen Iterative Solver.

template<>
struct Solver_traits<SolverCGEigen>
#include <solver_eigen.hh>

traits for the Eigen conjugate gradient solver

Public Types

using Solver = Eigen::ConjugateGradient<typename Cell::Adaptor, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner>

Eigen Iterative Solver.

template<>
struct Solver_traits<SolverDGMRESEigen>
#include <solver_eigen.hh>

traits for the Eigen DGMRES solver

Public Types

using Solver = Eigen::DGMRES<typename Cell::Adaptor, Eigen::IdentityPreconditioner>

Eigen Iterative Solver.

template<>
struct Solver_traits<SolverGMRESEigen>
#include <solver_eigen.hh>

traits for the Eigen GMRES solver

Public Types

using Solver = Eigen::GMRES<typename Cell::Adaptor, Eigen::IdentityPreconditioner>

Eigen Iterative Solver.

template<>
struct Solver_traits<SolverMINRESEigen>
#include <solver_eigen.hh>

traits for the Eigen MINRES solver

Public Types

using Solver = Eigen::MINRES<typename Cell::Adaptor, Eigen::Lower | Eigen::Upper, Eigen::IdentityPreconditioner>

Eigen Iterative Solver.

class SolverBase
#include <solver_base.hh>

Virtual base class for solvers. An implementation of this interface can be used with the solution strategies in solvers.hh

Subclassed by muSpectre::SolverCG, muSpectre::SolverEigen< SolverType >, muSpectre::SolverEigen< SolverBiCGSTABEigen >, muSpectre::SolverEigen< SolverCGEigen >, muSpectre::SolverEigen< SolverDGMRESEigen >, muSpectre::SolverEigen< SolverGMRESEigen >, muSpectre::SolverEigen< SolverMINRESEigen >

Public Types

using Vector_t = Eigen::Matrix<Real, Eigen::Dynamic, 1>

underlying vector type

using Vector_ref = Eigen::Ref<Vector_t>

Input vector for solvers.

using ConstVector_ref = Eigen::Ref<const Vector_t>

Input vector for solvers.

using Vector_map = Eigen::Map<Vector_t>

Output vector for solvers.

Public Functions

SolverBase() = delete

Default constructor.

SolverBase(Cell &cell, Real tol, Uint maxiter, bool verbose = false)

Constructor takes a Cell, tolerance, max number of iterations and verbosity flag as input

SolverBase(const SolverBase &other) = delete

Copy constructor.

SolverBase(SolverBase &&other) = default

Move constructor.

virtual ~SolverBase() = default

Destructor.

SolverBase &operator=(const SolverBase &other) = delete

Copy assignment operator.

SolverBase &operator=(SolverBase &&other) = delete

Move assignment operator.

virtual void initialise() = 0

Allocate fields used during the solution.

bool has_converged() const

returns whether the solver has converged

void reset_counter()

reset the iteration counter to zero

Uint get_counter() const

get the count of how many solve steps have been executed since construction of most recent counter reset

Uint get_maxiter() const

returns the max number of iterations

Real get_tol() const

returns the solving tolerance

virtual std::string get_name() const = 0

returns the solver’s name (i.e. ‘CG’, ‘GMRES’, etc)

virtual Vector_map solve(const ConstVector_ref rhs) = 0

run the solve operation

Protected Attributes

Cell &cell

reference to the problem’s cell

Real tol

convergence tolerance

Uint maxiter

maximum allowed number of iterations

bool verbose

whether to write information to the stdout

Uint counter = {0}

iteration counter

bool converged = {false}

whether the solver has converged

class SolverBiCGSTABEigen : public muSpectre::SolverEigen<SolverBiCGSTABEigen>
#include <solver_eigen.hh>

Binding to Eigen’s BiCGSTAB solver

Public Functions

inline virtual std::string get_name() const final

Solver’s name.

class SolverCG : public muSpectre::SolverBase
#include <solver_cg.hh>

implements the muSpectre::SolverBase interface using a conjugate gradient solver. This particular class is useful for trouble shooting, as it can be made very verbose, but for production runs, it is probably better to use muSpectre::SolverCGEigen.

Public Types

using Parent = SolverBase

standard short-hand for base class

using Vector_t = Parent::Vector_t

for storage of fields

using Vector_ref = Parent::Vector_ref

Input vector for solvers.

using ConstVector_ref = Parent::ConstVector_ref

Input vector for solvers.

using Vector_map = Parent::Vector_map

Output vector for solvers.

Public Functions

SolverCG() = delete

Default constructor.

SolverCG(const SolverCG &other) = delete

Copy constructor.

SolverCG(Cell &cell, Real tol, Uint maxiter, bool verbose = false)

Constructor takes a Cell, tolerance, max number of iterations and verbosity flag as input

SolverCG(SolverCG &&other) = default

Move constructor.

virtual ~SolverCG() = default

Destructor.

SolverCG &operator=(const SolverCG &other) = delete

Copy assignment operator.

SolverCG &operator=(SolverCG &&other) = delete

Move assignment operator.

inline virtual void initialise() final

initialisation does not need to do anything in this case

inline virtual std::string get_name() const final

returns the solver’s name

virtual Vector_map solve(const ConstVector_ref rhs) final

the actual solver

Protected Attributes

Vector_t r_k

residual

Vector_t p_k

search direction

Vector_t Ap_k

directional stiffness

Vector_t x_k

current solution

class SolverCGEigen : public muSpectre::SolverEigen<SolverCGEigen>
#include <solver_eigen.hh>

Binding to Eigen’s conjugate gradient solver

Public Functions

inline virtual std::string get_name() const final

returns the solver’s name (i.e. ‘CG’, ‘GMRES’, etc)

class SolverDGMRESEigen : public muSpectre::SolverEigen<SolverDGMRESEigen>
#include <solver_eigen.hh>

Binding to Eigen’s DGMRES solver

Public Functions

inline virtual std::string get_name() const final

Solver’s name.

template<class SolverType>
class SolverEigen : public muSpectre::SolverBase
#include <solver_eigen.hh>

base class for iterative solvers from Eigen

Public Types

using Parent = SolverBase

base class

using Solver = typename internal::Solver_traits<SolverType>::Solver

traits obtained from CRTP

using ConstVector_ref = Parent::ConstVector_ref

Input vectors for solver.

using Vector_map = Parent::Vector_map

Output vector for solver.

using Vector_t = Parent::Vector_t

storage for output vector

Public Functions

SolverEigen() = delete

Default constructor.

SolverEigen(Cell &cell, Real tol, Uint maxiter = 0, bool verbose = false)

Constructor with cell and solver parameters.

SolverEigen(const SolverEigen &other) = delete

Copy constructor.

SolverEigen(SolverEigen &&other) = default

Move constructor.

virtual ~SolverEigen() = default

Destructor.

SolverEigen &operator=(const SolverEigen &other) = delete

Copy assignment operator.

SolverEigen &operator=(SolverEigen &&other) = default

Move assignment operator.

virtual void initialise() final

Allocate fields used during the solution.

virtual Vector_map solve(const ConstVector_ref rhs) final

executes the solver

Protected Attributes

Cell::Adaptor adaptor

cell handle

Solver solver

Eigen’s Iterative solver.

Vector_t result

storage for result

class SolverError : public runtime_error

Subclassed by muSpectre::ConvergenceError

class SolverGMRESEigen : public muSpectre::SolverEigen<SolverGMRESEigen>
#include <solver_eigen.hh>

Binding to Eigen’s GMRES solver

Public Functions

inline virtual std::string get_name() const final

returns the solver’s name (i.e. ‘CG’, ‘GMRES’, etc)

class SolverMINRESEigen : public muSpectre::SolverEigen<SolverMINRESEigen>
#include <solver_eigen.hh>

Binding to Eigen’s MINRES solver

Public Functions

inline virtual std::string get_name() const final

Solver’s name.

class StateField
#include <state_field.hh>

Base class for state fields, useful for storing polymorphic references

Subclassed by muGrid::TypedStateField< T >, muGrid::TypedStateField< Scalar >

Public Functions

StateField() = delete

Default constructor.

StateField(const StateField &other) = delete

Copy constructor.

StateField(StateField &&other) = delete

Move constructor.

virtual ~StateField() = default

Destructor.

StateField &operator=(const StateField &other) = delete

Copy assignment operator.

StateField &operator=(StateField &&other) = delete

Move assignment operator.

const Dim_t &get_nb_memory() const

returns number of old states that are stored

virtual const std::type_info &get_stored_typeid() const = 0

return type_id of stored type

void cycle()

cycle the fields (current becomes old, old becomes older, oldest becomes current)

Field &current()

return a reference to the field holding the current values

const Field &current() const

return a const reference to the field holding the current values

const Field &old(size_t nb_steps_ago = 1) const

return a reference to the field holding the values which were current nb_steps_ago ago

inline const std::vector<size_t> &get_indices() const

get the current ordering of the fields (inlineable because called in hot loop)

Protected Functions

StateField(const std::string &unique_prefix, FieldCollection &collection, Dim_t nb_memory = 1)

Protected constructor

Protected Attributes

std::string prefix

the unique prefix is used as the first part of the unique name of the subfields belonging to this state field

FieldCollection &collection

reference to the collection this statefield belongs to

const Dim_t nb_memory

number of old states to store, defaults to 1

std::vector<size_t> indices = {}

the current (historically accurate) ordering of the fields

RefVector<Field> fields = {}

storage of references to the diverse fields

template<typename T, Mapping Mutability>
class StateFieldMap
#include <state_field.hh>

forward-declaration for friending

Dynamically sized map for iterating over muGrid::StateFields

Subclassed by muGrid::StaticStateFieldMap< T, Mutability, MapType, NbMemory, IterationType >

Public Types

using FieldMap_t = FieldMap<T, Mutability>

type for the current-values map (may be mutable, if the underlying field was)

using CFieldMap_t = FieldMap<T, Mapping::Const>

type for the old-values map, non-mutable

using iterator = Iterator<(Mutability == Mapping::Mut) ? Mapping::Mut : Mapping::Const>

stl

using const_iterator = Iterator<Mapping::Const>

stl

Public Functions

StateFieldMap() = delete

Default constructor.

StateFieldMap(TypedStateField<T> &state_field, Iteration iter_type = Iteration::QuadPt)

constructor from a state field. The default case is a map iterating over quadrature points with a matrix of shape (nb_components × 1) per field entry

StateFieldMap(TypedStateField<T> &state_field, Dim_t nb_rows, Iteration iter_type = Iteration::QuadPt)

Constructor from a state field with explicitly chosen shape of iterate. (the number of columns is inferred).

StateFieldMap(const StateFieldMap &other) = delete
StateFieldMap(StateFieldMap &&other) = delete

Move constructor.

virtual ~StateFieldMap() = default

Destructor.

StateFieldMap &operator=(const StateFieldMap &other) = delete

Copy assignment operator.

StateFieldMap &operator=(StateFieldMap &&other) = delete

Move assignment operator.

iterator begin()

stl

iterator end()

stl

const TypedStateField<T> &get_state_field() const

return a const reference to the mapped state field

const Dim_t &get_nb_rows() const

return the number of rows the iterates have

size_t size() const

returns the number of iterates produced by this map (corresponds to the number of field entries if Iteration::Quadpt, or the number of pixels/voxels if Iteration::Pixel);

inline StateWrapper<Mutability> operator[](size_t index)

random access operator

inline StateWrapper<Mapping::Const> operator[](size_t index) const

random constaccess operator

FieldMap_t &get_current()

returns a reference to the map over the current data

const FieldMap_t &get_current() const

returns a const reference to the map over the current data

const CFieldMap_t &get_old(size_t nb_steps_ago) const

returns a const reference to the map over the data which was current nb_steps_ago ago

Protected Functions

RefVector<Field> &get_fields()

protected access to the constituent fields

std::vector<FieldMap_t> make_maps(RefVector<Field> &fields)

helper function creating the list of maps to store for current values

std::vector<CFieldMap_t> make_cmaps(RefVector<Field> &fields)

helper function creating the list of maps to store for old values

Protected Attributes

TypedStateField<T> &state_field

mapped state field. Needed for query at initialisations

const Iteration iteration

type of map iteration

const Dim_t nb_rows

number of rows of the iterate

std::vector<FieldMap_t> maps

maps over nb_memory + 1 possibly mutable maps. current points to one of these

std::vector<CFieldMap_t> cmaps

maps over nb_memory + 1 const maps. old(nb_steps_ago) points to one of these

template<Mapping MutWrapper>
class StateWrapper
#include <state_field_map.hh>

The iterate needs to give access to current or previous values. This is handled by the muGrid::StateFieldMap::StateWrapper, a light-weight wrapper around the iterate’s data.

Public Types

using StateFieldMap_t = std::conditional_t<MutWrapper == Mapping::Const, const StateFieldMap, StateFieldMap>

convenience alias

using CurrentVal_t = typename FieldMap_t::template Return_t<MutWrapper>

return value when getting current value from iterate

using OldVal_t = typename FieldMap_t::template Return_t<Mapping::Const>

return value when getting old value from iterate

Public Functions

inline StateWrapper(StateFieldMap_t &state_field_map, size_t index)

constructor (should never have to be called by user)

~StateWrapper() = default
inline CurrentVal_t &current()

return the current value at this iterate

inline const OldVal_t &old(size_t nb_steps_ago) const

return the value at this iterate which was current nb_steps_ago ago

Protected Attributes

CurrentVal_t current_val

current value at this iterate

std::vector<OldVal_t> old_vals = {}

all old values at this iterate

template<typename T, Mapping Mutability, class MapType, Iteration IterationType = Iteration::QuadPt>
class StaticFieldMap : public muGrid::FieldMap<T, Mutability>

Statically sized field map. Static field maps reproduce the capabilities of the (dynamically sized) muGrid::FieldMap, but iterate much more efficiently.

Public Types

using Scalar = T

stored scalar type

using Parent = FieldMap<T, Mutability>

base class

using Field_t = typename Parent::Field_t

convenience alias

using Return_t = typename MapType::template Return_t<MutType>

return type when dereferencing iterators over this map

using reference = Return_t<Mutability>

stl

using PlainType = typename MapType::PlainType

Eigen type representing iterates of this map.

using Enumeration_t = akantu::containers::ZipContainer<std::conditional_t<(IterationType == Iteration::QuadPt), FieldCollection::IndexIterable, FieldCollection::PixelIndexIterable>, StaticFieldMap&>

iterable proxy type to iterate over the quad point/pixel indices and stored values simultaneously

using iterator = Iterator<(Mutability == Mapping::Mut) ? Mapping::Mut : Mapping::Const>

stl

using const_iterator = Iterator<Mapping::Const>

stl

Public Functions

StaticFieldMap() = delete

Default constructor.

inline explicit StaticFieldMap(Field &field)

Constructor from a non-typed field ref (has more runtime cost than the next constructor

inline explicit StaticFieldMap(Field_t &field)

Constructor from typed field ref.

StaticFieldMap(const StaticFieldMap &other) = delete

Copy constructor.

StaticFieldMap(StaticFieldMap &&other) = default

Move constructor.

virtual ~StaticFieldMap() = default

Destructor.

StaticFieldMap &operator=(const StaticFieldMap &other) = delete

Copy assignment operator.

StaticFieldMap &operator=(StaticFieldMap &&other) = delete

Move assignment operator.

template<bool IsMutableField = Mutability == Mapping::Mut>
inline std::enable_if_t<IsMutableField, StaticFieldMap> &operator=(const typename Parent::EigenRef &val)

Assign a matrix-like value with dynamic size to every entry.

template<bool IsMutableField = Mutability == Mapping::Mut>
inline std::enable_if_t<IsMutableField && !MapType::IsScalarMapType(), StaticFieldMap<T, Mutability, MapType, IterationType>> &operator=(const reference &val)

Assign a matrix-like value with static size to every entry.

template<bool IsMutableField = Mutability == Mapping::Mut>
inline std::enable_if_t<IsMutableField && MapType::IsScalarMapType(), StaticFieldMap<T, Mutability, MapType, IterationType>> &operator=(const Scalar &val)

Assign a scalar value to every entry.

inline Return_t<Mutability> operator[](size_t index)

random access operator

inline Return_t<Mapping::Const> operator[](size_t index) const

random const access operator

inline PlainType mean() const

evaluate the average of the field

inline iterator begin()

stl

inline iterator end()

stl

inline const_iterator begin() const

stl

inline const_iterator end() const

stl

template<bool IsPixelIterable = (IterationType == Iteration::Pixel)>
inline std::enable_if_t<IsPixelIterable, Enumeration_t> enumerate_indices()

iterate over pixel/quad point indices and stored values simultaneously

template<Iteration Iter = Iteration::QuadPt, class Dummy = std::enable_if_t<IterationType == Iter, bool>>
inline Enumeration_t enumerate_indices()

iterate over pixel/quad point indices and stored values simultaneously

Public Static Functions

static inline constexpr Iteration GetIterationType()

determine at compile time whether pixels or quadrature points are iterater over

static inline constexpr size_t Stride()

determine the number of components in the iterate at compile time

static inline constexpr bool IsStatic()

determine whether this map has statically sized iterates at compile time

template<typename T, Mapping Mutability, class MapType, size_t NbMemory, Iteration IterationType = Iteration::QuadPt>
class StaticStateFieldMap : public muGrid::StateFieldMap<T, Mutability>

statically sized version of muGrid::TypedStateField. Duplicates its capabilities, with much more efficient statically sized iterates.

Public Types

using Scalar = T

stored scalar type

using Parent = StateFieldMap<T, Mutability>

base class

using StaticFieldMap_t = StaticFieldMap<T, Mutability, MapType, IterationType>

convenience alias for current map

using CStaticFieldMap_t = StaticFieldMap<T, Mapping::Const, MapType, IterationType>

convenience alias for old map

using MapArray_t = std::array<StaticFieldMap_t, NbMemory + 1>

storage type for current maps

using CMapArray_t = std::array<CStaticFieldMap_t, NbMemory + 1>

storage type for old maps

using iterator = Iterator<(Mutability == Mapping::Mut) ? Mapping::Mut : Mapping::Const>

stl

using const_iterator = Iterator<Mapping::Const>

stl

Public Functions

StaticStateFieldMap() = delete

Deleted default constructor.

inline explicit StaticStateFieldMap(TypedStateField<T> &state_field)

constructor from a state field. The default case is a map iterating over quadrature points with a matrix of shape (nb_components × 1) per field entry

StaticStateFieldMap(const StaticStateFieldMap &other) = delete

Deleted copy constructor.

StaticStateFieldMap(StaticStateFieldMap &&other) = default

Move constructor.

virtual ~StaticStateFieldMap() = default

Destructor.

StaticStateFieldMap &operator=(const StaticStateFieldMap &other) = delete

Copy assignment operator.

StaticStateFieldMap &operator=(StaticStateFieldMap &&other) = default

Move assignment operator.

inline iterator begin()

stl

inline iterator end()

stl

inline const CStaticFieldMap_t &get_old_static(size_t nb_steps_ago) const

return a const ref to an old value map

inline StaticFieldMap_t &get_current_static()

return a ref to an the current map

inline StaticFieldMap_t &get_current()
inline StaticFieldMap_t &get_current_static() const

return a const ref to an the current map

inline StaticFieldMap_t &get_current() const
inline StaticStateWrapper<Mutability> operator[](size_t index)

random access operator

inline StaticStateWrapper<Mapping::Const> operator[](size_t index) const

random const access operator

Public Static Functions

static inline constexpr size_t GetNbMemory()

determine at compile time the number of old values stored

static inline constexpr Mapping FieldMutability()

determine the map’s mutability at compile time

static inline constexpr Iteration GetIterationType()

determine the map’s iteration type (pixels vs quad pts) at compile time

Protected Types

using HelperRet_t = std::conditional_t<MutIter == Mapping::Const, CMapArray_t, MapArray_t>

internal convenience alias

Protected Functions

template<Mapping MutIter, size_t... I>
inline auto map_helper(std::index_sequence<I...>) -> HelperRet_t<MutIter>

helper for building the maps

inline MapArray_t make_maps()

build the current value maps

inline CMapArray_t make_cmaps()

build the old value maps

Protected Attributes

MapArray_t static_maps

container for current maps

CMapArray_t static_cmaps

container for old maps

template<Mapping MutWrapper>
class StaticStateWrapper

The iterate needs to give access to current or previous values. This is handled by the muGrid::StaticStateFieldMap::StateWrapper, a light-weight wrapper around the iterate’s data.

Template Parameters

MutWrapper – mutability of the mapped field. It should never be necessary to set this manually, rather the iterators dereference operator*() should return the correct type.

Public Types

using StaticStateFieldMap_t = std::conditional_t<MutWrapper == Mapping::Const, const StaticStateFieldMap, StaticStateFieldMap>

const-correct map

using CurrentVal_t = typename MapType::template ref_type<MutWrapper>

return type handle for current value

using CurrentStorage_t = typename MapType::template storage_type<MutWrapper>

storage type for current value handle

using OldVal_t = typename MapType::template ref_type<Mapping::Const>

return type handle for old value

using OldStorage_t = typename MapType::template storage_type<Mapping::Const>

storage type for old value handle

Public Functions

inline StaticStateWrapper(StaticStateFieldMap_t &state_field_map, size_t index)

constructor with map and index, not for user to call

~StaticStateWrapper() = default
inline CurrentVal_t &current()

return the current value of the iterate

inline const OldVal_t &old(size_t nb_steps_ago) const

return the value of the iterate which was current nb_steps_ago steps ago. Possibly has excess runtime cost compared to the next function, and has no bounds checking, unlike the next function

template<size_t NbStepsAgo = 1>
inline const OldVal_t &old() const

return the value of the iterate which was current NbStepsAgo steps ago

Protected Functions

inline std::array<OldStorage_t, NbMemory> make_old_vals_static(StaticStateFieldMap_t &state_field_map, size_t index)

helper function to build the list of old values

template<size_t... NbStepsAgo>
inline std::array<OldStorage_t, NbMemory> old_vals_helper_static(StaticStateFieldMap_t &state_field_map, size_t index, std::index_sequence<NbStepsAgo...>)

helper function to build the list of old values

Protected Attributes

CurrentStorage_t current_val

handle to current value

std::array<OldStorage_t, NbMemory> old_vals = {}

storage for handles to old values

template<Dim_t DimM, StrainMeasure StrainM, StressMeasure StressM>
class STMaterialLinearElasticGeneric1 : public muSpectre::MaterialMuSpectre<STMaterialLinearElasticGeneric1<DimM, StrainM, StressM>, DimM>

forward declaration

Linear elastic law defined by a full stiffness tensor with the ability to compile and work for different strain/stress measures

Public Types

using Parent = MaterialMuSpectre<STMaterialLinearElasticGeneric1<DimM, StrainM, StressM>, DimM>

base class:

using CInput_t = Eigen::Ref<Eigen::MatrixXd>
using Strain_t = Eigen::Matrix<Real, DimM, DimM>
using Stress_t = Eigen::Matrix<Real, DimM, DimM>
using Stiffness_t = muGrid::T4Mat<Real, DimM>
using traits = MaterialMuSpectre_traits<STMaterialLinearElasticGeneric1<DimM, StrainM, StressM>>

traits of this material

using Material_sptr = std::shared_ptr<STMaterialLinearElasticGeneric1>

Public Functions

STMaterialLinearElasticGeneric1() = delete

Default constructor.

STMaterialLinearElasticGeneric1(const std::string &name, const Dim_t &spatial_dimension, const Dim_t &nb_quad_pts, const CInput_t &C_voigt)

Constructor by name and stiffness tensor.

Parameters
  • name – unique material name

  • spatial_dimension – spatial dimension of the problem. This corresponds to the dimensionality of the Cell

  • nb_quad_pts – number of quadrature points per pixel

  • C_voigt – elastic tensor in Voigt notation

STMaterialLinearElasticGeneric1(const STMaterialLinearElasticGeneric1 &other) = delete

Copy constructor.

STMaterialLinearElasticGeneric1(STMaterialLinearElasticGeneric1 &&other) = default

Move constructor.

virtual ~STMaterialLinearElasticGeneric1() = default

Destructor.

STMaterialLinearElasticGeneric1 &operator=(const STMaterialLinearElasticGeneric1 &other) = delete

Copy assignment operator.

STMaterialLinearElasticGeneric1 &operator=(STMaterialLinearElasticGeneric1 &&other) = delete

Move assignment operator.

template<class Derived>
inline Stress_t evaluate_stress(const Eigen::MatrixBase<Derived> &E, const size_t &quad_pt_index = 0)

evaluates stress given the strain

template<class Derived>
inline std::tuple<Stress_t, Stiffness_t> evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &strain, const size_t &quad_pt_index = 0)

evaluates both stress and stiffness given the strain

inline void set_F(const Strain_t &Finp)
inline Stiffness_t get_C()
template<class Derived>
auto evaluate_stress(const Eigen::MatrixBase<Derived> &strain, const size_t&) -> Stress_t
template<class Derived>
auto evaluate_stress_tangent(const Eigen::MatrixBase<Derived> &strain, const size_t&) -> std::tuple<Stress_t, Stiffness_t>

Public Static Functions

static std::tuple<Material_sptr, MaterialEvaluator<DimM>> make_evaluator(const CInput_t &C_voigt)

Factory.

Protected Attributes

std::unique_ptr<Stiffness_t> C_holder
const Stiffness_t &C

stiffness tensor

std::unique_ptr<Strain_t> F_holder
Strain_t &F
bool F_is_set
template<class Dummy>
struct StrainsTComputer
template<class StrainMap_t>
struct StrainsTComputer<std::tuple<StrainMap_t>>

Public Types

using type = std::tuple<typename StrainMap_t::reference>
template<class StrainMap_t>
struct StrainsTComputer<std::tuple<StrainMap_t, StrainMap_t>>

Public Types

using type = std::tuple<typename StrainMap_t::reference, typename StrainMap_t::reference>
template<class Dummy>
struct StressesTComputer
template<class StressMap_t>
struct StressesTComputer<std::tuple<StressMap_t>>

Public Types

using type = std::tuple<typename StressMap_t::reference>
template<class StressMap_t, class TangentMap_t>
struct StressesTComputer<std::tuple<StressMap_t, TangentMap_t>>

Public Types

using type = std::tuple<typename StressMap_t::reference, typename TangentMap_t::reference>
template<Dim_t dim, Dim_t i = dim - 1>
struct Summand
#include <eigen_tools.hh>

sum term

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

template<Dim_t dim>
struct Summand<dim, 0>
#include <eigen_tools.hh>

sum term

Public Static Functions

static inline decltype(auto) compute(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

wrapped function (raison d’être)

Public Static Attributes

static constexpr Dim_t i = {0}

short-hand

template<class Derived>
struct tensor_4_dim
#include <eigen_tools.hh>

computes the dimension from a fourth order tensor represented by a square matrix

Public Types

using T = std::remove_reference_t<Derived>

raw type for testing

Public Static Attributes

static constexpr Dim_t value = {ct_sqrt(T::RowsAtCompileTime)}

evaluated dimension

template<class Derived>
struct tensor_dim
#include <eigen_tools.hh>

computes the dimension from a second order tensor represented square matrix or array

Public Types

using T = std::remove_reference_t<Derived>

raw type for testing

Public Static Attributes

static constexpr Dim_t value = {T::RowsAtCompileTime}

evaluated dimension

template<class Derived, Dim_t Dim>
struct tensor_rank
#include <eigen_tools.hh>

computes the rank of a tensor given the spatial dimension

Public Types

using T = std::remove_reference_t<Derived>

Public Static Attributes

static constexpr Dim_t value{internal::get_rank<Dim, T::RowsAtCompileTime, T::ColsAtCompileTime>()}
template<class Cell>
struct traits<muSpectre::CellAdaptor<Cell>> : public Eigen::internal::traits<Eigen::SparseMatrix<Real>>, public Eigen::internal::traits<Eigen::SparseMatrix<Real>>
template<class OutType>
struct TupleBuilder

Public Static Functions

template<class ...InTypes, size_t... I>
static inline OutType helper(std::tuple<InTypes...> const &arg, std::index_sequence<I...>)
template<class ...InTypes>
static inline OutType build(std::tuple<InTypes...> const &arg)
template<typename T, typename FirstVal, typename ...RestVals>
struct TypeChecker
#include <ref_array.hh>

Struct user for checking that every member of a parameter pack has type T

Public Static Attributes

static constexpr bool value  {std::is_same<T, std::remove_reference_t<FirstVal>>::value andTypeChecker<T, RestVals...>::value}

whether the check passed

template<typename T, typename OnlyVal>
struct TypeChecker<T, OnlyVal>
#include <ref_array.hh>

Specialisation for recursion tail

Public Static Attributes

static constexpr bool value{std::is_same<T, std::remove_reference_t<OnlyVal>>::value}

whether the check passed

template<typename T>
class TypedField : public muGrid::TypedFieldBase<T>

forward declaration of the muSpectre::TypedField

forward declaration of the muGrid::TypedField

A muGrid::TypedField holds a certain number of components (scalars of type T per quadrature point of a muGrid::FieldCollection’s domain.

Template Parameters

T – type of scalar to hold. Must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex.

Public Types

using Parent = TypedFieldBase<T>

base class

using EigenRep_t = typename Parent::EigenRep_t

Eigen type to represent the field’s data.

using Negative = typename Parent::Negative

convenience alias

Public Functions

TypedField() = delete

Default constructor.

TypedField(TypedField &&other) = delete

Copy constructor.

Move constructor

virtual ~TypedField() = default

Destructor.

TypedField &operator=(TypedField &&other) = delete

Move assignment operator.

TypedField &operator=(const Parent &other)

Copy assignment operator.

TypedField &operator=(const Negative &other)

Copy assignment operator.

TypedField &operator=(const EigenRep_t &other)

Copy assignment operator.

virtual void set_zero() final

initialise field to zero (do more complicated initialisations through fully typed maps)

virtual void set_pad_size(size_t pad_size) final

add a pad region to the end of the field buffer; required for using this as e.g. an FFT workspace

virtual size_t buffer_size() const final

size of the internal buffer including the pad region (in scalars)

void push_back(const T &value)

add a new scalar value at the end of the field (incurs runtime cost, do not use this in any hot loop)

void push_back(const Eigen::Ref<const Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic>> &value)

add a new non-scalar value at the end of the field (incurs runtime cost, do not use this in any hot loop)

Public Members

friend FieldCollection

give access to collections

Public Static Functions

static TypedField &safe_cast(Field &other)

cast a reference to a base type to this type, with full checks

static const TypedField &safe_cast(const Field &other)

cast a const reference to a base type to this type, with full checks

static TypedField &safe_cast(Field &other, const Dim_t &nb_components)

cast a reference to a base type to this type safely, plus check whether it has the right number of components

static const TypedField &safe_cast(const Field &other, const Dim_t &nb_components)

cast a const reference to a base type to this type safely, plus check whether it has the right number of components

Protected Functions

inline TypedField(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components)

Fields are supposed to only exist in the form of std::unique_ptrs held by a FieldCollection. The Field constructor is protected to ensure this.

Parameters
  • unique_name – unique field name (unique within a collection)

  • nb_components – number of components to store per quadrature point

  • collection – reference to the holding field collection.

virtual void resize(size_t size) final

resizes the field to the given size

Protected Attributes

std::vector<T> values = {}

storage of the raw field data

template<typename T>
class TypedFieldBase : public muGrid::Field
#include <field_typed.hh>

forward declaration

Subclassed by muGrid::TypedField< T >, muGrid::WrappedField< T >, muGrid::TypedField< Scalar >

Public Types

using Scalar = T

stored scalar type

using EigenRep_t = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>

Eigen type used to represent the field’s data.

using Eigen_map = Eigen::Map<EigenRep_t>

eigen map (handle for EigenRep_t)

using Eigen_cmap = Eigen::Map<const EigenRep_t>

eigen const map (handle for EigenRep_t)

using Parent = Field

base class

Public Functions

TypedFieldBase() = delete

Default constructor.

TypedFieldBase(const TypedFieldBase &other) = delete

Copy constructor.

TypedFieldBase(TypedFieldBase &&other) = default

Move constructor.

virtual ~TypedFieldBase() = default

Destructor.

TypedFieldBase &operator=(TypedFieldBase &&other) = delete

Move assignment operator.

TypedFieldBase &operator=(const TypedFieldBase &other)

Copy assignment operator.

TypedFieldBase &operator=(const Negative &other)

Copy assignment operator.

TypedFieldBase &operator=(const EigenRep_t &other)

Copy assignment operators.

Negative operator-() const

Unary negative.

TypedFieldBase &operator+=(const TypedFieldBase &other)

addition assignment

TypedFieldBase &operator-=(const TypedFieldBase &other)

subtraction assignment

inline virtual const std::type_info &get_stored_typeid() const final

return the type information of the stored scalar (for compatibility checking)

Eigen_map eigen_vec()

return a vector map onto the underlying data

Eigen_cmap eigen_vec() const

return a const vector map onto the underlying data

Eigen_map eigen_quad_pt()

return a matrix map onto the underlying data with one column per quadrature point

Eigen_cmap eigen_quad_pt() const

return a const matrix map onto the underlying data with one column per quadrature point

Eigen_map eigen_pixel()

return a matrix map onto the underlying data with one column per pixel

Eigen_cmap eigen_pixel() const

return a const matrix map onto the underlying data with one column per pixel

FieldMap<T, Mapping::Mut> get_pixel_map(const Dim_t &nb_rows = Unknown)

convenience function returns a map of this field, iterable per pixel.

Parameters

nb_rows – optional specification of the number of rows for the iterate. If left to default value, a matrix of shape nb_components × nb_quad_pts is used

FieldMap<T, Mapping::Const> get_pixel_map(const Dim_t &nb_rows = Unknown) const

convenience function returns a const map of this field, iterable per pixel.

Parameters

nb_rows – optional specification of the number of rows for the iterate. If left to default value, a matrix of shape nb_components × nb_quad_pts is used

FieldMap<T, Mapping::Mut> get_quad_pt_map(const Dim_t &nb_rows = Unknown)

convenience function returns a map of this field, iterable per quadrature point.

Parameters

nb_rows – optional specification of the number of rows for the iterate. If left to default value, a column vector is used

FieldMap<T, Mapping::Const> get_quad_pt_map(const Dim_t &nb_rows = Unknown) const

convenience function returns a const map of this field, iterable per quadrature point.

Parameters

nb_rows – optional specification of the number of rows for the iterate. If left to default value, a column vector is used

T *data() const

get the raw data ptr. don’t use unless interfacing with external libs

Protected Functions

inline TypedFieldBase(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components)

Fields are supposed to only exist in the form of std::unique_ptrs held by a FieldCollection. TheFieldconstructor is protected to ensure this. Fields are instantiated through theregister_field` methods FieldCollection.

Parameters
  • unique_name – unique field name (unique within a collection)

  • nb_components – number of components to store per quadrature point

  • collection – reference to the holding field collection.

Eigen_map eigen_map(const Dim_t &nb_rows, const Dim_t &nb_cols)

back-end for the public non-const eigen_XXX functions

Eigen_cmap eigen_map(const Dim_t &nb_rows, const Dim_t &nb_cols) const

back-end for the public const eigen_XXX functions

void set_data_ptr(T *ptr)

set the data_ptr

Protected Attributes

T *data_ptr = {}

in order to accomodate both registered fields (who own and manage their data) and unregistered temporary field proxies (piggy-backing on a chunk of existing memory as e.g., a numpy array) efficiently, the get_ptr_to_entry methods need to be branchless. this means that we cannot decide on the fly whether to return pointers pointing into values or into alt_values, we need to maintain an (shudder) raw data pointer that is set either at construction (for unregistered fields) or at any resize event (which may invalidate existing pointers). For the coder, this means that they need to be absolutely vigilant that any operation on the values vector that invalidates iterators needs to be followed by an update of data_ptr, or we will get super annoying memory bugs.

Friends

friend class FieldMap
template<typename T>
class TypedStateField : public muGrid::StateField

forward declaration of the state field

forward declaration

The TypedStateField class is a byte compatible daughter class of the StateField class, and it can return fully typed Field references.

Public Types

using Parent = StateField

base class

Public Functions

TypedStateField() = delete

Deleted default constructor.

TypedStateField(const TypedStateField &other) = delete

Copy constructor.

TypedStateField(TypedStateField &&other) = delete

Move constructor.

virtual ~TypedStateField() = default

Destructor.

TypedStateField &operator=(const TypedStateField &other) = delete

Copy assignment operator.

TypedStateField &operator=(TypedStateField &&other) = delete

Move assignment operator.

virtual const std::type_info &get_stored_typeid() const final

return type_id of stored type

TypedField<T> &current()

return a reference to the current field

const TypedField<T> &current() const

return a const reference to the current field

const TypedField<T> &old(size_t nb_steps_ago = 1) const

return a const reference to the field which was current nb_steps_ago steps ago

Protected Functions

TypedStateField(const std::string &unique_prefix, FieldCollection &collection, Dim_t nb_memory, Dim_t nb_components)

protected constructor, to avoid the creation of unregistered fields. Users should create fields through the muGrid::FieldCollection::register_real_field() (or int, uint, compplex) factory functions.

RefVector<Field> &get_fields()

return a reference to the storage of the constituent fields

Protected Attributes

friend FieldCollection

give access to the protected state field constructor

Friends

friend class StateFieldMap< T, Mapping::Const >
friend class StateFieldMap< T, Mapping::Mut >
class Vectors_t

Public Functions

inline explicit Vectors_t(const Dim_t &dim)

constructor

inline Vectors_t(const std::vector<Real> &data, const Dim_t &dim)

constructor

inline Eigen::Map<const Vector_t> operator[](const Dim_t &id) const

access operator:

inline Eigen::Map<Vector_t> operator[](const Dim_t &id)

access operator:

template<Dim_t DimS>
inline Eigen::Map<Eigen::Matrix<Real, DimS, 1>> at(const Dim_t &id)

access to staic sized map of the vectors:

inline void push_back(const Vector_t &vector)

push back for adding new vector to the data of the class

inline void push_back(const Eigen::Map<Vector_t, 0> &vector)

push back for adding new vector to the data of the class

inline void push_back(const Eigen::Map<const Vector_t, 0> &vector)

push back for adding new vector to the data of the class

inline void push_back(const DynRcoord_t &vector)

push back for adding new vector from DynRcoord

inline std::vector<Real> get_a_vector(const Dim_t &id)
inline const Dim_t &get_dim()
inline iterator begin()
inline iterator end()
inline size_t size() const

Protected Attributes

std::vector<Real> data = {}
Dim_t dim

Private Types

using Vector_t = Eigen::Matrix<Real, Eigen::Dynamic, 1>
template<Dim_t dim>
class VoigtConversion

implements a bunch of static functions to convert between full and Voigt notation of tensors

Public Functions

VoigtConversion()
template<>
inline auto get_sym_mat() -> decltype(auto)

voigt vector indices for symmetric tensors

template<>
inline auto get_sym_mat() -> decltype(auto)
template<>
inline auto get_sym_mat() -> decltype(auto)
template<>
inline auto get_mat() -> decltype(auto)

voigt vector indices for non_symmetric tensors

template<>
inline auto get_mat() -> decltype(auto)
template<>
inline auto get_mat() -> decltype(auto)
template<>
inline auto get_vec() -> decltype(auto)

matrix indices from voigt vectors

template<>
inline auto get_vec() -> decltype(auto)
template<>
inline auto get_vec() -> decltype(auto)
template<>
inline auto get_factors() -> decltype(auto)
template<>
inline auto get_factors() -> decltype(auto)
template<>
inline auto get_factors() -> decltype(auto)
template<>
inline auto get_vec_vec() -> decltype(auto)

reordering between a row/column in voigt vs col-major matrix (e.g., stiffness tensor)

template<>
inline auto get_vec_vec() -> decltype(auto)
template<>
inline auto get_vec_vec() -> decltype(auto)

Public Static Functions

template<class Tens4, class Voigt, bool sym = true>
static inline void fourth_to_voigt(const Tens4 &t, Voigt &v)

obtain a fourth order voigt matrix from a tensor

template<class Tens4, bool sym = true> static inline Eigen::Matrix< Real, vsize< sym >dim), vsize< sym >dim)> fourth_to_voigt (const Tens4 &t)

return a fourth order voigt matrix from a tensor

template<class Tens4> static inline Eigen::Matrix< Real, vsize< false >dim), vsize< false >dim)> fourth_to_2d (const Tens4 &t)

return a fourth order non-symmetric voigt matrix from a tensor

template<class Tens2, class Voigt, bool sym = true>
static inline void second_to_voigt(const Tens2 &t, Voigt &v)

probably obsolete

template<class Tens2, class Voigt>
static inline void gradient_to_voigt_strain(const Tens2 &F, Voigt &v)

probably obsolete

template<class Tens2, class Voigt>
static inline void gradient_to_voigt_GreenLagrange_strain(const Tens2 &F, Voigt &v)

probably obsolete

template<class Tens2, class Voigt, bool sym = true>
static inline void stress_from_voigt(const Voigt &v, Tens2 &sigma)

probably obsolete

static inline auto get_mat() -> decltype(auto)
static inline auto get_sym_mat() -> decltype(auto)
static inline auto get_vec() -> decltype(auto)
static inline auto get_factors() -> decltype(auto)
static inline auto get_vec_vec() -> decltype(auto)

Private Functions

template<> const Eigen::Matrix< Dim_t, 1, 1 > mat

voigt vector indices for non-symmetric tensors

template<> const Eigen::Matrix< Dim_t, 2, 2 > mat

voigt vector indices for non-symmetric tensors

template<> const Eigen::Matrix< Dim_t, 3, 3 > mat

voigt vector indices for non-symmetric tensors

template<> const Eigen::Matrix< Dim_t, 1, 1 > sym_mat

voigt vector indices

template<> const Eigen::Matrix< Dim_t, 2, 2 > sym_mat

voigt vector indices

template<> const Eigen::Matrix< Dim_t, 3, 3 > sym_mat

voigt vector indices

template<> const Eigen::Matrix< Dim_t, 1 *1, 2 > vec

matrix indices from voigt vectors

template<> const Eigen::Matrix< Dim_t, 2 *2, 2 > vec

matrix indices from voigt vectors

template<> const Eigen::Matrix< Dim_t, 3 *3, 2 > vec

matrix indices from voigt vectors

template<> const Eigen::Matrix< Real, vsize(1), 1 > factors

factors for shear components in voigt notation

template<> const Eigen::Matrix< Real, vsize(2), 1 > factors

factors for shear components in voigt notation

template<> const Eigen::Matrix< Real, vsize(3), 1 > factors

factors for shear components in voigt notation

template<> const Eigen::Matrix< Dim_t, 1 *1, 1 > vec_vec

reordering between a row/column in voigt vs col-major matrix (e.g., stiffness tensor)

template<> const Eigen::Matrix< Dim_t, 2 *2, 1 > vec_vec
template<> const Eigen::Matrix< Dim_t, 3 *3, 1 > vec_vec

Private Static Attributes

static const Eigen::Matrix<Dim_t, dim, dim> mat

matrix of vector index I as function of tensor indices i,j

static const Eigen::Matrix<Dim_t, dim, dim> sym_mat

matrix of vector index I as function of tensor indices i,j

static const Eigen::Matrix<Dim_t, dim * dim, 2> vec

array of matrix indices ij as function of vector index I

static const Eigen::Matrix<Real, vsize(dim), 1> factors

factors to multiply the strain by for voigt notation

static const Eigen::Matrix<Dim_t, dim * dim, 1> vec_vec

reordering between a row/column in voigt vs col-major matrix (e.g., stiffness tensor)

template<typename T>
class WrappedField : public muGrid::TypedFieldBase<T>
#include <field_typed.hh>

Wrapper class providing a field view of existing memory. This is particularly useful when dealing with input from external libraries (e.g., numpy arrays)

Public Types

using Parent = TypedFieldBase<T>

base class

using EigenRep_t = typename Parent::EigenRep_t

convenience alias to the Eigen representation of this field’s data

Public Functions

WrappedField(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components, size_t size, T *ptr)

constructor from a raw pointer. Typically, this would be a reference to a numpy array from the python bindings.

WrappedField(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components, Eigen::Ref<EigenRep_t> values)

constructor from an eigen array ref.

WrappedField() = delete

Default constructor.

WrappedField(const WrappedField &other) = delete

Copy constructor.

WrappedField(WrappedField &&other) = default

Move constructor.

virtual ~WrappedField() = default

Destructor.

WrappedField &operator=(const WrappedField &other) = delete

Copy assignment operator.

WrappedField &operator=(WrappedField &&other) = delete

Move assignment operator.

virtual void set_zero() final

initialise field to zero (do more complicated initialisations through fully typed maps)

virtual void set_pad_size(size_t pad_size) final

add a pad region to the end of the field buffer; required for using this as e.g. an FFT workspace

virtual size_t buffer_size() const final

size of the internal buffer including the pad region (in scalars)

Public Members

friend FieldCollection

give access to collections

Public Static Functions

static std::unique_ptr<const WrappedField> make_const(const std::string &unique_name, FieldCollection &collection, Dim_t nb_components, const Eigen::Ref<const EigenRep_t> values)

Emulation of a const constructor.

Protected Functions

virtual void resize(size_t size) final

resizes the field to the given size

Protected Attributes

size_t size

size of the wrapped buffer

template<class ...Containers>
class ZipContainer
#include <iterators.hh>

helper for the emulation of python zip

Public Functions

inline explicit ZipContainer(Containers&&... containers)

undocumented

inline decltype(auto) begin() const

undocumented

inline decltype(auto) end() const

undocumented

inline decltype(auto) begin()

undocumented

inline decltype(auto) end()

undocumented

Private Types

using containers_t = std::tuple<Containers...>

Private Members

containers_t containers
template<class ...Iterators>
class ZipIterator
#include <iterators.hh>

iterator for emulation of python zip

Public Functions

inline explicit ZipIterator(tuple_t iterators)

undocumented

inline decltype(auto) operator*()

undocumented

inline ZipIterator &operator++()

undocumented

inline bool operator==(const ZipIterator &other) const

undocumented

inline bool operator!=(const ZipIterator &other) const

undocumented

Private Types

using tuple_t = std::tuple<Iterators...>

Private Members

tuple_t iterators
namespace akantu

Functions

template<class ...Iterators>
decltype(auto) zip_iterator(std::tuple<Iterators...> &&iterators_tuple)

emulates python zip()

template<class ...Containers>
decltype(auto) zip(Containers&&... conts)

emulates python’s zip()

template<class T, typename = std::enable_if_t<std::is_integral<std::decay_t<T>>::value>>
inline decltype(auto) arange(const T &stop)

emulates python’s range()

template<class T1, class T2, typename = std::enable_if_t<std::is_integral<std::common_type_t<T1, T2>>::value>>
inline decltype(auto) constexpr arange(const T1 &start, const T2 &stop)

emulates python’s range()

template<class T1, class T2, class T3, typename = std::enable_if_t<std::is_integral<std::common_type_t<T1, T2, T3>>::value>>
inline decltype(auto) constexpr arange(const T1 &start, const T2 &stop, const T3 &step)

emulates python’s range()

template<class Container>
inline decltype(auto) constexpr enumerate(Container &&container, size_t start_ = 0)

emulates python’s enumerate

namespace containers
namespace iterators
namespace tuple

Functions

template<class Tuple>
bool are_not_equal(Tuple &&a, Tuple &&b)

detail

template<class F, class Tuple>
void foreach_(F &&func, Tuple &&tuple)

detail

template<class F, class Tuple>
decltype(auto) transform(F &&func, Tuple &&tuple)

detail

namespace details

Functions

template<typename ...Ts>
decltype(auto) make_tuple_no_decay(Ts&&... args)

eats up a bunch of arguments and returns them packed in a tuple

template<class F, class Tuple, size_t... Is>
void foreach_impl(F &&func, Tuple &&tuple, std::index_sequence<Is...>&&)

helper for static for loop

template<class F, class Tuple, size_t... Is>
decltype(auto) transform_impl(F &&func, Tuple &&tuple, std::index_sequence<Is...>&&)

detail

namespace Eigen
namespace internal

Typedefs

typedef muSpectre::Dim_t Dim_t

universal index type

typedef muSpectre::Real Real

universal real value type

namespace muFFT

Typedefs

using Matrix_t = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
using Derivative_ptr = std::shared_ptr<DerivativeBase>

convenience alias

using Gradient_t = std::vector<Derivative_ptr>

convenience alias

using FFTEngine_ptr = std::shared_ptr<FFTEngineBase>

reference to fft engine is safely managed through a std::shared_ptr

Enums

enum FFT_PlanFlags

Planner flags for FFT (follows FFTW, hopefully this choice will be compatible with alternative FFT implementations)

Values:

enumerator estimate

cheapest plan for slowest execution

enumerator measure

more expensive plan for fast execution

enumerator patient

very expensive plan for fastest execution

Functions

template<typename T>
T modulo(T a, T b)

module operator that can handle negative values

std::ostream &operator<<(std::ostream &os, const DiscreteDerivative &derivative)

Allows inserting muFFT::DiscreteDerivatives into std::ostreams

Gradient_t make_fourier_gradient(const Dim_t &spatial_dimension)

convenience function to build a spatial_dimension-al gradient operator using exact Fourier differentiation

Parameters

spatial_dimension – number of spatial dimensions

std::valarray<Real> fft_freqs(size_t nb_samples)

compute fft frequencies (in time (or length) units of of sampling periods), see numpy’s fftfreq function for reference

std::valarray<Real> fft_freqs(size_t nb_samples, Real length)

compute fft frequencies in correct length or time units. Here, length refers to the total size of the domain over which the fft is taken (for instance the length of an edge of an RVE)

template<size_t dim>
constexpr Ccoord_t<dim> get_nb_hermitian_grid_pts(Ccoord_t<dim> full_nb_grid_pts)

returns the hermition grid to correcsponding to a full grid, assuming that the last dimension is not fully represented in reciprocal space

template<size_t MaxDim>
inline muGrid::DynCcoord<MaxDim> get_nb_hermitian_grid_pts(muGrid::DynCcoord<MaxDim> full_nb_grid_pts)

returns the hermition grid to correcsponding to a full grid, assuming that the last dimension is not fully represented in reciprocal space

inline Int fft_freq(Int i, size_t nb_samples)

compute fft frequency (in time (or length) units of of sampling periods), see numpy’s fftfreq function for reference

inline Real fft_freq(Int i, size_t nb_samples, Real length)

compute fft frequency in correct length or time units. Here, length refers to the total size of the domain over which the fft is taken (for instance the length of an edge of an RVE)

template<size_t dim>
inline std::array<std::valarray<Real>, dim> fft_freqs(Ccoord_t<dim> nb_grid_pts)

Get fft_freqs for a grid

template<size_t dim>
inline std::array<std::valarray<Real>, dim> fft_freqs(Ccoord_t<dim> nb_grid_pts, std::array<Real, dim> lengths)

Get fft_freqs for a grid in correct length or time units.

namespace internal

Functions

template<Dim_t Dim, size_t... I>
constexpr Ccoord_t<Dim> herm(const Ccoord_t<Dim> &nb_grid_pts, std::index_sequence<I...>)

computes hermitian size according to FFTW

namespace muGrid

Typedefs

using optional = typename std::experimental::optional<T>

emulation std::optional (a C++17 feature)

using Decomp_t = Eigen::SelfAdjointEigenSolver<Eigen::Matrix<Real, dim, dim>>

It seems we only need to take logs of self-adjoint matrices

using Matrix_t = Eigen::Matrix<Real, Dim, Dim>
using MatrixFieldMap = StaticFieldMap<T, Mutability, internal::MatrixMap<T, NbRow, NbCol>, IterationType>

Alias of muGrid::StaticFieldMap you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Matrix iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • IterationType – whether to iterate over pixels or quadrature points

using ArrayFieldMap = StaticFieldMap<T, Mutability, internal::ArrayMap<T, NbRow, NbCol>, IterationType>

Alias of muGrid::StaticFieldMap you wish to iterate over pixel by pixel or quadrature point by quadrature point with* statically sized Eigen::Array iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • IterationType – whether to iterate over pixels or quadrature points

using ScalarFieldMap = StaticFieldMap<T, Mutability, internal::ScalarMap<T>, Iteration::QuadPt>

Alias of muGrid::StaticFieldMap over a scalar field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

using T1NFieldMap = StaticFieldMap<T, Mutability, internal::MatrixMap<T, Dim, 1>, Iteration::QuadPt>

Alias of muGrid::StaticNFieldMap over a first-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

using T1FieldMap = StaticFieldMap<T, Mutability, internal::MatrixMap<T, Dim, 1>, Iteration::QuadPt>

Alias of muGrid::StaticFieldMap over a second-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

using T2FieldMap = StaticFieldMap<T, Mutability, internal::MatrixMap<T, Dim, Dim>, Iteration::QuadPt>

Alias of muGrid::StaticFieldMap over a second-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

using T4FieldMap = StaticFieldMap<T, Mutability, internal::MatrixMap<T, Dim * Dim, Dim * Dim>, Iteration::QuadPt>

Alias of muGrid::StaticFieldMap over a fourth-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

using RealField = TypedField<Real>

Alias for real-valued fields.

using ComplexField = TypedField<Complex>

Alias for complex-valued fields.

using IntField = TypedField<Int>

Alias for integer-valued fields.

using UintField = TypedField<Uint>

Alias for unsigned integer-valued fields.

using Dim_t = int

Eigen uses signed integers for dimensions. For consistency, µGrid uses them througout the code. Needs to represent -1 for Eigen

using Uint = unsigned int

type to use in math for unsigned integers

using Int = int

type to use in math for signed integers

using Real = double

type to use in math for real numbers

using Complex = std::complex<Real>

type to use in math for complex numbers

using Ccoord_t = std::array<Dim_t, Dim>

Ccoord_t are cell coordinates, i.e. integer coordinates.

using Rcoord_t = std::array<Real, Dim>

Real space coordinates.

using DynCcoord_t = DynCcoord<threeD>

usually, we should not need omre than three dimensions

using DynRcoord_t = DynCcoord<threeD, Real>

usually, we should not need omre than three dimensions

using MappedMatrixField = MappedField<MatrixFieldMap<T, Mutability, NbRow, NbCol, IterationType>>

Alias of muGrid::MappedField for a map with corresponding muSpectre::Field you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Matrix iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • IterationType – whether to iterate over pixels or quadrature points

using MappedArrayField = MappedField<ArrayFieldMap<T, Mutability, NbRow, NbCol, IterationType>>

Alias of muGrid::MappedField for a map with corresponding muSpectre::Field you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Array iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • IterationType – whether to iterate over pixels or quadrature points

using MappedScalarField = MappedField<ScalarFieldMap<T, Mutability>>

Alias of muGrid::MappedField for a map of scalars with corresponding muSpectre::Field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

using MappedT1Field = MappedField<T1FieldMap<T, Mutability, Dim>>

Alias of muGrid::MappedField for a map of second-rank with corresponding muSpectre::Field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

using MappedT2Field = MappedField<T2FieldMap<T, Mutability, Dim>>

Alias of muGrid::MappedField for a map of first-rank with corresponding muSpectre::Field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

using MappedT4Field = MappedField<T4FieldMap<T, Mutability, Dim>>

Alias of muGrid::MappedField for a map of fourth-rank with corresponding muSpectre::Field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

using MappedMatrixStateField = MappedStateField<MatrixStateFieldMap<T, Mutability, NbRow, NbCol, NbMemory, IterationType>>

Alias of muGrid::MappedStateField for a map with corresponding muSpectre::StateField you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Matrix iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • NbMemory – number of previous values to store

  • IterationType – whether to iterate over pixels or quadrature points

using MappedArrayStateField = MappedStateField<ArrayStateFieldMap<T, Mutability, NbRow, NbCol, NbMemory, IterationType>>

Alias of muGrid::MappedStateField for a map with corresponding muSpectre::StateField you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Array iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • NbMemory – number of previous values to store

  • IterationType – whether to iterate over pixels or quadrature points

using MappedScalarStateField = MappedStateField<ScalarStateFieldMap<T, Mutability, NbMemory>>

Alias of muGrid::MappedStateField for a map of scalars with corresponding muSpectre::StateField you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbMemory – number of previous values to store

using MappedT1StateNField = MappedStateField<T1StateNFieldMap<T, Mutability, Dim, NbMemory>>

Alias of muGrid::MappedStateField for a map of first-rank with corresponding muSpectre::StateNField you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

  • NbMemory – number of previous values to store

using MappedT2StateField = MappedStateField<T2StateFieldMap<T, Mutability, Dim, NbMemory>>

Alias of muGrid::MappedStateField for a map of second-rank with corresponding muSpectre::StateField you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

  • NbMemory – number of previous values to store

using MappedT4StateField = MappedStateField<T4StateFieldMap<T, Mutability, Dim, NbMemory>>

Alias of muGrid::MappedStateField for a map of fourth-rank with corresponding muSpectre::StateField you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensors

  • NbMemory – number of previous values to store

using RealStateField = TypedStateField<Real>

Alias for real-valued state fields.

using ComplexStateField = TypedStateField<Complex>

Alias for complex-valued state fields.

using IntStateField = TypedStateField<Int>

Alias for integer-valued state fields.

using Uintfield = TypedStateField<Uint>

Alias for unsigned integer-valued state fields.

using MatrixStateFieldMap = StaticStateFieldMap<T, Mutability, internal::MatrixMap<T, NbRow, NbCol>, NbMemory, IterationType>

Alias of muGrid::StaticStateFieldMap you wish to iterate over pixel by pixel or quadrature point by quadrature point with statically sized Eigen::Matrix iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • NbMemory – number of previous values to store

  • IterationType – whether to iterate over pixels or quadrature points

using ArrayStateFieldMap = StaticStateFieldMap<T, Mutability, internal::ArrayMap<T, NbRow, NbCol>, NbMemory, IterationType>

Alias of muGrid::StaticStateFieldMap you wish to iterate over pixel by pixel or quadrature point by quadrature point with* statically sized Eigen::Array iterates

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbRow – number of rows of the iterate

  • NbCol – number of columns of the iterate

  • NbMemory – number of previous values to store

  • IterationType – whether to iterate over pixels or quadrature points

using ScalarStateFieldMap = StaticStateFieldMap<T, Mutability, internal::ScalarMap<T>, NbMemory, Iteration::QuadPt>

Alias of muGrid::StaticStateFieldMap over a scalar field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • NbMemory – number of previous values to store

using T1StateNFieldMap = StaticStateFieldMap<T, Mutability, internal::MatrixMap<T, Dim, 1>, NbMemory, Iteration::QuadPt>

Alias of muGrid::StaticStateNFieldMap over a first-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

  • NbMemory – number of previous values to store

using T2StateFieldMap = StaticStateFieldMap<T, Mutability, internal::MatrixMap<T, Dim, Dim>, NbMemory, Iteration::QuadPt>

Alias of muGrid::StaticStateNFieldMap over a second-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

  • NbMemory – number of previous values to store

using T4StateFieldMap = StaticStateFieldMap<T, Mutability, internal::MatrixMap<T, Dim * Dim, Dim * Dim>, NbMemory, Iteration::QuadPt>

Alias of muGrid::StaticStateFieldMap over a fourth-rank tensor field you wish to iterate over quadrature point by quadrature point.

Template Parameters
  • T – scalar type stored in the field, must be one of muGrid::Real, muGrid::Int, muGrid::Uint, muGrid::Complex

  • Mutability – whether or not the map allows to modify the content of the field

  • Dim – spatial dimension of the tensor

  • NbMemory – number of previous values to store

using T4Mat = Eigen::Matrix<T, Dim * Dim, Dim * Dim>

simple adapter function to create a matrix that can be mapped as a tensor

using T4MatMap = std::conditional_t<ConstMap, Eigen::Map<const T4Mat<T, Dim>>, Eigen::Map<T4Mat<T, Dim>>>

Map onto muGrid::T4Mat

Enums

enum Iteration

Used to specify whether to iterate over pixels or quadrature points in field maps

Values:

enumerator Pixel
enumerator QuadPt
enum Mapping

Maps can give constant or mutable access to the mapped field through their iterators or access operators.

Values:

enumerator Const
enumerator Mut

Functions

template<Dim_t order, Dim_t dim, typename Fun_t>
inline decltype(auto) call_sizes(Fun_t &&fun)

takes a lambda and calls it with the proper Eigen::Sizes unpacked as arguments. Is used to call constructors of a Eigen::Tensor or map thereof in a context where the spatial dimension is templated

static constexpr Dim_t ct_sqrt(Dim_t res, Dim_t l, Dim_t r)
static constexpr Dim_t ct_sqrt(Dim_t res)
template<Dim_t dim>
inline decltype(auto) logm(const log_comp::Mat_t<dim> &mat)

computes the matrix logarithm efficiently for dim=1, 2, or 3 for a diagonizable tensor. For larger tensors, better use the direct eigenvalue/vector computation

template<class Derived, template<class Matrix_t> class DecompType = Eigen::SelfAdjointEigenSolver>
inline decltype(auto) spectral_decomposition(const Eigen::MatrixBase<Derived> &mat)

compute the spectral decomposition

template<Dim_t Dim>
inline decltype(auto) logm_alt(const Decomp_t<Dim> &spectral_decomp)

Uses a pre-existing spectral decomposition of a matrix to compute its logarithm

Parameters

spectral_decomp – spectral decomposition of a matrix

Template Parameters

Dim – spatial dimension (i.e., number of rows and colums in the matrix)

template<class Derived>
inline decltype(auto) logm_alt(const Eigen::MatrixBase<Derived> &mat)

compute the matrix log with a spectral decomposition. This may not be the most efficient way to do this

template<Dim_t Dim, template<class Matrix_t> class DecompType = Eigen::SelfAdjointEigenSolver>
inline decltype(auto) expm(const Decomp_t<Dim> &spectral_decomp)

Uses a pre-existing spectral decomposition of a matrix to compute its exponential

Parameters

spectral_decomp – spectral decomposition of a matrix

Template Parameters

Dim – spatial dimension (i.e., number of rows and colums in the matrix)

template<class Derived>
inline decltype(auto) expm(const Eigen::MatrixBase<Derived> &mat)

compute the matrix exponential with a spectral decomposition. This may not be the most efficient way to do this

template<typename T, size_t Dim>
Eigen::Map<Eigen::Matrix<T, Dim, 1>> eigen(std::array<T, Dim> &coord)

return a Eigen representation of the data stored in a std::array (e.g., for doing vector operations on a coordinate)

template<typename T, size_t Dim>
Eigen::Map<const Eigen::Matrix<T, Dim, 1>> eigen(const std::array<T, Dim> &coord)

return a constant Eigen representation of the data stored in a std::array (e.g., for doing vector operations on a coordinate)

template<typename T, size_t MaxDim>
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1>> eigen(DynCcoord<MaxDim, T> &coord)

return a Eigen representation of the data stored in a std::array (e.g., for doing vector operations on a coordinate)

template<typename T, size_t MaxDim>
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> eigen(const DynCcoord<MaxDim, T> &coord)

return a const Eigen representation of the data stored in a std::array (e.g., for doing vector operations on a coordinate)

template<typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &values)

Allows inserting std::vector into std::ostreams

template<typename T, size_t dim>
std::ostream &operator<<(std::ostream &os, const std::array<T, dim> &values)

Allows inserting muGrid::Ccoord_t and muGrid::Rcoord_t into std::ostreams

template<size_t MaxDim, typename T>
std::ostream &operator<<(std::ostream &os, const DynCcoord<MaxDim, T> &values)

Allows inserting muGrid::DynCcoord into std::ostreams

template<size_t dim>
Rcoord_t<dim> operator/(const Rcoord_t<dim> &a, const Rcoord_t<dim> &b)

element-wise division

template<size_t dim>
Rcoord_t<dim> operator/(const Rcoord_t<dim> &a, const Ccoord_t<dim> &b)

element-wise division

template<typename R, typename I>
constexpr R ipow(R base, I exponent)

compile-time potentiation required for field-size computations

template<typename T>
std::vector<Dim_t> numpy_copy(const TypedFieldBase<T> &field, pybind11::array_t<T, pybind11::array::f_style> array)
template<typename T>
pybind11::array_t<T, pybind11::array::f_style> numpy_wrap(const TypedFieldBase<T> &field, std::vector<Dim_t> components_shape = std::vector<Dim_t>{})
template<typename T>
pybind11::tuple to_tuple(T a)
template<typename T4>
inline auto get(const Eigen::MatrixBase<T4> &t4, Dim_t i, Dim_t j, Dim_t k, Dim_t l) -> decltype(auto)

provides index-based access to fourth-order Tensors represented by square matrices

template<typename T4>
inline auto get(Eigen::MatrixBase<T4> &t4, Dim_t i, Dim_t j, Dim_t k, Dim_t l) -> decltype(t4.coeffRef(i, j))

provides constant index-based access to fourth-order Tensors represented by square matrices

Variables

constexpr Dim_t oneD = {1}

constant for a one-dimensional problem

constexpr Dim_t twoD = {2}

constant for a two-dimensional problem

constexpr Dim_t threeD = {3}

constant for a three-dimensional problem

constexpr Dim_t firstOrder = {1}

constant for vectors

constexpr Dim_t secondOrder = {2}

constant second-order tensors

constexpr Dim_t fourthOrder = {4}

constant fourth-order tensors

constexpr Dim_t OneQuadPt = {1}

constant for 1 quadrature point/pixel

constexpr Real pi = {3.1415926535897932384626433}

convenience definitions

static constexpr Dim_t Unknown = {-1}

constant used to explicitly denote unknown positive integers

namespace CcoordOps

Functions

Dim_t get_index(const DynCcoord_t &nb_grid_pts, const DynCcoord_t &locations, const DynCcoord_t &ccoord)

get the linear index of a pixel in a given grid

Real compute_volume(const DynRcoord_t &lenghts)

these functions can be used whenever it is necessary to calcluate the volume of a cell or each pixle of the cell

Real compute_pixel_volume(const DynCcoord_t &nb_grid_pts, const DynRcoord_t &lenghts)
template<size_t dim, typename T>
constexpr std::array<T, dim> get_cube(T nb_grid_pts)

returns a grid of equal number of grid points in each direction

template<size_t MaxDim = threeD>
DynCcoord<MaxDim> get_cube(const Dim_t &dim, const Dim_t &nb_grid_pts)

returns a grid of equal number of grid points in each direction

template<size_t dim>
Eigen::Matrix<Real, dim, 1> get_vector(const Ccoord_t<dim> &ccoord, Real pix_size = 1.)

return physical vector of a cell of cubic pixels

template<size_t dim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const Ccoord_t<dim> &ccoord, Eigen::Matrix<T, Dim_t(dim), 1> pix_size)

return physical vector of a cell of general pixels

template<size_t dim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const Ccoord_t<dim> &ccoord, const std::array<T, dim> &pix_size)

return physical vector of a cell of general pixels

template<size_t dim, size_t MaxDim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const Ccoord_t<dim> &ccoord, const DynCcoord<MaxDim, T> &pix_size)

return physical vector of a cell of general pixels

template<size_t dim>
Eigen::Matrix<Real, dim, 1> get_vector(const DynCcoord_t &ccoord, Real pix_size = 1.)

return physical vector of a cell of cubic pixels

template<size_t dim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const DynCcoord_t ccoord, Eigen::Matrix<T, Dim_t(dim), 1> pix_size)

return physical vector of a cell of general pixels

template<size_t dim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const DynCcoord_t ccoord, const std::array<T, dim> &pix_size)

return physical vector of a cell of general pixels

template<size_t dim, size_t MaxDim, typename T>
Eigen::Matrix<T, dim, 1> get_vector(const DynCcoord_t ccoord, const DynCcoord<MaxDim, T> &pix_size)

return physical vector of a cell of general pixels

template<size_t dim>
constexpr Ccoord_t<dim> get_default_strides(const Ccoord_t<dim> &nb_grid_pts)

get all strides from a column-major grid

template<size_t MaxDim>
constexpr DynCcoord<MaxDim> get_default_strides(const DynCcoord<MaxDim> &nb_grid_pts)

get all strides from a row-major grid

template<size_t dim>
constexpr Ccoord_t<dim> get_ccoord(const Ccoord_t<dim> &nb_grid_pts, const Ccoord_t<dim> &locations, Dim_t index)

get the i-th pixel in a grid of size nb_grid_pts

template<size_t dim, size_t... I>
constexpr Ccoord_t<dim> get_ccoord(const Ccoord_t<dim> &nb_grid_pts, const Ccoord_t<dim> &locations, Dim_t index, std::index_sequence<I...>)

get the i-th pixel in a grid of size nb_grid_pts

template<size_t... I>
constexpr Ccoord_t<1> get_ccoord(const Ccoord_t<1> &nb_grid_pts, const Ccoord_t<1> &locations, Dim_t index, std::index_sequence<I...>)

get the i-th pixel in a grid of size nb_grid_pts - specialization for one dimension

template<size_t dim>
constexpr Ccoord_t<dim> get_ccoord_from_strides(const Ccoord_t<dim> &nb_grid_pts, const Ccoord_t<dim> &locations, const Ccoord_t<dim> &strides, Dim_t index)

get the i-th pixel in a grid of size nb_grid_pts

template<size_t MaxDim>
inline DynCcoord<MaxDim> get_ccoord_from_strides(const DynCcoord<MaxDim> &nb_grid_pts, const DynCcoord<MaxDim> &locations, const DynCcoord<MaxDim> &strides, Dim_t index)

get the i-th pixel in a grid of size nb_grid_pts

template<size_t dim>
constexpr Dim_t get_index(const Ccoord_t<dim> &nb_grid_pts, const Ccoord_t<dim> &locations, const Ccoord_t<dim> &ccoord)

get the linear index of a pixel in a given grid

template<size_t dim>
constexpr Dim_t get_index_from_strides(const Ccoord_t<dim> &strides, const Ccoord_t<dim> &ccoord)

get the linear index of a pixel given a set of strides

template<size_t MaxDim>
Dim_t get_index_from_strides(const DynCcoord<MaxDim> &strides, const DynCcoord<MaxDim> &ccoord)

get the linear index of a pixel given a set of strides

template<size_t dim>
constexpr size_t get_size(const Ccoord_t<dim> &nb_grid_pts)

get the number of pixels in a grid

template<size_t MaxDim>
size_t get_size(const DynCcoord<MaxDim> &nb_grid_pts)

get the number of pixels in a grid

template<size_t dim>
constexpr size_t get_size_from_strides(const Ccoord_t<dim> &nb_grid_pts, const Ccoord_t<dim> &strides)

get the number of pixels in a grid given its strides

namespace internal

Functions

template<typename T>
constexpr T ret(T val, size_t)

simple helper returning the first argument and ignoring the second

template<Dim_t Dim, typename T, size_t... I>
constexpr std::array<T, Dim> cube_fun(T val, std::index_sequence<I...>)

helper to build cubes

template<Dim_t Dim, size_t... I>
constexpr Ccoord_t<Dim> herm(const Ccoord_t<Dim> &nb_grid_pts, std::index_sequence<I...>)

computes hermitian size according to FFTW

template<Dim_t Dim>
constexpr Dim_t stride(const Ccoord_t<Dim> &nb_grid_pts, const size_t index)

compute the stride in a direction of a column-major grid

template<Dim_t Dim, size_t... I>
constexpr Ccoord_t<Dim> compute_strides(const Ccoord_t<Dim> &nb_grid_pts, std::index_sequence<I...>)

get all strides from a column-major grid (helper function)

namespace EigenCheck
namespace internal

Functions

template<Dim_t Dim, Dim_t NbRow, Dim_t NbCol>
inline constexpr Dim_t get_rank()

determine the rank of a Dim-dimensional tensor represented by an Eigen::Matrix of shape NbRow × NbCol

Template Parameters
  • Dim – spatial dimension

  • NbRow – number of rows

  • NbCol – number of columns

namespace internal

Typedefs

using MatrixMap = EigenMap<T, Eigen::Matrix<T, NbRow, NbCol>>

internal convenience alias for creating maps iterating over statically sized Eigen::Matrixs

using ArrayMap = EigenMap<T, Eigen::Array<T, NbRow, NbCol>>

internal convenience alias for creating maps iterating over statically sized Eigen::Arrays

namespace log_comp

Typedefs

using Mat_t = Eigen::Matrix<Real, dim, dim>

Matrix type used for logarithm evaluation.

using Vec_t = Eigen::Matrix<Real, dim, 1>

Vector type used for logarithm evaluation.

Functions

template<Dim_t dim, Dim_t i>
inline decltype(auto) P(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

Product term.

template<Dim_t dim>
inline decltype(auto) Sum(const Vec_t<dim> &eigs, const Mat_t<dim> &T)

sum implementation

namespace Matrices

Typedefs

using Tens2_t = Eigen::Matrix<Real, dim, dim>

second-order tensor representation

using Tens4_t = T4Mat<Real, dim>

fourth-order tensor representation

Functions

template<Dim_t dim>
inline constexpr Tens2_t<dim> I2()

compile-time second-order identity

template<typename T1, typename T2>
inline decltype(auto) constexpr outer(T1 &&A, T2 &&B)

compile-time outer tensor product as defined by Curnier R_ijkl = A_ij.B_klxx 0123 01 23

template<typename Derived1, typename Derived2>
inline decltype(auto) constexpr outer_under(const Eigen::MatrixBase<Derived1> &A, const Eigen::MatrixBase<Derived2> &B)

compile-time underlined outer tensor product as defined by Curnier R_ijkl = A_ik.B_jlxx 0123 02 13 0213 01 23 <- this defines the shuffle order

template<typename T1, typename T2>
inline decltype(auto) constexpr outer_over(T1 &&A, T2 &&B)

compile-time overlined outer tensor product as defined by Curnier R_ijkl = A_il.B_jkxx 0123 03 12 0231 01 23 <- this defines the shuffle order

template<typename T4, typename T2>
inline constexpr auto tensmult(const Eigen::MatrixBase<T4> &A, const Eigen::MatrixBase<T2> &B) -> Tens2_t<T2::RowsAtCompileTime>

Standart tensor multiplication

template<Dim_t dim>
inline constexpr Tens4_t<dim> Itrac()

compile-time fourth-order tracer

template<Dim_t dim>
inline constexpr Tens4_t<dim> Iiden()

compile-time fourth-order identity

template<Dim_t dim>
inline constexpr Tens4_t<dim> Itrns()

compile-time fourth-order transposer

template<Dim_t dim>
inline constexpr Tens4_t<dim> Isymm()

compile-time fourth-order symmetriser

template<Dim_t Dim, class T1, class T2>
decltype(auto) dot(T1 &&t1, T2 &&t2)

simple contraction between two tensors. The result depends on the rank of the tesnors, see documentation for muGrid::internal::Dotter

template<Dim_t Dim, class T1, class T2>
decltype(auto) ddot(T1 &&t1, T2 &&t2)

double contraction between two tensors. The result depends on the rank of the tesnors, see documentation for muGrid::internal::Dotter

namespace internal
namespace Tensors

Typedefs

using Tens2_t = Eigen::TensorFixedSize<Real, Eigen::Sizes<dim, dim>>

second-order tensor representation

using Tens4_t = Eigen::TensorFixedSize<Real, Eigen::Sizes<dim, dim, dim, dim>>

fourth-order tensor representation

Functions

template<Dim_t dim>
inline constexpr Tens2_t<dim> I2()

compile-time second-order identity

template<Dim_t dim, typename T1, typename T2>
inline decltype(auto) constexpr outer(T1 &&A, T2 &&B)

compile-time outer tensor product as defined by Curnier R_ijkl = A_ij.B_klxx 0123 01 23

template<Dim_t dim, typename T1, typename T2>
inline decltype(auto) constexpr outer_under(T1 &&A, T2 &&B)

compile-time underlined outer tensor product as defined by Curnier R_ijkl = A_ik.B_jlxx 0123 02 13 0213 01 23 <- this defines the shuffle order

template<Dim_t dim, typename T1, typename T2>
inline decltype(auto) constexpr outer_over(T1 &&A, T2 &&B)

compile-time overlined outer tensor product as defined by Curnier R_ijkl = A_il.B_jkxx 0123 03 12 0231 01 23 <- this defines the shuffle order

template<Dim_t dim>
inline constexpr Tens4_t<dim> I4S()

compile-time fourth-order symmetrising identity

namespace muSpectre

Typedefs

using MatrixXXc = Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic>

convenience alias

using Grad_t = Matrices::Tens2_t<Dim>

Field type that solvers expect gradients to be expressed in

using LoadSteps_t = std::vector<Eigen::MatrixXd>

Input type for specifying a load regime

Enums

enum RotationOrder

The rotation matrices depend on the order in which we rotate around different axes. See [[ https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix ]] to find the matrices

Values:

enumerator Z
enumerator XZXEuler
enumerator XYXEuler
enumerator YXYEuler
enumerator YZYEuler
enumerator ZYZEuler
enumerator ZXZEuler
enumerator XZYTaitBryan
enumerator XYZTaitBryan
enumerator YXZTaitBryan
enumerator YZXTaitBryan
enumerator ZYXTaitBryan
enumerator ZXYTaitBryan
enum Formulation

continuum mechanics flags

Values:

enumerator finite_strain

causes evaluation in PK1(F)

enumerator small_strain

causes evaluation in σ(ε)

enumerator small_strain_sym

symmetric storage as vector ε

enumerator native

causes the material’s native measures to be used in evaluation

enum SplitCell

split cell flags

Values:

enumerator laminate
enumerator simple
enumerator no
enum FiniteDiff

finite differences flags

Values:

enumerator forward

∂f/∂x ≈ (f(x+Δx) - f(x))/Δx

enumerator backward

∂f/∂x ≈ (f(x) - f(x-Δx))/Δx

enumerator centred

∂f/∂x ≈ (f(x+Δx) - f(x-Δx))/2Δx

enum StressMeasure

Material laws can declare which type of stress measure they provide, and µSpectre will handle conversions

Values:

enumerator Cauchy

Cauchy stress σ

enumerator PK1

First Piola-Kirchhoff stress.

enumerator PK2

Second Piola-Kirchhoff stress.

enumerator Kirchhoff

Kirchhoff stress τ

enumerator Biot

Biot stress.

enumerator Mandel

Mandel stress.

enumerator no_stress_

only for triggering static_asserts

enum StrainMeasure

Material laws can declare which type of strain measure they require and µSpectre will provide it

Values:

enumerator Gradient

placement gradient (δy/δx)

enumerator Infinitesimal

small strain tensor .5(∇u + ∇uᵀ)

enumerator GreenLagrange

Green-Lagrange strain .5(Fᵀ·F - I)

enumerator Biot

Biot strain.

enumerator Log

logarithmic strain

enumerator Almansi

Almansi strain.

enumerator RCauchyGreen

Right Cauchy-Green tensor.

enumerator LCauchyGreen

Left Cauchy-Green tensor.

enumerator no_strain_

only for triggering static_assert

enum ElasticModulus

all isotropic elastic moduli to identify conversions, such as E = µ(3λ + 2µ)/(λ+µ). For the full description, see https://en.wikipedia.org/wiki/Lam%C3%A9_parameters Not all the conversions are implemented, so please add as needed

Values:

enumerator Bulk

Bulk modulus K.

enumerator K

alias for ElasticModulus::Bulk

enumerator Young

Young’s modulus E.

enumerator E

alias for ElasticModulus::Young

enumerator lambda

Lamé’s first parameter λ

enumerator Shear

Shear modulus G or µ

enumerator G

alias for ElasticModulus::Shear

enumerator mu

alias for ElasticModulus::Shear

enumerator Poisson

Poisson’s ratio ν

enumerator nu

alias for ElasticModulus::Poisson

enumerator Pwave

P-wave modulus M.

enumerator M

alias for ElasticModulus::Pwave

enumerator no_modulus_
enum IsStrainInitialised

Values:

enumerator True
enumerator False

Functions

template<class FFTEngine = muFFT::FFTWEngine>
inline std::unique_ptr<ProjectionBase> cell_input(const DynCcoord_t &nb_grid_pts, const DynRcoord_t &lengths, const Formulation &form, muFFT::Gradient_t gradient, const muFFT::Communicator &comm = muFFT::Communicator())

Convenience function to create consistent input for the constructor of * muSpectre::Cell. Creates a unique ptr to a Projection operator (with appropriate FFT_engine) to be used in a cell constructor

Parameters
  • nb_grid_pts – resolution of the discretisation grid in each spatial directional

  • lengths – length of the computational domain in each spatial direction

  • form – problem formulation (small vs finite strain)

  • gradient – gradient operator to use (i.e., “exact” Fourier derivation, finite differences, etc)

  • comm – communicator used for solving distributed problems

template<class FFTEngine = muFFT::FFTWEngine>
inline std::unique_ptr<ProjectionBase> cell_input(const DynCcoord_t &nb_grid_pts, const DynRcoord_t &lengths, const Formulation &form, const muFFT::Communicator &comm = muFFT::Communicator())

Convenience function to create consistent input for the constructor of * muSpectre::Cell. Creates a unique ptr to a Projection operator (with appropriate FFT_engine) to be used in a cell constructor. Uses the “exact” fourier derivation operator for calculating gradients

Parameters
  • nb_grid_pts – resolution of the discretisation grid in each spatial directional

  • lengths – length of the computational domain in each spatial direction

  • form – problem formulation (small vs finite strain)

  • comm – communicator used for solving distributed problems

template<typename Cell_t = Cell, class FFTEngine = muFFT::FFTWEngine>
inline Cell_t make_cell(DynCcoord_t nb_grid_pts, DynRcoord_t lengths, Formulation form, muFFT::Gradient_t gradient, const muFFT::Communicator &comm = muFFT::Communicator())

convenience function to create a cell (avoids having to build and move the chain of unique_ptrs

Parameters
  • nb_grid_pts – resolution of the discretisation grid in each spatial directional

  • lengths – length of the computational domain in each spatial direction

  • form – problem formulation (small vs finite strain)

  • gradient – gradient operator to use (i.e., “exact” Fourier derivation, finite differences, etc)

  • comm – communicator used for solving distributed problems

template<typename Cell_t = Cell, class FFTEngine = muFFT::FFTWEngine>
inline Cell_t make_cell(DynCcoord_t nb_grid_pts, DynRcoord_t lengths, Formulation form, const muFFT::Communicator &comm = muFFT::Communicator())

convenience function to create a cell (avoids having to build and move the chain of unique_ptrs. Uses the “exact” fourier derivation operator for calculating gradients

Parameters
  • nb_grid_pts – resolution of the discretisation grid in each spatial directional

  • lengths – length of the computational domain in each spatial direction

  • form – problem formulation (small vs finite strain)

  • comm – communicator used for solving distributed problems

template<typename Cell_t = CellSplit, class FFTEngine = muFFT::FFTWEngine>
inline Cell_t make_cell_split(DynCcoord_t nb_grid_pts, DynRcoord_t lengths, Formulation form, muFFT::Gradient_t gradient, const muFFT::Communicator &comm = muFFT::Communicator())
template<typename Cell_t = CellSplit, class FFTEngine = muFFT::FFTWEngine>
std::unique_ptr<Cell_t> make_cell_ptr(const DynCcoord_t &nb_grid_pts, const DynRcoord_t &lengths, const Formulation &form, muFFT::Gradient_t gradient, const muFFT::Communicator &comm = muFFT::Communicator())
std::ostream &operator<<(std::ostream &os, Formulation f)

inserts muSpectre::Formulations into std::ostreams

std::ostream &operator<<(std::ostream &os, StressMeasure s)

inserts muSpectre::StressMeasures into std::ostreams

std::ostream &operator<<(std::ostream &os, StrainMeasure s)

inserts muSpectre::StrainMeasures into std::ostreams

void banner(std::string name, Uint year, std::string cpy_holder)

Copyright banner to be printed to the terminal by executables Arguments are the executable’s name, year of writing and the name

  • address of the copyright holder

template<bool sym = true>
constexpr Dim_t vsize(Dim_t dim)

compile time computation of voigt vector

constexpr Dim_t dof_for_formulation(const Formulation form, const Dim_t dim)

compute the number of degrees of freedom to store for the strain tensor given dimension dim

inline constexpr bool operator<(ElasticModulus A, ElasticModulus B)

define comparison in order to exploit that moduli can be expressed in terms of any two other moduli in any order (e.g. K = K(E, ν) = K(ν, E)

constexpr StrainMeasure get_stored_strain_type(Formulation form)

Compile-time function to g strain measure stored by muSpectre depending on the formulation

constexpr StressMeasure get_stored_stress_type(Formulation form)

Compile-time function to g stress measure stored by muSpectre depending on the formulation

constexpr StrainMeasure get_formulation_strain_type(Formulation form, StrainMeasure expected)

Compile-time functions to get the stress and strain measures after they may have been modified by choosing a formulation.

For instance, a law that expecs a Green-Lagrange strain as input will get the infinitesimal strain tensor instead in a small strain computation

template<typename T>
T modulo(T a, T b)
bool check_symmetry(const Eigen::Ref<const Eigen::ArrayXXd> &eps, Real rel_tol)

check whether a strain is symmetric, for the purposes of small strain problems

Eigen::IOFormat format (Eigen::FullPrecision, 0, ", ", ",\, "[", "]", "[", "]")

produces numpy-compatible full precision text output. great for debugging

std::vector<OptimizeResult> newton_cg(Cell &cell, const LoadSteps_t &load_steps, SolverBase &solver, Real newton_tol, Real equil_tol, Dim_t verbose, IsStrainInitialised strain_init)

Uses the Newton-conjugate Gradient method to find the static equilibrium of a cell given a series of mean applied strain(ε for Formulation::small_strain and H (=F-I) for Formulation::finite_strain). The initial macroscopic strain state is set to zero in cell initialisation.

std::vector<OptimizeResult> de_geus(Cell &cell, const LoadSteps_t &load_steps, SolverBase &solver, Real newton_tol, Real equil_tol, Dim_t verbose, IsStrainInitialised strain_init)

Uses the method proposed by de Geus method to find the static given a series of mean applied strain(ε for Formulation::small_strain and H (=F-I) for Formulation::finite_strain). The initial macroscopic strain state is set to zero in cell initialisation.

inline OptimizeResult newton_cg(Cell &cell, const Eigen::Ref<Eigen::MatrixXd> load_step, SolverBase &solver, Real newton_tol, Real equil_tol, Dim_t verbose = 0, IsStrainInitialised strain_init = IsStrainInitialised::False)

Uses the Newton-conjugate Gradient method to find the static equilibrium of a cell given a mean applied strain.

inline OptimizeResult de_geus(Cell &cell, const Eigen::Ref<Eigen::MatrixXd> load_step, SolverBase &solver, Real newton_tol, Real equil_tol, Dim_t verbose = 0, IsStrainInitialised strain_init = IsStrainInitialised::False)

Uses the method proposed by de Geus method to find the static equilibrium of a cell given a mean applied strain.

namespace internal

Functions

template<size_t DimS, class FFTEngine>
inline std::unique_ptr<ProjectionBase> cell_input_helper(const DynCcoord_t &nb_grid_pts, const DynRcoord_t &lengths, const Formulation &form, muFFT::Gradient_t gradient, const muFFT::Communicator &comm = muFFT::Communicator())

function to create consistent input for the constructor of muSpectre::Cell. Users should never need to call this function, for internal use only

namespace MatTB

Enums

enum NeedTangent

Flag used to designate whether the material should compute both stress and tangent moduli or only stress

Values:

enumerator yes

compute both stress and tangent moduli

enumerator no

compute only stress

Functions

template<StrainMeasure In, StrainMeasure Out, class Strain_t>
decltype(auto) convert_strain(Strain_t &&strain)

set of functions returning one strain measure as a function of another

template<ElasticModulus Out, ElasticModulus In1, ElasticModulus In2>
inline constexpr Real convert_elastic_modulus(const Real &in1, const Real &in2)

allows the conversion from any two distinct input moduli to a chosen output modulus

template<Dim_t Dim, FiniteDiff FinDif = FiniteDiff::centred, class FunType, class Derived>
inline muGrid::T4Mat<Real, Dim> compute_numerical_tangent(FunType &&fun, const Eigen::MatrixBase<Derived> &strain, Real delta)

Helper function to numerically determine tangent, intended for testing, rather than as a replacement for analytical tangents

template<Dim_t DimM>
inline Eigen::Matrix<Real, DimM, DimM> compute_deviatoric_stress(const Eigen::Matrix<Real, DimM, DimM> &PK2)

Computes the deviatoric stress σ_{dev}=σ-{1}{3} tr(σ)*I, on each pixel from a given stress, first only for PK2.

template<Dim_t DimM>
inline decltype(auto) compute_equivalent_von_Mises_stress(const Eigen::Map<const Eigen::Matrix<Real, DimM, DimM>> PK2)

Computes the equivalent von Mises stress σ_{eq} on each pixel from a given PK2 stress.

template<Formulation Form, class Material, class Strains, class Stresses>
void constitutive_law(Material &mat, Strains &&strains, Stresses &stresses, const size_t &quad_pt_id, const Real &ratio)
template<Formulation Form, class Material, class Strains, class Stresses>
void constitutive_law(Material &mat, Strains &&strains, Stresses &stresses, const size_t &quad_pt_id)
template<Formulation Form, class Material, class Strains, class Stresses>
void constitutive_law_tangent(Material &mat, Strains &&strains, Stresses &stresses, const size_t &quad_pt_id)
template<Formulation Form, class Material, class Strains, class Stresses>
void constitutive_law_tangent(Material &mat, Strains &&strains, Stresses &stresses, const size_t &quad_pt_id, const Real &ratio)
template<Dim_t DimM, class Derived1, class Derived2>
void make_C_from_C_voigt(const Eigen::MatrixBase<Derived1> &C_voigt, Eigen::MatrixBase<Derived2> &C_holder)
template<StressMeasure StressM, StrainMeasure StrainM, class Stress_t, class Strain_t>
decltype(auto) PK1_stress(Strain_t &&strain, Stress_t &&stress)

set of functions returning an expression for PK1 stress based on

template<StressMeasure StressM, StrainMeasure StrainM, class Stress_t, class Strain_t, class Tangent_t>
decltype(auto) PK1_stress(Strain_t &&strain, Stress_t &&stress, Tangent_t &&tangent)

set of functions returning an expression for PK1 stress based on

template<StressMeasure StressM, StrainMeasure StrainM, class Stress_t, class Strain_t>
decltype(auto) PK2_stress(Strain_t &&strain, Stress_t &&stress)

set of functions returning an expression for PK2 stress based on

template<StressMeasure StressM, StrainMeasure StrainM, class Stress_t, class Strain_t, class Tangent_t>
decltype(auto) PK2_stress(Strain_t &&strain, Stress_t &&stress, Tangent_t &&tangent)

set of functions returning an expression for PK2 stress based on

template<StressMeasure StressM, StrainMeasure StrainM, class Stress_t, class Strain_t>
decltype(auto) Kirchhoff_stress(Strain_t &&strain, Stress_t &&stress)

set of functions returning an expression for Kirchhoff stress based on

namespace internal
namespace std_replacement

Functions

template<class F, class ...ArgTypes>
auto invoke(F &&f, ArgTypes&&... args) noexcept(noexcept(detail::INVOKE(std::forward<F>(f), std::forward<ArgTypes>(args)...))) -> decltype(detail::INVOKE(std::forward<F>(f), std::forward<ArgTypes>(args)...))

from cppreference

template<class F, class Tuple>
decltype(auto) constexpr apply(F &&f, Tuple &&t)

from cppreference

namespace detail

Functions

template<class Base, class T, class Derived, class ...Args>
auto INVOKE(T Base::* pmf, Derived &&ref, Args&&... args) noexcept(noexcept((std::forward<Derived>(ref) .* pmf)(std::forward<Args>(args)...))) -> std::enable_if_t<std::is_function<T>::value && std::is_base_of<Base, std::decay_t<Derived>>::value, decltype((std::forward<Derived>(ref) .* pmf)(std::forward<Args>(args)...))>

from cppreference

template<class Base, class T, class RefWrap, class ...Args>
auto INVOKE(T Base::* pmf, RefWrap &&ref, Args&&... args) noexcept(noexcept((ref.get() .* pmf)(std::forward<Args>(args)...))) -> std::enable_if_t<std::is_function<T>::value && is_reference_wrapper<std::decay_t<RefWrap>>::value, decltype((ref.get() .* pmf)(std::forward<Args>(args)...))>

from cppreference

template<class Base, class T, class Pointer, class ...Args>
auto INVOKE(T Base::* pmf, Pointer &&ptr, Args&&... args) noexcept(noexcept(((*std::forward<Pointer>(ptr)) .* pmf)(std::forward<Args>(args)...))) -> std::enable_if_t<std::is_function<T>::value && !is_reference_wrapper<std::decay_t<Pointer>>::value && !std::is_base_of<Base, std::decay_t<Pointer>>::value, decltype(((*std::forward<Pointer>(ptr)) .* pmf)(std::forward<Args>(args)...))>

from cppreference

template<class Base, class T, class Derived>
auto INVOKE(T Base::* pmd, Derived &&ref) noexcept(noexcept(std::forward<Derived>(ref) .* pmd)) -> std::enable_if_t<!std::is_function<T>::value && std::is_base_of<Base, std::decay_t<Derived>>::value, decltype(std::forward<Derived>(ref) .* pmd)>

from cppreference

template<class Base, class T, class RefWrap>
auto INVOKE(T Base::* pmd, RefWrap &&ref) noexcept(noexcept(ref.get() .* pmd)) -> std::enable_if_t<!std::is_function<T>::value && is_reference_wrapper<std::decay_t<RefWrap>>::value, decltype(ref.get() .* pmd)>

from cppreference

template<class Base, class T, class Pointer>
auto INVOKE(T Base::* pmd, Pointer &&ptr) noexcept(noexcept((*std::forward<Pointer>(ptr)) .* pmd)) -> std::enable_if_t<!std::is_function<T>::value && !is_reference_wrapper<std::decay_t<Pointer>>::value && !std::is_base_of<Base, std::decay_t<Pointer>>::value, decltype((*std::forward<Pointer>(ptr)) .* pmd)>

from cppreference

template<class F, class ...Args>
auto INVOKE(F &&f, Args&&... args) noexcept(noexcept(std::forward<F>(f)(std::forward<Args>(args)...))) -> std::enable_if_t<!std::is_member_pointer<std::decay_t<F>>::value, decltype(std::forward<F>(f)(std::forward<Args>(args)...))>

from cppreference

template<class F, class Tuple, std::size_t... I>
decltype(auto) constexpr apply_impl(F &&f, Tuple &&t, std::index_sequence<I...>)

from cppreference

file cell.cc
#include “cell_adaptor.hh
#include “cell.hh
#include <set>

implementation for the Cell class

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

05 Oct 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell.hh
#include <memory>

Class for the representation of a homogenisation problem in µSpectre.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

13 Sep 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_adaptor.hh
#include <Eigen/IterativeLinearSolvers>

Cell Adaptor implements the matrix-vector multiplication and allows the adapted cell to be used like a spacse matrix in conjugate-gradient-type solvers.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

13 Sep 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_factory.hh
#include “cell/cell.hh
#include <memory>

Cell factories to help create cells with ease.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_split.cc
#include “cell/cell_split.hh

Implementation for cell base class.

Copyright © 2017 Till Junge

Author

Ali Falsafi ali.faslafi@epfl.ch

Date

10 Dec 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_split.hh
#include “cell/cell.hh
#include “libmugrid/field.hh
#include <vector>
#include <memory>
#include <tuple>
#include <functional>
#include <sstream>
#include <algorithm>

Base class representing a unit cell able to handle split material assignments.

Copyright © 2017 Till Junge

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

10 Dec 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_split_factory.hh
#include “cell/cell_split.hh
#include “libmufft/fftw_engine.hh
#include “cell/cell_factory.hh
#include <memory>

Implementation for cell base class.

Copyright © 2017 Till Junge

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

01 Nov 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cell_traits.hh
#include <Eigen/IterativeLinearSolvers>

Provides traits for Eigen solvers to be able to use Cells.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

19 Jan 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file common.cc
#include <stdexcept>
#include <iostream>

Implementation for common functions.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 Nov 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file geometry.hh
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <array>
#include <memory>

Geometric calculation helpers.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

18 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file intersection_octree.cc

Oct tree for obtaining and calculating the intersection with pixels.

Copyright © 2018 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

May 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file intersection_octree.hh
#include “cell/cell.hh
#include <vector>
#include <array>
#include <algorithm>

octree algorithm employed to accelerate precipitate pixel assignment

Copyright © 2018 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

May 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file intersection_volume_calculator_corkpp.hh
#include “cork_interface.hh”
#include “libmugrid/grid_common.hh
#include <vector>
#include <fstream>
#include <math.h>

Calculation of the intersection volume of percipitates and pixles.

Copyright © 2018 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

04 June 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file muSpectre_common.hh
#include <string>

Small definitions of commonly used types throughout µSpectre.

Author

Till Junge till.junge@epfl.ch

Date

01 May 2017

LICENSE

Copyright © 2017 Till Junge

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file voigt_conversion.cc

specializations for static members of voigt converter

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

04 May 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file voigt_conversion.hh
#include <Eigen/Dense>
#include <unsupported/Eigen/CXX11/Tensor>
#include <iostream>

utilities to transform vector notation arrays into voigt notation arrays and vice-versa

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

02 May 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file communicator.cc
#include “communicator.hh
#include <sstream>

implementation for mpi abstraction layer

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

02 Oct 2019

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file communicator.hh
#include <type_traits>
#include “mufft_common.hh
#include <Eigen/Dense>

abstraction layer for the distributed memory communicator object

Copyright © 2017 Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

07 Mar 2018

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file derivative.cc
#include <iostream>
#include “derivative.hh
file derivative.cc
#include “projection/derivative.hh”
file derivative.hh
#include <memory>

Representation of finite-differences stencils.

Copyright © 2019 Lars Pastewka

Author

Richard Leute richard.leute@imtek.uni-freiburg.de Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

05 June 2019

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fft_engine_base.cc
#include “fft_engine_base.hh
#include “fft_utils.hh

implementation for FFT engine base class

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

03 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fft_engine_base.hh
#include “communicator.hh
#include “mufft_common.hh

Interface for FFT engines.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

01 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fft_utils.cc
#include “fft_utils.hh

implementation of fft utilities

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

11 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fft_utils.hh
#include “mufft_common.hh
#include <Eigen/Dense>
#include <array>
#include <valarray>

collection of functions used in the context of spectral operations

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

06 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fftw_engine.cc
#include <sstream>
#include “fftw_engine.hh

implements the fftw engine

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

03 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fftw_engine.hh
#include “fft_engine_base.hh
#include <fftw3.h>

FFT engine using FFTW.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

03 Dec 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fftwmpi_engine.cc
#include “fftwmpi_engine.hh

implements the MPI-parallel fftw engine

Copyright © 2017 Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

06 Mar 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file fftwmpi_engine.hh
#include “fft_engine_base.hh
#include <fftw3-mpi.h>

FFT engine using MPI-parallel FFTW.

Copyright © 2017 Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

06 Mar 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file mufft_common.hh

Small definitions of commonly used types throughout µFFT.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Jan 2019

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file pfft_engine.cc
#include “pfft_engine.hh

implements the MPI-parallel pfft engine

Copyright © 2017 Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

06 Mar 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file pfft_engine.hh
#include “fft_engine_base.hh
#include <pfft.h>

FFT engine using MPI-parallel PFFT.

Copyright © 2017 Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

06 Mar 2017

µFFT is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µFFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µFFT; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file ccoord_operations.cc
#include <iostream>
#include “ccoord_operations.hh

pre-compilable pixel operations

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

01 Oct 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file ccoord_operations.hh
#include <functional>
#include <numeric>
#include <utility>
#include <Eigen/Dense>
#include “grid_common.hh
#include “iterators.hh

common operations on pixel addressing

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

29 Sep 2017

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file cpp_compliance.hh
#include <tuple>
#include <experimental/optional>

additions to the standard name space to anticipate C++17 features

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

17 Nov 2017

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file eigen_tools.hh
#include “grid_common.hh
#include <Eigen/Dense>
#include <unsupported/Eigen/CXX11/Tensor>
#include <type_traits>
#include <utility>

small tools to be used with Eigen

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

20 Sep 2017

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field.cc
#include “field.hh
#include “field_collection.hh

implementation of Field

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

11 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field.hh
#include “grid_common.hh
#include <string>
#include <typeinfo>

Base class for fields.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

10 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection.cc
#include “field_collection.hh
#include “field.hh
#include “state_field.hh
#include “field_typed.hh

Implementations for field collections.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

11 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection.hh
#include “grid_common.hh
#include <map>
#include <string>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <vector>

Base class for field collections.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

10 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection_global.cc
#include <iostream>

Implementation of GlobalFieldCollection.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

11 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection_global.hh
#include “field_collection.hh
#include “ccoord_operations.hh

Global field collections.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

11 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection_local.cc

implementation of local field collection

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

12 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_collection_local.hh
#include “field_collection.hh

Local field collection.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

12 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_map.cc
#include “field_map.hh
#include “field_typed.hh
#include “field_collection.hh
#include “iterators.hh
#include <sstream>
#include <iostream>

Implementation for basic FieldMap.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_map.hh
#include “grid_common.hh
#include “iterators.hh
#include “field_collection.hh
#include <type_traits>
#include <memory>
#include <functional>

Implementation of the base class of all field maps.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_map_static.hh
#include “field.hh
#include “field_typed.hh
#include “field_map.hh
#include “T4_map_proxy.hh
#include <sstream>

header-only implementation of field maps with statically known iterate sizes

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

20 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_typed.cc
#include <sstream>
#include “field_typed.hh
#include “field_collection.hh
#include “field_map.hh

Implementation for typed fields.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

13 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file field_typed.hh
#include “field.hh
#include “grid_common.hh
#include <Eigen/Dense>
#include <vector>
#include <memory>

Field classes for which the scalar type has been defined.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

10 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file grid_common.hh
#include <Eigen/Dense>
#include <array>
#include <cmath>
#include <complex>
#include <type_traits>
#include <initializer_list>
#include <algorithm>
#include <vector>
#include “cpp_compliance.hh

Small definitions of commonly used types throughout µgrid.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Jan 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file iterators.hh
#include <tuple>
#include <utility>

iterator interfaces

Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)

Author

Nicolas Richart

Date

creation Wed Jul 19 2017

Akantu is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Akantu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Akantu. If not, see http://www.gnu.org/licenses/.

Above block was left intact as in akantu. µGrid exercises the right to redistribute and modify the code below

file mapped_field.hh
#include “field_map_static.hh
#include “field_collection.hh
#include “field_typed.hh
#include <string>

convenience class to deal with data structures common to most internal variable fields in materials

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

04 Sep 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file mapped_state_field.hh
#include “state_field.hh
#include “field_collection.hh

Convenience class extending the mapped field concept to state fields.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

09 Sep 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file numpy_tools.hh
#include <algorithm>
#include <pybind11/numpy.h>
#include “field_typed.hh

Convenience function for working with (pybind11’s) numpy arrays.

Copyright © 2018 Lars Pastewka, Till Junge

Author

Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Author

Till Junge till.junge@epfl.ch

Date

02 Dec 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file ref_array.hh
#include <array>
#include <initializer_list>
#include “iterators.hh

convenience class to simulate an array of references

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

04 Dec 2018

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file ref_vector.hh
#include <vector>

convenience class providing a vector of references

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

21 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file state_field.cc
#include “state_field.hh
#include “field.hh
#include “field_typed.hh
#include “field_collection.hh
#include <sstream>

implementation for state fields

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

20 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file state_field.hh
#include “grid_common.hh
#include “ref_vector.hh
#include “state_field_map.hh
#include <string>
#include <vector>
#include <utility>

A state field is an abstraction of a field that can hold current, as well as a chosen number of previous values. This is useful for instance for internal state variables in plastic laws, where a current, new, or trial state is computed based on its previous state, and at convergence, this new state gets cycled into the old, the old into the old-1 etc. The state field abstraction helps doing this safely (i.e. only const references to the old states are available, while the current state can be assigned to/modified), and efficiently (i.e., no need to copy values from new to old, we just cycle the labels). This file implements the state field as well as state maps using the Field, FieldCollection and FieldMap abstractions of µGrid.

Copyright © 2019 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

20 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file state_field_map.cc
#include “state_field_map.hh
#include “state_field.hh
#include “field_map.hh
#include “field_typed.hh
#include “field_collection.hh
#include “field.hh

implementation of state field maps

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

22 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file state_field_map.hh
#include “grid_common.hh
#include “field_map.hh
#include “ref_vector.hh
#include <vector>
#include <memory>

implementation of state field maps

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

22 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file state_field_map_static.hh
#include “state_field_map.hh
#include “field_map_static.hh
#include “field_typed.hh
#include <array>
#include <sstream>
#include <utility>

header-only implementation of state field maps with statically known iterate sizes

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

27 Aug 2019

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file T4_map_proxy.hh
#include “eigen_tools.hh
#include <Eigen/Dense>
#include <Eigen/src/Core/util/Constants.h>
#include <type_traits>

Map type to allow fourth-order tensor-like maps on 2D matrices.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

19 Nov 2017

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file tensor_algebra.hh
#include “grid_common.hh
#include “T4_map_proxy.hh
#include “eigen_tools.hh
#include <Eigen/Dense>
#include <unsupported/Eigen/CXX11/Tensor>
#include <type_traits>

collection of compile-time quantities and algrebraic functions for tensor operations

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

05 Nov 2017

µGrid is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µGrid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µGrid; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file iterable_proxy.hh

transitional class for iterating over materials and their strain and stress fields

Copyright © 2019 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

08 Nov 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file laminate_homogenisation.cc

: Implementation of functions of internal laminate solver used in MaterialLaminate

Copyright © 2017 Till Junge, Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

28 Sep 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file laminate_homogenisation.hh
#include “common/geometry.hh
#include “libmugrid/field_map.hh
#include “materials_toolbox.hh
#include <tuple>

Laminatehomogenisation enables one to obtain the resulting stress and stiffness tensors of a laminate pixel that is consisted of two materialswith a certain normal vector of their interface plane. note that it is supposed to be used in static way. so it does note any data member. It is merely a collection of functions used to calculate effective stress and stiffness.

Copyright © 2017 Till Junge, Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

28 Sep 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_base.cc
#include <libmugrid/field.hh>

implementation of material

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

01 Nov 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_base.hh
#include <string>
#include <tuple>

Base class for materials (constitutive models)

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

25 Oct 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_evaluator.hh
#include <exception>
#include <memory>
#include <sstream>

Helper to evaluate material laws.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

12 Dec 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_hyper_elasto_plastic1.cc

implementation for MaterialHyperElastoPlastic1

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

21 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_hyper_elasto_plastic1.hh
#include <algorithm>

Material for logarithmic hyperelasto-plasticity, as defined in de Geus 2017 (https://doi.org/10.1016/j.cma.2016.12.032) and further explained in Geers 2003 (https://doi.org/10.1016/j.cma.2003.07.014)

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

20 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_hyper_elasto_plastic2.cc

copy of material_hyper_elasto_plastic1 with Young, Poisson, yield criterion and hardening modulus per pixel. As defined in de Geus 2017 (https://doi.org/10.1016/j.cma.2016.12.032) and further explained in Geers 2003 (https://doi.org/10.1016/j.cma.2003.07.014).

Copyright © 2019 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

08 Jul 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_hyper_elasto_plastic2.hh
#include <algorithm>

copy of material_hyper_elasto_plastic1 with Young, Poisson, yield criterion and hardening modulus per pixel. As defined in de Geus 2017 (https://doi.org/10.1016/j.cma.2016.12.032) and further explained in Geers 2003 (https://doi.org/10.1016/j.cma.2003.07.014).

Copyright © 2019 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

08 Jul 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_laminate.cc
#include “material_laminate.hh

material that uses laminae homogenisation

Copyright © 2018 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Author

Till Junge till.junge@altermail.ch

Date

04 Jun 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_laminate.hh
#include “cell/cell.hh
#include <vector>

material that uses laminae homogenisation

Copyright © 2018 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Author

Till Junge till.junge@altermail.ch

Date

04 Jun 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_anisotropic.cc

Implementation of general anisotropic linear constitutive model.

Copyright © 2017 Till Junge

Author

Ali Falsafiali.falsafi@epfl.ch

Date

09 Jul 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_anisotropic.hh
#include “libmugrid/eigen_tools.hh

defenition of general anisotropic linear constitutive model

Copyright © 2017 Till Junge

Author

Ali Falsafiali.falsafi@epfl.ch

Date

9 Jul 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic1.cc

Implementation for materiallinearelastic1.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

14 Nov 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic1.hh

Implementation for linear elastic reference material like in de Geus.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

13 Nov 2017

    2017. This follows the simplest and likely not most efficient
    implementation (with exception of the Python law)

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic2.cc

implementation for linear elastic material with eigenstrain

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

04 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic2.hh
#include <Eigen/Dense>

linear elastic material with imposed eigenstrain and its type traits. Uses the MaterialMuSpectre facilities to keep it simple

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

03 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic3.cc

implementation for linear elastic material with distribution of stiffness properties. Uses the MaterialMuSpectre facilities to keep it simple.

Copyright © 2018 Till Junge

Author

Richard Leute <richard.leute@imtek.uni-freiburg.de

Date

20 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic3.hh
#include <Eigen/Dense>

linear elastic material with distribution of stiffness properties. Uses the MaterialMuSpectre facilities to keep it simple.

Copyright © 2018 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

20 Feb 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic4.cc

linear elastic material with distribution of stiffness properties. In difference to material_linear_elastic3 two Lame constants are stored per pixel instead of the whole elastic matrix C. Uses the MaterialMuSpectre facilities to keep it simple.

Copyright © 2018 Till Junge

Author

Richard Leute <richard.leute@imtek.uni-freiburg.de

Date

15 March 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic4.hh
#include <Eigen/Dense>

linear elastic material with distribution of stiffness properties. In difference to material_linear_elastic3 two Lame constants are stored per pixel instead of the whole elastic matrix C. Uses the MaterialMuSpectre facilities to keep it simple.

Copyright © 2018 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

15 March 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic_generic1.cc

implementation for MaterialLinearElasticGeneric

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

21 Sep 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic_generic1.hh
#include <memory>

Implementation fo a generic linear elastic material that stores the full elastic stiffness tensor. Convenient but not the most efficient.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

21 Sep 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic_generic2.cc

Implementation for generic linear elastic law with eigenstrains.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

20 Dec 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_elastic_generic2.hh

implementation of a generic linear elastic law with eigenstrains

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

20 Dec 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_orthotropic.cc
#include “material_base.hh

Implementation of general orthotropic linear constitutive model.

Copyright © 2017 Till Junge

Author

Ali Falsafiali.falsafi@epfl.ch

Date

11 Jul 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_linear_orthotropic.hh
#include “material_base.hh
#include “cell/cell.hh

defenition of general orthotropic linear constitutive model

Copyright © 2017 Till Junge

Author

Ali Falsafiali.falsafi@epfl.ch

Date

11 Jul 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_muSpectre_base.hh
#include “cell/cell.hh
#include <tuple>
#include <type_traits>
#include <iterator>
#include <stdexcept>
#include <functional>
#include <utility>
#include “sstream”

Base class for materials written for µSpectre specifically. These can take full advantage of the configuration-change utilities of µSpectre. The user can inherit from them to define new constitutive laws and is merely required to provide the methods for computing the second Piola-Kirchhoff stress and Tangent. This class uses the “curiously recurring template parameter” to avoid virtual calls.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

25 Oct 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_stochastic_plasticity.cc
#include <sstream>

material for stochastic plasticity as described in Z. Budrikis et al. Nature Comm. 8:15928, 2017. It only works together with “python

-script”, which performes the avalanche loop. This makes the material slower but more easy to modify and test. (copied from

material_linear_elastic4.cc)

Copyright © 2019 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

24 Jan 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file material_stochastic_plasticity.hh
#include “cell/cell.hh

material for stochastic plasticity as described in Z. Budrikis et al. Nature Comm. 8:15928, 2017. It only works together with “python

-script”, which performes the avalanche loop. This makes the material slower but more easy to modify and test. (copied from

material_linear_elastic4.hh)

Copyright © 2019 Till Junge

Author

Richard Leute richard.leute@imtek.uni-freiburg.de

Date

24 Jan 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file materials_toolbox.hh
#include <Eigen/Dense>
#include <unsupported/Eigen/MatrixFunctions>
#include <exception>
#include <sstream>
#include <iostream>
#include <tuple>
#include <type_traits>

collection of common continuum mechanics tools

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

02 Nov 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file s_t_material_linear_elastic_generic1.cc

the implemenation of the methods of the class STMateriallinearelasticgeneric1

Copyright © 2020 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

20 Jan 2020

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file s_t_material_linear_elastic_generic1.hh

Material that is merely used to behave as an intermediate convertor for enablling us to conduct tests on stress_transformation usogn MaterialLinearelasticgeneric1.

Copyright © 2020 Ali Falsafi

Author

Ali Falsafi ali.falsafi@epfl.ch

Date

20 Jan 2020

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations.hh

isolation of stress conversions for quicker compilation

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_default_case.hh

default structure for stress conversions

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_Kirchhoff.hh

Stress conversions for Kirchhoff stress (τ)

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_Kirchhoff_impl.hh

Implementation of stress conversions for Kirchhoff stress.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_PK1.hh

stress conversion for PK1 stress

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_PK1_impl.hh

implementation of stress conversion for PK1 stress

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_PK2.hh

stress conversions for PK2 stress

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file stress_transformations_PK2_impl.hh

Implementation of stress conversions for PK2 stress.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

29 Oct 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_base.cc
#include <sstream>

implementation of base class for projections

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

06 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_base.hh
#include <memory>

Base class for Projection operators.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

03 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_default.cc

Implementation default projection implementation.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

14 Jan 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_default.hh

virtual base class for default projection implementation, where the projection operator is stored as a full fourth-order tensor per k-space point (as opposed to ‘smart’ faster implementations, such as ProjectionFiniteStrainFast

Copyright (C) 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

14 Jan 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_finite_strain.cc
#include “Eigen/Dense”

implementation of the finite strain projection operator

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch Richard Leute richard.leute@imtek.uni-freiburg.de Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

05 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_finite_strain.hh

Class for discrete finite-strain gradient projections.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch Richard Leute richard.leute@imtek.uni-freiburg.de Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

16 Apr 2019

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_finite_strain_fast.cc

implementation for fast projection in finite strain

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

12 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_finite_strain_fast.hh

Faster alternative to ProjectionFinitestrain.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@epfl.ch Lars Pastewka lars.pastewka@imtek.uni-freiburg.de

Date

12 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_small_strain.cc

Implementation for ProjectionSmallStrain.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

14 Jan 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file projection_small_strain.hh

Small strain projection operator as defined in Appendix A1 of DOI: 10.1002/nme.5481 (“A finite element perspective on nonlinear

FFT-based micromechanical simulations”, Int. J. Numer. Meth. Engng 2017; 111 :903–926)

Copyright © 2018 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

14 Jan 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_base.cc
#include “solver/solver_base.hh

implementation of SolverBase

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_base.hh
#include “solver/solver_common.hh
#include “cell/cell.hh
#include <Eigen/Dense>

Base class for iterative solvers for linear systems of equations.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_cg.cc
#include “solver/solver_cg.hh
#include “cell/cell_adaptor.hh
#include <iomanip>
#include <sstream>
#include <iostream>

implements SolverCG

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_cg.hh
#include “solver/solver_base.hh

class fo a simple implementation of a conjugate gradient solver. This follows algorithm 5.2 in Nocedal’s Numerical Optimization (p 112)

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_common.cc
#include “solver/solver_common.hh

implementation for solver utilities

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 May 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_common.hh
#include <Eigen/Dense>
#include <stdexcept>

Errors raised by solvers and other common utilities.

Copyright © 2017 Till Junge

Author

Till Junge till.junge@altermail.ch

Date

28 Dec 2017

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_eigen.cc
#include “solver/solver_eigen.hh
#include <iomanip>
#include <sstream>

Implementations for bindings to Eigen’s iterative solvers.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 May 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solver_eigen.hh
#include “solver/solver_base.hh
#include “cell/cell.hh
#include “cell/cell_adaptor.hh
#include <Eigen/IterativeLinearSolvers>
#include <iostream>
#include <unsupported/Eigen/IterativeSolvers>

Bindings to Eigen’s iterative solvers.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

15 May 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solvers.cc
#include “solver/solvers.hh
#include <Eigen/Dense>
#include <iomanip>
#include <iostream>

implementation of dynamic newton-cg solver

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

file solvers.hh
#include “solver/solver_base.hh
#include <Eigen/Dense>
#include <vector>
#include <string>

Free functions for solving rve problems.

Copyright © 2018 Till Junge

Author

Till Junge till.junge@epfl.ch

Date

24 Apr 2018

µSpectre is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3, or (at your option) any later version.

µSpectre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with µSpectre; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  • Boston, MA 02111-1307, USA.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with proprietary FFT implementations or numerical libraries, containing parts covered by the terms of those libraries’ licenses, the licensors of this Program grant you additional permission to convey the resulting work.

group Coordinates

Typedefs

using Ccoord_t = std::array<Dim_t, Dim>

Ccoord_t are cell coordinates, i.e. integer coordinates.

using Rcoord_t = std::array<Real, Dim>

Real space coordinates.

using DynCcoord_t = DynCcoord<threeD>

usually, we should not need omre than three dimensions

using DynRcoord_t = DynCcoord<threeD, Real>

usually, we should not need omre than three dimensions

dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/cell
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/common
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/libmufft
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/libmugrid
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/materials
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/projection
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src/solver
dir /home/docs/checkouts/readthedocs.org/user_builds/muspectre/checkouts/master/src