PLaSK library
Loading...
Searching...
No Matches
plask::RectangularMesh2D::ElementMesh Class Reference

#include <plask/mesh/rectangular2d.hpp>

Inheritance diagram for plask::RectangularMesh2D::ElementMesh:
[legend]
Collaboration diagram for plask::RectangularMesh2D::ElementMesh:
[legend]

Public Member Functions

template<typename... Args>
 ElementMesh (const RectangularMesh2D *originalMesh, Args... args)
 
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.
 
- Public Member Functions inherited from plask::RectangularMesh2D
Elements elements () const
 Accessor to FEM-like elements.
 
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.
 
void setIterationOrder (IterationOrder order)
 Choose iteration order.
 
IterationOrder getIterationOrder () const
 Get iteration order.
 
const chargetIterationOrderAsArray () const
 Get iteration order as an array, e.g.
 
const chargetAxisToIterationOrder () const
 Similar to getIterationOrderAsArray but the resulted array has exchanged indexes with values.
 
void setOptimalIterationOrder ()
 Set iteration order to the shortest axis changes fastest.
 
 RectangularMesh2D (IterationOrder iterationOrder=ORDER_01)
 Construct mesh which has all axes of type OrderedAxis and all are empty.
 
 RectangularMesh2D (shared_ptr< MeshAxis > axis0, shared_ptr< MeshAxis > axis1, IterationOrder iterationOrder=ORDER_01)
 Construct mesh with is based on given 1D meshes.
 
void reset (shared_ptr< MeshAxis > axis0, shared_ptr< MeshAxis > axis1, IterationOrder iterationOrder=ORDER_01)
 Change axes and iteration order of this mesh.
 
 RectangularMesh2D (const RectangularMesh2D &src, bool clone_axes=false)
 Copy constructor.
 
void reset (const RectangularMesh2D &src, bool clone_axes=false)
 Change axes and iteration order of this mesh to the ones from src.
 
RectangularMesh2Doperator= (const RectangularMesh2D &src)
 
RectangularMesh2Doperator= (RectangularMesh2D &&src)
 
 ~RectangularMesh2D ()
 
void setAxis (std::size_t axis_nr, shared_ptr< MeshAxis > new_val, bool fireResized=true)
 Change axis.
 
const shared_ptr< MeshAxisgetAxis0 () const
 
void setAxis0 (shared_ptr< MeshAxis > a0)
 
const shared_ptr< MeshAxisgetAxis1 () const
 
void setAxis1 (shared_ptr< MeshAxis > a1)
 
const shared_ptr< MeshAxis > & tran () const
 Get first coordinate of points in this mesh.
 
void setTran (shared_ptr< MeshAxis > a0)
 
const shared_ptr< MeshAxis > & vert () const
 Get second coordinate of points in this mesh.
 
void setVert (shared_ptr< MeshAxis > a1)
 
const shared_ptr< MeshAxis > & ee_x () const
 Get first coordinate of points in this mesh.
 
const shared_ptr< MeshAxis > & ee_y () const
 Get second coordinate of points in this mesh.
 
const shared_ptr< MeshAxis > & rad_r () const
 Get first coordinate of points in this mesh.
 
const shared_ptr< MeshAxis > & rad_z () const
 Get second coordinate of points in this mesh.
 
const shared_ptr< MeshAxis > & getAxis (size_t n) const
 Get numbered axis.
 
const shared_ptr< MeshAxismajorAxis () const
 
std::size_t majorAxisIndex () const
 
const shared_ptr< MeshAxisminorAxis () const
 
std::size_t minorAxisIndex () const
 
bool operator== (const RectangularMesh2D &to_compare) const
 Compare meshes.
 
bool operator!= (const RectangularMesh2D &to_compare) const
 
std::size_t size () const override
 Get number of points in mesh.
 
std::size_t getMaxSize () const
 Get maximum of sizes axis0 and axis1.
 
std::size_t getMinSize () const
 Get minimum of sizes axis0 and axis1.
 
void writeXML (XMLElement &object) const override
 Write mesh to XML.
 
bool empty () const override
 
std::size_t index (std::size_t axis0_index, std::size_t axis1_index) const
 Calculate this mesh index using indexes of axis[0] and axis[1].
 
