Salome HOME
Initiating medtool
[modules/med.git] / src / medtool / src / INTERP_KERNEL / DiameterCalculator.hxx
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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 (EDF R&D)
20
21 #ifndef __DIAMETERCALCULATOR_HXX__
22 #define __DIAMETERCALCULATOR_HXX__
23
24 #include "INTERPKERNELDefines.hxx"
25
26 #include "NormalizedGeometricTypes"
27
28 namespace INTERP_KERNEL
29 {
30   class DiameterCalculator
31   {
32   public:
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;
39   };
40
41   class DiameterCalulatorTRI3S2 : public DiameterCalculator
42   {
43   public:
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;
50   public:
51     static NormalizedCellType TYPE;
52   };
53
54   class DiameterCalulatorTRI3S3 : public DiameterCalculator
55   {
56   public:
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;
63   public:
64     static NormalizedCellType TYPE;
65   };
66
67   class DiameterCalulatorTRI6S2 : public DiameterCalculator
68   {
69   public:
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;
76   public:
77     static NormalizedCellType TYPE;
78   };
79
80   class DiameterCalulatorTRI6S3 : public DiameterCalculator
81   {
82   public:
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;
89   public:
90     static NormalizedCellType TYPE;
91   };
92
93   class DiameterCalulatorTRI7S2 : public DiameterCalculator
94   {
95   public:
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;
102   public:
103     static NormalizedCellType TYPE;
104   };
105
106   class DiameterCalulatorTRI7S3 : public DiameterCalculator
107   {
108   public:
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;
115   public:
116     static NormalizedCellType TYPE;
117   };
118
119   class DiameterCalulatorQUAD4S2 : public DiameterCalculator
120   {
121   public:
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;
128   public:
129     static NormalizedCellType TYPE;
130   };
131
132   class DiameterCalulatorQUAD4S3 : public DiameterCalculator
133   {
134   public:
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;
141   public:
142     static NormalizedCellType TYPE;
143   };
144
145   class DiameterCalulatorQUAD8S2 : public DiameterCalculator
146   {
147   public:
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;
154   public:
155     static NormalizedCellType TYPE;
156   };
157
158   class DiameterCalulatorQUAD8S3 : public DiameterCalculator
159   {
160   public:
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;
167   public:
168     static NormalizedCellType TYPE;
169   };
170
171   class DiameterCalulatorQUAD9S2 : public DiameterCalculator
172   {
173   public:
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;
180   public:
181     static NormalizedCellType TYPE;
182   };
183
184   class DiameterCalulatorQUAD9S3 : public DiameterCalculator
185   {
186   public:
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;
193   public:
194     static NormalizedCellType TYPE;
195   };
196
197   class DiameterCalulatorTETRA4 : public DiameterCalculator
198   {
199   public:
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;
206   public:
207     static NormalizedCellType TYPE;
208   };
209
210   class DiameterCalulatorTETRA10 : public DiameterCalculator
211   {
212   public:
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;
219   public:
220     static NormalizedCellType TYPE;
221   };
222
223   class DiameterCalulatorHEXA8 : public DiameterCalculator
224   {
225   public:
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;
232   public:
233     static NormalizedCellType TYPE;
234   };
235
236   class DiameterCalulatorHEXA20 : public DiameterCalculator
237   {
238   public:
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;
245   public:
246     static NormalizedCellType TYPE;
247   };
248
249   class DiameterCalulatorHEXA27 : public DiameterCalculator
250   {
251   public:
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;
258   public:
259     static NormalizedCellType TYPE;
260   };
261
262   class DiameterCalulatorPENTA6 : public DiameterCalculator
263   {
264   public:
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;
271   public:
272     static NormalizedCellType TYPE;
273   };
274
275   class DiameterCalulatorPENTA15 : public DiameterCalculator
276   {
277   public:
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;
284   public:
285     static NormalizedCellType TYPE;
286   };
287
288   class DiameterCalulatorPYRA5 : public DiameterCalculator
289   {
290   public:
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;
297   public:
298     static NormalizedCellType TYPE;
299   };
300
301   class DiameterCalulatorPYRA13 : public DiameterCalculator
302   {
303   public:
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;
310   public:
311     static NormalizedCellType TYPE;
312   };
313 }
314
315 #endif