Public Member Functions
ScalarField Class Reference

Scalar field class. More...

#include <scalarfield.hpp>

Inheritance diagram for ScalarField:
Mesh

List of all members.

Public Member Functions

 ScalarField ()
 Default constructor.
 ScalarField (const Mesh &m)
 Constructor for scalarfield from mesh.
 ScalarField (geom_mode_e geom_mode, Int3D size, Vec3D origo, double h)
 Constructor for set geometry.
 ScalarField (std::istream &s)
 Constructor for loading scalar field from a stream s.
 ScalarField (const ScalarField &f)
 Copy constructor.
 ~ScalarField ()
 Destructor.
void clear ()
 Clears the field.
void reset (geom_mode_e geom_mode, Int3D size, Vec3D origo, double h)
 Resets the field geometry.
void get_minmax (double &min, double &max) const
 Search minimum and maximum values of scalar field.
void epot_get_minmax (const Geometry &g, double &min, double &max) const
 Search minimum and maximum electric potential values of electric potential field.
ScalarFieldoperator= (const ScalarField &f)
 Copy operator.
ScalarFieldoperator+= (const ScalarField &f)
 Accumulation operator.
ScalarFieldoperator*= (double x)
 Scaling operator.
ScalarFieldoperator/= (double x)
 Inverse scaling operator.
double & operator() (int32_t i)
 Operator for pointing to elements of the field mesh.
double & operator() (int32_t i, int32_t j)
 Operator for pointing to elements of the field mesh.
double & operator() (int32_t i, int32_t j, int32_t k)
 Operator for pointing to elements of the field mesh.
const double & operator() (int32_t i) const
 Operator for pointing to elements of the field mesh.
const double & operator() (int32_t i, int32_t j) const
 Operator for pointing to elements of the field mesh.
const double & operator() (int32_t i, int32_t j, int32_t k) const
 Operator for pointing to elements of the field mesh.
double operator() (Vec3D x) const
 Operator for getting linearly interpolated field values.
void save (const std::string &filename) const
 Saves data to a new file filename.
void save (std::ostream &s) const
 Saves scalar field data to stream s.
void debug_print (std::ostream &os) const
 Print debugging information to os.

Detailed Description

Scalar field class.

ScalarField is intended to be used as a container for scalar field data. The IBSimu Package uses scalar fields for storing electric potential and space charge density fields. A separate Efield exists for electric fields. The scalar field class provides a subset of vector operations to copy, sum and scale scalar fields. The class also includes operators for indexed access to mesh elements and interpolation functions for linearly interpolated smooth field data. The interpolation function uses linear extrapolation of field outside the defined mesh. This way it can be ensured that ScalarField returns sensible values even close by to the edges of the geometry.

The scalar field mesh size has to be at least 2 nodes in active directions for the selected geometry mode. The mesh size has to be 1 in the other (inactive) directions.


Constructor & Destructor Documentation

Default constructor.

The field made with the default constructor 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). The field evaluator returns always zero.

Constructor for scalarfield from mesh.

Returns a new scalar field with geometry parameters (including mesh size) set from m. The field is set to zero in all locations.

ScalarField::ScalarField ( geom_mode_e  geom_mode,
Int3D  size,
Vec3D  origo,
double  h 
)

Constructor for set geometry.

Returns a new scalar field with geometry set according to parameters. The field is set to zero in all locations.

ScalarField::ScalarField ( std::istream &  s)

Constructor for loading scalar field from a stream s.

Copy constructor.

Destructor.


Member Function Documentation

Clears the field.

void ScalarField::debug_print ( std::ostream &  os) const

Print debugging information to os.

Reimplemented from Mesh.

void ScalarField::epot_get_minmax ( const Geometry g,
double &  min,
double &  max 
) const

Search minimum and maximum electric potential values of electric potential field.

Searches the minimum and maximum electric potential field values skipping the virtual potentials of electrode edges defined by the geometry and adding in the electrode potentials.

void ScalarField::get_minmax ( double &  min,
double &  max 
) const

Search minimum and maximum values of scalar field.

It should be noted that ScalarField object itself doesn't know about virtual potentials at electrode edges and therefore this function doesn't know how to separate these points from other points. For electric potential fields use epot_get_minmax() instead.

double& ScalarField::operator() ( int32_t  i) [inline]

Operator for pointing to elements of the field mesh.

double& ScalarField::operator() ( int32_t  i,
int32_t  j 
) [inline]

Operator for pointing to elements of the field mesh.

double& ScalarField::operator() ( int32_t  i,
int32_t  j,
int32_t  k 
) [inline]

Operator for pointing to elements of the field mesh.

const double& ScalarField::operator() ( int32_t  i) const [inline]

Operator for pointing to elements of the field mesh.

const double& ScalarField::operator() ( int32_t  i,
int32_t  j 
) const [inline]

Operator for pointing to elements of the field mesh.

const double& ScalarField::operator() ( int32_t  i,
int32_t  j,
int32_t  k 
) const [inline]

Operator for pointing to elements of the field mesh.

double ScalarField::operator() ( Vec3D  x) const

Operator for getting linearly interpolated field values.

The field is interpolated linearly to get the field value at x. If x is outside the mesh, the field is extrapolated linearly using the field points to x. This provides correct field values also close to the mesh boundaries.

ScalarField& ScalarField::operator*= ( double  x)

Scaling operator.

ScalarField& ScalarField::operator+= ( const ScalarField f)

Accumulation operator.

ScalarField& ScalarField::operator/= ( double  x)

Inverse scaling operator.

ScalarField& ScalarField::operator= ( const ScalarField f)

Copy operator.

void ScalarField::reset ( geom_mode_e  geom_mode,
Int3D  size,
Vec3D  origo,
double  h 
)

Resets the field geometry.

Sets the field geometry according to the parameters and clears the field to zero in all locations.

Reimplemented from Mesh.

void ScalarField::save ( const std::string &  filename) const

Saves data to a new file filename.

void ScalarField::save ( std::ostream &  s) const

Saves scalar field data to stream s.

Reimplemented from Mesh.


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