PLaSK library
|
Rectilinear mesh in 2D space. More...
#include <plask/mesh/rectangular2d.hpp>
Classes | |
class | Element |
Represent FEM-like element in RectangularMesh. More... | |
class | ElementMesh |
class | Elements |
Wrapper to TriangularMesh2D which allows for accessing FEM-like elements. More... | |
Public Types | |
enum | IterationOrder { ORDER_10 , ORDER_01 } |
Iteration orders: More... | |
Public Types inherited from plask::RectangularMeshBase2D | |
typedef plask::Boundary< RectangularMeshBase2D > | Boundary |
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 >, LocalCoords > | const_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 |
Public Member Functions | |
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 char * | getIterationOrderAsArray () const |
Get iteration order as an array, e.g. | |
const char * | getAxisToIterationOrder () 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 . | |
RectangularMesh2D & | operator= (const RectangularMesh2D &src) |
RectangularMesh2D & | operator= (RectangularMesh2D &&src) |
~RectangularMesh2D () | |
void | setAxis (std::size_t axis_nr, shared_ptr< MeshAxis > new_val, bool fireResized=true) |
Change axis. | |
const shared_ptr< MeshAxis > | getAxis0 () const |
void | setAxis0 (shared_ptr< MeshAxis > a0) |
const shared_ptr< MeshAxis > | getAxis1 () 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< MeshAxis > | majorAxis () const |
std::size_t | majorAxisIndex () const |
const shared_ptr< MeshAxis > | minorAxis () 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, double > | at (std::size_t index0, std::size_t index1) const |
Get point with given mesh indices. | |
Vec< 2, double > | at (std::size_t index) const override |
Get point with given mesh index. | |
Vec< 2, double > | operator[] (std::size_t index) const |
Get point with given mesh index. | |
Vec< 2, double > | operator() (std::size_t axis0_index, std::size_t axis1_index) const |
Get point with given x and y indexes. | |
shared_ptr< RectangularMesh2D::ElementMesh > | getElementMesh () 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, double > | getElementMidpoint (std::size_t index0, std::size_t index1) const |
Get point in center of Elements. | |
Vec< 2, double > | getElementMidpoint (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 () | |
MeshD & | operator= (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 () |
Public Attributes | |
const shared_ptr< MeshAxis > | axis [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. | |
Protected Member Functions | |
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 | |
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) |
Rectilinear mesh in 2D space.
Includes two 1D rectilinear meshes:
Definition at line 39 of file rectangular2d.hpp.
Iteration orders:
Enumerator | |
---|---|
ORDER_10 | |
ORDER_01 |
Definition at line 256 of file rectangular2d.hpp.
|
explicit |
Construct mesh which has all axes of type OrderedAxis and all are empty.
iterationOrder | iteration order |
Definition at line 67 of file rectangular2d.cpp.
plask::RectangularMesh2D::RectangularMesh2D | ( | shared_ptr< MeshAxis > | axis0, |
shared_ptr< MeshAxis > | axis1, | ||
IterationOrder | iterationOrder = ORDER_01 |
||
) |
Construct mesh with is based on given 1D meshes.
mesh0 | mesh for the first coordinate |
mesh1 | mesh for the second coordinate |
iterationOrder | iteration order |
Definition at line 74 of file rectangular2d.cpp.
plask::RectangularMesh2D::RectangularMesh2D | ( | const RectangularMesh2D & | src, |
bool | clone_axes = false |
||
) |
Copy constructor.
src | mesh to copy |
clone_axes | whether axes of the src should be cloned (if true) or shared (if false; default) |
Definition at line 87 of file rectangular2d.cpp.
plask::RectangularMesh2D::~RectangularMesh2D | ( | ) |
Definition at line 104 of file rectangular2d.cpp.
Get point with given mesh index.
index | index of point, from 0 to size()-1 |
index
Implements plask::MeshD< 2 >.
Definition at line 567 of file rectangular2d.hpp.
|
inline |
Get point with given mesh indices.
index0 | index of point in axis0 |
index1 | index of point in axis1 |
index
Definition at line 558 of file rectangular2d.hpp.
|
overridevirtual |
Create node set which includes one horizontal, bottom (from left to right) line in mesh.
Implements plask::RectangularMeshBase2D.
Definition at line 214 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which lies on bottom edge of the box
(at mesh line nearest bottom edge and inside the box).
box | box in which boundary should lie |
box
or empty boundary if there are no mesh indexes which lies inside the box
Implements plask::RectangularMeshBase2D.
Definition at line 173 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one horizontal (from left to right) line in mesh.
line_nr_axis1 | number of horizontal line, index of axis1 mesh |
Implements plask::RectangularMeshBase2D.
Definition at line 191 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes range in horizontal (from left to right) line in mesh.
line_nr_axis1 | number of horizontal line, index of axis1 mesh |
indexBegin,indexEnd | ends of [indexBegin, indexEnd) range in line |
Implements plask::RectangularMeshBase2D.
Definition at line 195 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one horizontal (from left to right) line in mesh which lies nearest given coordinate.
axis1_coord | axis 1 coordinate |
Implements plask::RectangularMeshBase2D.
Definition at line 199 of file rectangular2d.cpp.
|
overridevirtual |
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.
axis1_coord | axis 1 coordinate |
from,to | ends of line segment, [from, to] range of axis 0 coordinates |
Implements plask::RectangularMeshBase2D.
Definition at line 203 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one vertical, left (from bottom to top) line in mesh.
Implements plask::RectangularMeshBase2D.
Definition at line 147 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which lies on left edge of the box
(at mesh line nearest left edge and inside the box).
box | box in which boundary should lie |
box
or empty boundary if there are no mesh indexes which lies inside the box
Implements plask::RectangularMeshBase2D.
Definition at line 155 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one vertical, right (from bottom to top) line in mesh.
Implements plask::RectangularMeshBase2D.
Definition at line 151 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which lies on right edge of the box
(at mesh line nearest right edge and inside the box).
box | box in which boundary should lie |
box
or empty boundary if there are no mesh indexes which lies inside the box
Implements plask::RectangularMeshBase2D.
Definition at line 164 of file rectangular2d.cpp.
|
overridevirtual |
Create node set which includes one horizontal, top (from left to right) line in mesh.
Implements plask::RectangularMeshBase2D.
Definition at line 210 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which lies on top edge of the box
(at mesh line nearest top edge and inside the box).
box | box in which boundary should lie |
box
or empty boundary if there are no mesh indexes which lies inside the box
Implements plask::RectangularMeshBase2D.
Definition at line 182 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one vertical (from bottom to top) line in mesh.
line_nr_axis0 | number of vertical line, axis 0 index of mesh |
Implements plask::RectangularMeshBase2D.
Definition at line 128 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes a range in vertical (from bottom to top) line in mesh.
line_nr_axis0 | number of vertical line, axis 0 index of mesh |
indexBegin,indexEnd | ends of [indexBegin, indexEnd) range in line |
Implements plask::RectangularMeshBase2D.
Definition at line 132 of file rectangular2d.cpp.
|
overridevirtual |
Create a node set which includes one vertical (from bottom to top) line in mesh which lies nearest given coordinate.
axis0_coord | axis 0 coordinate |
Implements plask::RectangularMeshBase2D.
Definition at line 136 of file rectangular2d.cpp.
|
overridevirtual |
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.
axis0_coord | axis 0 coordinate |
from,to | ends of line segment, [from, to] range of axis 1 coordinates |
Implements plask::RectangularMeshBase2D.
Definition at line 140 of file rectangular2d.cpp.
Get first coordinate of points in this mesh.
Definition at line 394 of file rectangular2d.hpp.
Get second coordinate of points in this mesh.
Definition at line 400 of file rectangular2d.hpp.
|
inline |
Get an element with a given index i
.
i | index of the element |
Definition at line 239 of file rectangular2d.hpp.
|
inline |
Definition at line 231 of file rectangular2d.hpp.
|
inline |
Accessor to FEM-like elements.
Definition at line 228 of file rectangular2d.hpp.
|
inlineoverridevirtual |
Reimplemented from plask::Mesh.
Definition at line 486 of file rectangular2d.hpp.
Get numbered axis.
n | number of axis |
Definition at line 419 of file rectangular2d.hpp.
Definition at line 351 of file rectangular2d.hpp.
Definition at line 355 of file rectangular2d.hpp.
Similar to getIterationOrderAsArray but the resulted array has exchanged indexes with values.
Resulted array is indexed by axis number (0, 1) and the bigger value means that the index of the axis changes faster when index of the mesh is changed by 1.
Definition at line 288 of file rectangular2d.hpp.
|
inline |
Get an element with a given index i
.
i | index of the element |
Definition at line 246 of file rectangular2d.hpp.
|
inline |
Definition at line 232 of file rectangular2d.hpp.
|
inline |
Get an area of a given element.
element_index | index of the element |
Definition at line 744 of file rectangular2d.hpp.
|
inline |
Get an area of a given element.
index0,index1 | axis 0 and axis 1 indexes of the element |
Definition at line 735 of file rectangular2d.hpp.
|
inline |
Get an element as a rectangle.
element_index | index of the element |
Definition at line 796 of file rectangular2d.hpp.
|
inline |
Get element as rectangle.
index0,index1 | index of Elements |
Definition at line 787 of file rectangular2d.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 696 of file rectangular2d.hpp.
|
inline |
Convert mesh indexes of a bottom-left corner of an element to the index of this element.
axis0_index | index of the corner along the axis0 (left), from 0 to axis[0]->size()-1 |
axis1_index | index of the corner along the axis1 (bottom), from 0 to axis[1]->size()-1 |
Definition at line 706 of file rectangular2d.hpp.
shared_ptr< RectangularMesh2D::ElementMesh > plask::RectangularMesh2D::getElementMesh | ( | ) | const |
Remove all points from mesh.
Return a mesh that enables iterating over middle points of the rectangles
Definition at line 118 of file rectangular2d.cpp.
|
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 715 of file rectangular2d.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 725 of file rectangular2d.hpp.
|
inline |
Get point in the center of an element.
element_index | index of the element |
Definition at line 777 of file rectangular2d.hpp.
|
inline |
Get point in center of Elements.
index0,index1 | index of Elements |
Definition at line 768 of file rectangular2d.hpp.
|
inline |
Get first coordinate of point in center of Elements.
index0 | index of Elements (axis0 index) |
Definition at line 754 of file rectangular2d.hpp.
|
inline |
Get second coordinate of point in center of Elements.
index1 | index of Elements (axis1 index) |
Definition at line 761 of file rectangular2d.hpp.
|
inline |
Definition at line 229 of file rectangular2d.hpp.
|
inline |
Get number of elements (for FEM method).
Definition at line 677 of file rectangular2d.hpp.
|
inline |
Get number of elements (for FEM method) in the first direction.
Definition at line 659 of file rectangular2d.hpp.
|
inline |
Get number of elements (for FEM method) in the second direction.
Definition at line 668 of file rectangular2d.hpp.
RectangularMesh2D::IterationOrder plask::RectangularMesh2D::getIterationOrder | ( | ) | const |
Get iteration order.
Definition at line 58 of file rectangular2d.cpp.
Get iteration order as an array, e.g.
[1, 0] is returned for ORDER_10.
Definition at line 276 of file rectangular2d.hpp.
|
inline |
Get maximum of sizes axis0 and axis1.
Definition at line 471 of file rectangular2d.hpp.
|
inline |
Get minimum of sizes axis0 and axis1.
Definition at line 477 of file rectangular2d.hpp.
|
overrideprotected |
Definition at line 122 of file rectangular2d.cpp.
Calculate this mesh index using indexes of axis[0] and axis[1].
indexes | index of axis[0] and axis[1] |
Definition at line 503 of file rectangular2d.hpp.
|
inline |
Calculate this mesh index using indexes of axis[0] and axis[1].
axis0_index | index of axis[0], from 0 to axis[0]->size()-1 |
axis1_index | index of axis[1], from 0 to axis[1]->size()-1 |
Definition at line 494 of file rectangular2d.hpp.
|
inline |
Calculate index of axis0 using this mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 512 of file rectangular2d.hpp.
|
inline |
Calculate index of y using given mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 521 of file rectangular2d.hpp.
|
inline |
Calculate indexes of axes.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 530 of file rectangular2d.hpp.
|
inline |
Calculate (using linear interpolation) value of data in point using data in points described by this mesh.
data | values of data in points describe by this mesh |
point | point in which value should be calculate |
point
Definition at line 612 of file rectangular2d.hpp.
|
inline |
Calculate (using nearest neighbor interpolation) value of data in point using data in points described by this mesh.
data | values of data in points describe by this mesh |
point | point in which value should be calculate |
point
Definition at line 647 of file rectangular2d.hpp.
|
inline |
Check if mesh index is at the bottom, left, front corner of an element.
meshIndex | mesh index |
meshIndex
is at the bottom, left, front corner of an element Definition at line 687 of file rectangular2d.hpp.
Definition at line 425 of file rectangular2d.hpp.
|
inline |
Definition at line 430 of file rectangular2d.hpp.
|
inline |
Calculate index of major axis using given mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 539 of file rectangular2d.hpp.
Definition at line 435 of file rectangular2d.hpp.
|
inline |
Definition at line 440 of file rectangular2d.hpp.
|
inline |
Calculate index of minor axis using given mesh index.
mesh_index | this mesh index, from 0 to size()-1 |
Definition at line 548 of file rectangular2d.hpp.
|
inline |
Definition at line 457 of file rectangular2d.hpp.
|
inline |
Get point with given x and y indexes.
axis0_index | index of axis0, from 0 to axis0->size()-1 |
axis1_index | index of axis1, from 0 to axis[1]->size()-1 |
Definition at line 587 of file rectangular2d.hpp.
|
inline |
Definition at line 337 of file rectangular2d.hpp.
|
inline |
Definition at line 339 of file rectangular2d.hpp.
|
inline |
Compare meshes.
to_compare | mesh to compare |
true
only if this mesh and to_compare
represents the same sequence of points Definition at line 449 of file rectangular2d.hpp.
Get point with given mesh index.
index | index of point, from 0 to size()-1 |
index
Definition at line 577 of file rectangular2d.hpp.
Get first coordinate of points in this mesh.
Definition at line 406 of file rectangular2d.hpp.
Get second coordinate of points in this mesh.
Definition at line 412 of file rectangular2d.hpp.
void plask::RectangularMesh2D::reset | ( | const RectangularMesh2D & | src, |
bool | clone_axes = false |
||
) |
Change axes and iteration order of this mesh to the ones from src
.
src | mesh to copy |
iterationOrder | iteration order |
Definition at line 97 of file rectangular2d.cpp.
void plask::RectangularMesh2D::reset | ( | shared_ptr< MeshAxis > | axis0, |
shared_ptr< MeshAxis > | axis1, | ||
RectangularMesh2D::IterationOrder | iterationOrder = ORDER_01 |
||
) |
Change axes and iteration order of this mesh.
mesh0 | mesh for the first coordinate |
mesh1 | mesh for the second coordinate |
iterationOrder | iteration order |
Definition at line 81 of file rectangular2d.cpp.
void plask::RectangularMesh2D::setAxis | ( | std::size_t | axis_nr, |
shared_ptr< MeshAxis > | new_val, | ||
bool | fireResized = true |
||
) |
Change axis.
axis_nr | number of axis to change |
new_val | new value for axis |
fireResized | whether to call fireResized() |
Definition at line 109 of file rectangular2d.cpp.
Definition at line 353 of file rectangular2d.hpp.
Definition at line 357 of file rectangular2d.hpp.
void plask::RectangularMesh2D::setIterationOrder | ( | IterationOrder | order | ) |
Choose iteration order.
order | iteration order to use |
Definition at line 41 of file rectangular2d.cpp.
|
inline |
Set iteration order to the shortest axis changes fastest.
Definition at line 296 of file rectangular2d.hpp.
Definition at line 380 of file rectangular2d.hpp.
Definition at line 388 of file rectangular2d.hpp.
|
inlineoverridevirtual |
Get number of points in mesh.
Implements plask::Mesh.
Definition at line 465 of file rectangular2d.hpp.
Get first coordinate of points in this mesh.
Definition at line 378 of file rectangular2d.hpp.
Get second coordinate of points in this mesh.
Definition at line 386 of file rectangular2d.hpp.
|
overridevirtual |
Write mesh to XML.
object | XML object to write to |
Reimplemented from plask::Mesh.
Definition at line 218 of file rectangular2d.cpp.
First and second coordinates of points in this mesh.
Definition at line 225 of file rectangular2d.hpp.