PLaSK library
Loading...
Searching...
No Matches
plask::RectangularMaskedMesh3D Struct Reference

Rectangular mesh which uses (and indexes) only chosen elements and all nodes in their corners. More...

#include <plask/mesh/rectangular_masked3d.hpp>

Inheritance diagram for plask::RectangularMaskedMesh3D:
[legend]
Collaboration diagram for plask::RectangularMaskedMesh3D:
[legend]

Classes

struct  BoundaryIteratorImpl
 Iterator over plane CHANGE_DIR_SLOWER, CHANGE_DIR_FASTER (an index if the remain coordinate is constant). More...
 
struct  BoundaryNodeSetImpl
 
class  Element
 
struct  ElementMesh
 Element mesh. More...
 
struct  Elements
 

Public Types

typedef std::function< bool(const RectangularMesh3D::Element &)> Predicate
 Type of predicate function which returns bool for given element of a mesh.
 
- Public Types inherited from plask::RectangularMaskedMeshBase< 3 >
enum  
 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

std::size_t index2 (std::size_t mesh_index) const
 Calculate index of axis2 using this mesh index.
 
std::size_t middleIndex (std::size_t mesh_index) const
 Calculate index of middle axis using given mesh index.
 
std::size_t getElementsCount2 () const
 Get number of elements (for FEM method) in the third direction.
 
double getElementMidpoint2 (std::size_t index2) const
 Get third coordinate of point in the center of an elements.
 
 RectangularMaskedMesh3D ()=default
 Construct empty/uninitialized mesh.
 
void reset (const Predicate &predicate)
 Change a selection of elements used to once pointed by a given predicate.
 
 RectangularMaskedMesh3D (const RectangularMesh< 3 > &fullMesh, const Predicate &predicate, bool clone_axes=false)
 Construct masked mesh with elements of fullMesh chosen by a predicate.
 
void reset (const RectangularMesh< 3 > &fullMesh, const Predicate &predicate, bool clone_axes=false)
 Change parameter of this mesh to use elements of fullMesh chosen by a predicate.
 
 RectangularMaskedMesh3D (const RectangularMesh< 3 > &fullMesh, const GeometryD< 3 > &geom, const std::function< bool(shared_ptr< const Material >)> materialPredicate, bool clone_axes=false)
 Construct masked mesh with all elements of fullMesh which have required materials in the midpoints.
 
void reset (const RectangularMesh< 3 > &rectangularMesh, const GeometryD< 3 > &geom, const std::function< bool(shared_ptr< const Material >)> materialPredicate, bool clone_axes=false)
 Change parameter of this mesh to use all elements of rectangularMesh which have required materials in the midpoints.
 
 RectangularMaskedMesh3D (const RectangularMesh< 3 > &rectangularMesh, const GeometryD< 3 > &geom, unsigned materialKinds, bool clone_axes=false)
 Construct masked mesh with all elements of rectangularMesh which have required kinds of materials (in the midpoints).
 
void reset (const RectangularMesh< 3 > &rectangularMesh, const GeometryD< 3 > &geom, unsigned materialKinds, bool clone_axes=false)
 Change parameters of this mesh to use all elements of rectangularMesh which have required kinds of materials (in the midpoints).
 
 RectangularMaskedMesh3D (const RectangularMesh< DIM > &rectangularMesh, Set nodeSet, bool clone_axes=false)
 Construct a mesh with given set of nodes.
 
Elements elements () const
 
Elements getElements () const
 
Element element (std::size_t i0, std::size_t i1, std::size_t i2) const
 
Element getElement (std::size_t i0, std::size_t i1, std::size_t i2) const
 
Element element (std::size_t i) const
 Get an element with a given index i.
 
Element getElement (std::size_t i) const
 Get an element with a given index i.
 
std::size_t index (std::size_t axis0_index, std::size_t axis1_index, std::size_t axis2_index) const
 Calculate this mesh index using indexes of axis0 and axis1.
 
