#include "MEDMEMTest.hxx"#include "MEDMEM_FieldConvert.hxx"#include "MEDMEM_Field.hxx"#include "MEDMEM_Mesh.hxx"#include "MEDMEM_Group.hxx"#include "MEDMEM_Support.hxx"#include "MEDMEM_VtkMeshDriver.hxx"#include "MEDMEM_MedMeshDriver.hxx"#include <cppunit/TestAssert.h>#include <sstream>#include <cmath>
Functions | |
| static void | compareField_ (const FIELD_ *theField_1, const FIELD_ *theField_2, bool isFIELD, bool isValue) |
| static void | checkField_ (FIELD_ *theField_, const SUPPORT *theSupport, MED_EN::med_type_champ theValueType, MED_EN::medModeSwitch theInterlace) |
| template<class T , class INTERLACING_TAG > | |
| void | compareField (const FIELD< T, INTERLACING_TAG > *theField_1, const FIELD< T, INTERLACING_TAG > *theField_2, bool isValue) |
| template<class T , class INTERLACING_TAG > | |
| void | checkField (FIELD< T, INTERLACING_TAG > *theField, const SUPPORT *theSupport) |
| template<class T > | |
| FIELD< T > * | createFieldOnGroup (MESH *theMesh, const GROUP *theGroup, const string theName, const string theDescr) |
| double | plus13 (double val) |
| static void | proj2d (const double *temp, double *output) |
| static void | testDrivers () |
| static void | MEDMEMTest_testField () |
| int | main (int argc, char **argv) |
| static void compareField_ | ( | const FIELD_ * | theField_1, |
| const FIELD_ * | theField_2, | ||
| bool | isFIELD, | ||
| bool | isValue | ||
| ) | [static] |
Check methods (48), defined in MEDMEM_Field.hxx: class FIELD_ { (+) FIELD_(); (+) FIELD_(const SUPPORT * Support, const int NumberOfComponents); (+) FIELD_(const FIELD_ &m); (+) virtual ~FIELD_(); (+) FIELD_& operator=(const FIELD_ &m);
(-) virtual void rmDriver(int index=0); (-) virtual int addDriver(driverTypes driverType, const string & fileName="Default File Name.med", const string & driverFieldName="Default Field Nam", MED_EN.med_mode_acces access=MED_EN::MED_REMP); (-) virtual int addDriver(GENDRIVER & driver);
(-) virtual void read (const GENDRIVER &); (-) virtual void read(int index=0); (-) virtual void openAppend(void); (-) virtual void write(const GENDRIVER &); (-) virtual void write(int index=0, const string & driverName=""); (-) virtual void writeAppend(const GENDRIVER &); (-) virtual void writeAppend(int index=0, const string & driverName="");
(+) inline void setName(const string Name); (+) inline string getName() const; (+) inline void setDescription(const string Description); (+) inline string getDescription() const; (+) inline const SUPPORT * getSupport() const; (+) inline void setSupport(const SUPPORT * support); (+) inline void setNumberOfComponents(const int NumberOfComponents); (+) inline int getNumberOfComponents() const; (+) inline void setNumberOfValues(const int NumberOfValues); (+) inline int getNumberOfValues() const; (+) inline void setComponentsNames(const string * ComponentsNames); (+) inline void setComponentName(int i, const string ComponentName); (+) inline const string * getComponentsNames() const; (+) inline string getComponentName(int i) const; (+) inline void setComponentsDescriptions(const string * ComponentsDescriptions); (+) inline void setComponentDescription(int i, const string ComponentDescription); (+) inline const string * getComponentsDescriptions() const; (+) inline string getComponentDescription(int i) const; (+) inline void setComponentsUnits(const UNIT * ComponentsUnits); (+) inline const UNIT * getComponentsUnits() const; (+) inline const UNIT * getComponentUnit(int i) const; (+) inline void setMEDComponentsUnits(const string * MEDComponentsUnits); (+) inline void setMEDComponentUnit(int i, const string MEDComponentUnit); (+) inline const string * getMEDComponentsUnits() const; (+) inline string getMEDComponentUnit(int i) const;
(+) inline void setIterationNumber(int IterationNumber); (+) inline int getIterationNumber() const; (+) inline void setTime(double Time); (+) inline double getTime() const; (+) inline void setOrderNumber(int OrderNumber); (+) inline int getOrderNumber() const;
(+) inline MED_EN.med_type_champ getValueType () const; (+) inline MED_EN.medModeSwitch getInterlacingType() const; (-) virtual inline bool getGaussPresence() const throw (MEDEXCEPTION);
}
template <class T, class INTERLACING_TAG> class FIELD : public FIELD_ { (+) FIELD(); (+) FIELD(const FIELD &m); (+) FIELD(const SUPPORT * Support, const int NumberOfComponents) throw (MEDEXCEPTION); (+) FIELD(driverTypes driverType, const string & fileName, const string & fieldDriverName, const int iterationNumber=-1, const int orderNumber=-1) throw (MEDEXCEPTION); (+) FIELD(const SUPPORT * Support, driverTypes driverType, const string & fileName="", const string & fieldName="", const int iterationNumber = -1, const int orderNumber = -1) throw (MEDEXCEPTION); (+) ~FIELD(); (+) FIELD & operator=(const FIELD &m);
(+) const FIELD operator+(const FIELD& m) const; (+) const FIELD operator-(const FIELD& m) const; (+) const FIELD operator*(const FIELD& m) const; (+) const FIELD operator/(const FIELD& m) const; (+) const FIELD operator-() const; (+) FIELD& operator+=(const FIELD& m); (+) FIELD& operator-=(const FIELD& m); (+) FIELD& operator*=(const FIELD& m); (+) FIELD& operator/=(const FIELD& m);
(+) static FIELD* add(const FIELD& m, const FIELD& n); (+) static FIELD* addDeep(const FIELD& m, const FIELD& n); (+) static FIELD* sub(const FIELD& m, const FIELD& n); (+) static FIELD* subDeep(const FIELD& m, const FIELD& n); (+) static FIELD* mul(const FIELD& m, const FIELD& n); (+) static FIELD* mulDeep(const FIELD& m, const FIELD& n); (+) static FIELD* div(const FIELD& m, const FIELD& n); (+) static FIELD* divDeep(const FIELD& m, const FIELD& n);
(+) double normMax() const throw (MEDEXCEPTION); (+) double norm2() const throw (MEDEXCEPTION);
(+) void applyLin(T a, T b); (+) template <T T_function(T)> void applyFunc(); (+) void applyPow(T scalar);
(+) static FIELD* scalarProduct(const FIELD& m, const FIELD& n, bool deepCheck=false);
(+) double normL2(int component, const FIELD<double,FullInterlace> * p_field_volume=NULL) const; (+) double normL2(const FIELD<double,FullInterlace> * p_field_volume=NULL) const; (+) double normL1(int component, const FIELD<double,FullInterlace> * p_field_volume=NULL) const; (+) double normL1(const FIELD<double,FullInterlace> * p_field_volume=NULL) const;
(+) FIELD* extract(const SUPPORT *subSupport) const throw (MEDEXCEPTION);
(EMPTY COMMENT, EMPTY IMPLEMENTATION!!!) void init ();
(+) void rmDriver(int index=0); (+) int addDriver(driverTypes driverType, const string & fileName="Default File Name.med", const string & driverFieldName="Default Field Name", MED_EN.med_mode_acces access=MED_EN::MED_REMP); (+) int addDriver(GENDRIVER & driver);
(+) void allocValue(const int NumberOfComponents); (+) void allocValue(const int NumberOfComponents, const int LengthValue); (+) void deallocValue();
(+) inline void read(int index=0); (+) inline void read(const GENDRIVER & genDriver); (+) inline void write(int index=0, const string & driverName = ""); (+) inline void write(const GENDRIVER &); (+) inline void writeAppend(int index=0, const string & driverName = ""); (+) inline void writeAppend(const GENDRIVER &);
(+) inline MEDMEM_Array_ * getArray() const throw (MEDEXCEPTION); (+) inline ArrayGauss * getArrayGauss() const throw (MEDEXCEPTION); (+) inline ArrayNoGauss * getArrayNoGauss() const throw (MEDEXCEPTION); (+) inline bool getGaussPresence() const throw (MEDEXCEPTION);
(+) inline int getValueLength() const throw (MEDEXCEPTION); (+) inline const T* getValue() const throw (MEDEXCEPTION); (+) inline const T* getRow(int i) const throw (MEDEXCEPTION); (+) inline const T* getColumn(int j) const throw (MEDEXCEPTION); (+) inline T getValueIJ(int i,int j) const throw (MEDEXCEPTION); (+) inline T getValueIJK(int i,int j,int k) const throw (MEDEXCEPTION); (+) bool getValueOnElement(int eltIdInSup,T* retValues) const throw (MEDEXCEPTION);
(+) const int getNumberOfGeometricTypes() const throw (MEDEXCEPTION);
(+) const GAUSS_LOCALIZATION<INTERLACING_TAG> & getGaussLocalization (MED_EN.medGeometryElement geomElement) const throw (MEDEXCEPTION); (+) const GAUSS_LOCALIZATION<INTERLACING_TAG> * getGaussLocalizationPtr (MED_EN.medGeometryElement geomElement) const throw (MEDEXCEPTION); (+) void setGaussLocalization(MED_EN.medGeometryElement geomElement, const GAUSS_LOCALIZATION<INTERLACING_TAG> & gaussloc); (+) const int * getNumberOfGaussPoints() const throw (MEDEXCEPTION); (+) const int getNumberOfGaussPoints (MED_EN.medGeometryElement geomElement) const throw (MEDEXCEPTION); (+) const int getNbGaussI(int i) const throw (MEDEXCEPTION);
(+) const int * getNumberOfElements() const throw (MEDEXCEPTION); (+) const MED_EN.medGeometryElement * getGeometricTypes() const throw (MEDEXCEPTION); (+) bool isOnAllElements() const throw (MEDEXCEPTION);
(+) inline void setArray(MEDMEM_Array_ *value) throw (MEDEXCEPTION); (+) inline void setValue(T* value) throw (MEDEXCEPTION); (+) inline void setRow(int i, T* value) throw (MEDEXCEPTION); (+) inline void setColumn(int i, T* value) throw (MEDEXCEPTION); (+) inline void setValueIJ(int i, int j, T value) throw (MEDEXCEPTION);
(NOT IMPLEMENTED!!!) void getVolume() const throw (MEDEXCEPTION); (NOT IMPLEMENTED!!!) void getArea() const throw (MEDEXCEPTION); (NOT IMPLEMENTED!!!) void getLength() const throw (MEDEXCEPTION); (NOT IMPLEMENTED!!!) void getNormal() const throw (MEDEXCEPTION); (NOT IMPLEMENTED!!!) void getBarycenter() const throw (MEDEXCEPTION);
(+) void fillFromAnalytic(myFuncType f) throw (MEDEXCEPTION);
}
Use code of test_operation_fieldint.cxx test_operation_fielddouble.cxx test_copie_field_.cxx test_copie_fieldT.cxx
References MEDMEM.FIELD_.getComponentDescription(), MEDMEM.FIELD_.getComponentName(), MEDMEM.FIELD_.getDescription(), MEDMEM.FIELD_.getGaussPresence(), MEDMEM.FIELD_.getInterlacingType(), MEDMEM.FIELD_.getIterationNumber(), MEDMEM.FIELD_.getMEDComponentUnit(), MEDMEM.FIELD_.getName(), MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), MEDMEM.FIELD_.getOrderNumber(), MEDMEM.FIELD_.getSupport(), MEDMEM.FIELD_.getTime(), and MEDMEM.FIELD_.getValueType().
| static void checkField_ | ( | FIELD_ * | theField_, |
| const SUPPORT * | theSupport, | ||
| MED_EN::med_type_champ | theValueType, | ||
| MED_EN::medModeSwitch | theInterlace | ||
| ) | [static] |
References MEDMEM.FIELD_.getComponentDescription(), MEDMEM.FIELD_.getComponentName(), MEDMEM.FIELD_.getComponentsDescriptions(), MEDMEM.FIELD_.getComponentsNames(), MEDMEM.FIELD_.getDescription(), MEDMEM.FIELD_.getInterlacingType(), MEDMEM.FIELD_.getIterationNumber(), MEDMEM.FIELD_.getMEDComponentsUnits(), MEDMEM.FIELD_.getMEDComponentUnit(), MEDMEM.FIELD_.getName(), MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD_.getNumberOfValues(), MEDMEM.FIELD_.getOrderNumber(), MEDMEM.FIELD_.getSupport(), MEDMEM.FIELD_.getTime(), MEDMEM.FIELD_.getValueType(), MEDMEM.FIELD_.setComponentDescription(), MEDMEM.FIELD_.setComponentName(), MEDMEM.FIELD_.setComponentsDescriptions(), MEDMEM.FIELD_.setComponentsNames(), MEDMEM.FIELD_.setDescription(), MEDMEM.FIELD_.setIterationNumber(), MEDMEM.FIELD_.setMEDComponentsUnits(), MEDMEM.FIELD_.setMEDComponentUnit(), MEDMEM.FIELD_.setName(), MEDMEM.FIELD_.setNumberOfComponents(), MEDMEM.FIELD_.setNumberOfValues(), MEDMEM.FIELD_.setOrderNumber(), MEDMEM.FIELD_.setSupport(), and MEDMEM.FIELD_.setTime().
| void compareField | ( | const FIELD< T, INTERLACING_TAG > * | theField_1, |
| const FIELD< T, INTERLACING_TAG > * | theField_2, | ||
| bool | isValue | ||
| ) |
References compareField_().
| void checkField | ( | FIELD< T, INTERLACING_TAG > * | theField, |
| const SUPPORT * | theSupport | ||
| ) |
References MEDMEM.FIELD< T, INTERLACING_TAG >.allocValue(), checkField_(), compareField(), MEDMEM.FIELD< T, INTERLACING_TAG >.deallocValue(), MEDMEM.FIELD< T, INTERLACING_TAG >.getGaussPresence(), MEDMEM.SUPPORT.getMesh(), MEDMEM.SUPPORT.getNumberOfElements(), MEDMEM.FIELD_.getNumberOfValues(), MEDMEM.GMESH.getSpaceDimension(), MED_EN.MED_ALL_ELEMENTS, and batchmode_medcorba_test.spaceDim.
| static void testDrivers | ( | ) | [static] |
References MEDMEM.FIELD< T, INTERLACING_TAG >.addDriver(), MEDMEM.ASCII_DRIVER, MEDMEM.VTK_MESH_DRIVER.close(), MEDMEM.MED_MESH_DRIVER.close(), test_MEDSPLITTER.filename_rd, MEDMEM.FIELD_.getName(), INTERP_TEST.getResourceFile(), MEDMEM.GMESH.getSupportOnAll(), MEDMEM.GIBI_DRIVER, makeTmpFile(), MED_EN.MED_CELL, MEDMEM.MED_DRIVER, test_MEDSPLITTER.meshname, MEDMEM.NO_DRIVER, MEDMEM.VTK_MESH_DRIVER.open(), MEDMEM.MED_MESH_DRIVER.open(), MEDMEM.PORFLOW_DRIVER, MEDMEM.MED_MESH_RDONLY_DRIVER.read(), MEDMEM.MED_FIELD_RDONLY_DRIVER< T >.read(), MEDMEM.FIELD< T, INTERLACING_TAG >.read(), MEDMEMTest_TmpFilesRemover.Register(), MEDMEM.RCBASE.removeReference(), MEDMEM.FIELD< T, INTERLACING_TAG >.rmDriver(), MEDMEM.MED_FIELD_DRIVER< T >.setFieldName(), MEDMEM.GENDRIVER.setFileName(), MEDMEM.MED_MESH_DRIVER.setMeshName(), MEDMEM.FIELD_.setName(), MEDMEM.VTK_DRIVER, MEDMEM.MEDEXCEPTION.what(), MEDMEM.VTK_MESH_DRIVER.write(), MEDMEM.MED_FIELD_RDONLY_DRIVER< T >.write(), MEDMEM.FIELD< T, INTERLACING_TAG >.write(), and MEDMEM.FIELD< T, INTERLACING_TAG >.writeAppend().
| static void MEDMEMTest_testField | ( | ) | [static] |
References MEDMEM.FIELD< T, INTERLACING_TAG >.allocValue(), MEDMEM.FIELD< T, INTERLACING_TAG >.applyFunc(), MEDMEM.FIELD< T, INTERLACING_TAG >.applyPow(), med_test1.barycenter, checkField(), checkField_(), compareField_(), MEDMEM.FIELD< T, INTERLACING_TAG >.deallocValue(), MEDMEM.FIELD< T, INTERLACING_TAG >.extract(), MEDMEM.FIELD< T, INTERLACING_TAG >.getArray(), MEDMEM.FIELD< T, INTERLACING_TAG >.getArrayGauss(), MEDMEM.FIELD< T, INTERLACING_TAG >.getArrayNoGauss(), MEDMEM.FIELD< T, INTERLACING_TAG >.getColumn(), MEDMEM.FIELD_.getDescription(), MEDMEM.FIELD< T, INTERLACING_TAG >.getGaussLocalization(), MEDMEM.FIELD< T, INTERLACING_TAG >.getGaussLocalizationPtr(), MEDMEM.FIELD< T, INTERLACING_TAG >.getGaussPresence(), MEDMEM.FIELD< T, INTERLACING_TAG >.getGeometricTypes(), MEDMEM.GMESH.getGroup(), MEDMEM.MEDMEM_Array< ARRAY_ELEMENT_TYPE, INTERLACING_POLICY, CHECKING_POLICY >.getIJ(), MEDMEM.FIELD_.getName(), MEDMEM.FIELD< T, INTERLACING_TAG >.getNbGaussI(), MEDMEM.FIELD_.getNumberOfComponents(), MEDMEM.FIELD< T, INTERLACING_TAG >.getNumberOfElements(), MEDMEM.FIELD< T, INTERLACING_TAG >.getNumberOfGaussPoints(), MEDMEM.FIELD< T, INTERLACING_TAG >.getNumberOfGeometricTypes(), MEDMEM.FIELD_.getNumberOfValues(), MEDMEM.FIELD< T, INTERLACING_TAG >.getRow(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValue(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValueIJ(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValueIJK(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValueLength(), MEDMEM.FIELD< T, INTERLACING_TAG >.getValueOnElement(), MEDMEM.FIELD< T, INTERLACING_TAG >.isOnAllElements(), MED_EN.MED_FACE, MED_EN.MED_QUAD4, MED_EN.MED_TRIA3, MED_EN.MED_TRIA6, MED_EN.MED_UNDEFINED_INTERLACE, MED_EN.MED_UNDEFINED_TYPE, MEDMEMTest_createTestMesh(), MEDMEM.FIELD< T, INTERLACING_TAG >.norm2(), MEDMEM.FIELD< T, INTERLACING_TAG >.normL1(), MEDMEM.FIELD< T, INTERLACING_TAG >.normL2(), MEDMEM.FIELD< T, INTERLACING_TAG >.normMax(), plus13(), proj2d(), MEDMEM.RCBASE.removeReference(), MEDMEM.FIELD< T, INTERLACING_TAG >.setArray(), MEDMEM.FIELD< T, INTERLACING_TAG >.setColumn(), MEDMEM.FIELD_.setDescription(), MEDMEM.FIELD< T, INTERLACING_TAG >.setGaussLocalization(), MEDMEM.MEDMEM_Array< ARRAY_ELEMENT_TYPE, INTERLACING_POLICY, CHECKING_POLICY >.setIJ(), MEDMEM.MEDMEM_Array< ARRAY_ELEMENT_TYPE, INTERLACING_POLICY, CHECKING_POLICY >.setIJK(), MEDMEM.FIELD_.setMEDComponentUnit(), MEDMEM.SUPPORT.setMesh(), MEDMEM.FIELD_.setName(), MEDMEM.FIELD< T, INTERLACING_TAG >.setRow(), MEDMEM.FIELD< T, INTERLACING_TAG >.setValueIJ(), testDrivers(), and MEDMEM.MEDEXCEPTION.what().
References MEDMEMTest_testField().