PLaSK library
|
Common base class for RectangularMaskedMesh 2D and 3D. More...
#include <plask/mesh/rectangular_masked_common.hpp>
Classes | |
struct | BoundaryIndexForAxis |
The lowest and the largest index in use, for each direction. More... | |
class | const_iterator |
Iterator over nodes coordinates. More... | |
struct | ElementMeshBase |
Base class for element meshes with common code for 2D and 3D. More... | |
struct | ElementsBase |
Base class for Elements with common code for 2D and 3D. More... | |
Public Types | |
enum | : std::size_t { NOT_INCLUDED = Set::NOT_INCLUDED } |
Returned by some methods to signalize that element or node (with given index(es)) is not included in the mesh. More... | |
typedef const_iterator | iterator |
Iterator over nodes coordinates. The same as const_iterator, since non-const iterators are not supported. | |
Public Member Functions | |
RectangularMaskedMeshBase ()=default | |
Construct an empty mesh. One should use reset() or selectAll() method before using it. | |
RectangularMaskedMeshBase (const RectangularMesh< DIM > &rectangularMesh, Set nodeSet, bool clone_axes=false) | |
Constructor which allows us to construct midpoints mesh. | |
RectangularMaskedMeshBase (const RectangularMesh< DIM > &rectangularMesh, bool clone_axes=false) | |
Construct a mesh by wrap of a given rectangularMesh . | |
const_iterator | begin () const |
const_iterator | end () const |
LocalCoords | at (std::size_t index) const override |
std::size_t | size () const override |
bool | empty () const override |
bool | full () const |
void | selectAll (const RectangularMesh< DIM > &rectangularMesh, bool clone_axes=false) |
Set wrapped mesh and select all its elements. | |
void | selectAll () |
Select all elements of wrapped mesh. | |
std::size_t | index (const Vec< DIM, std::size_t > &indexes) const |
Calculate this mesh index using indexes of axis[0] and axis[1]. | |
std::size_t | index0 (std::size_t mesh_index) const |
Calculate index of axis0 using this mesh index. | |
std::size_t | index1 (std::size_t mesh_index) const |
Calculate index of axis1 using this mesh index. | |
Vec< DIM, std::size_t > | indexes (std::size_t mesh_index) const |
Calculate indexes of axes. | |
std::size_t | majorIndex (std::size_t mesh_index) const |
Calculate index of major axis using given mesh index. | |
std::size_t | minorIndex (std::size_t mesh_index) const |
Calculate index of major axis using given mesh index. | |
std::size_t | getElementsCount0 () const |
Get number of elements (for FEM method) in the first direction. | |
std::size_t | getElementsCount1 () const |
Get number of elements (for FEM method) in the second direction. | |
std::size_t | getElementsCount () const |
Get number of elements (for FEM method). | |
std::size_t | getElementIndexFromLowIndex (std::size_t mesh_index_of_el_bottom_left) const |
Convert mesh index of bottom left element corner to index of this element. | |
std::size_t | getElementMeshLowIndex (std::size_t element_index) const |
Convert element index to mesh index of bottom-left element corner. | |
Vec< DIM, std::size_t > | getElementMeshLowIndexes (std::size_t element_index) const |
Convert an element index to mesh indexes of bottom-left corner of the element. | |
double | getElementArea (std::size_t element_index) const |
Get an area of a given element. | |
double | getElementMidpoint0 (std::size_t index0) const |
Get first coordinate of point in the center of an elements. | |
double | getElementMidpoint1 (std::size_t index1) const |
Get second coordinate of point in the center of an elements. | |
Vec< DIM, double > | getElementMidpoint (std::size_t element_index) const |
Get point in the center of an element. | |
Primitive< DIM >::Box | getElementBox (std::size_t element_index) const |
Get an element as a rectangle. | |
Public Attributes | |
RectangularMesh< DIM > | fullMesh |
Full, rectangular, wrapped mesh. | |
Static Public Attributes | |
static constexpr double | MIN_DISTANCE = 1e-9 |
Maximum distance from boundary to include in the inerpolation. | |
Protected Types | |
typedef CompressedSetOfNumbers< std::size_t > | Set |
typedef BoundaryIndexForAxis | BoundaryIndex[DIM] |
Protected Member Functions | |
void | resetBoundyIndex () |
void | reset () |
Clear nodeSet, elementSet and call resetBoundyIndex(). | |
const Set & | ensureHasElements () const |
Ensure that elementSet is calculated (calculate it if it is not). | |
const BoundaryIndex & | ensureHasBoundaryIndex () const |
Ensure that boundaryIndex is calculated (calculate it if it is not). | |
Static Protected Member Functions | |
static void | findIndexes (const MeshAxis &axis, double wrapped_point_coord, std::size_t &index_lo, std::size_t &index_hi) |
Used by interpolation. | |
static std::size_t | nearest (double p, const MeshAxis &axis, std::size_t index_lo, std::size_t index_hi) |
Used by nearest neighbor interpolation. | |
Protected Attributes | |
Set | nodeSet |
Numbers of rectangularMesh indexes which are in the corners of the elements enabled. | |
Set | elementSet |
Numbers of enabled elements. | |
BoundaryIndex | boundaryIndex |
DontCopyThisField< boost::mutex > | writeMutex |
Only one thread can calculate elementSet or boundaryIndex. | |
bool | elementSetInitialized = true |
Whether elementSet is initialized (default for most constructors). | |
bool | boundaryIndexInitialized |
Whether boundatyIndex is initialized. | |
Common base class for RectangularMaskedMesh 2D and 3D.
Do not use directly.
Definition at line 33 of file rectangular_masked_common.hpp.
|
protected |
Definition at line 60 of file rectangular_masked_common.hpp.
typedef const_iterator plask::RectangularMaskedMeshBase< DIM >::iterator |
Iterator over nodes coordinates. The same as const_iterator, since non-const iterators are not supported.
Definition at line 280 of file rectangular_masked_common.hpp.
|
protected |
Definition at line 46 of file rectangular_masked_common.hpp.
Returned by some methods to signalize that element or node (with given index(es)) is not included in the mesh.
Enumerator | |
---|---|
NOT_INCLUDED |
Definition at line 1 of file rectangular_masked_common.hpp.
|
default |
Construct an empty mesh. One should use reset() or selectAll() method before using it.
|
inline |
Constructor which allows us to construct midpoints mesh.
Definition at line 233 of file rectangular_masked_common.hpp.
|
inline |
Construct a mesh by wrap of a given rectangularMesh
.
rectangularMesh | mesh to wrap (it is copied by the constructor) |
clone_axes | whether axes of the rectangularMesh should be cloned (if true) or shared (if false; default) |
Definition at line 244 of file rectangular_masked_common.hpp.
|
inlineoverride |
Definition at line 285 of file rectangular_masked_common.hpp.
|
inline |
Definition at line 282 of file rectangular_masked_common.hpp.
|
inlineoverride |
Definition at line 291 of file rectangular_masked_common.hpp.
|
inline |
Definition at line 283 of file rectangular_masked_common.hpp.
|
inlineprotected |
Ensure that boundaryIndex is calculated (calculate it if it is not).
Definition at line 645 of file rectangular_masked_common.hpp.
|
inlineprotected |
Ensure that elementSet is calculated (calculate it if it is not).
Definition at line 636 of file rectangular_masked_common.hpp.
|
inlinestaticprotected |
Used by interpolation.
axis | |
wrapped_point_coord | |
index_lo | |
index_hi |
Definition at line 70 of file rectangular_masked_common.hpp.
|
inline |
Definition at line 296 of file rectangular_masked_common.hpp.
|
inline |
Get an area of a given element.
element_index | index of the element |
Definition at line 433 of file rectangular_masked_common.hpp.
|
inline |
Get an element as a rectangle.
element_index | index of the element |
Definition at line 469 of file rectangular_masked_common.hpp.
|
inline |
Convert mesh index of bottom left element corner to index of this element.
mesh_index_of_el_bottom_left | mesh index |
Definition at line 405 of file rectangular_masked_common.hpp.
|
inline |
Convert element index to mesh index of bottom-left element corner.
element_index | index of element, from 0 to getElementsCount()-1 |
Definition at line 414 of file rectangular_masked_common.hpp.
|
inline |
Convert an element index to mesh indexes of bottom-left corner of the element.
element_index | index of the element, from 0 to getElementsCount()-1 |
Definition at line 424 of file rectangular_masked_common.hpp.
|
inline |
Get point in the center of an element.
element_index | index of Elements |
Definition at line 460 of file rectangular_masked_common.hpp.
|
inline |
Get first coordinate of point in the center of an elements.
index0 | index of the element (axis0 index) |
Definition at line 442 of file rectangular_masked_common.hpp.
|
inline |
Get second coordinate of point in the center of an elements.
index1 | index of the element (axis1 index) |
Definition at line 451 of file rectangular_masked_common.hpp.
|
inline |
Get number of elements (for FEM method).
Definition at line 396 of file rectangular_masked_common.hpp.
|
inline |
Get number of elements (for FEM method) in the first direction.
Definition at line 380 of file rectangular_masked_common.hpp.
|
inline |
Get number of elements (for FEM method) in the second direction.
Definition at line 388 of file rectangular_masked_common.hpp.
|
inline |
Calculate this mesh index using indexes of axis[0] and axis[1].
indexes | index of axis[0] and axis[1] |
Definition at line 327 of file rectangular_masked_common.hpp.
|
inline |
Calculate index of axis0 using this mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 336 of file rectangular_masked_common.hpp.
|
inline |
Calculate index of axis1 using this mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 345 of file rectangular_masked_common.hpp.
|
inline |
Calculate indexes of axes.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 354 of file rectangular_masked_common.hpp.
|
inline |
Calculate index of major axis using given mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 363 of file rectangular_masked_common.hpp.
|
inline |
Calculate index of major axis using given mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 372 of file rectangular_masked_common.hpp.
|
inlinestaticprotected |
Used by nearest neighbor interpolation.
p | point coordinate such that axis.at(index_lo) <= p <= axis.at(index_hi) |
axis | |
index_lo,index_hi | indexes |
index_lo
or index_hi
, index which minimize |p - axis.at(index)| Definition at line 84 of file rectangular_masked_common.hpp.
|
inlineprotected |
Clear nodeSet, elementSet and call resetBoundyIndex().
Definition at line 218 of file rectangular_masked_common.hpp.
|
inlineprotected |
Definition at line 209 of file rectangular_masked_common.hpp.
|
inline |
Select all elements of wrapped mesh.
Definition at line 311 of file rectangular_masked_common.hpp.
|
inline |
Set wrapped mesh and select all its elements.
rectangularMesh | input mesh, before masking |
clone_axes | whether axes of the rectangularMesh should be cloned (if true ) or shared (if false ; default) |
Definition at line 303 of file rectangular_masked_common.hpp.
|
inlineoverride |
Definition at line 289 of file rectangular_masked_common.hpp.
|
protected |
Definition at line 61 of file rectangular_masked_common.hpp.
|
protected |
Whether boundatyIndex is initialized.
Definition at line 482 of file rectangular_masked_common.hpp.
|
protected |
Numbers of enabled elements.
Definition at line 52 of file rectangular_masked_common.hpp.
|
protected |
Whether elementSet is initialized (default for most constructors).
Definition at line 479 of file rectangular_masked_common.hpp.
RectangularMesh<DIM> plask::RectangularMaskedMeshBase< DIM >::fullMesh |
Full, rectangular, wrapped mesh.
Definition at line 39 of file rectangular_masked_common.hpp.
|
staticconstexpr |
Maximum distance from boundary to include in the inerpolation.
Definition at line 36 of file rectangular_masked_common.hpp.
|
protected |
Numbers of rectangularMesh indexes which are in the corners of the elements enabled.
Definition at line 49 of file rectangular_masked_common.hpp.
|
protected |
Only one thread can calculate elementSet or boundaryIndex.
Definition at line 476 of file rectangular_masked_common.hpp.