FrictionQPotFEM 0.23.3
Loading...
Searching...
No Matches
GooseFEM::Element::QuadratureBase< D > Class Template Reference

CRTP base class for quadrature. More...

#include <include/GooseFEM/Element.h>

Inheritance diagram for GooseFEM::Element::QuadratureBase< D >:

Public Types

using derived_type = D
 Underlying type. More...
 

Public Member Functions

auto nelem () const
 Number of elements. More...
 
auto nne () const
 Number of nodes per element. More...
 
auto ndim () const
 Number of dimensions for node vectors. More...
 
auto tdim () const
 Number of dimensions for integration point tensors. More...
 
auto nip () const
 Number of integration points. More...
 
template<class T , class R >
void asTensor (const T &arg, R &ret) const
 Convert "qscalar" to "qtensor" of certain rank. More...
 
template<size_t rank, class T >
auto AsTensor (const T &arg) const
 Convert "qscalar" to "qtensor" of certain rank. More...
 
template<class T >
auto AsTensor (size_t rank, const T &arg) const
 Convert "qscalar" to "qtensor" of certain rank. More...
 
auto shape_elemvec () const -> std::array< size_t, 3 >
 Get the shape of an "elemvec". More...
 
auto shape_elemvec (size_t arg) const -> std::array< size_t, 3 >
 Get the shape of an "elemvec". More...
 
auto shape_elemmat () const -> std::array< size_t, 3 >
 Get the shape of an "elemmat". More...
 
template<size_t rank = 0>
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.). More...
 
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.). More...
 
template<size_t trank>
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.). More...
 
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.). More...
 
auto shape_qscalar () const -> std::array< size_t, 2 >
 Get the shape of a "qscalar" (a "qtensor" of rank 0) More...
 
auto shape_qvector () const -> std::array< size_t, 3 >
 Get the shape of a "qvector" (a "qtensor" of rank 1) More...
 
auto shape_qvector (size_t arg) const -> std::array< size_t, 3 >
 Get the shape of a "qvector" (a "qtensor" of rank 1) More...
 
template<class R >
auto allocate_elemvec () const
 Get an allocated array_type::tensor to store a "elemvec". More...
 
template<class R >
auto allocate_elemvec (R val) const
 Get an allocated and initialised xt::xarray to store a "elemvec". More...
 
template<class R >
auto allocate_elemmat () const
 Get an allocated array_type::tensor to store a "elemmat". More...
 
template<class R >
auto allocate_elemmat (R val) const
 Get an allocated and initialised xt::xarray to store a "elemmat". More...
 
template<size_t rank = 0, class R >
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.). More...
 
template<size_t rank = 0, class R >
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.). More...
 
template<class R >
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.). More...
 
template<class R >
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.). More...
 
template<class R >
auto allocate_qscalar () const
 Get an allocated array_type::tensor to store a "qscalar" (a "qtensor" of rank 0). More...
 
template<class R >
auto allocate_qscalar (R val) const
 Get an allocated and initialised xt::xarray to store a "qscalar" (a "qtensor" of rank 0). More...
 

Detailed Description

template<class D>
class GooseFEM::Element::QuadratureBase< D >

CRTP base class for quadrature.

Definition at line 149 of file Element.h.

Member Typedef Documentation

◆ derived_type

template<class D >
using GooseFEM::Element::QuadratureBase< D >::derived_type = D

Underlying type.

Definition at line 154 of file Element.h.

Member Function Documentation

