1 // Copyright (C) 2007-2019 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"
27 #include "MCIdType.hxx"
29 namespace INTERP_KERNEL
31 class DiameterCalculator
34 INTERPKERNEL_EXPORT virtual ~DiameterCalculator() { }
35 INTERPKERNEL_EXPORT virtual NormalizedCellType getType() const = 0;
36 INTERPKERNEL_EXPORT virtual double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const = 0;
37 INTERPKERNEL_EXPORT virtual void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const = 0;
38 INTERPKERNEL_EXPORT virtual void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const = 0;
39 INTERPKERNEL_EXPORT virtual void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const = 0;
42 class DiameterCalulatorTRI3S2 : public DiameterCalculator
45 NormalizedCellType getType() const { return TYPE; }
46 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
47 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
48 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
49 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
50 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
52 static NormalizedCellType TYPE;
55 class DiameterCalulatorTRI3S3 : public DiameterCalculator
58 NormalizedCellType getType() const { return TYPE; }
59 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
60 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
61 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
62 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
63 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
65 static NormalizedCellType TYPE;
68 class DiameterCalulatorTRI6S2 : public DiameterCalculator
71 NormalizedCellType getType() const { return TYPE; }
72 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
73 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
74 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
75 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
76 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
78 static NormalizedCellType TYPE;
81 class DiameterCalulatorTRI6S3 : public DiameterCalculator
84 NormalizedCellType getType() const { return TYPE; }
85 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
86 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
87 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
88 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
89 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
91 static NormalizedCellType TYPE;
94 class DiameterCalulatorTRI7S2 : public DiameterCalculator
97 NormalizedCellType getType() const { return TYPE; }
98 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
99 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
100 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
101 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
102 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
104 static NormalizedCellType TYPE;
107 class DiameterCalulatorTRI7S3 : public DiameterCalculator
110 NormalizedCellType getType() const { return TYPE; }
111 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
112 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
113 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
114 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
115 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
117 static NormalizedCellType TYPE;
120 class DiameterCalulatorQUAD4S2 : public DiameterCalculator
123 NormalizedCellType getType() const { return TYPE; }
124 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
125 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
126 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
127 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
128 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
130 static NormalizedCellType TYPE;
133 class DiameterCalulatorQUAD4S3 : public DiameterCalculator
136 NormalizedCellType getType() const { return TYPE; }
137 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
138 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
139 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
140 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
141 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
143 static NormalizedCellType TYPE;
146 class DiameterCalulatorQUAD8S2 : public DiameterCalculator
149 NormalizedCellType getType() const { return TYPE; }
150 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
151 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
152 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
153 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
154 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
156 static NormalizedCellType TYPE;
159 class DiameterCalulatorQUAD8S3 : public DiameterCalculator
162 NormalizedCellType getType() const { return TYPE; }
163 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
164 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
165 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
166 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
167 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
169 static NormalizedCellType TYPE;
172 class DiameterCalulatorQUAD9S2 : public DiameterCalculator
175 NormalizedCellType getType() const { return TYPE; }
176 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
177 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
178 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
179 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
180 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
182 static NormalizedCellType TYPE;
185 class DiameterCalulatorQUAD9S3 : public DiameterCalculator
188 NormalizedCellType getType() const { return TYPE; }
189 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
190 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
191 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
192 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
193 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
195 static NormalizedCellType TYPE;
198 class DiameterCalulatorTETRA4 : public DiameterCalculator
201 NormalizedCellType getType() const { return TYPE; }
202 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
203 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
204 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
205 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
206 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
208 static NormalizedCellType TYPE;
211 class DiameterCalulatorTETRA10 : public DiameterCalculator
214 NormalizedCellType getType() const { return TYPE; }
215 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
216 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
217 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
218 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
219 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
221 static NormalizedCellType TYPE;
224 class DiameterCalulatorHEXA8 : public DiameterCalculator
227 NormalizedCellType getType() const { return TYPE; }
228 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
229 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
230 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
231 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
232 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
234 static NormalizedCellType TYPE;
237 class DiameterCalulatorHEXA20 : public DiameterCalculator
240 NormalizedCellType getType() const { return TYPE; }
241 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
242 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
243 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
244 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
245 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
247 static NormalizedCellType TYPE;
250 class DiameterCalulatorHEXA27 : public DiameterCalculator
253 NormalizedCellType getType() const { return TYPE; }
254 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
255 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
256 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
257 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
258 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
260 static NormalizedCellType TYPE;
263 class DiameterCalulatorPENTA6 : public DiameterCalculator
266 NormalizedCellType getType() const { return TYPE; }
267 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
268 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
269 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
270 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
271 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
273 static NormalizedCellType TYPE;
276 class DiameterCalulatorPENTA15 : public DiameterCalculator
279 NormalizedCellType getType() const { return TYPE; }
280 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
281 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
282 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
283 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
284 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
286 static NormalizedCellType TYPE;
289 class DiameterCalulatorPYRA5 : public DiameterCalculator
292 NormalizedCellType getType() const { return TYPE; }
293 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
294 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
295 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
296 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
297 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
299 static NormalizedCellType TYPE;
302 class DiameterCalulatorPYRA13 : public DiameterCalculator
305 NormalizedCellType getType() const { return TYPE; }
306 double computeForOneCell(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr) const { return ComputeForOneCellInternal(bg,endd,coordsPtr); }
307 static double ComputeForOneCellInternal(const mcIdType *bg, const mcIdType *endd, const double *coordsPtr);
308 void computeForListOfCellIdsUMeshFrmt(const mcIdType *bgIds, const mcIdType *endIds, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
309 void computeForRangeOfCellIdsUMeshFrmt(mcIdType bgId, mcIdType endId, const mcIdType *indPtr, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
310 void computeFor1SGTUMeshFrmt(mcIdType nbOfCells, const mcIdType *connPtr, const double *coordsPtr, double *resPtr) const;
312 static NormalizedCellType TYPE;