Vec< 3, doubleat (std::size_t index0, std::size_t index1, std::size_t index2) const
 Get point with given mesh indices.
 
Vec< 3, doubleoperator() (std::size_t axis0_index, std::size_t axis1_index, std::size_t axis2_index) const
 Get point with given x and y indexes.
 
shared_ptr< RectangularMaskedMesh3D::ElementMeshgetElementMesh () const
 Return a mesh that enables iterating over middle points of the selected rectangles.
 
bool prepareInterpolation (const Vec< 3 > &point, Vec< 3 > &wrapped_point, std::size_t &index0_lo, std::size_t &index0_hi, std::size_t &index1_lo, std::size_t &index1_hi, std::size_t &index2_lo, std::size_t &index2_hi, const InterpolationFlags &flags) const
 Prepare point for inteprolation.
 
template<typename RandomAccessContainer >
auto interpolateLinear (const RandomAccessContainer &data, const Vec< 3 > &point, const InterpolationFlags &flags) const -> typename std::remove_reference< decltype(data[0])>::type
 Calculate (using linear interpolation) value of data in point using data in points described by this mesh.
 
template<typename RandomAccessContainer >
auto interpolateNearestNeighbor (const RandomAccessContainer &data, const Vec< 3 > &point, const InterpolationFlags &flags) const -> typename std::remove_reference< decltype(data[0])>::type
 Calculate (using nearest neighbor interpolation) value of data in point using data in points described by this mesh.
 
std::size_t getElementIndexFromLowIndexes (std::size_t axis0_index, std::size_t axis1_index, std::size_t axis2_index) const
 Convert mesh indexes of a back-left-bottom corner of an element to the index of this element.
 
double getElementArea (std::size_t index0, std::size_t index1, std::size_t index2) const
 Get an area of a given element.
 
Vec< 3, doublegetElementMidpoint (std::size_t index0, std::size_t index1, std::size_t index2) const
 Get point in center of Elements.
 
Box3D getElementBox (std::size_t index0, std::size_t index1, std::size_t index2) const
 Get element as rectangle.
 
BoundaryNodeSet createIndex0BoundaryAtLine (std::size_t line_nr_axis0, std::size_t index1Begin, std::size_t index1End, std::size_t index2Begin, std::size_t index2End) const override
 
BoundaryNodeSet createIndex0BoundaryAtLine (std::size_t line_nr_axis0) const override
 
BoundaryNodeSet createIndex1BoundaryAtLine (std::size_t line_nr_axis1, std::size_t index0Begin, std::size_t index0End, std::size_t index2Begin, std::size_t index2End) const override
 
BoundaryNodeSet createIndex1BoundaryAtLine (std::size_t line_nr_axis1) const override
 
BoundaryNodeSet createIndex2BoundaryAtLine (std::size_t line_nr_axis2, std::size_t index0Begin, std::size_t index0End, std::size_t index1Begin, std::size_t index1End) const override
 
BoundaryNodeSet createIndex2BoundaryAtLine (std::size_t line_nr_axis2) const override
 
BoundaryNodeSet createBackBoundary () const override
 
BoundaryNodeSet createFrontBoundary () const override
 
BoundaryNodeSet createLeftBoundary () const override
 
BoundaryNodeSet createRightBoundary () const override
 
BoundaryNodeSet createBottomBoundary () const override
 
BoundaryNodeSet createTopBoundary () const override
 
BoundaryNodeSet createBackOfBoundary (const Box3D &box) const override
 
BoundaryNodeSet createFrontOfBoundary (const Box3D &box) const override
 
BoundaryNodeSet createLeftOfBoundary (const Box3D &box) const override
 
BoundaryNodeSet createRightOfBoundary (const Box3D &box) const override
 
BoundaryNodeSet createBottomOfBoundary (const Box3D &box) const override
 
