Salome HOME
Merge from V6_main 11/02/2013
[modules/med.git] / src / MEDCoupling / MEDCouplingFieldDiscretization.hxx
1 // Copyright (C) 2007-2012  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 *clone() const = 0;
56     virtual MEDCouplingFieldDiscretization *clonePart(const int *startCellIds, const int *endCellIds) const;
57     virtual std::string getStringRepr() const = 0;
58     virtual const char *getRepr() const = 0;
59     virtual int getNumberOfTuples(const MEDCouplingMesh *mesh) const = 0;
60     virtual int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const = 0;
61     virtual DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const = 0;
62     virtual void normL1(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const throw(INTERP_KERNEL::Exception);
63     virtual void normL2(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, double *res) const throw(INTERP_KERNEL::Exception);
64     virtual void integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs, double *res) const throw(INTERP_KERNEL::Exception);
65     virtual DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const = 0;
66     virtual void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
67                                                     DataArrayInt *&cellRest) = 0;
68     virtual void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception) = 0;
69     virtual void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception);
70     virtual void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
71                                        const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception) = 0;
72     virtual double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
73     virtual void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception) = 0;
74     virtual MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const = 0;
75     virtual void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const = 0;
76     virtual void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const = 0;
77     virtual DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const = 0;
78     virtual DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const = 0;
79     virtual MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const = 0;
80     virtual void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const = 0;
81     virtual void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const = 0;
82     virtual void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const = 0;
83     virtual void getSerializationIntArray(DataArrayInt *& arr) const;
84     virtual void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
85     virtual void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
86     virtual void finishUnserialization(const std::vector<double>& tinyInfo);
87     virtual void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *& arr);
88     virtual void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
89                                             const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
90     virtual void setGaussLocalizationOnCells(const MEDCouplingMesh *m, const int *begin, const int *end, const std::vector<double>& refCoo,
91                                              const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
92     virtual void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
93     virtual MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
94     virtual int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
95     virtual int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
96     virtual int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
97     virtual std::set<int> getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
98     virtual void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
99     virtual const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
100     virtual ~MEDCouplingFieldDiscretization();
101   protected:
102     MEDCouplingFieldDiscretization();
103     static void RenumberEntitiesFromO2NArr(double epsOnVals, const int *old2NewPtr, int newNbOfEntity, DataArrayDouble *arr, const char *msg);
104     static void RenumberEntitiesFromN2OArr(const int *new2OldPtr, int new2OldSz, DataArrayDouble *arr, const char *msg);
105   protected:
106     double _precision;
107     static const double DFLT_PRECISION;
108   };
109
110   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP0 : public MEDCouplingFieldDiscretization
111   {
112   public:
113     TypeOfField getEnum() const;
114     MEDCouplingFieldDiscretization *clone() const;
115     std::string getStringRepr() const;
116     const char *getRepr() const;
117     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
118     int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
119     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
120     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
121     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
122                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
123     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
124     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
125     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
126                                             DataArrayInt *&cellRest);
127     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
128     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
129     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
130     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
131     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
132     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
133     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
134     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
135     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
136     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
137   public:
138     static const char REPR[];
139     static const TypeOfField TYPE;
140   };
141
142   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationOnNodes : public MEDCouplingFieldDiscretization
143   {
144   public:
145     int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
146     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
147     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
148     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
149                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
150     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
151     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
152                                             DataArrayInt *&cellRest);
153     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
154     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
155     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
156     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
157     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
158     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
159   public:
160     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
161   };
162
163   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP1 : public MEDCouplingFieldDiscretizationOnNodes
164   {
165   public:
166     TypeOfField getEnum() const;
167     MEDCouplingFieldDiscretization *clone() const;
168     std::string getStringRepr() const;
169     const char *getRepr() const;
170     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
171     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
172     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
173     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
174     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
175   public:
176     static const char REPR[];
177     static const TypeOfField TYPE;
178   protected:
179     void getValueInCell(const MEDCouplingMesh *mesh, int cellId, const DataArrayDouble *arr, const double *loc, double *res) const;
180   };
181
182   /*!
183    * This class abstracts MEDCouplingFieldDiscretization that needs an information on each cell to perform their job.
184    * All classes that inherits from this are more linked to mesh.
185    */
186   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
187   {
188   public:
189     const DataArrayInt *getArrayOfDiscIds() const;
190   protected:
191     MEDCouplingFieldDiscretizationPerCell();
192     MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, const int *startCellIds, const int *endCellIds);
193     ~MEDCouplingFieldDiscretizationPerCell();
194     void updateTime() const;
195     std::size_t getHeapMemorySize() const;
196     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
197     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
198     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
199     void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
200     void checkNoOrphanCells() const throw(INTERP_KERNEL::Exception);
201   protected:
202     void buildDiscrPerCellIfNecessary(const MEDCouplingMesh *m);
203   protected:
204     DataArrayInt *_discr_per_cell;
205     static const int DFT_INVALID_LOCID_VALUE;
206   };
207
208   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGauss : public MEDCouplingFieldDiscretizationPerCell
209   {
210   public:
211     MEDCouplingFieldDiscretizationGauss();
212     TypeOfField getEnum() const;
213     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
214     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
215     MEDCouplingFieldDiscretization *clone() const;
216     MEDCouplingFieldDiscretization *clonePart(const int *startCellIds, const int *endCellIds) const;
217     std::string getStringRepr() const;
218     const char *getRepr() const;
219     std::size_t getHeapMemorySize() const;
220     int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
221     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
222     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
223     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
224                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
225     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
226     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
227                                             DataArrayInt *&cellRest);
228     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
229     void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
230     void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
231     void finishUnserialization(const std::vector<double>& tinyInfo);
232     void getSerializationIntArray(DataArrayInt *& arr) const;
233     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *& arr);
234     double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
235     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
236     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
237     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
238     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
239     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
240     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
241     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
242     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
243     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
244     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
245     void setGaussLocalizationOnType(const MEDCouplingMesh *m, INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
246                                     const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
247     void setGaussLocalizationOnCells(const MEDCouplingMesh *m, const int *begin, const int *end, const std::vector<double>& refCoo,
248                                      const std::vector<double>& gsCoo, const std::vector<double>& wg) throw(INTERP_KERNEL::Exception);
249     void clearGaussLocalizations() throw(INTERP_KERNEL::Exception);
250     MEDCouplingGaussLocalization& getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception);
251     int getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception);
252     int getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception);
253     int getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
254     std::set<int> getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
255     void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
256     const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
257     std::vector<DataArrayInt *> splitIntoSingleGaussDicrPerCellType(std::vector< int >& locIds) const throw(INTERP_KERNEL::Exception);
258     DataArrayInt *buildNbOfGaussPointPerCellField() const throw(INTERP_KERNEL::Exception);
259   protected:
260     MEDCouplingFieldDiscretizationGauss(const MEDCouplingFieldDiscretizationGauss& other, const int *startCellIds=0, const int *endCellIds=0);
261     void zipGaussLocalizations();
262     int getOffsetOfCell(int cellId) const throw(INTERP_KERNEL::Exception);
263     void checkLocalizationId(int locId) const throw(INTERP_KERNEL::Exception);
264   public:
265     static const char REPR[];
266     static const TypeOfField TYPE;
267   private:
268     std::vector<MEDCouplingGaussLocalization> _loc;
269   };
270
271   /*!
272    * Gauss with points of values located on nodes of element. This is a specialization of MEDCouplingFieldDiscretizationGauss.
273    */
274   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGaussNE : public MEDCouplingFieldDiscretization
275   {
276   public:
277     MEDCouplingFieldDiscretizationGaussNE();
278     TypeOfField getEnum() const;
279     MEDCouplingFieldDiscretization *clone() const;
280     std::string getStringRepr() const;
281     const char *getRepr() const;
282     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
283     int getNumberOfTuples(const MEDCouplingMesh *mesh) const;
284     int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
285     DataArrayInt *getOffsetArr(const MEDCouplingMesh *mesh) const;
286     void renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
287                                const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
288     DataArrayDouble *getLocalizationOfDiscValues(const MEDCouplingMesh *mesh) const;
289     void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
290                                             DataArrayInt *&cellRest);
291     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
292     double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
293     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
294     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
295     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
296     void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
297     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
298     MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
299     DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
300     void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
301     void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
302     void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
303   protected:
304     MEDCouplingFieldDiscretizationGaussNE(const MEDCouplingFieldDiscretizationGaussNE& other);
305   public:
306     static const char REPR[];
307     static const TypeOfField TYPE;
308   };
309
310   class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
311   {
312   public:
313     TypeOfField getEnum() const;
314     const char *getRepr() const;
315     MEDCouplingFieldDiscretization *clone() const;
316     std::string getStringRepr() const;
317     void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
318     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
319     MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
320     void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
321     DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
322   public://specific part
323     DataArrayDouble *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, int& isDrift) const;
324   protected:
325     void operateOnDenseMatrix(int spaceDimension, int nbOfElems, double *matrixPtr) const;
326     DataArrayDouble *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr, int& delta) const;
327   public:
328     static const char REPR[];
329     static const TypeOfField TYPE;
330   };
331 }
332
333 #endif