Mesh geometry definion. More...
#include <mesh.hpp>
Public Member Functions | |
Mesh () | |
Default constructor for mesh definition. | |
Mesh (geom_mode_e geom_mode, Int3D size, Vec3D origo, double h) | |
Constructor for mesh definition. | |
Mesh (std::istream &is) | |
Constructoer for loading mesh from a stream is. | |
~Mesh () | |
Destructor. | |
void | reset (geom_mode_e geom_mode, Int3D size, Vec3D origo, double h) |
Reset mesh definition. | |
geom_mode_e | geom_mode (void) const |
Returns geometry mode. | |
int32_t | dim (void) const |
Returns number of dimensions in geometry. | |
Int3D | size (void) const |
Returns size array of geometry. | |
int32_t | size (int i) const |
Returns size of solid mesh in direction i. | |
int32_t | nodecount (void) const |
Returns number of nodes in the mesh. | |
Vec3D | origo (void) const |
Returns origo vector of geometry. | |
double | origo (int i) const |
Returns i-th component of vector origo. | |
Vec3D | max (void) const |
Returns vector pointing to the last mesh point opposite of origo. | |
double | max (int i) const |
Returns i-th component of vector pointing to the last mesh point opposite of origo. | |
double | h (void) const |
Returns mesh cell size. | |
double | div_h (void) const |
Returns reciprocal of mesh cell size (1/h). | |
void | save (std::ostream &os) const |
Saves geometry data to stream os. | |
bool | operator== (const Mesh &m) const |
Equality. | |
bool | operator!= (const Mesh &m) const |
Non-equality. | |
void | debug_print (std::ostream &os) const |
Print debugging information to stream os. |
Protected Attributes | |
geom_mode_e | _geom_mode |
Geometry mode | |
Int3D | _size |
Size of mesh. | |
Vec3D | _origo |
Location of mesh point (0,0,0) [m]. | |
Vec3D | _max |
Location of mesh point (size[0]-1,size[1]-1,size[2]-1) [m]. | |
double | _h |
Length of mesh step [m]. | |
double | _div_h |
Reciprocal of length of mesh step [1/m]. |
Mesh geometry definion.
Class contains mesh geometry definition. It stores geometry mode (geom_mode), number of mesh nodes in each direction (size), the mesh cell size (h) and the locations of mesh node (0,0,0) and (size[0]-1,size[1]-1,size[2]-1) (known as origo and max). The max point is internally calculated. Other parameters are given when Mesh is constructed.
Mesh is to be used as a base class in all classes, which store or process some kind of mesh data.
Mesh::Mesh | ( | ) |
Default constructor for mesh definition.
Sets geometry mode to MODE3D, mesh cell size h to 1, mesh size size to (0,0,0) and origo origo to (0,0,0).
Mesh::Mesh | ( | geom_mode_e | geom_mode, |
Int3D | size, | ||
Vec3D | origo, | ||
double | h | ||
) |
Constructor for mesh definition.
Sets geometry mode, mesh cell size h, mesh size size and origo origo.
Mesh::Mesh | ( | std::istream & | is | ) |
Constructoer for loading mesh from a stream is.
|
inline |
Destructor.
void Mesh::debug_print | ( | std::ostream & | os | ) | const |
Print debugging information to stream os.
Reimplemented in Geometry, MeshVectorField, and ScalarField.
int32_t Mesh::dim | ( | void | ) | const |
Returns number of dimensions in geometry.
|
inline |
Returns reciprocal of mesh cell size (1/h).
|
inline |
Returns geometry mode.
|
inline |
Returns mesh cell size.
|
inline |
Returns vector pointing to the last mesh point opposite of origo.
|
inline |
Returns i-th component of vector pointing to the last mesh point opposite of origo.
|
inline |
Returns number of nodes in the mesh.
bool Mesh::operator!= | ( | const Mesh & | m | ) | const |
Non-equality.
bool Mesh::operator== | ( | const Mesh & | m | ) | const |
Equality.
Allows small inequality.
|
inline |
Returns origo vector of geometry.
|
inline |
Returns i-th component of vector origo.
void Mesh::reset | ( | geom_mode_e | geom_mode, |
Int3D | size, | ||
Vec3D | origo, | ||
double | h | ||
) |
Reset mesh definition.
Reimplemented in ScalarField.
void Mesh::save | ( | std::ostream & | os | ) | const |
Saves geometry data to stream os.
Reimplemented in Geometry, MeshVectorField, and ScalarField.
|
inline |
Returns size array of geometry.
|
inline |
Returns size of solid mesh in direction i.
|
protected |
Reciprocal of length of mesh step [1/m].
|
protected |
Geometry mode
|
protected |
Length of mesh step [m].
|
protected |
Location of mesh point (size[0]-1,size[1]-1,size[2]-1) [m].
|
protected |
Location of mesh point (0,0,0) [m].
|
protected |
Size of mesh.