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_MEDCOUPLINGGAUSSLOCALIZATION_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGGAUSSLOCALIZATION_HXX__
00022
00023 #include "MEDCoupling.hxx"
00024 #include "NormalizedUnstructuredMesh.hxx"
00025 #include "InterpKernelException.hxx"
00026
00027 #include <vector>
00028
00029 namespace ParaMEDMEM
00030 {
00031 class MEDCouplingMesh;
00032
00033 class MEDCOUPLING_EXPORT MEDCouplingGaussLocalization
00034 {
00035 public:
00036 MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
00037 const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
00038 INTERP_KERNEL::NormalizedCellType getType() const { return _type; }
00039 int getNumberOfGaussPt() const { return _weight.size(); }
00040 int getDimension() const;
00041 int getNumberOfPtsInRefCell() const;
00042 void checkCoherency() const throw(INTERP_KERNEL::Exception);
00043 bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
00044 void pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const;
00045 void pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const;
00046 const double *fillWithValues(const double *vals);
00047
00048 const std::vector<double>& getRefCoords() const { return _ref_coord; }
00049 double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00050 const std::vector<double>& getGaussCoords() const { return _gauss_coord; }
00051 double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00052 const std::vector<double>& getWeights() const { return _weight; }
00053 double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
00054 void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00055 void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00056 void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
00057
00058 static MEDCouplingGaussLocalization BuildNewInstanceFromTinyInfo(int dim, const std::vector<int>& tinyData);
00059 static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
00060 private:
00061 int checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00062 private:
00063 INTERP_KERNEL::NormalizedCellType _type;
00064 std::vector<double> _ref_coord;
00065 std::vector<double> _gauss_coord;
00066 std::vector<double> _weight;
00067 };
00068 }
00069
00070 #endif