std::size_t index (const Vec< 2, 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 y using given mesh index.
 
Vec< 2, 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 minor axis using given mesh index.
 
Vec< 2, doubleat (std::size_t index0, std::size_t index1) const
 Get point with given mesh indices.
 
Vec< 2, doubleat (std::size_t index) const override
 Get point with given mesh index.
 
Vec< 2, doubleoperator[] (std::size_t index) const
 Get point with given mesh index.
 
Vec< 2, doubleoperator() (std::size_t axis0_index, std::size_t axis1_index) const
 Get point with given x and y indexes.
 
shared_ptr< RectangularMesh2D::ElementMeshgetElementMesh () const
 Remove all points from mesh.
 
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 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).
 
bool isLowIndexOfElement (std::size_t meshIndex) const
 Check if mesh index is at the bottom, left, front corner of an element.
 
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 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.
 
std::size_t getElementMeshLowIndex (std::size_t element_index) const
 Convert element index to mesh index of bottom-left element corner.
 
Vec< 2, 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 index0, std::size_t index1) const
 Get an area of a given 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 center of Elements.
 
double getElementMidpoint1 (std::size_t index1) const
 Get second coordinate of point in center of Elements.
 
Vec< 2, doublegetElementMidpoint (std::size_t index0, std::size_t index1) const
 Get point in center of Elements.
 
Vec< 2, doublegetElementMidpoint (std::size_t element_index) const
 Get point in the center of an element.
 
Box2D getElementBox (std::size_t index0, std::size_t index1) const
 Get element as rectangle.
 
Box2D getElementBox (std::size_t element_index) const
 Get an element as a rectangle.
 
BoundaryNodeSet createVerticalBoundaryAtLine (std::size_t line_nr_axis0) const override
 Create a node set which includes one vertical (from bottom to top) line in mesh.
 
BoundaryNodeSet createVerticalBoundaryAtLine (std::size_t line_nr_axis0, std::size_t indexBegin, std::size_t indexEnd) const override
 Create a node set which includes a range in vertical (from bottom to top) line in mesh.
 
BoundaryNodeSet createVerticalBoundaryNear (double axis0_coord) const override
 Create a node set which includes one vertical (from bottom to top) line in mesh which lies nearest given coordinate.
 
BoundaryNodeSet createVerticalBoundaryNear (double axis0_coord, double from, double to) const override
 Create a node set which includes one vertical (from bottom to top) segment in mesh which lies nearest given coordinate and has ends in given range.
 
BoundaryNodeSet createLeftBoundary () const override
 Create a node set which includes one vertical, left (from bottom to top) line in mesh.
 
BoundaryNodeSet createRightBoundary () const override
 Create a node set which includes one vertical, right (from bottom to top) line in mesh.
 
BoundaryNodeSet createLeftOfBoundary (const Box2D &box) const override
 Create a node set which lies on left edge of the box (at mesh line nearest left edge and inside the box).
 
BoundaryNodeSet createRightOfBoundary (const Box2D &box) const override
 Create a node set which lies on right edge of the box (at mesh line nearest right edge and inside the box).
 
BoundaryNodeSet createBottomOfBoundary (const Box2D &box) const override
 Create a node set which lies on bottom edge of the box (at mesh line nearest bottom edge and inside the box).
 
BoundaryNodeSet createTopOfBoundary (const Box2D &box) const override
 Create a node set which lies on top edge of the box (at mesh line nearest top edge and inside the box).
 
BoundaryNodeSet createHorizontalBoundaryAtLine (std::size_t line_nr_axis1) const override
 Create a node set which includes one horizontal (from left to right) line in mesh.
 
BoundaryNodeSet createHorizontalBoundaryAtLine (std::size_t line_nr_axis1, std::size_t indexBegin, std::size_t indexEnd) const override
 Create a node set which includes range in horizontal (from left to right) line in mesh.
 
BoundaryNodeSet createHorizontalBoundaryNear (double axis1_coord) const override
 Create a node set which includes one horizontal (from left to right) line in mesh which lies nearest given coordinate.
 
BoundaryNodeSet createHorizontalBoundaryNear (double axis1_coord, double from, double to) const override
 Create a node set which includes one horizontal (from left to right) segment in mesh which lies nearest given coordinate and has ends in given range.
 
BoundaryNodeSet createTopBoundary () const override
 Create node set which includes one horizontal, top (from left to right) line in mesh.
 
BoundaryNodeSet createBottomBoundary () const override
 Create node set which includes one horizontal, bottom (from left to right) line in mesh.
 
