Salome HOME
Merge from V6_main 01/04/2013
[modules/med.git] / src / MEDCoupling / MEDCouplingFieldDiscretization.hxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __PARAMEDMEM_MEDCOUPLINGFIELDDISCRETIZATION_HXX__
22 #define __PARAMEDMEM_MEDCOUPLINGFIELDDISCRETIZATION_HXX__
23
24 #include "MEDCoupling.hxx"
25 #include "MEDCouplingRefCountObject.hxx"
26 #include "InterpKernelException.hxx"
27 #include "MEDCouplingTimeLabel.hxx"
28 #include "MEDCouplingNatureOfField.hxx"
29 #include "MEDCouplingGaussLocalization.hxx"
30 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
31
32 #include <set>
33 #include <vector>
34
35 namespace ParaMEDMEM
36 {
37   class DataArrayInt;
38   class MEDCouplingMesh;
39   class DataArrayDouble;
40   class MEDCouplingFieldDouble;
41
42   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization : public RefCountObject, public TimeLabel
43   {
44   public:
45     static MEDCouplingFieldDiscretization *New(TypeOfField type);
46     double getPrecision() const { return _precision; }
47     void setPrecision(double val) { _precision=val; }
48     void updateTime() const;
49     std::size_t getHeapMemorySize() const;
50     static TypeOfField GetTypeOfFieldFromStringRepr(const char *repr) throw(INTERP_KERNEL::Exception);
51     virtual TypeOfField getEnum() const = 0;
52     virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
53     virtual bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const = 0;
54     virtual bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
55     virtual MEDCouplingFieldDiscretization *deepCpy() const;
56     virtual MEDCouplingFieldDiscretization *clone() const = 0;
57     virtual MEDCouplingFieldDiscretization *clonePart(const int *startCellIds, const int *endCellIds) const;
58     virtual std::string getStringRepr() const = 0;
59     virtual const char *getRepr() const = 0;
60     virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception) = 0;
61     virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const = 0;
62     virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const = 0;
63     virtual void normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const throw(INTERP_KERNEL::Exception);
64     virtual void normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const throw(INTERP_KERNEL::Exception);
65     virtual void integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs, double *res) const throw(INTERP_KERNEL::Exception);
66     virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const = 0;
67     virtual void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
68                                                     DataArrayInt *&cellRestriction, DataArrayInt *&trueTupleRestriction) const throw(INTERP_KERNEL::Exception) = 0;
69     virtual void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception) = 0;
70     virtual void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception);
71     virtual void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
72                                        const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception) = 0;
73     virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
74     virtual void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception) = 0;
75     virtual MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const = 0;
76     virtual void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const = 0;
77     virtual void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const = 0;
78     virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const = 0;
79     virtual DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const = 0;
80     virtual MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const = 0;
81     virtual void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const = 0;
82     virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const = 0;
83     virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const = 0;
84     virtual void getSerializationIntArray(DataArrayInt *& arr) const;
85     virtual void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
86     virtual void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
87     virtual void finishUnserialization(const std::vector<double>& tinyInfo);
88     virtual void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *& arr);
89     virtual void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
90                                             const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
91     virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, const int *begin, const int *end, const std::vector<double>& refCoo,
92                                              const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
93     virtual void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
94     virtual MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
95     virtual int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
96     virtual int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
97     virtual int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
98     virtual std::set<int> getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
99     virtual void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
100     virtual const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
101     virtual ~MEDCouplingFieldDiscretization();
102   protected:
103     MEDCouplingFieldDiscretization();
104     static void RenumberEntitiesFromO2NArr(double epsOnVals, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const char *msg);
105     static void RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg);
106   protected:
107     double _precision;
108     static const double DFLT_PRECISION;
109   };
110
111   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP0 : public MEDCouplingFieldDiscretization
112   {
113   public:
114     TypeOfField getEnum() const;
115     MEDCouplingFieldDiscretization *clone() const;
116     std::string getStringRepr() const;
117     const char *getRepr() const;
118     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
119     int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
120     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
121     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
122     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
123                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
124     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
125     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
126     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
127                                             DataArrayInt *&cellRestriction, DataArrayInt *&trueTupleRestriction) const throw(INTERP_KERNEL::Exception);
128     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
129     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
130     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
131     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
132     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
133     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
134     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
135     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
136     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
137     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
138   public:
139     static const char REPR[];
140     static const TypeOfField TYPE;
141   };
142
143   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationOnNodes : public MEDCouplingFieldDiscretization
144   {
145   public:
146     int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
147     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
148     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
149     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
150                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
151     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
152     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
153                                             DataArrayInt *&cellRestriction, DataArrayInt *&trueTupleRestriction) const throw(INTERP_KERNEL::Exception);
154     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
155     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
156     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
157     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
158     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
159     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
160   public:
161     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
162   };
163
164   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP1 : public MEDCouplingFieldDiscretizationOnNodes
165   {
166   public:
167     TypeOfField getEnum() const;
168     MEDCouplingFieldDiscretization *clone() const;
169     std::string getStringRepr() const;
170     const char *getRepr() const;
171     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
172     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
173     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
174     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
175     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
176   public:
177     static const char REPR[];
178     static const TypeOfField TYPE;
179   protected:
180     void getValueInCell(const MEDCouplingMesh *mesh, int cellId, const DataArrayDouble *arr, const double *loc, double *res) const;
181   };
182
183   /*!
184    * This class abstracts MEDCouplingFieldDiscretization that needs an information on each cell to perform their job.
185    * All classes that inherits from this are more linked to mesh.
186    */
187   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
188   {
189   public:
190     const DataArrayInt *getArrayOfDiscIds() const;
191     void checkNoOrphanCells() const throw(INTERP_KERNEL::Exception);
192     std::vector<DataArrayInt *> splitIntoSingleGaussDicrPerCellType(std::vector< int >& locIds) const throw(INTERP_KERNEL::Exception);
193   protected:
194     MEDCouplingFieldDiscretizationPerCell();
195     MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, const int *startCellIds, const int *endCellIds);
196     ~MEDCouplingFieldDiscretizationPerCell();
197     void updateTime() const;
198     std::size_t getHeapMemorySize() const;
199     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
200     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
201     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
202     void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
203   protected:
204     void buildDiscrPerCellIfNecessary(const MEDCouplingMesh *m);
205   protected:
206     DataArrayInt *_discr_per_cell;
207     static const int DFT_INVALID_LOCID_VALUE;
208   };
209
210   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGauss : public MEDCouplingFieldDiscretizationPerCell
211   {
212   public:
213     MEDCouplingFieldDiscretizationGauss();
214     TypeOfField getEnum() const;
215     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
216     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
217     MEDCouplingFieldDiscretization *clone() const;
218     MEDCouplingFieldDiscretization *clonePart(const int *startCellIds, const int *endCellIds) const;
219     std::string getStringRepr() const;
220     const char *getRepr() const;
221     std::size_t getHeapMemorySize() const;
222     int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
223     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
224     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
225     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
226                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
227     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
228     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
229                                             DataArrayInt *&cellRestriction, DataArrayInt *&trueTupleRestriction) const throw(INTERP_KERNEL::Exception);
230     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
231     void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
232     void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
233     void finishUnserialization(const std::vector<double>& tinyInfo);
234     void getSerializationIntArray(DataArrayInt *& arr) const;
235     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *& arr);
236     double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
237     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
238     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
239     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
240     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
241     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
242     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
243     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
244     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
245     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
246     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
247     void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
248                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
249     void setGaussLocalizationOnCells(const MEDCouplingMesh *m, const int *begin, const int *end, const std::vector<double>& refCoo,
250                                      const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
251     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
252     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
253     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
254     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
255     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
256     std::set<int> getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
257     void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
258     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
259     DataArrayInt *buildNbOfGaussPointPerCellField() const throw(INTERP_KERNEL::Exception);
260   protected:
261     MEDCouplingFieldDiscretizationGauss(const MEDCouplingFieldDiscretizationGauss& other, const int *startCellIds=0, const int *endCellIds=0);
262     void zipGaussLocalizations();
263     int getOffsetOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
264     void checkLocalizationId(int locId) const throw(INTERP_KERNEL::Exception);
265   public:
266     static const char REPR[];
267     static const TypeOfField TYPE;
268   private:
269     std::vector<MEDCouplingGaussLocalization> _loc;
270   };
271
272   /*!
273    * Gauss with points of values located on nodes of element. This is a specialization of MEDCouplingFieldDiscretizationGauss.
274    */
275   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGaussNE : public MEDCouplingFieldDiscretization
276   {
277   public:
278     MEDCouplingFieldDiscretizationGaussNE();
279     TypeOfField getEnum() const;
280     MEDCouplingFieldDiscretization *clone() const;
281     std::string getStringRepr() const;
282     const char *getRepr() const;
283     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
284     int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
285     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
286     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
287     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
288                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
289     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
290     void integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs, double *res) const throw(INTERP_KERNEL::Exception);
291     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *tupleIdsBg, const int *tupleIdsEnd,
292                                             DataArrayInt *&cellRestriction, DataArrayInt *&trueTupleRestriction) const throw(INTERP_KERNEL::Exception);
293     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
294     double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
295     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
296     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
297     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
298     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
299     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
300     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
301     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
302     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
303     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
304     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
305     static const double *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType, std::size_t& lgth) throw(INTERP_KERNEL::Exception);
306     static const double *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType, std::size_t& lgth) throw(INTERP_KERNEL::Exception);
307   protected:
308     MEDCouplingFieldDiscretizationGaussNE(const MEDCouplingFieldDiscretizationGaussNE& other);
309   public:
310     static const char REPR[];
311     static const TypeOfField TYPE;
312     static const double FGP_SEG2[2];
313     static const double FGP_SEG3[3];
314     static const double FGP_SEG4[4];
315     static const double FGP_TRI3[3];
316     static const double FGP_TRI6[6];
317     static const double FGP_TRI7[7];
318     static const double FGP_QUAD4[4];
319     //static const double FGP_QUAD8[8];
320     static const double FGP_QUAD9[9];
321     static const double FGP_TETRA4[4];
322     //static const double FGP_TETRA10[10];
323     static const double FGP_PENTA6[6];
324     //static const double FGP_PENTA15[15];
325     static const double FGP_HEXA8[8];
326     static const double FGP_HEXA27[27];
327     static const double FGP_PYRA5[5];
328     //static const double FGP_PYRA13[13];
329     static const double REF_SEG2[2];
330     static const double REF_SEG3[3];
331     static const double REF_SEG4[4];
332     static const double REF_TRI3[6];
333     static const double REF_TRI6[12];
334     static const double REF_TRI7[14];
335     static const double REF_QUAD4[8];
336     static const double REF_QUAD8[16];
337     static const double REF_QUAD9[18];
338     static const double REF_TETRA4[12];
339     static const double REF_TETRA10[30];
340     static const double REF_PENTA6[18];
341     static const double REF_PENTA15[45];
342     static const double REF_HEXA8[24];
343     static const double REF_HEXA20[60];
344     static const double REF_HEXA27[81];
345     static const double REF_PYRA5[15];
346     static const double REF_PYRA13[39];
347   };
348
349   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
350   {
351   public:
352     TypeOfField getEnum() const;
353     const char *getRepr() const;
354     MEDCouplingFieldDiscretization *clone() const;
355     std::string getStringRepr() const;
356     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
357     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
358     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
359     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
360     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
361   public://specific part
362     DataArrayDouble *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, int& isDrift) const;
363   protected:
364     void operateOnDenseMatrix(int spaceDimension, int nbOfElems, double *matrixPtr) const;
365     DataArrayDouble *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr, int& delta) const;
366   public:
367     static const char REPR[];
368     static const TypeOfField TYPE;
369   };
370 }
371
372 #endif