Class GooseFEM::Mesh::Quad4::Map::RefineRegular#

class RefineRegular#

Refine a Regular mesh: subdivide elements in several smaller elements.

Public Functions

inline RefineRegular(const GooseFEM::Mesh::Quad4::Regular &mesh, size_t nx, size_t ny)#

Constructor.

Parameters:
  • mesh – the coarse mesh.

  • nx – for each coarse element: number of fine elements in x-direction.

  • ny – for each coarse element: number of fine elements in y-direction.

inline size_t nx() const#

For each coarse element: number of fine elements in x-direction.

Returns:

unsigned int (same as used in constructor)

inline size_t ny() const#

For each coarse element: number of fine elements in y-direction.

Returns:

unsigned int (same as used in constructor)

inline GooseFEM::Mesh::Quad4::Regular coarseMesh() const#

Obtain the coarse mesh (copy of the mesh passed to the constructor).

Returns:

mesh

inline GooseFEM::Mesh::Quad4::Regular fineMesh() const#

Obtain the fine mesh.

Returns:

mesh

inline const array_type::tensor<size_t, 2> &map() const#

Get element-mapping: elements of the fine mesh per element of the coarse mesh.

Returns:

[nelem_coarse, nx() * ny()]

inline GooseFEM::Mesh::Quad4::Regular getCoarseMesh() const#

Obtain the coarse mesh (copy of the mesh passed to the constructor).

Returns:

mesh

inline GooseFEM::Mesh::Quad4::Regular getFineMesh() const#

Obtain the fine mesh.

Returns:

mesh

inline const array_type::tensor<size_t, 2> &getMap() const#

Get element-mapping: elements of the fine mesh per element of the coarse mesh.

Returns:

[nelem_coarse, nx() * ny()]

template<class T, size_t rank>
inline array_type::tensor<T, rank> meanToCoarse(const array_type::tensor<T, rank> &data) const#

Compute the mean of the quantity define on the fine mesh when mapped on the coarse mesh.

Template Parameters:
  • T – type of the data (e.g. double).

  • rank – rank of the data.

Parameters:

data – the data [nelem_fine, …]

Returns:

the average data of the coarse mesh [nelem_coarse, …]

template<class T, size_t rank, class S>
inline array_type::tensor<T, rank> averageToCoarse(const array_type::tensor<T, rank> &data, const array_type::tensor<S, rank> &weights) const#

Compute the average of the quantity define on the fine mesh when mapped on the coarse mesh.

Template Parameters:
  • T – type of the data (e.g. double).

  • rank – rank of the data.

  • S – type of the weights (e.g. double).

Parameters:
  • data – the data [nelem_fine, …]

  • weights – the weights [nelem_fine, …]

Returns:

the average data of the coarse mesh [nelem_coarse, …]

template<class T, size_t rank>
inline array_type::tensor<T, rank> mapToFine(const array_type::tensor<T, rank> &data) const#

Map element quantities to the fine mesh.

The mapping is a bit simplistic: no interpolation is involved. The mapping is such that::

 ret[e_fine, ...] <- data[e_coarse, ...]

Template Parameters:
  • T – type of the data (e.g. double).

  • rank – rank of the data.

Parameters:

data – the data.

Returns:

mapped data.