- Public Member Functions inherited from plask::MeshD< 2 >
LocalCoords operator[] (std::size_t index) const
 Get point with given mesh index.
 
const_iterator begin () const
 
const_iterator end () const
 
 MeshD (const MeshD &PLASK_UNUSED(to_copy))
 Initialize this to be the same as to_copy but don't copy any changes observer.
 
 MeshD ()
 
MeshDoperator= (const MeshD &PLASK_UNUSED(to_copy))
 Set this to be the same as to_copy but doesn't changed changes observer.
 
bool operator== (const MeshD &to_compare) const
 Check if this mesh and to_compare represent the same sequence of points (have exactly the same points in the same order).
 
bool operator!= (const MeshD &to_compare) const
 Check if this mesh and to_compare represent different sequences of points.
 
void print (std::ostream &out) const override
 Print this to stream out.
 
- Public Member Functions inherited from plask::Mesh
template<typename ClassT , typename methodT >
boost::signals2::connection changedConnectMethod (ClassT *obj, methodT method, boost::signals2::connect_position at=boost::signals2::at_back)
 Connect a method to changed signal.
 
template<typename ClassT , typename methodT >
void changedDisconnectMethod (ClassT *obj, methodT method)
 
template<typename EventT = Event, typename ... Args>
void fireChanged (Args &&... event_constructor_params_without_source)
 Call changed with this as event source.
 
void fireResized ()
 This method is called when the mesh is resized.
 
virtual ~Mesh ()
 
- Public Member Functions inherited from plask::Printable
virtual ~Printable ()
 
std::string str () const
 Get string representation of this using print method.
 
- Public Member Functions inherited from plask::MeshBase
virtual ~MeshBase ()
 

Protected Member Functions

bool hasSameNodes (const MeshD< 2 > &to_compare) const override
 
- Protected Member Functions inherited from plask::RectangularMesh2D
bool hasSameNodes (const MeshD< 2 > &to_compare) const override
 
- Protected Member Functions inherited from plask::MeshD< 2 >
virtual bool hasSameNodes (const MeshD< dimension > &to_compare) const
 Check if this mesh and to_compare represent the same sequence of points (have exactly the same points in the same order).
 
- Protected Member Functions inherited from plask::Mesh
virtual void onChange (const Event &evt)
 This method is called when the mesh is changed, just before changed signal.
 

Additional Inherited Members

- Public Types inherited from plask::RectangularMesh2D
enum  IterationOrder { ORDER_10 , ORDER_01 }
 Iteration orders: More...
 
- Public Types inherited from plask::RectangularMeshBase2D
typedef plask::Boundary< RectangularMeshBase2DBoundary
 Boundary type.
 
- Public Types inherited from plask::MeshD< 2 >
enum  
 Number of dimensions. More...
 
typedef Primitive< DIM >::DVec LocalCoords
 Type of vector representing coordinates in local space.
 
typedef IndexedIterator< const MeshD< dimension >, LocalCoordsconst_iterator
 Random access iterator type which allow iterate over all points in this mesh, in order appointed by operator[].
 
typedef const_iterator iterator
 
typedef const_iterator Iterator
 
- Static Public Member Functions inherited from plask::RectangularMeshBase2D
template<typename Predicate >
static Boundary getBoundary (Predicate predicate)
 
static Boundary getVerticalBoundaryAtLine (std::size_t line_nr_axis0)
 Get boundary which show one vertical (from bottom to top) line in mesh.
 
static Boundary getVerticalBoundaryAtLine (std::size_t line_nr_axis0, std::size_t indexBegin, std::size_t indexEnd)
 Get boundary which show range in vertical (from bottom to top) line in mesh.
 
static Boundary getVerticalBoundaryNear (double axis0_coord)
 Get boundary which show one vertical (from bottom to top) line in mesh which lies nearest given coordinate.
 
static Boundary getVerticalBoundaryNear (double axis0_coord, double from, double to)
 Get boundary which show one vertical (from bottom to top) segment in mesh which lies nearest given coordinate and has ends in given range.
 
static Boundary getLeftBoundary ()
 Get boundary which show one vertical, left (from bottom to top) line in mesh.
 
static Boundary getRightBoundary ()
 Get boundary which show one vertical, right (from bottom to top) line in mesh.
 
