Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.5new_solver
   Version 1.0.5dev
      Class Index
      File List
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads

Mesh geometry definion. More...

#include <mesh.hpp>

Inheritance diagram for Mesh:
Geometry MeshVectorField ScalarField

List of all members.

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).
Int3D closest_node (Vec3D x) const
 Returns node closest to location x.
Int3D mesh_number (Vec3D x) const
 Returns node, which contains x.
Vec3D coord_of_node (Int3D n) const
 Returns coordinates of node i.
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

Int3D Mesh::closest_node ( Vec3D  x  )  const

Returns node closest to location x.

Calculated as

 floor((x[i]-origo(i))/h() + 0.5) 

for each component

Vec3D Mesh::coord_of_node ( Int3D  n  )  const

Returns coordinates of node i.

Calculated as

 origo(i)+n[i]*h() 

for each component

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.

Int3D Mesh::mesh_number ( Vec3D  x  )  const

Returns node, which contains x.

Calculated as

 floor((x[i]-origo(i))/h()) 

for each component

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.

double Mesh::origo ( int  i  )  const [inline]

Returns i-th component of vector origo.

Vec3D Mesh::origo ( void   )  const [inline]

Returns origo vector of geometry.

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

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:


Reference manual for Ion Beam Simulator 1.0.5dev
Generated by Doxygen 1.7.1 on Mon Feb 6 2012 15:07:16.