BoundaryNodeSet createTopOfBoundary (const Box3D &box) const override
 
- Public Member Functions inherited from plask::RectangularMaskedMeshBase< 3 >
 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.
 

Additional Inherited Members

- Public Attributes inherited from plask::RectangularMaskedMeshBase< 3 >
RectangularMesh< DIM > fullMesh
 Full, rectangular, wrapped mesh.
 
- Static Public Attributes inherited from plask::RectangularMaskedMeshBase< 3 >
static constexpr double MIN_DISTANCE
 Maximum distance from boundary to include in the inerpolation.
 
- Protected Types inherited from plask::RectangularMaskedMeshBase< 3 >
typedef CompressedSetOfNumbers< std::size_t > Set
 
typedef BoundaryIndexForAxis BoundaryIndex[DIM]
 
- Protected Member Functions inherited from plask::RectangularMaskedMeshBase< 3 >
void resetBoundyIndex ()
 
void reset ()
 Clear nodeSet, elementSet and call resetBoundyIndex().
 
const SetensureHasElements () 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 inherited from plask::RectangularMaskedMeshBase< 3 >
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 inherited from plask::RectangularMaskedMeshBase< 3 >
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
 Whether elementSet is initialized (default for most constructors).
 
bool boundaryIndexInitialized
 Whether boundatyIndex is initialized.
 

Detailed Description

Rectangular mesh which uses (and indexes) only chosen elements and all nodes in their corners.

Objects of this class can be constructed from instances of full rectangular mesh (RectangularMaskedMesh3D) and they can use the same boundary conditions (BoundaryConditions instance for full mesh accepts also objects of this class). Interpolation methods return NaN-s for all elements which have not been chosen.

Definition at line 28 of file rectangular_masked3d.hpp.

Member Typedef Documentation

◆ Predicate

Type of predicate function which returns bool for given element of a mesh.

Definition at line 66 of file rectangular_masked3d.hpp.

Constructor & Destructor Documentation

◆ RectangularMaskedMesh3D() [1/5]

plask::RectangularMaskedMesh3D::RectangularMaskedMesh3D ( )
default

Construct empty/uninitialized mesh.

One should call reset() or selectAll() method before using this.

◆ RectangularMaskedMesh3D() [2/5]

plask::RectangularMaskedMesh3D::RectangularMaskedMesh3D ( const RectangularMesh< 3 > &  fullMesh,
const Predicate predicate,
bool  clone_axes = false 
)

Construct masked mesh with elements of fullMesh chosen by a predicate.

Preserve order of elements and nodes of fullMesh.

Parameters
fullMeshinput mesh, before masking
predicatepredicate which returns either true for accepting element or false for rejecting it
clone_axeswhether axes of the fullMesh should be cloned (if true) or shared (if false; default)

Definition at line 23 of file rectangular_masked3d.cpp.

◆ RectangularMaskedMesh3D() [3/5]

plask::RectangularMaskedMesh3D::RectangularMaskedMesh3D ( const RectangularMesh< 3 > &  fullMesh,
const GeometryD< 3 > &  geom,
const std::function< bool(shared_ptr< const Material >)>  materialPredicate,
bool  clone_axes = false 
)
inline

Construct masked mesh with all elements of fullMesh which have required materials in the midpoints.

Preserve order of elements and nodes of fullMesh.

Parameters
fullMeshinput mesh, before masking
geomgeometry to get materials from
materialPredicatepredicate which returns either true for accepting material or false for rejecting it
clone_axeswhether axes of the fullMesh should be cloned (if true) or shared (if false; default)

Definition at line 394 of file rectangular_masked3d.hpp.

◆ RectangularMaskedMesh3D() [4/5]

plask::RectangularMaskedMesh3D::RectangularMaskedMesh3D ( const RectangularMesh< 3 > &  rectangularMesh,
const GeometryD< 3 > &  geom,
unsigned  materialKinds,
bool  clone_axes = false 
)
inline

