1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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 (EDF R&D)
21 #ifndef __DIAMETERCALCULATOR_HXX__
22 #define __DIAMETERCALCULATOR_HXX__
24 #include "INTERPKERNELDefines.hxx"
26 #include "NormalizedGeometricTypes"
28 namespace INTERP_KERNEL
30 class DiameterCalculator
33 INTERPKERNEL_EXPORT virtual ~DiameterCalculator() { }
34 INTERPKERNEL_EXPORT virtual NormalizedCellType getType() const = 0;
35 INTERPKERNEL_EXPORT virtual double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const = 0;
36 INTERPKERNEL_EXPORT virtual void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
37 INTERPKERNEL_EXPORT virtual void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
38 INTERPKERNEL_EXPORT virtual void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
41 class DiameterCalulatorTRI3S2 : public DiameterCalculator
44 NormalizedCellType getType() const { return TYPE; }
45 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
46 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
47 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
48 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
49 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
51 static NormalizedCellType TYPE;
54 class DiameterCalulatorTRI3S3 : public DiameterCalculator
57 NormalizedCellType getType() const { return TYPE; }
58 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
59 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
60 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
61 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
62 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
64 static NormalizedCellType TYPE;
67 class DiameterCalulatorTRI6S2 : public DiameterCalculator
70 NormalizedCellType getType() const { return TYPE; }
71 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
72 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
73 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
74 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
75 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
77 static NormalizedCellType TYPE;
80 class DiameterCalulatorTRI6S3 : public DiameterCalculator
83 NormalizedCellType getType() const { return TYPE; }
84 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
85 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
86 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
87 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
88 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
90 static NormalizedCellType TYPE;
93 class DiameterCalulatorTRI7S2 : public DiameterCalculator
96 NormalizedCellType getType() const { return TYPE; }
97 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
98 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
99 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
100 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
101 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
103 static NormalizedCellType TYPE;
106 class DiameterCalulatorTRI7S3 : public DiameterCalculator
109 NormalizedCellType getType() const { return TYPE; }
110 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
111 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
112 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
113 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
114 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
116 static NormalizedCellType TYPE;
119 class DiameterCalulatorQUAD4S2 : public DiameterCalculator
122 NormalizedCellType getType() const { return TYPE; }
123 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
124 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
125 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
126 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
127 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
129 static NormalizedCellType TYPE;
132 class DiameterCalulatorQUAD4S3 : public DiameterCalculator
135 NormalizedCellType getType() const { return TYPE; }
136 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
137 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
138 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
139 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
140 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
142 static NormalizedCellType TYPE;
145 class DiameterCalulatorQUAD8S2 : public DiameterCalculator
148 NormalizedCellType getType() const { return TYPE; }
149 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
150 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
151 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
152 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
153 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
155 static NormalizedCellType TYPE;
158 class DiameterCalulatorQUAD8S3 : public DiameterCalculator
161 NormalizedCellType getType() const { return TYPE; }
162 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
163 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
164 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
165 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
166 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
168 static NormalizedCellType TYPE;
171 class DiameterCalulatorQUAD9S2 : public DiameterCalculator
174 NormalizedCellType getType() const { return TYPE; }
175 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
176 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
177 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
178 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
179 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
181 static NormalizedCellType TYPE;
184 class DiameterCalulatorQUAD9S3 : public DiameterCalculator
187 NormalizedCellType getType() const { return TYPE; }
188 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
189 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
190 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
191 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
192 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
194 static NormalizedCellType TYPE;
197 class DiameterCalulatorTETRA4 : public DiameterCalculator
200 NormalizedCellType getType() const { return TYPE; }
201 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
202 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
203 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
204 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
205 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
207 static NormalizedCellType TYPE;
210 class DiameterCalulatorTETRA10 : public DiameterCalculator
213 NormalizedCellType getType() const { return TYPE; }
214 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
215 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
216 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
217 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
218 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
220 static NormalizedCellType TYPE;
223 class DiameterCalulatorHEXA8 : public DiameterCalculator
226 NormalizedCellType getType() const { return TYPE; }
227 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
228 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
229 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
230 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
231 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
233 static NormalizedCellType TYPE;
236 class DiameterCalulatorHEXA20 : public DiameterCalculator
239 NormalizedCellType getType() const { return TYPE; }
240 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
241 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
242 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
243 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
244 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
246 static NormalizedCellType TYPE;
249 class DiameterCalulatorHEXA27 : public DiameterCalculator
252 NormalizedCellType getType() const { return TYPE; }
253 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
254 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
255 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
256 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
257 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
259 static NormalizedCellType TYPE;
262 class DiameterCalulatorPENTA6 : public DiameterCalculator
265 NormalizedCellType getType() const { return TYPE; }
266 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
267 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
268 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
269 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
270 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
272 static NormalizedCellType TYPE;
275 class DiameterCalulatorPENTA15 : public DiameterCalculator
278 NormalizedCellType getType() const { return TYPE; }
279 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
280 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
281 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
282 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
283 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
285 static NormalizedCellType TYPE;
288 class DiameterCalulatorPYRA5 : public DiameterCalculator
291 NormalizedCellType getType() const { return TYPE; }
292 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
293 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
294 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
295 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
296 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
298 static NormalizedCellType TYPE;
301 class DiameterCalulatorPYRA13 : public DiameterCalculator
304 NormalizedCellType getType() const { return TYPE; }
305 double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
306 static double ComputeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr);
307 void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
308 void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
309 void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
311 static NormalizedCellType TYPE;