1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __PARAMEDMEM_MEDCOUPLINGFIELDDISCRETIZATION_HXX__
22 #define __PARAMEDMEM_MEDCOUPLINGFIELDDISCRETIZATION_HXX__
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"
38 class MEDCouplingMesh;
39 class DataArrayDouble;
40 class MEDCouplingFieldDouble;
42 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization : public RefCountObject, public TimeLabel
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();
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);
107 static const double DFLT_PRECISION;
110 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP0 : public MEDCouplingFieldDiscretization
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;
138 static const char REPR[];
139 static const TypeOfField TYPE;
142 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationOnNodes : public MEDCouplingFieldDiscretization
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;
160 void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
163 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationP1 : public MEDCouplingFieldDiscretizationOnNodes
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;
176 static const char REPR[];
177 static const TypeOfField TYPE;
179 void getValueInCell(const MEDCouplingMesh *mesh, int cellId, const DataArrayDouble *arr, const double *loc, double *res) const;
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.
186 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationPerCell : public MEDCouplingFieldDiscretization
189 const DataArrayInt *getArrayOfDiscIds() const;
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);
202 void buildDiscrPerCellIfNecessary(const MEDCouplingMesh *m);
204 DataArrayInt *_discr_per_cell;
205 static const int DFT_INVALID_LOCID_VALUE;
208 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGauss : public MEDCouplingFieldDiscretizationPerCell
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);
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);
265 static const char REPR[];
266 static const TypeOfField TYPE;
268 std::vector<MEDCouplingGaussLocalization> _loc;
272 * Gauss with points of values located on nodes of element. This is a specialization of MEDCouplingFieldDiscretizationGauss.
274 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGaussNE : public MEDCouplingFieldDiscretization
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 integral(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, bool isWAbs, double *res) const throw(INTERP_KERNEL::Exception);
290 void computeMeshRestrictionFromTupleIds(const MEDCouplingMesh *mesh, const int *partBg, const int *partEnd,
291 DataArrayInt *&cellRest);
292 void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
293 double getIJK(const MEDCouplingMesh *mesh, const DataArrayDouble *da, int cellId, int nodeIdInCell, int compoId) const throw(INTERP_KERNEL::Exception);
294 void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception);
295 MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
296 void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
297 void getValueOnPos(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, int i, int j, int k, double *res) const;
298 DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
299 MEDCouplingMesh *buildSubMeshData(const MEDCouplingMesh *mesh, const int *start, const int *end, DataArrayInt *&di) const;
300 DataArrayInt *computeTupleIdsToSelectFromCellIds(const MEDCouplingMesh *mesh, const int *startCellIds, const int *endCellIds) const;
301 void renumberValuesOnNodes(double epsOnVals, const int *old2New, int newNbOfNodes, DataArrayDouble *arr) const;
302 void renumberValuesOnCells(double epsOnVals, const MEDCouplingMesh *mesh, const int *old2New, int newSz, DataArrayDouble *arr) const;
303 void renumberValuesOnCellsR(const MEDCouplingMesh *mesh, const int *new2old, int newSz, DataArrayDouble *arr) const;
304 static const double *GetWeightArrayFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType, std::size_t& lgth) throw(INTERP_KERNEL::Exception);
306 MEDCouplingFieldDiscretizationGaussNE(const MEDCouplingFieldDiscretizationGaussNE& other);
308 static const char REPR[];
309 static const TypeOfField TYPE;
310 static const double FGP_SEG2[2];
311 static const double FGP_SEG3[3];
312 static const double FGP_SEG4[4];
313 static const double FGP_TRI3[3];
314 static const double FGP_TRI6[6];
315 static const double FGP_TRI7[7];
316 static const double FGP_QUAD4[4];
317 //static const double FGP_QUAD8[8];
318 static const double FGP_QUAD9[9];
319 static const double FGP_TETRA4[4];
320 //static const double FGP_TETRA10[10];
321 static const double FGP_PENTA6[6];
322 //static const double FGP_PENTA15[15];
323 static const double FGP_HEXA8[8];
324 static const double FGP_HEXA27[27];
325 static const double FGP_PYRA5[5];
326 //static const double FGP_PYRA13[13];
329 class MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationKriging : public MEDCouplingFieldDiscretizationOnNodes
332 TypeOfField getEnum() const;
333 const char *getRepr() const;
334 MEDCouplingFieldDiscretization *clone() const;
335 std::string getStringRepr() const;
336 void checkCompatibilityWithNature(NatureOfField nat) const throw(INTERP_KERNEL::Exception);
337 bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
338 MEDCouplingFieldDouble *getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const;
339 void getValueOn(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, double *res) const;
340 DataArrayDouble *getValueOnMulti(const DataArrayDouble *arr, const MEDCouplingMesh *mesh, const double *loc, int nbOfPoints) const;
341 public://specific part
342 DataArrayDouble *computeVectorOfCoefficients(const MEDCouplingMesh *mesh, const DataArrayDouble *arr, int& isDrift) const;
344 void operateOnDenseMatrix(int spaceDimension, int nbOfElems, double *matrixPtr) const;
345 DataArrayDouble *performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr, int& delta) const;
347 static const char REPR[];
348 static const TypeOfField TYPE;