static Boundary getLeftOfBoundary (const Box2D &box)
 Get boundary which lies on left edge of the box (at mesh line nearest left edge and inside the box).
 
static Boundary getRightOfBoundary (const Box2D &box)
 Get boundary which lies on right edge of the box (at mesh line nearest right edge and inside the box).
 
static Boundary getBottomOfBoundary (const Box2D &box)
 Get boundary which lies on bottom edge of the box (at mesh line nearest bottom edge and inside the box).
 
static Boundary getTopOfBoundary (const Box2D &box)
 Get boundary which lies on top edge of the box (at mesh line nearest top edge and inside the box).
 
static Boundary getLeftOfBoundary (shared_ptr< const GeometryObject > object, const PathHints &path)
 Get boundary which lies on left edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getLeftOfBoundary (shared_ptr< const GeometryObject > object)
 Get boundary which lies on left edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getLeftOfBoundary (shared_ptr< const GeometryObject > object, const PathHints *path)
 Get boundary which lies on left edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getRightOfBoundary (shared_ptr< const GeometryObject > object, const PathHints &path)
 Get boundary which lies on right edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getRightOfBoundary (shared_ptr< const GeometryObject > object)
 Get boundary which lies on right edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getRightOfBoundary (shared_ptr< const GeometryObject > object, const PathHints *path)
 Get boundary which lies on right edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getBottomOfBoundary (shared_ptr< const GeometryObject > object, const PathHints &path)
 Get boundary which lies on bottom edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getBottomOfBoundary (shared_ptr< const GeometryObject > object)
 Get boundary which lies on bottom edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getBottomOfBoundary (shared_ptr< const GeometryObject > object, const PathHints *path)
 Get boundary which lies on bottom edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getTopOfBoundary (shared_ptr< const GeometryObject > object, const PathHints &path)
 Get boundary which lies on top edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getTopOfBoundary (shared_ptr< const GeometryObject > object)
 Get boundary which lies on top edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getTopOfBoundary (shared_ptr< const GeometryObject > object, const PathHints *path)
 Get boundary which lies on top edge of bounding-boxes of object (in geometry coordinates).
 
static Boundary getHorizontalBoundaryAtLine (std::size_t line_nr_axis1)
 Get boundary which shows one horizontal (from left to right) line in mesh.
 
static Boundary getHorizontalBoundaryAtLine (std::size_t line_nr_axis1, std::size_t indexBegin, std::size_t indexEnd)
 Get boundary which shows range in horizontal (from left to right) line in mesh.
 
static Boundary getHorizontalBoundaryNear (double axis1_coord)
 Get boundary which shows one horizontal (from left to right) line in mesh which lies nearest given coordinate.
 
static Boundary getHorizontalBoundaryNear (double axis1_coord, double from, double to)
 Get boundary which show one horizontal (from left to right) segment in mesh which lies nearest given coordinate and has ends in given range.
 
static Boundary getTopBoundary ()
 Get boundary which shows one horizontal, top (from left to right) line in mesh.
 
static Boundary getBottomBoundary ()
 Get boundary which shows one horizontal, bottom (from left to right) line in mesh.
 
static Boundary getBoundary (const std::string &boundary_desc)
 
static Boundary getBoundary (XMLReader &boundary_desc, Manager &manager)
 
- Public Attributes inherited from plask::RectangularMesh2D
const shared_ptr< MeshAxisaxis [2]
 First and second coordinates of points in this mesh.
 
- Public Attributes inherited from plask::Mesh
boost::signals2::signal< void(Event &)> changed
 Changed signal, fired when mesh was changed.
 

Detailed Description

Definition at line 1007 of file rectangular2d.hpp.

Constructor & Destructor Documentation

◆ ElementMesh()

template<typename... Args>
plask::RectangularMesh2D::ElementMesh::ElementMesh ( const RectangularMesh2D originalMesh,
Args...  args 
)
inline

Definition at line 1014 of file rectangular2d.hpp.

Member Function Documentation

◆ hasSameNodes()

bool plask::RectangularMesh2D::ElementMesh::hasSameNodes ( const MeshD< 2 > &  to_compare) const
overrideprotected

Definition at line 252 of file rectangular2d.cpp.

◆ interpolateNearestNeighbor()

auto plask::RectangularMesh2D::ElementMesh::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.

Consider original mesh boundaries for point selection

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 1024 of file rectangular2d.hpp.


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