Construct masked mesh with all elements of rectangularMesh which have required kinds of materials (in the midpoints).

Preserve order of elements and nodes of rectangularMesh.

Parameters
rectangularMeshinput mesh, before masking
geomgeometry to get materials from
materialKindsone or more kinds of material encoded with bit or operation, e.g. DIELECTRIC|METAL for selecting all dielectrics and metals, or ~(DIELECTRIC|METAL) for selecting everything else
clone_axeswhether axes of the rectangularMesh should be cloned (if true) or shared (if false; default)

Definition at line 425 of file rectangular_masked3d.hpp.

◆ RectangularMaskedMesh3D() [5/5]

plask::RectangularMaskedMesh3D::RectangularMaskedMesh3D ( const RectangularMesh< DIM > &  rectangularMesh,
Set  nodeSet,
bool  clone_axes = false 
)

Construct a mesh with given set of nodes.

Set of elements are calculated on-demand, just before the first use, according to the rule: An element is selected if and only if all its vertices are included in the nodeSet.

This constructor is used by getElementMesh.

Member Function Documentation

◆ at()

Vec< 3, double > plask::RectangularMaskedMesh3D::at ( std::size_t  index0,
std::size_t  index1,
std::size_t  index2 
) const
inline

Get point with given mesh indices.

Parameters
index0index of point in axis[0]
index1index of point in axis[1]
index2index of point in axis[2]
Returns
point with given index

Definition at line 499 of file rectangular_masked3d.hpp.

◆ createBackBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createBackBoundary ( ) const
override

Definition at line 153 of file rectangular_masked3d.cpp.

◆ createBackOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createBackOfBoundary ( const Box3D box) const
override

Definition at line 177 of file rectangular_masked3d.cpp.

◆ createBottomBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createBottomBoundary ( ) const
override

Definition at line 169 of file rectangular_masked3d.cpp.

◆ createBottomOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createBottomOfBoundary ( const Box3D box) const
override

Definition at line 217 of file rectangular_masked3d.cpp.

◆ createFrontBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createFrontBoundary ( ) const
override

Definition at line 157 of file rectangular_masked3d.cpp.

◆ createFrontOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createFrontOfBoundary ( const Box3D box) const
override

Definition at line 187 of file rectangular_masked3d.cpp.

◆ createIndex0BoundaryAtLine() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex0BoundaryAtLine ( std::size_t  line_nr_axis0) const
override

Definition at line 122 of file rectangular_masked3d.cpp.

◆ createIndex0BoundaryAtLine() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex0BoundaryAtLine ( std::size_t  line_nr_axis0,
std::size_t  index1Begin,
std::size_t  index1End,
std::size_t  index2Begin,
std::size_t  index2End 
) const
override

Definition at line 114 of file rectangular_masked3d.cpp.

◆ createIndex1BoundaryAtLine() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex1BoundaryAtLine ( std::size_t  line_nr_axis1) const
override

Definition at line 135 of file rectangular_masked3d.cpp.

◆ createIndex1BoundaryAtLine() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex1BoundaryAtLine ( std::size_t  line_nr_axis1,
std::size_t  index0Begin,
std::size_t  index0End,
std::size_t  index2Begin,
std::size_t  index2End 
) const
override

Definition at line 127 of file rectangular_masked3d.cpp.

◆ createIndex2BoundaryAtLine() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex2BoundaryAtLine ( std::size_t  line_nr_axis2) const
override

Definition at line 148 of file rectangular_masked3d.cpp.

◆ createIndex2BoundaryAtLine() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh3D::createIndex2BoundaryAtLine ( std::size_t  line_nr_axis2,
std::size_t  index0Begin,
std::size_t  index0End,
std::size_t  index1Begin,
std::size_t  index1End 
) const
override

Definition at line 140 of file rectangular_masked3d.cpp.

◆ createLeftBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createLeftBoundary ( ) const
override

Definition at line 161 of file rectangular_masked3d.cpp.

◆ createLeftOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createLeftOfBoundary ( const Box3D box) const
override

Definition at line 197 of file rectangular_masked3d.cpp.

◆ createRightBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createRightBoundary ( ) const
override

Definition at line 165 of file rectangular_masked3d.cpp.

◆ createRightOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createRightOfBoundary ( const Box3D box) const
override

Definition at line 207 of file rectangular_masked3d.cpp.

◆ createTopBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createTopBoundary ( ) const
override

Definition at line 173 of file rectangular_masked3d.cpp.

◆ createTopOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh3D::createTopOfBoundary ( const Box3D box) const
override

Definition at line 227 of file rectangular_masked3d.cpp.

◆ element() [1/2]

Element plask::RectangularMaskedMesh3D::element ( std::size_t  i) const
inline

Get an element with a given index i.

Parameters
iindex of the element
Returns
the element

Definition at line 469 of file rectangular_masked3d.hpp.

◆ element() [2/2]

Element plask::RectangularMaskedMesh3D::element ( std::size_t  i0,
std::size_t  i1,
std::size_t  i2 
) const
inline

Definition at line 461 of file rectangular_masked3d.hpp.

◆ elements()

Elements plask::RectangularMaskedMesh3D::elements ( ) const
inline

Definition at line 458 of file rectangular_masked3d.hpp.

◆ getElement() [1/2]

Element plask::RectangularMaskedMesh3D::getElement ( std::size_t  i) const
inline

Get an element with a given index i.

Parameters
iindex of the element
Returns
the element

Definition at line 476 of file rectangular_masked3d.hpp.

◆ getElement() [2/2]

Element plask::RectangularMaskedMesh3D::getElement ( std::size_t  i0,
std::size_t  i1,
std::size_t  i2 
) const
inline

Definition at line 462 of file rectangular_masked3d.hpp.

◆ getElementArea()

double plask::RectangularMaskedMesh3D::getElementArea ( std::size_t  index0,
std::size_t  index1,
std::size_t  index2 
) const
inline

Get an area of a given element.

Parameters
index0,index1,index2axes 0, 1 and 1 indexes of the element
Returns
the area of the element with given indexes

Definition at line 621 of file rectangular_masked3d.hpp.

◆ getElementBox()

Box3D plask::RectangularMaskedMesh3D::getElementBox ( std::size_t  index0,
std::size_t  index1,
std::size_t  index2 
) const
inline

Get element as rectangle.

Parameters
index0,index1,index2index of Elements
Returns
box of elements with given index

Definition at line 639 of file rectangular_masked3d.hpp.

◆ getElementIndexFromLowIndexes()

std::size_t plask::RectangularMaskedMesh3D::getElementIndexFromLowIndexes ( std::size_t  axis0_index,
std::size_t  axis1_index,
std::size_t  axis2_index 
) const
inline

Convert mesh indexes of a back-left-bottom corner of an element to the index of this element.

Parameters
axis0_indexindex of the corner along the axis[0] (back), from 0 to axis[0]->size()-1
axis1_indexindex of the corner along the axis[1] (left), from 0 to axis[1]->size()-1
axis2_indexindex of the corner along the axis[2] (bottom), from 0 to axis[2]->size()-1
Returns
index of the element, from 0 to getElementsCount()-1

Definition at line 612 of file rectangular_masked3d.hpp.

◆ getElementMesh()

shared_ptr< RectangularMaskedMesh3D::ElementMesh > plask::RectangularMaskedMesh3D::getElementMesh ( ) const
inline

Return a mesh that enables iterating over middle points of the selected rectangles.

Returns
new rectilinear masked mesh with points in the middles of original, selected rectangles

Definition at line 518 of file rectangular_masked3d.hpp.

◆ getElementMidpoint()

Vec< 3, double > plask::RectangularMaskedMesh3D::getElementMidpoint ( std::size_t  index0,
std::size_t  index1,
std::size_t  index2 
) const
inline

Get point in center of Elements.

Parameters
index0,index1,index2index of Elements
Returns
point in center of element with given index

Definition at line 630 of file rectangular_masked3d.hpp.

◆ getElementMidpoint2()

double plask::RectangularMaskedMesh3D::getElementMidpoint2 ( std::size_t  index2) const
inline

Get third coordinate of point in the center of an elements.

Parameters
index2index of the element (axis2 index)
Returns
third coordinate of the point in the center of the element

Definition at line 61 of file rectangular_masked3d.hpp.

◆ getElements()

Elements plask::RectangularMaskedMesh3D::getElements ( ) const
inline

Definition at line 459 of file rectangular_masked3d.hpp.

◆ getElementsCount2()

std::size_t plask::RectangularMaskedMesh3D::getElementsCount2 ( ) const
inline

Get number of elements (for FEM method) in the third direction.

Returns
number of elements in the full rectangular mesh in the third direction (axis2 direction).

Definition at line 52 of file rectangular_masked3d.hpp.

◆ index()

std::size_t plask::RectangularMaskedMesh3D::index ( std::size_t  axis0_index,
std::size_t  axis1_index,
std::size_t  axis2_index 
) const
inline

Calculate this mesh index using indexes of axis0 and axis1.

Parameters
axis0_indexindex of axis0, from 0 to axis[0]->size()-1
axis1_indexindex of axis1, from 0 to axis[1]->size()-1
axis2_indexindex of axis2, from 0 to axis[2]->size()-1
Returns
this mesh index, from 0 to size()-1, or NOT_INCLUDED

Definition at line 485 of file rectangular_masked3d.hpp.

◆ index2()

std::size_t plask::RectangularMaskedMesh3D::index2 ( std::size_t  mesh_index) const
inline

Calculate index of axis2 using this mesh index.

Parameters
mesh_indexthis mesh index, from 0 to size()-1
Returns
index of axis2, from 0 to axis2->size()-1

Definition at line 35 of file rectangular_masked3d.hpp.

◆ interpolateLinear()

auto plask::RectangularMaskedMesh3D::interpolateLinear ( const RandomAccessContainer data,
const Vec< 3 > &  point,
const InterpolationFlags flags 
) const -> typename std::remove_reference<decltype(data[0])>::type
inline

Calculate (using linear interpolation) value of data in point using data in points described by this mesh.

Parameters
datavalues of data in points describe by this mesh
pointpoint in which value should be calculate
Returns
interpolated value in point point

Definition at line 556 of file rectangular_masked3d.hpp.

◆ interpolateNearestNeighbor()

auto plask::RectangularMaskedMesh3D::interpolateNearestNeighbor ( const RandomAccessContainer data,
const Vec< 3 > &  point,
const InterpolationFlags flags 
) const -> typename std::remove_reference<decltype(data[0])>::type
inline

Calculate (using nearest neighbor interpolation) value of data in point using data in points described by this mesh.

Parameters
datavalues of data in points describe by this mesh
pointpoint in which value should be calculate
Returns
interpolated value in point point

Definition at line 588 of file rectangular_masked3d.hpp.

◆ middleIndex()

std::size_t plask::RectangularMaskedMesh3D::middleIndex ( std::size_t  mesh_index) const
inline

Calculate index of middle axis using given mesh index.

Parameters
mesh_indexthis mesh index, from 0 to size()-1
Returns
index of major axis, from 0 to middleIndex.size()-1

Definition at line 44 of file rectangular_masked3d.hpp.

◆ operator()()

Vec< 3, double > plask::RectangularMaskedMesh3D::operator() ( std::size_t  axis0_index,
std::size_t  axis1_index,
std::size_t  axis2_index 
) const
inline

Get point with given x and y indexes.

Parameters
axis0_indexindex of axis[0], from 0 to axis[0]->size()-1
axis1_indexindex of axis[1], from 0 to axis[1]->size()-1
axis1_indexindex of axis[2], from 0 to axis[2]->size()-1
Returns
point with given axis0 and axis1 indexes

Definition at line 510 of file rectangular_masked3d.hpp.

◆ prepareInterpolation()

bool plask::RectangularMaskedMesh3D::prepareInterpolation ( const Vec< 3 > &  point,
Vec< 3 > &  wrapped_point,
std::size_t &  index0_lo,
std::size_t &  index0_hi,
std::size_t &  index1_lo,
std::size_t &  index1_hi,
std::size_t &  index2_lo,
std::size_t &  index2_hi,
const InterpolationFlags flags 
) const

Prepare point for inteprolation.

Parameters
pointpoint to check
[out]wrapped_pointpoint after wrapping with interpolation flags
[out]index0_lo,index0_hisurrounding indices in the rectantular mesh for axis0
[out]index1_lo,index1_hisurrounding indices in the rectantular mesh for axis1
[out]index2_lo,index2_hisurrounding indices in the rectantular mesh for axis2
flagsinterpolation flags
Returns
false if the point falls in the hole or outside of the mesh, true if it can be interpolated

Definition at line 68 of file rectangular_masked3d.cpp.

◆ reset() [1/4]

void plask::RectangularMaskedMesh3D::reset ( const Predicate predicate)

Change a selection of elements used to once pointed by a given predicate.

Parameters
predicatepredicate which returns either true for accepting element or false for rejecting it

Definition at line 18 of file rectangular_masked3d.cpp.

◆ reset() [2/4]

void plask::RectangularMaskedMesh3D::reset ( const RectangularMesh< 3 > &  fullMesh,
const Predicate predicate,
bool  clone_axes = false 
)

Change parameter of this mesh to use elements of fullMesh chosen by a predicate.

Preserve order of elements and nodes of fullMesh.

Parameters
rectangularMeshinput mesh, before masking
predicatepredicate which returns either true for accepting element or false for rejecting it
clone_axeswhether axes of the fullMesh should be cloned (if true) or shared with fullMesh (if false; default)

Definition at line 29 of file rectangular_masked3d.cpp.

◆ reset() [3/4]

void plask::RectangularMaskedMesh3D::reset ( const RectangularMesh< 3 > &  rectangularMesh,
const GeometryD< 3 > &  geom,
const std::function< bool(shared_ptr< const Material >)>  materialPredicate,
bool  clone_axes = false 
)
inline

Change parameter of this mesh to use all elements of rectangularMesh which have required materials in the midpoints.

Preserve order of elements and nodes of rectangularMesh.

Parameters
rectangularMeshinput mesh, before masking
geomgeometry to get materials from
materialPredicatepredicate which returns either true for accepting material or false for rejecting it
clone_axeswhether axes of the rectangularMesh should be cloned (if true) or shared (if false; default)

Definition at line 409 of file rectangular_masked3d.hpp.

◆ reset() [4/4]

void plask::RectangularMaskedMesh3D::reset ( const RectangularMesh< 3 > &  rectangularMesh,
const GeometryD< 3 > &  geom,
unsigned  materialKinds,
bool  clone_axes = false 
)
inline

Change parameters of this mesh to use all elements of rectangularMesh which have required kinds of materials (in the midpoints).

Preserve order of elements and nodes of rectangularMesh.

Parameters
rectangularMeshinput mesh, before masking
geomgeometry to get materials from
materialKindsone or more kinds of material encoded with bit or operation, e.g. DIELECTRIC|METAL for selecting all dielectrics and metals, or ~(DIELECTRIC|METAL) for selecting everything else
clone_axeswhether axes of the rectangularMesh should be cloned (if true) or shared (if false; default)

Definition at line 442 of file rectangular_masked3d.hpp.


The documentation for this struct was generated from the following files: