43 #ifndef SCALARFIELD_HPP
44 #define SCALARFIELD_HPP 1
75 void check_definition();
170 return( _F[i + j*
_size[0]] ); }
174 inline double &
operator()( int32_t i, int32_t j, int32_t k ) {
175 return( _F[i + (j + k*
_size[1])*
_size(0)] ); }
184 inline const double &
operator()( int32_t i, int32_t j )
const {
185 return( _F[i + j*
_size[0]] ); }
189 inline const double &
operator()( int32_t i, int32_t j, int32_t k )
const {
190 return( _F[i + (j + k*
_size[1])*
_size(0)] ); }
203 void save(
const std::string &filename )
const;
207 void save( std::ostream &s )
const;
~ScalarField()
Destructor.
void get_minmax(double &min, double &max) const
Search minimum and maximum values of scalar field.
ScalarField & operator+=(const ScalarField &f)
Accumulation operator.
Mesh geometry definion.
Definition: mesh.hpp:67
Vec3D origo(void) const
Returns origo vector of geometry.
Definition: mesh.hpp:128
double & operator()(int32_t i)
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:164
geom_mode_e
Geometry mode enum.
Definition: types.hpp:59
Three dimensional vectors.
double & operator()(int32_t i, int32_t j)
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:169
void save(const std::string &filename) const
Saves data to a new file filename.
Geometry defining class.
Definition: geometry.hpp:131
double h(void) const
Returns mesh cell size.
Definition: mesh.hpp:146
void reset(geom_mode_e geom_mode, Int3D size, Vec3D origo, double h)
Resets the field geometry.
void clear()
Clears the field.
void debug_print(std::ostream &os) const
Print debugging information to os.
const double & operator()(int32_t i, int32_t j) const
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:184
Vec3D max(void) const
Returns vector pointing to the last mesh point opposite of origo.
Definition: mesh.hpp:137
const double & operator()(int32_t i) const
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:179
const double & operator()(int32_t i, int32_t j, int32_t k) const
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:189
3D Integer vector class.
Definition: vec3d.hpp:289
Int3D _size
Size of mesh.
Definition: mesh.hpp:71
ScalarField()
Default constructor.
void epot_get_minmax(const Geometry &g, double &min, double &max) const
Search minimum and maximum electric potential values of electric potential field. ...
Int3D size(void) const
Returns size array of geometry.
Definition: mesh.hpp:116
Three dimensional vector.
Definition: vec3d.hpp:58
ScalarField & operator*=(double x)
Scaling operator.
ScalarField & operator/=(double x)
Inverse scaling operator.
ScalarField & operator=(const ScalarField &f)
Copy operator.
Scalar field class.
Definition: scalarfield.hpp:70
geom_mode_e geom_mode(void) const
Returns geometry mode.
Definition: mesh.hpp:108
double & operator()(int32_t i, int32_t j, int32_t k)
Operator for pointing to elements of the field mesh.
Definition: scalarfield.hpp:174