◆ allocate_elemmat() [1/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_elemmat ( ) const
inline

Get an allocated array_type::tensor to store a "elemmat".

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

Template Parameters
Rvalue-type of the array, e.g. double.
Returns
xt::xarray container of the correct shape.

Definition at line 411 of file Element.h.

◆ allocate_elemmat() [2/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_elemmat ( val) const
inline

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

Template Parameters
Rvalue-type of the array, e.g. double.
Parameters
valThe value to which to initialise all items.
Returns
array_type::tensor container of the correct shape.

Definition at line 424 of file Element.h.

◆ allocate_elemvec() [1/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_elemvec ( ) const
inline

Get an allocated array_type::tensor to store a "elemvec".

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

Template Parameters
Rvalue-type of the array, e.g. double.
Returns
xt::xarray container of the correct shape.

Definition at line 383 of file Element.h.

◆ allocate_elemvec() [2/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_elemvec ( val) const
inline

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

Template Parameters
Rvalue-type of the array, e.g. double.
Parameters
valThe value to which to initialise all items.
Returns
array_type::tensor container of the correct shape.

Definition at line 396 of file Element.h.

◆ allocate_qscalar() [1/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qscalar ( ) const
inline

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

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

Template Parameters
Rvalue-type of the array, e.g. double.
Returns
xt::xarray container of the correct shape.

Definition at line 503 of file Element.h.

◆ allocate_qscalar() [2/2]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qscalar ( val) const
inline

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

Template Parameters
Rvalue-type of the array, e.g. double.
Parameters
valThe value to which to initialise all items.
Returns
array_type::tensor container of the correct shape (and rank).

Definition at line 516 of file Element.h.

◆ allocate_qtensor() [1/4]

template<class D >
template<size_t rank = 0, class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qtensor ( ) const
inline

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
Rvalue-type of the array, e.g. double.
Returns
[nelem, nip].

Definition at line 441 of file Element.h.

◆ allocate_qtensor() [2/4]

template<class D >
template<size_t rank = 0, class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qtensor ( val) const
inline

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
Rvalue-type of the array, e.g. double.
Parameters
valThe value to which to initialise all items.
Returns
array_type::tensor container of the correct shape (and rank).

Definition at line 456 of file Element.h.

◆ allocate_qtensor() [3/4]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qtensor ( size_t  rank) const
inline

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
Rvalue-type of the array, e.g. double.
Parameters
rankThe tensor rank.
Returns
xt::xarray container of the correct shape.

Definition at line 473 of file Element.h.

◆ allocate_qtensor() [4/4]

template<class D >
template<class R >
auto GooseFEM::Element::QuadratureBase< D >::allocate_qtensor ( size_t  rank,
val 
) const
inline

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
Rvalue-type of the array, e.g. double.
Parameters
rankThe tensor rank.
valThe value to which to initialise all items.
Returns
array_type::tensor container of the correct shape (and rank).

Definition at line 488 of file Element.h.

◆ AsTensor() [1/2]

template<class D >
template<size_t rank, class T >
auto GooseFEM::Element::QuadratureBase< D >::AsTensor ( const T &  arg) const
inline

Convert "qscalar" to "qtensor" of certain rank.

Parameters
argA "qscalar".
Returns
"qtensor".

Definition at line 227 of file Element.h.

◆ asTensor()

template<class D >
template<class T , class R >
void GooseFEM::Element::QuadratureBase< D >::asTensor ( const T &  arg,
R &  ret 
) const
inline

Convert "qscalar" to "qtensor" of certain rank.

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

Parameters
argA "qscalar".
retA "qtensor".

Definition at line 214 of file Element.h.

◆ AsTensor() [2/2]

template<class D >
template<class T >
auto GooseFEM::Element::QuadratureBase< D >::AsTensor ( size_t  rank,
const T &  arg 
) const
inline

Convert "qscalar" to "qtensor" of certain rank.

Parameters
rankTensor rank.
argA "qscalar".
Returns
"qtensor".

Definition at line 240 of file Element.h.

◆ ndim()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::ndim ( ) const
inline

Number of dimensions for node vectors.

Returns
Scalar.

Definition at line 181 of file Element.h.

◆ nelem()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::nelem ( ) const
inline

Number of elements.

Returns
Scalar.

Definition at line 161 of file Element.h.

◆ nip()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::nip ( ) const
inline

Number of integration points.

Returns
Scalar.

Definition at line 201 of file Element.h.

◆ nne()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::nne ( ) const
inline

Number of nodes per element.

Returns
Scalar.

Definition at line 171 of file Element.h.

◆ shape_elemmat()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_elemmat ( ) const -> std::array<size_t, 3>
inline

Get the shape of an "elemmat".

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

Definition at line 271 of file Element.h.

◆ shape_elemvec() [1/2]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_elemvec ( ) const -> std::array<size_t, 3>
inline

Get the shape of an "elemvec".

Returns
[nelem, nne, ndim].

Definition at line 250 of file Element.h.

◆ shape_elemvec() [2/2]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_elemvec ( size_t  arg) const -> std::array<size_t, 3>
inline

Get the shape of an "elemvec".

Parameters
argThe vector dimension.
Returns
[nelem, nne, tdim].

Definition at line 261 of file Element.h.

◆ shape_qscalar()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_qscalar ( ) const -> std::array<size_t, 2>
inline

Get the shape of a "qscalar" (a "qtensor" of rank 0)

Returns
[nelem, nip].

Definition at line 351 of file Element.h.

◆ shape_qtensor() [1/4]

template<class D >
template<size_t rank = 0>
auto GooseFEM::Element::QuadratureBase< D >::shape_qtensor ( ) const -> std::array<size_t, 2 + rank>
inline

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

Template Parameters
rankRank of the tensor. Output is fixed-size: std::array<size_t, rank>.
Returns
[nelem, nip, tdim, ...].

Definition at line 285 of file Element.h.

◆ shape_qtensor() [2/4]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_qtensor ( size_t  rank) const -> std::vector<size_t>
inline

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

Parameters
rankThe tensor rank.
Returns
[nelem, nip, tdim, ...].

Definition at line 301 of file Element.h.

◆ shape_qtensor() [3/4]

template<class D >
template<size_t trank>
auto GooseFEM::Element::QuadratureBase< D >::shape_qtensor ( size_t  rank,
size_t  arg 
) const -> std::array<size_t, 2 + trank>
inline

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

Template Parameters
rankRank of the tensor. Output is fixed-size: std::array<size_t, rank>.
Parameters
rankThe tensor rank. Effectively useless: to distinguish from the dynamic-sized.
argThe tensor dimension.
Returns
[nelem, nip, tdim, ...].

Definition at line 320 of file Element.h.

◆ shape_qtensor() [4/4]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_qtensor ( size_t  rank,
size_t  arg 
) const -> std::vector<size_t>
inline

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

Parameters
rankThe tensor rank.
argThe tensor dimension.
Returns
[nelem, nip, tdim, ...].

Definition at line 338 of file Element.h.

◆ shape_qvector() [1/2]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_qvector ( ) const -> std::array<size_t, 3>
inline

Get the shape of a "qvector" (a "qtensor" of rank 1)

Returns
[nelem, nip, tdim].

Definition at line 360 of file Element.h.

◆ shape_qvector() [2/2]

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::shape_qvector ( size_t  arg) const -> std::array<size_t, 3>
inline

Get the shape of a "qvector" (a "qtensor" of rank 1)

Parameters
argTensor dimension.
Returns
[nelem, nip, tdim].

Definition at line 370 of file Element.h.

◆ tdim()

template<class D >
auto GooseFEM::Element::QuadratureBase< D >::tdim ( ) const
inline

Number of dimensions for integration point tensors.

Returns
Scalar.

Definition at line 191 of file Element.h.


The documentation for this class was generated from the following file: