Class GooseFEM::Element::QuadratureBase#

template<class D>
class QuadratureBase#

CRTP base class for quadrature.

Subclassed by GooseFEM::Element::QuadratureBaseCartesian< Quadrature >, GooseFEM::Element::QuadratureBaseCartesian< QuadratureAxisymmetric >, GooseFEM::Element::QuadratureBaseCartesian< QuadraturePlanar >, GooseFEM::Element::QuadratureBaseCartesian< D >

Public Types

using derived_type = D#

Underlying type.

Public Functions

inline auto nelem() const#

Number of elements.

Returns

Scalar.

inline auto nne() const#

Number of nodes per element.

Returns

Scalar.

inline auto ndim() const#

Number of dimensions for node vectors.

Returns

Scalar.

inline auto tdim() const#

Number of dimensions for integration point tensors.

Returns

Scalar.

inline auto nip() const#

Number of integration points.

Returns

Scalar.

template<class T, class R>
inline void asTensor(const T &arg, R &ret) const#

Convert “qscalar” to “qtensor” of certain rank.

Fully allocated output passed as reference, use AsTensor to allocate and return data.

Parameters
  • arg – A “qscalar”.

  • ret – A “qtensor”.

template<size_t rank, class T>
inline auto AsTensor(const T &arg) const#

Convert “qscalar” to “qtensor” of certain rank.

Parameters

arg – A “qscalar”.

Returns

“qtensor”.

template<class T>
inline auto AsTensor(size_t rank, const T &arg) const#

Convert “qscalar” to “qtensor” of certain rank.

Parameters
  • rank – Tensor rank.

  • arg – A “qscalar”.

Returns

“qtensor”.

inline auto shape_elemvec() const -> std::array<size_t, 3>#

Get the shape of an “elemvec”.

Returns

[nelem, nne, ndim].

inline auto shape_elemvec(size_t arg) const -> std::array<size_t, 3>#

Get the shape of an “elemvec”.

Parameters

arg – The vector dimension.

Returns

[nelem, nne, tdim].

inline auto shape_elemmat() const -> std::array<size_t, 3>#

Get the shape of an “elemmat”.

Returns

[nelem, nne * ndim, nne * ndim].

template<size_t rank = 0>
inline auto shape_qtensor() const -> std::array<size_t, 2 + rank>#

Get the shape of a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Template Parameters

rank – Rank of the tensor. Output is fixed-size: std::array<size_t, rank>.

Returns

[nelem, nip, tdim, …].

inline auto shape_qtensor(size_t rank) const -> std::vector<size_t>#

Get the shape of a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Parameters

rank – The tensor rank.

Returns

[nelem, nip, tdim, …].

template<size_t trank>
inline auto shape_qtensor(size_t rank, size_t arg) const -> std::array<size_t, 2 + trank>#

Get the shape of a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Template Parameters

rank – Rank of the tensor. Output is fixed-size: std::array<size_t, rank>.

Parameters
  • rank – The tensor rank. Effectively useless: to distinguish from the dynamic-sized.

  • arg – The tensor dimension.

Returns

[nelem, nip, tdim, …].

inline auto shape_qtensor(size_t rank, size_t arg) const -> std::vector<size_t>#

Get the shape of a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Parameters
  • rank – The tensor rank.

  • arg – The tensor dimension.

Returns

[nelem, nip, tdim, …].

inline auto shape_qscalar() const -> std::array<size_t, 2>#

Get the shape of a “qscalar” (a “qtensor” of rank 0)

Returns

[nelem, nip].

inline auto shape_qvector() const -> std::array<size_t, 3>#

Get the shape of a “qvector” (a “qtensor” of rank 1)

Returns

[nelem, nip, tdim].

inline auto shape_qvector(size_t arg) const -> std::array<size_t, 3>#

Get the shape of a “qvector” (a “qtensor” of rank 1)

Parameters

arg – Tensor dimension.

Returns

[nelem, nip, tdim].

template<class R>
inline auto allocate_elemvec() const#

Get an allocated array_type::tensor to store a “elemvec”.

Note: the container is not (zero-)initialised.

Template Parameters

R – value-type of the array, e.g. double.

Returns

xt::xarray container of the correct shape.

template<class R>
inline auto allocate_elemvec(R val) const#

Get an allocated and initialised xt::xarray to store a “elemvec”.

Template Parameters

R – value-type of the array, e.g. double.

Parameters

val – The value to which to initialise all items.

Returns

array_type::tensor container of the correct shape.

template<class R>
inline auto allocate_elemmat() const#

Get an allocated array_type::tensor to store a “elemmat”.

Note: the container is not (zero-)initialised.

Template Parameters

R – value-type of the array, e.g. double.

Returns

xt::xarray container of the correct shape.

template<class R>
inline auto allocate_elemmat(R val) const#

Get an allocated and initialised xt::xarray to store a “elemmat”.

Template Parameters

R – value-type of the array, e.g. double.

Parameters

val – The value to which to initialise all items.

Returns

array_type::tensor container of the correct shape.

template<size_t rank = 0, class R>
inline auto allocate_qtensor() const#

Get an allocated array_type::tensor to store a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Default: rank = 0, a.k.a. scalar. Note: the container is not (zero-)initialised.

Template Parameters

R – value-type of the array, e.g. double.

Returns

[nelem, nip].

template<size_t rank = 0, class R>
inline auto allocate_qtensor(R val) const#

Get an allocated and initialised array_type::tensor to store a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Default: rank = 0, a.k.a. scalar.

Template Parameters

R – value-type of the array, e.g. double.

Parameters

val – The value to which to initialise all items.

Returns

array_type::tensor container of the correct shape (and rank).

template<class R>
inline auto allocate_qtensor(size_t rank) const#

Get an allocated xt::xarray to store a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Note: the container is not (zero-)initialised.

Template Parameters

R – value-type of the array, e.g. double.

Parameters

rank – The tensor rank.

Returns

xt::xarray container of the correct shape.

template<class R>
inline auto allocate_qtensor(size_t rank, R val) const#

Get an allocated and initialised xt::xarray to store a “qtensor” of a certain rank (0 = scalar, 1, vector, 2 = 2nd-order tensor, etc.).

Template Parameters

R – value-type of the array, e.g. double.

Parameters
  • rank – The tensor rank.

  • val – The value to which to initialise all items.

Returns

array_type::tensor container of the correct shape (and rank).

template<class R>
inline auto allocate_qscalar() const#

Get an allocated array_type::tensor to store a “qscalar” (a “qtensor” of rank 0).

Note: the container is not (zero-)initialised.

Template Parameters

R – value-type of the array, e.g. double.

Returns

xt::xarray container of the correct shape.

template<class R>
inline auto allocate_qscalar(R val) const#

Get an allocated and initialised xt::xarray to store a “qscalar” (a “qtensor” of rank 0).

Template Parameters

R – value-type of the array, e.g. double.

Parameters

val – The value to which to initialise all items.

Returns

array_type::tensor container of the correct shape (and rank).