1 #ifndef EMMG_RealField_H 2 #define EMMG_RealField_H 52 static inline SP::EMMG_RealField
New() {
63 SP::EMMG_RealField p=
New();
193 tReal *vs=&(*this)[i*dim];
380 const tReal *v=&(*this)[i*dim];
403 if (size>0) values=(
const float*) &mArray[0];
417 if (
getTypeToString().compare(CORE_Object::getTypeName<double>())==0) {
419 if (size>0) values=(
const double*) &mArray[0];
432 if (
getTypeToString().compare(CORE_Object::getTypeName<long double>())==0) {
434 if (size>0) values=(
const long double*) &mArray[0];
449 if (size>0) values=(
float*) &mArray[0];
462 if (
getTypeToString().compare(CORE_Object::getTypeName<double>())==0) {
464 if (size>0) values=(
double*) &mArray[0];
477 if (
getTypeToString().compare(CORE_Object::getTypeName<long double>())==0) {
479 if (size>0) values=(
long double*) &mArray[0];
virtual void divideBy(const tReal &f)
compute This/=f
Definition: EMMG_RealField.cpp:561
EMM_RealArray mArray
Definition: EMMG_RealField.h:28
This class describes a grid3d mesh.
Definition: EMM_Grid3D.h:48
const tUIndex & getSize() const
return the size of the array for reading
Definition: CORE_Array.h:1018
DEFINE_SPTR(EMMG_RealField)
EMM_RealArray & getArray()
get the array for writing
Definition: EMMG_RealField.h:353
virtual void add(const tReal &alpha, const EMM_RealField &X)
compute This += alpha. X
Definition: EMMG_RealField.cpp:748
virtual void dotArray(const EMM_RealArray &w, const EMM_RealField &F, const EMM_RealField &G, EMM_RealArray &R) const
compute the array
Definition: EMMG_RealField.cpp:1947
static const tDimension Y
Definition: EMM_Object.h:34
EMMG_RealField()
create
Definition: EMMG_RealField.cpp:9
tBoolean loadFromStream(ifstream &f, const vector< tUSInt > &dims, const vector< EMM_Array< T > * > &arrays) const
load the values to indicators from the stream
Definition: EMM_Array.hpp:235
virtual void copy(const EMM_RealField &f)
copy the real vector
Definition: EMMG_RealField.cpp:17
virtual tBoolean getValues(tUIndex &size, const double *&values) const
get the values
Definition: EMMG_RealField.h:416
tString getTypeToString() const
get the type name of the array
Definition: CORE_Array.h:570
This class describes a generic real field.
Definition: EMMG_RealField.h:17
virtual void sub(const EMM_RealField &f)
compute This-=f
Definition: EMMG_RealField.cpp:1155
virtual tString getTypeToString() const
get the string type
Definition: EMMG_RealField.h:391
static const tDimension X
Definition: EMM_Object.h:33
const tReal & operator()(const tUIndex &i, const tDimension &d) const
get the value at point i for coordinate d
Definition: EMMG_RealField.h:87
virtual tBoolean getValues(tUIndex &size, double *&values)
get the values
Definition: EMMG_RealField.h:461
This class is a I/O output class for VTK / Paraviwe file.
Definition: EMM_VTK.h:25
const EMM_RealArray & getArray() const
get the array for reading
Definition: EMMG_RealField.h:347
virtual tBoolean saveToStream(ofstream &f) const
save the steady array into stream the steam will contain the values of the field. One value per line ...
Definition: EMMG_RealField.h:599
#define tUSInt
Definition: types.h:28
virtual void mean(tReal *mean) const
compute the mean of each direction
Definition: EMMG_RealField.cpp:2434
#define tBoolean
Definition: types.h:139
virtual tReal distanceMax(const EMM_RealField &B, tUIndex &k) const
compute the Max_i ||this[i]-B[i]||
Definition: EMMG_RealField.cpp:2554
tReal & operator()(const tUIndex &i, const tDimension &d)
get the value at point i for coordinate d
Definition: EMMG_RealField.h:79
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
tBoolean loadFromFile(const tString &fileName)
load the steady array from file
Definition: EMM_RealField.cpp:313
virtual void fitToSize()
fit the memory size to the size
Definition: EMMG_RealField.h:204
virtual void normalize()
normalize the field
Definition: EMMG_RealField.cpp:2502
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
virtual void setSize(const tUIndex &s)
set the size
Definition: EMMG_RealField.h:110
static SP::EMMG_RealField New()
constructor with a shared pointer
Definition: EMMG_RealField.h:52
virtual tString toString() const
return the string representation of the field
Definition: EMM_RealField.h:725
virtual tBoolean cellDataToPointData(const EMM_Grid3D &mesh)
turn the field from cell data to point data
Definition: EMMG_RealField.cpp:3057
virtual tReal dot(const EMM_RealField &F, const EMM_RealField &G) const
compute the scalar product <F,G>
Definition: EMMG_RealField.cpp:1235
virtual void initField(const tReal &alpha, const EMM_RealField &f)
init the field to the field multiplied by alpha This=alpha.f
Definition: EMMG_RealField.cpp:151
tBoolean saveToStream(ofstream &f) const
save the values of the array into the stream with 1 value per line
Definition: EMM_Array.h:208
virtual void setValue(const tUIndex &i, const tReal v[])
set the value of the element at index i
Definition: EMMG_RealField.h:191
#define tSInt
Definition: types.h:30
virtual tReal getValue(const tUIndex &i) const
get the value of the element at index i
Definition: EMMG_RealField.h:370
virtual void setValue(const tUIndex &i, const tReal &v)
set the value of the element at index i
Definition: EMMG_RealField.h:182
virtual void fitToSize()
fit the array alocation exactly to size fit the allocation of the array to its size ...
Definition: CORE_Array.hpp:128
#define tUInt
Definition: types.h:33
virtual tBoolean pointDataToCellData(const EMM_Grid3D &mesh)
turn the field from point data to cll data
Definition: EMMG_RealField.cpp:3279
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_Array.h:545
virtual void unmagnetized(const EMM_Grid3D &mesh)
unmagnetized the field in the mesh
Definition: EMMG_RealField.cpp:507
#define tUIndex
Definition: types.h:126
virtual tBoolean getValues(tUIndex &size, float *&values)
get the values
Definition: EMMG_RealField.h:446
This class describes a real array.
Definition: EMM_RealArray.h:16
const tDimension & getDimension() const
get the dimension
Definition: EMM_RealField.h:553
const tReal & operator[](const tUIndex &i) const
get the value at index
Definition: EMMG_RealField.h:101
virtual ~EMMG_RealField(void)
destroy
Definition: EMMG_RealField.cpp:14
virtual tBoolean loadFromStream(ifstream &f, const tUSInt &d)
load the steady array from stream the steam contains the values of the field. One value per line ...
Definition: EMMG_RealField.h:582
tReal & operator[](const tUIndex &i)
get the value at index
Definition: EMMG_RealField.h:94
virtual tBoolean saveToVTKStream(ofstream &file, EMM_VTK &vtk, const tString &name) const
save the field in vtk
Definition: EMMG_RealField.cpp:3020
#define tString
Definition: types.h:135
virtual SP::EMM_RealField NewInstance() const
create a new instance of real field with the smae dimension and size
Definition: EMMG_RealField.h:62
virtual void wedge(const EMM_RealField &X, EMM_RealField &Y) const
compute the vectorial product of two fields This & X Y=alpha this ^ X
Definition: EMMG_RealField.cpp:2687
virtual void multiplyBy(const tReal &f)
compute This*=f
Definition: EMMG_RealField.cpp:600
virtual void getValue(const tUIndex &i, tReal vs[]) const
get the vector value at point i of size dim
Definition: EMMG_RealField.h:378
SP_OBJECT(EMMG_RealField)
#define tULLInt
Definition: types.h:45
virtual void setFieldByReference(const tUIndex &from, const tUIndex &to, EMM_RealField &X)
set the field by reference
Definition: EMMG_RealField.cpp:476
This class describes a real field.
Definition: EMM_RealField.h:21
virtual tBoolean getValues(tUIndex &size, long double *&values)
get the values
Definition: EMMG_RealField.h:476
virtual tULLInt getMemorySize() const
return the memory size in bytes
Definition: EMMG_RealField.h:341
#define tReal
Definition: types.h:118
virtual tBoolean getValues(tUIndex &size, const long double *&values) const
get the values
Definition: EMMG_RealField.h:431
virtual tReal norm(const tUIndex &index) const
compute the norm at point at index
Definition: EMMG_RealField.cpp:2329
DEFINE_SVPTR(EMMG_RealField)
virtual tBoolean getValues(tUIndex &size, const float *&values) const
get the values
Definition: EMMG_RealField.h:399
virtual tBoolean initField(const tString &fileName)
init the field by the file name
Definition: EMMG_RealField.h:157
virtual tUIndex getSize() const
return the size of the field
Definition: EMMG_RealField.h:362
virtual tReal normMax(tUIndex &k) const
compute the point where the norm of the field is maximum
Definition: EMMG_RealField.cpp:2384
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141