Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh::Hex8::FineLayer port convenience functions #239

Open
tdegeus opened this issue Feb 17, 2022 · 0 comments
Open

Mesh::Hex8::FineLayer port convenience functions #239

tdegeus opened this issue Feb 17, 2022 · 0 comments

Comments

@tdegeus
Copy link
Owner

tdegeus commented Feb 17, 2022

Port convenience functions from Mesh::Quad4::FineLayer

/**
Reconstruct class for given coordinates / connectivity.
\tparam C e.g. `xt::xtensor<double, 2>`
\tparam E e.g. `xt::xtensor<size_t, 2>`
\param coor Nodal coordinates ``[nnode, ndim]`` with ``ndim == 2``.
\param conn Connectivity ``[nne, nne]`` with ``nne == 4``.
\throw GOOSEFEM_CHECK()
*/
template <class C, class E, std::enable_if_t<xt::is_xexpression<C>::value, bool> = true>
FineLayer(const C& coor, const E& conn);
/**
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.
\return List of size equal to the number of rows of blocks.
*/
xt::xtensor<size_t, 1> elemrow_nhx() 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.
\return List of size equal to the number of rows of blocks.
*/
xt::xtensor<size_t, 1> elemrow_nhy() 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.
\return List of size equal to the number of rows of blocks.
*/
xt::xtensor<size_t, 1> elemrow_nelem() const;
/**
Elements in the middle (fine) layer.
\return List of element numbers.
*/
xt::xtensor<size_t, 1> elementsMiddleLayer() const;
/**
Elements along a layer.
\return List of element numbers.
*/
xt::xtensor<size_t, 1> elementsLayer(size_t layer) const;
/**
Select region of elements from 'matrix' of element numbers.
\return List of element numbers.
*/
xt::xtensor<size_t, 1> elementgrid_ravel(
std::vector<size_t> rows_start_stop,
std::vector<size_t> cols_start_stop) const;
/**
Select region of elements from 'matrix' of element numbers around an element:
square box with edge-size ``(2 * size + 1) * h``, around ``element``.
\param element The element around which to select elements.
\param size Edge size of the square box encapsulating the selected element.
\param periodic Assume the mesh periodic.
\return List of elements.
*/
xt::xtensor<size_t, 1>
elementgrid_around_ravel(size_t element, size_t size, bool periodic = true);
/**
Select region of elements from 'matrix' of element numbers around an element:
left/right from ``element`` (on the same layer).
\param element The element around which to select elements.
\param left Number of elements to select to the left.
\param right Number of elements to select to the right.
\param periodic Assume the mesh periodic.
\return List of elements.
*/
// -
xt::xtensor<size_t, 1>
elementgrid_leftright(size_t element, size_t left, size_t right, bool periodic = true);
/**
Mapping to 'roll' periodically in the x-direction,
\return element mapping, such that: new_elemvar = elemvar[elem_map]
*/
xt::xtensor<size_t, 1> roll(size_t n);

see also #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant