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

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

#include <plask/mesh/rectangular_masked2d.hpp>

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

Classes

struct  BoundaryIteratorImpl
 
struct  BoundaryNodeSetImpl
 
class  Element
 
struct  ElementMesh
 Element mesh. More...
 
struct  Elements
 

Public Types

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

 RectangularMaskedMesh2D ()=default
 Construct empty/uninitialized mesh.
 
void reset (const Predicate &predicate)
 Change a selection of elements used to once pointed by a given predicate.
 
 RectangularMaskedMesh2D (const RectangularMesh< 2 > &fullMesh, const Predicate &predicate, bool clone_axes=false)
 Construct masked mesh with elements of fullMesh chosen by a predicate.
 
void reset (const RectangularMesh< 2 > &fullMesh, const Predicate &predicate, bool clone_axes=false)
 Change parameters of this mesh to use elements of fullMesh chosen by a predicate.
 
 RectangularMaskedMesh2D (const RectangularMesh< 2 > &fullMesh, const GeometryD< 2 > &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< 2 > &rectangularMesh, const GeometryD< 2 > &geom, const std::function< bool(shared_ptr< const Material >)> materialPredicate, bool clone_axes=false)
 Change parameters of this mesh to use all elements of rectangularMesh which have required materials in the midpoints.
 
 RectangularMaskedMesh2D (const RectangularMesh< 2 > &rectangularMesh, const GeometryD< 2 > &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< 2 > &rectangularMesh, const GeometryD< 2 > &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).
 
 RectangularMaskedMesh2D (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) const
 
Element getElement (std::size_t i0, std::size_t i1) 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) const
 Calculate this mesh index using indexes of axis0 and axis1.
 
Vec< 2, doubleat (std::size_t index0, std::size_t index1) const
 Get point with given mesh indices.
 
Vec< 2, doubleoperator() (std::size_t axis0_index, std::size_t axis1_index) const
 Get point with given x and y indexes.
 
shared_ptr< RectangularMaskedMesh2D::ElementMeshgetElementMesh () const
 Return a mesh that enables iterating over middle points of the selected rectangles.
 
bool prepareInterpolation (const Vec< 2 > &point, Vec< 2 > &wrapped_point, std::size_t &index0_lo, std::size_t &index0_hi, std::size_t &index1_lo, std::size_t &index1_hi, const InterpolationFlags &flags) const
 Prepare point for interpolation.
 
template<typename RandomAccessContainer >
auto interpolateLinear (const RandomAccessContainer &data, const Vec< 2 > &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< 2 > &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) const
 Convert mesh indexes of a bottom-left corner of an element to the index of this element.
 
double getElementArea (std::size_t index0, std::size_t index1) const
 Get an area of a given element.
 
Vec< 2, doublegetElementMidpoint (std::size_t index0, std::size_t index1) const
 Get point in center of Elements.
 
Box2D getElementBox (std::size_t index0, std::size_t index1) const
 Get element as rectangle.
 
BoundaryNodeSet createVerticalBoundaryAtLine (std::size_t line_nr_axis0) const override
 
BoundaryNodeSet createVerticalBoundaryAtLine (std::size_t line_nr_axis0, std::size_t indexBegin, std::size_t indexEnd) const override
 
BoundaryNodeSet createVerticalBoundaryNear (double axis0_coord) const override
 
BoundaryNodeSet createVerticalBoundaryNear (double axis0_coord, double from, double to) const override
 
BoundaryNodeSet createLeftBoundary () const override
 
BoundaryNodeSet createRightBoundary () const override
 
BoundaryNodeSet createLeftOfBoundary (const Box2D &box) const override
 
BoundaryNodeSet createRightOfBoundary (const Box2D &box) const override
 
BoundaryNodeSet createBottomOfBoundary (const Box2D &box) const override
 
BoundaryNodeSet createTopOfBoundary (const Box2D &box) const override
 
BoundaryNodeSet createHorizontalBoundaryAtLine (std::size_t line_nr_axis1) const override
 
BoundaryNodeSet createHorizontalBoundaryAtLine (std::size_t line_nr_axis1, std::size_t indexBegin, std::size_t indexEnd) const override
 
BoundaryNodeSet createHorizontalBoundaryNear (double axis1_coord) const override
 
BoundaryNodeSet createHorizontalBoundaryNear (double axis1_coord, double from, double to) const override
 
BoundaryNodeSet createTopBoundary () const override
 
BoundaryNodeSet createBottomBoundary () const override
 
- Public Member Functions inherited from plask::RectangularMaskedMeshBase< 2 >
 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< 2 >
RectangularMesh< DIM > fullMesh
 Full, rectangular, wrapped mesh.
 
