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