Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PARAMEDMEM_MEDCOUPLINGFIELD_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGFIELD_HXX__
00022
00023 #include "MEDCoupling.hxx"
00024 #include "MEDCouplingTimeLabel.hxx"
00025 #include "MEDCouplingNatureOfField.hxx"
00026 #include "MEDCouplingRefCountObject.hxx"
00027 #include "NormalizedUnstructuredMesh.hxx"
00028 #include "InterpKernelException.hxx"
00029
00030 #include <string>
00031 #include <vector>
00032
00033 namespace ParaMEDMEM
00034 {
00035 class DataArrayInt;
00036 class DataArrayDouble;
00037 class MEDCouplingMesh;
00038 class MEDCouplingFieldDouble;
00039 class MEDCouplingFieldDiscretization;
00040 class MEDCouplingGaussLocalization;
00041
00042 class MEDCOUPLING_EXPORT MEDCouplingField : public RefCountObject, public TimeLabel
00043 {
00044 public:
00045 virtual void checkCoherency() const throw(INTERP_KERNEL::Exception) = 0;
00046 virtual bool areCompatibleForMerge(const MEDCouplingField *other) const;
00047 virtual bool areStrictlyCompatible(const MEDCouplingField *other) const;
00048 virtual bool isEqual(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
00049 virtual bool isEqualWithoutConsideringStr(const MEDCouplingField *other, double meshPrec, double valsPrec) const;
00050 void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh);
00051 const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _mesh; }
00052 void setName(const char *name) { _name=name; }
00053 const char *getDescription() const { return _desc.c_str(); }
00054 void setDescription(const char *desc) { _desc=desc; }
00055 const char *getName() const { return _name.c_str(); }
00056 TypeOfField getTypeOfField() const;
00057 NatureOfField getNature() const { return _nature; }
00058 virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
00059 DataArrayDouble *getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception);
00060 MEDCouplingFieldDouble *buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception);
00061 MEDCouplingMesh *buildSubMeshData(const int *start, const int *end, DataArrayInt *&di) const;
00062 MEDCouplingFieldDiscretization *getDiscretization() const { return _type; }
00063 int getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception);
00064 int getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception);
00065
00066 void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
00067 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
00068 void setGaussLocalizationOnCells(const int *begin, const int *end, const std::vector<double>& refCoo,
00069 const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
00070 void clearGaussLocalizations();
00071 MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
00072 int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
00073 int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
00074 int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
00075 void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
00076 const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
00077 protected:
00078 void updateTime() const;
00079 protected:
00080 MEDCouplingField(TypeOfField type);
00081 MEDCouplingField(const MEDCouplingField& other);
00082 MEDCouplingField(MEDCouplingFieldDiscretization *type, NatureOfField nature=NoNature);
00083 virtual ~MEDCouplingField();
00084 protected:
00085 std::string _name;
00086 std::string _desc;
00087 NatureOfField _nature;
00088 const MEDCouplingMesh *_mesh;
00089 MEDCouplingFieldDiscretization *_type;
00090 };
00091 }
00092
00093 #endif