- Static Public Attributes inherited from plask::RectangularMaskedMeshBase< 2 >
static constexpr double MIN_DISTANCE
 Maximum distance from boundary to include in the inerpolation.
 
- Protected Types inherited from plask::RectangularMaskedMeshBase< 2 >
typedef CompressedSetOfNumbers< std::size_t > Set
 
typedef BoundaryIndexForAxis BoundaryIndex[DIM]
 
- Protected Member Functions inherited from plask::RectangularMaskedMeshBase< 2 >
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< 2 >
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< 2 >
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 instences of full rectangular mesh (RectangularMaskedMesh2D) 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_masked2d.hpp.

Member Typedef Documentation

◆ Predicate

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

Definition at line 31 of file rectangular_masked2d.hpp.

Constructor & Destructor Documentation

◆ RectangularMaskedMesh2D() [1/5]

plask::RectangularMaskedMesh2D::RectangularMaskedMesh2D ( )
default

Construct empty/uninitialized mesh.

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

◆ RectangularMaskedMesh2D() [2/5]

plask::RectangularMaskedMesh2D::RectangularMaskedMesh2D ( const RectangularMesh< 2 > &  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 with fullMesh (if false; default)

Definition at line 23 of file rectangular_masked2d.cpp.

◆ RectangularMaskedMesh2D() [3/5]

plask::RectangularMaskedMesh2D::RectangularMaskedMesh2D ( const RectangularMesh< 2 > &  fullMesh,
const GeometryD< 2 > &  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 296 of file rectangular_masked2d.hpp.

◆ RectangularMaskedMesh2D() [4/5]

plask::RectangularMaskedMesh2D::RectangularMaskedMesh2D ( const RectangularMesh< 2 > &  rectangularMesh,
const GeometryD< 2 > &  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 327 of file rectangular_masked2d.hpp.

◆ RectangularMaskedMesh2D() [5/5]

plask::RectangularMaskedMesh2D::RectangularMaskedMesh2D ( 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< 2, double > plask::RectangularMaskedMesh2D::at ( std::size_t  index0,
std::size_t  index1 
) const
inline

Get point with given mesh indices.

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

Definition at line 399 of file rectangular_masked2d.hpp.

◆ createBottomBoundary()

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

Definition at line 182 of file rectangular_masked2d.cpp.

◆ createBottomOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh2D::createBottomOfBoundary ( const Box2D box) const
override

Definition at line 140 of file rectangular_masked2d.cpp.

◆ createHorizontalBoundaryAtLine() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createHorizontalBoundaryAtLine ( std::size_t  line_nr_axis1) const
override

Definition at line 158 of file rectangular_masked2d.cpp.

◆ createHorizontalBoundaryAtLine() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createHorizontalBoundaryAtLine ( std::size_t  line_nr_axis1,
std::size_t  indexBegin,
std::size_t  indexEnd 
) const
override

Definition at line 163 of file rectangular_masked2d.cpp.

◆ createHorizontalBoundaryNear() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createHorizontalBoundaryNear ( double  axis1_coord) const
override

Definition at line 167 of file rectangular_masked2d.cpp.

◆ createHorizontalBoundaryNear() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createHorizontalBoundaryNear ( double  axis1_coord,
double  from,
double  to 
) const
override

Definition at line 171 of file rectangular_masked2d.cpp.

◆ createLeftBoundary()

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

Definition at line 114 of file rectangular_masked2d.cpp.

◆ createLeftOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh2D::createLeftOfBoundary ( const Box2D box) const
override

Definition at line 122 of file rectangular_masked2d.cpp.

◆ createRightBoundary()

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

Definition at line 118 of file rectangular_masked2d.cpp.

◆ createRightOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh2D::createRightOfBoundary ( const Box2D box) const
override

Definition at line 131 of file rectangular_masked2d.cpp.

◆ createTopBoundary()

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

Definition at line 178 of file rectangular_masked2d.cpp.

◆ createTopOfBoundary()

BoundaryNodeSet plask::RectangularMaskedMesh2D::createTopOfBoundary ( const Box2D box) const
override

Definition at line 149 of file rectangular_masked2d.cpp.

◆ createVerticalBoundaryAtLine() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createVerticalBoundaryAtLine ( std::size_t  line_nr_axis0) const
override

Definition at line 94 of file rectangular_masked2d.cpp.

◆ createVerticalBoundaryAtLine() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createVerticalBoundaryAtLine ( std::size_t  line_nr_axis0,
std::size_t  indexBegin,
std::size_t  indexEnd 
) const
override

Definition at line 99 of file rectangular_masked2d.cpp.

◆ createVerticalBoundaryNear() [1/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createVerticalBoundaryNear ( double  axis0_coord) const
override

Definition at line 103 of file rectangular_masked2d.cpp.

◆ createVerticalBoundaryNear() [2/2]

BoundaryNodeSet plask::RectangularMaskedMesh2D::createVerticalBoundaryNear ( double  axis0_coord,
double  from,
double  to 
) const
override

Definition at line 107 of file rectangular_masked2d.cpp.

◆ element() [1/2]

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

Get an element with a given index i.

Parameters
iindex of the element
Returns
the element0.

Definition at line 371 of file rectangular_masked2d.hpp.

◆ element() [2/2]

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

Definition at line 363 of file rectangular_masked2d.hpp.

◆ elements()

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

Definition at line 360 of file rectangular_masked2d.hpp.

◆ getElement() [1/2]

Element plask::RectangularMaskedMesh2D::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 378 of file rectangular_masked2d.hpp.

◆ getElement() [2/2]

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

Definition at line 364 of file rectangular_masked2d.hpp.

◆ getElementArea()

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

Get an area of a given element.

Parameters
index0,index1axis 0 and axis 1 indexes of the element
Returns
the area of the element with given indexes

Definition at line 510 of file rectangular_masked2d.hpp.

◆ getElementBox()

Box2D plask::RectangularMaskedMesh2D::getElementBox ( std::size_t  index0,
std::size_t  index1 
) const
inline

Get element as rectangle.

Parameters
index0,index1index of Elements
Returns
box of elements with given index

Definition at line 528 of file rectangular_masked2d.hpp.

◆ getElementIndexFromLowIndexes()

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

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

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

Definition at line 501 of file rectangular_masked2d.hpp.

◆ getElementMesh()

shared_ptr< RectangularMaskedMesh2D::ElementMesh > plask::RectangularMaskedMesh2D::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 417 of file rectangular_masked2d.hpp.

◆ getElementMidpoint()

Vec< 2, double > plask::RectangularMaskedMesh2D::getElementMidpoint ( std::size_t  index0,
std::size_t  index1 
) const
inline

Get point in center of Elements.

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

Definition at line 519 of file rectangular_masked2d.hpp.

◆ getElements()

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

Definition at line 361 of file rectangular_masked2d.hpp.

◆ index()

std::size_t plask::RectangularMaskedMesh2D::index ( std::size_t  axis0_index,
std::size_t  axis1_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
Returns
this mesh index, from 0 to size()-1, or NOT_INCLUDED

Definition at line 386 of file rectangular_masked2d.hpp.

◆ interpolateLinear()

auto plask::RectangularMaskedMesh2D::interpolateLinear ( const RandomAccessContainer data,
const Vec< 2 > &  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 452 of file rectangular_masked2d.hpp.

◆ interpolateNearestNeighbor()

auto plask::RectangularMaskedMesh2D::interpolateNearestNeighbor ( const RandomAccessContainer data,
const Vec< 2 > &  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 479 of file rectangular_masked2d.hpp.

◆ operator()()

Vec< 2, double > plask::RectangularMaskedMesh2D::operator() ( std::size_t  axis0_index,
std::size_t  axis1_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
Returns
point with given axis0 and axis1 indexes

Definition at line 409 of file rectangular_masked2d.hpp.

◆ prepareInterpolation()

bool plask::RectangularMaskedMesh2D::prepareInterpolation ( const Vec< 2 > &  point,
Vec< 2 > &  wrapped_point,
std::size_t &  index0_lo,
std::size_t &  index0_hi,
std::size_t &  index1_lo,
std::size_t &  index1_hi,
const InterpolationFlags flags 
) const

Prepare point for interpolation.

Parameters
pointpoint to check
[out]wrapped_pointpoint after wrapping with interpolation flags
[out]index0_lo,index0_hisurrounding indices in the rectangular mesh for axis0
[out]index1_lo,index1_hisurrounding indices in the rectangular mesh for axis1
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 58 of file rectangular_masked2d.cpp.

◆ reset() [1/4]

void plask::RectangularMaskedMesh2D::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_masked2d.cpp.

◆ reset() [2/4]

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

Change parameters of this mesh to use 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 with rectangularMesh (if false; default)

Definition at line 29 of file rectangular_masked2d.cpp.

◆ reset() [3/4]

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

Change parameters 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 311 of file rectangular_masked2d.hpp.

◆ reset() [4/4]

void plask::RectangularMaskedMesh2D::reset ( const RectangularMesh< 2 > &  rectangularMesh,
const GeometryD< 2 > &  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 344 of file rectangular_masked2d.hpp.


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