Class GooseFEM::Mesh::Quad4::FineLayer#

class FineLayer : public GooseFEM::Mesh::RegularBase2d<FineLayer>#

Mesh with fine middle layer, and coarser elements towards the top and bottom.

Public Functions

inline FineLayer(size_t nelx, size_t nely, double h = 1.0, size_t nfine = 1)#

Constructor.

Parameters
  • nelx – Number of elements (along the middle layer) in horizontal (x) direction.

  • nely – Approximate equivalent number of elements in vertical (y) direction.

  • h – Edge size (width == height) of elements along the weak layer.

  • nfine – Extra number of fine layers around the middle layer. By default the element size is kept smaller than the distance to the middle layer.

template<class C, class E, std::enable_if_t<xt::is_xexpression<C>::value, bool> = true>
inline FineLayer(const C &coor, const E &conn)#

Reconstruct class for given coordinates / connectivity.

Template Parameters
Parameters
  • coor – Nodal coordinates [nnode, ndim] with ndim == 2.

  • conn – Connectivity [nne, nne] with nne == 4.

inline const array_type::tensor<size_t, 1> &elemrow_nhx() const#

Edge size in x-direction of a block, in units of h, per row of blocks.

Note that a block is equal to an element except in refinement layers where it contains three elements.

Returns

List of size equal to the number of rows of blocks.

inline const array_type::tensor<size_t, 1> &elemrow_nhy() const#

Edge size in y-direction of a block, in units of h, per row of blocks.

Note that a block is equal to an element except in refinement layers where it contains three elements.

Returns

List of size equal to the number of rows of blocks.

inline const array_type::tensor<int, 1> &elemrow_type() const#

Per row of blocks: -1: normal layer 0: transition layer to match coarse and finer element on the previous/next row.

Returns

List of size equal to the number of rows of blocks.

inline const array_type::tensor<size_t, 1> &elemrow_nelem() const#

Number of elements per row of blocks.

Note that a block is equal to an element except in refinement layers where it contains three elements.

Returns

List of size equal to the number of rows of blocks.

inline array_type::tensor<size_t, 1> elementsMiddleLayer() const#

Elements in the middle (fine) layer.

Returns

List of element numbers.

inline array_type::tensor<size_t, 1> elementsLayer(size_t layer) const#

Elements along a layer.

Returns

List of element numbers.

inline array_type::tensor<size_t, 1> elementgrid_ravel(std::vector<size_t> start_stop_rows, std::vector<size_t> start_stop_cols) const#

Select region of elements from ‘matrix’ of element numbers.

Returns

List of element numbers.

inline array_type::tensor<size_t, 1> elementgrid_around_ravel(size_t e, size_t size, bool periodic = true)#

Select region of elements from ‘matrix’ of element numbers around an element: square box with edge-size (2 * size + 1) * h, around element.

Parameters
  • e – The element around which to select elements.

  • size – Edge size of the square box encapsulating the selected element.

  • periodic – Assume the mesh periodic.

Returns

List of elements.

inline array_type::tensor<size_t, 1> elementgrid_leftright(size_t e, size_t left, size_t right, bool periodic = true)#

Select region of elements from ‘matrix’ of element numbers around an element: left/right from element (on the same layer).

Parameters
  • e – The element around which to select elements.

  • left – Number of elements to select to the left.

  • right – Number of elements to select to the right.

  • periodic – Assume the mesh periodic.

Returns

List of elements.

inline array_type::tensor<size_t, 1> roll(size_t n)#

Mapping to ‘roll’ periodically in the x-direction,.

Returns

element mapping, such that: new_elemvar = elemvar[elem_map]