Public Member Functions | Protected Attributes | List of all members
Mesh Class Reference

Mesh geometry definion. More...

#include <mesh.hpp>

Inheritance diagram for Mesh:
Geometry MeshVectorField ScalarField

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].

Detailed Description

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.

Constructor & Destructor Documentation

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.

Mesh::~Mesh ( )
inline

Destructor.

Member Function Documentation

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.

double Mesh::div_h ( void  ) const
inline

Returns reciprocal of mesh cell size (1/h).

geom_mode_e Mesh::geom_mode ( void  ) const
inline

Returns geometry mode.

double Mesh::h ( void  ) const
inline

Returns mesh cell size.

Vec3D Mesh::max ( void  ) const
inline

Returns vector pointing to the last mesh point opposite of origo.

double Mesh::max ( int  i) const
inline

Returns i-th component of vector pointing to the last mesh point opposite of origo.

int32_t Mesh::nodecount ( void  ) const
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.

Vec3D Mesh::origo ( void  ) const
inline

Returns origo vector of geometry.

double Mesh::origo ( int  i) const
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.

Int3D Mesh::size ( void  ) const
inline

Returns size array of geometry.

int32_t Mesh::size ( int  i) const
inline

Returns size of solid mesh in direction i.

Member Data Documentation

double Mesh::_div_h
protected

Reciprocal of length of mesh step [1/m].

geom_mode_e Mesh::_geom_mode
protected

Geometry mode

double Mesh::_h
protected

Length of mesh step [m].

Vec3D Mesh::_max
protected

Location of mesh point (size[0]-1,size[1]-1,size[2]-1) [m].

Vec3D Mesh::_origo
protected

Location of mesh point (0,0,0) [m].

Int3D Mesh::_size
protected

Size of mesh.


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