]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_InterlacingPolicy.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_InterlacingPolicy.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef MEDMEM_INTERLACING_HXX
23 #define MEDMEM_INTERLACING_HXX
24
25 #include <MEDMEM.hxx>
26
27 #include <iostream>
28 #include "MEDMEM_Utilities.hxx"
29
30 #include "MEDMEM_PointerOf.hxx"
31 #include "MEDMEM_define.hxx"
32
33 namespace MEDMEM {
34
35 class MEDMEM_EXPORT InterlacingPolicy {
36 protected:
37   ~InterlacingPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
38 public :
39   InterlacingPolicy(void) : _dim(0), _nbelem(0),
40                             _arraySize(0),
41                             _interlacing(MED_EN::MED_UNDEFINED_INTERLACE),
42                             _gaussPresence(false) {}
43
44   InterlacingPolicy(int nbelem, int dim, int arraySize=0, int interlacing=MED_EN::MED_UNDEFINED_INTERLACE) :
45     _dim(dim),
46     _nbelem(nbelem),
47     _arraySize(arraySize),
48     _interlacing(interlacing),
49     _gaussPresence(false) {}
50
51   // Constructeur par recopie
52   InterlacingPolicy(const InterlacingPolicy & intpol,
53                     bool shallowcopy = true) :_dim(intpol._dim),
54                                               _nbelem(intpol._nbelem),
55                                               _arraySize(intpol._arraySize),
56                                               _interlacing(intpol._interlacing),
57                                               _gaussPresence(intpol._gaussPresence) {}
58
59   InterlacingPolicy & operator=(const InterlacingPolicy & intpol) {
60     if ( this == &intpol ) return *this;
61   const char* LOC = "InterlacingPolicy operator =";
62   BEGIN_OF_MED(LOC);
63
64     _dim           = intpol._dim;
65     _nbelem        = intpol._nbelem; //ne prend pas en compte les points de Gauss
66     _arraySize     = intpol._arraySize;
67     _interlacing   = intpol._interlacing;
68     _gaussPresence = intpol._gaussPresence;
69
70     return *this;
71   }
72
73   inline int getDim()       const { return _dim; }
74   inline int getNbElem()    const { return _nbelem; }
75   inline int getArraySize() const { return _arraySize; }
76   inline MED_EN::medModeSwitch getInterlacingType() const {return _interlacing;}
77   inline bool getGaussPresence() const { return _gaussPresence;}
78   virtual int getNbGauss(int i) const = 0;
79
80   int _dim;
81   int _nbelem;
82   int _arraySize;
83   MED_EN::medModeSwitch _interlacing;
84   bool _gaussPresence;
85 };
86
87
88 class MEDMEM_EXPORT FullInterlaceNoGaussPolicy : public  InterlacingPolicy {
89
90 protected:
91   ~FullInterlaceNoGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
92
93 public :
94   FullInterlaceNoGaussPolicy() : InterlacingPolicy() {}
95   FullInterlaceNoGaussPolicy(int nbelem, int dim) :
96     InterlacingPolicy(nbelem, dim, dim*nbelem,MED_EN::MED_FULL_INTERLACE) {}
97
98   FullInterlaceNoGaussPolicy(const FullInterlaceNoGaussPolicy & policy,
99                                 bool shallowcopie=true)
100     : InterlacingPolicy(policy) {};
101  
102   inline int getIndex(int i,int j) const {
103     return (i-1)*_dim + j-1;
104   }
105
106   inline int getIndex(int i,int j,int k) const {
107     return (i-1)*_dim + j-1;
108   }
109
110   inline int getNbGauss(int i) const { return 1; }
111
112 };
113
114 class MEDMEM_EXPORT NoInterlaceNoGaussPolicy : public InterlacingPolicy {
115
116 protected:
117   ~NoInterlaceNoGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
118
119 public :
120
121   NoInterlaceNoGaussPolicy():InterlacingPolicy() {}
122   NoInterlaceNoGaussPolicy(int nbelem, int dim) : 
123     InterlacingPolicy(nbelem, dim, dim*nbelem,MED_EN::MED_NO_INTERLACE) {}
124
125   NoInterlaceNoGaussPolicy(const NoInterlaceNoGaussPolicy & policy,
126                               bool shallowcopie=true)
127     : InterlacingPolicy(policy) {}
128
129   inline int getIndex(int i,int j) const {
130     return (j-1)*_nbelem + i-1;
131   }
132
133   inline int getIndex(int i,int j,int k) const {
134     return (j-1)*_nbelem + i-1;
135   }
136
137   inline int getNbGauss(int i) const { return 1; }
138
139 };
140
141 class MEDMEM_EXPORT NoInterlaceByTypeNoGaussPolicy : public InterlacingPolicy {
142
143 protected:
144   ~NoInterlaceByTypeNoGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
145
146   PointerOf<int> _T; //!< type of element
147   PointerOf<int> _G; //!< where type begin
148   int _nbtypegeo;
149   PointerOf<int> _nbelegeoc;
150
151 public :
152
153   NoInterlaceByTypeNoGaussPolicy():InterlacingPolicy(),_nbtypegeo(-1)
154   {
155   }
156
157   NoInterlaceByTypeNoGaussPolicy(int nbelem, int dim):InterlacingPolicy()
158   {
159     // constructor is incoorect for this type of interlace
160     throw MEDEXCEPTION(LOCALIZED("Wrong constructor of NoInterlaceByTypeNoGaussPolicy "));
161   }
162
163   NoInterlaceByTypeNoGaussPolicy(int nbelem, int dim, int nbtypegeo,
164                                  const int * const nbelgeoc) : 
165     InterlacingPolicy(nbelem, dim, dim*nbelem,MED_EN::MED_NO_INTERLACE_BY_TYPE),
166     _nbtypegeo(nbtypegeo)
167   {
168     _nbelegeoc.set(_nbtypegeo+1,nbelgeoc);
169     _G.set(nbtypegeo+1);
170     _T.set(nbelem+1);
171     int elemno = 1;
172     int cumul = 0;
173
174     for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
175       int nbelcurtype = nbelgeoc[ntyp]-nbelgeoc[ntyp-1];
176       for (int i=0; i < nbelcurtype; i++ ) {
177         _T[ elemno ] = ntyp;
178         elemno++;
179       };
180       _G[ ntyp ] = cumul;
181       cumul += nbelcurtype*_dim;
182 #ifdef ARRAY_DEBUG
183       std::cout << "Valeur de cumul " << cumul << std::endl;
184 #endif
185     };
186
187     _arraySize = cumul;
188
189 #ifdef ARRAY_DEBUG
190     for (int i =0; i< nbelem+1; i++ )
191       std::cout << "Valeur de _T["<<i<<"] = "<<_T[i] << std::endl;
192 #endif
193   }
194
195   NoInterlaceByTypeNoGaussPolicy(const NoInterlaceByTypeNoGaussPolicy & policy,
196                                  bool shallowcopie=true)
197     : InterlacingPolicy(policy),_nbtypegeo(policy._nbtypegeo)
198   {
199     //Seuls les tableaux de grande taille sont recopiés superficiellement
200     if(shallowcopie)
201     {
202       this->_G.set(policy._G);
203       this->_T.set(policy._T);
204     }
205     else
206     {
207       this->_G.set(_nbtypegeo+1,policy._G);
208       this->_T.set(_nbelem+1,policy._T);
209     }
210     
211     // Tableaux toujours recopiés par recopie profonde
212     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
213   }
214
215   NoInterlaceByTypeNoGaussPolicy & operator=(const NoInterlaceByTypeNoGaussPolicy & policy) {
216     if ( this == &policy) return *this;
217
218   const char* LOC = "NoInterlaceNoGaussPolicy operator =";
219   BEGIN_OF_MED(LOC);
220     InterlacingPolicy::operator=(policy);
221     this->_G.set(policy._G);
222     this->_T.set(policy._T);
223
224     // Tableaux toujours recopiés par recopie profonde
225     this->_nbtypegeo=policy._nbtypegeo;
226     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
227
228     return *this;
229   }
230   inline int getIndex(int t) const {
231     return _G[t];
232   }
233
234   inline int getIndex(int i,int j) const {
235     int t = _T[i];
236     return getIndexByType( i-(_nbelegeoc[t-1]-_nbelegeoc[0]), j, t );
237   }
238
239   inline int getIndex(int i,int j,int k) const {
240     return getIndex(i,j);
241   }
242
243   inline int getIndexByType(int i,int j,int t) const {
244     return _G[t] + i-1 + (j-1)*(_nbelegeoc[t]-_nbelegeoc[t-1]);
245   }
246
247   inline int getIndexByType(int i,int j,int k,int t) const {
248     return getIndexByType( i, j, t );
249   }
250
251   inline int getLengthOfType(int t) const {
252     return (_nbelegeoc[t]-_nbelegeoc[t-1]) * _dim;
253   }
254
255   inline int getNbGauss(int i) const { return 1; }
256
257   inline int getNbGeoType() const {return _nbtypegeo;}
258
259   inline const int * const getNbElemGeoC() const {return _nbelegeoc;}
260
261 };
262
263 class MEDMEM_EXPORT FullInterlaceGaussPolicy : public InterlacingPolicy {
264 protected:
265   ~FullInterlaceGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
266 public :
267
268   PointerOf<int> _G;
269   PointerOf<int> _S;
270   int _nbtypegeo;
271   PointerOf<int> _nbelegeoc;
272   PointerOf<int> _nbgaussgeo;
273
274   FullInterlaceGaussPolicy():InterlacingPolicy(),_nbtypegeo(-1) {
275     InterlacingPolicy::_gaussPresence=true;
276   }
277   FullInterlaceGaussPolicy(int nbelem, int dim, int nbtypegeo,
278                   const int * const nbelgeoc, const int * const nbgaussgeo)
279     : InterlacingPolicy(nbelem, dim, -1, MED_EN::MED_FULL_INTERLACE),_nbtypegeo(nbtypegeo) {
280
281     InterlacingPolicy::_gaussPresence=true;
282
283     _nbelegeoc.set(_nbtypegeo+1,nbelgeoc);
284     _nbgaussgeo.set(_nbtypegeo+1,nbgaussgeo);
285     _G.set(nbelem+1);
286     // _G[0]       = 1;
287     _S.set(nbelem+1);
288     _S[0]       = -1;
289     int cumul   = 0;
290     int elemno  = 0;
291
292     // Construction of _G
293     for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
294       for (int  i=0; i < (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) ; i++ ) {
295         _G[ elemno ] = cumul + i*nbgaussgeo[ntyp]*dim + 1;
296         elemno++;
297         _S[ elemno ] = nbgaussgeo[ntyp];
298       };
299       cumul += (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) * nbgaussgeo[ntyp] * dim;
300 #ifdef ARRAY_DEBUG
301       std::cout << "Valeur de cumul " << cumul << std::endl;
302 #endif
303     };
304
305     _G[ elemno ] = cumul+1;
306     _arraySize   = _G[ elemno ] -1 ;
307
308 #ifdef ARRAY_DEBUG
309     for (int i =0; i< nbelem+1; i++ )
310       std::cout << "Valeur de _G["<<i<<"] = "<<_G[i] << std::endl;
311 #endif
312   }
313
314   FullInterlaceGaussPolicy(const FullInterlaceGaussPolicy & policy,
315                               bool shallowcopie=true)
316     : InterlacingPolicy(policy),_nbtypegeo(policy._nbtypegeo) {
317
318     //Seuls les tableaux de grande taille sont recopiés superficiellement
319     if(shallowcopie) {
320       this->_G.set(policy._G);
321       this->_S.set(policy._S);
322     } else {
323       this->_G.set(_nbelem+1,policy._G);
324       this->_S.set(_nbelem+1,policy._S);
325     }
326     // Tableaux toujours recopiés par recopie profonde
327     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
328     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
329   }
330
331   FullInterlaceGaussPolicy & operator=(const FullInterlaceGaussPolicy & policy) {
332   const char* LOC = "FullInterlaceGaussPolicy operator =";
333   BEGIN_OF_MED(LOC);
334
335     if ( this == &policy) return *this;
336
337     //Seuls les tableaux de grande taille sont recopiés superficiellement
338     InterlacingPolicy::operator=(policy);
339     this->_G.set(policy._G);
340     this->_S.set(policy._S);
341
342     // Tableaux toujours recopiés par recopie profonde
343     this->_nbtypegeo=policy._nbtypegeo;
344     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
345     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
346
347     return *this;
348   }
349
350   inline int getIndex(int i,int j ) const {
351     return _G[i-1]-1 + (j-1);
352   }
353
354   inline int getIndex(int i,int j, int k ) const {
355     //std::cout << "Index : " << _G[i-1]-1 + _dim *(k-1) + (j-1) << std::endl;
356     return _G[i-1]-1 +  (k-1)*_dim + (j-1);
357   }
358
359   inline int getNbGauss(int i) const { return _S[i]; }
360
361   inline int getNbGeoType() const {return _nbtypegeo;}
362
363   inline const int * const getNbElemGeoC() const {return _nbelegeoc;}
364
365   inline const int * const getNbGaussGeo() const {return _nbgaussgeo;}
366
367
368 };
369
370 class MEDMEM_EXPORT NoInterlaceGaussPolicy : public InterlacingPolicy {
371
372 protected:
373   ~NoInterlaceGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
374
375 public :
376
377   PointerOf<int> _G;
378   PointerOf<int> _S;
379   int _nbtypegeo;
380   PointerOf<int> _nbelegeoc;
381   PointerOf<int> _nbgaussgeo;
382   // _cumul is used in getIndex() to access directly to the first value
383   // of a given dimension.
384   int _cumul;
385
386   NoInterlaceGaussPolicy():InterlacingPolicy(),_nbtypegeo(-1),_cumul(0) {
387     InterlacingPolicy::_gaussPresence=true;
388   }
389
390   NoInterlaceGaussPolicy(int nbelem, int dim, int nbtypegeo,
391                          const int * const nbelgeoc, const int * const nbgaussgeo)
392     : InterlacingPolicy(nbelem, dim, -1, MED_EN::MED_NO_INTERLACE),_nbtypegeo(nbtypegeo) {
393
394     InterlacingPolicy::_gaussPresence=true;
395
396     _nbelegeoc.set(_nbtypegeo+1,nbelgeoc);
397     _nbgaussgeo.set(_nbtypegeo+1,nbgaussgeo);
398     _G.set(nbelem+1);
399     //_G[0]       = 1;
400     _S.set(nbelem+1);
401     _S[0] = -1;
402     int elemno = 0;
403
404     _cumul = 0;
405     for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
406       for (int  i=0; i < (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) ; i++ ) {
407         _G[ elemno ] = _cumul + i*nbgaussgeo[ntyp] + 1;
408         elemno++;
409         _S[ elemno ] = nbgaussgeo[ntyp];
410       };
411       _cumul += (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) * nbgaussgeo[ntyp];
412 #ifdef ARRAY_DEBUG
413       std::cout << "Valeur de _cumul " << _cumul << std::endl;
414 #endif
415     };
416
417     _G[ elemno ] = _cumul+1;
418     _arraySize   = ( _G[ elemno ] -1 ) * dim ;
419
420 #ifdef ARRAY_DEBUG
421     for (int i =0; i< nbelem+1; i++ )
422       std::cout << "Valeur de _G["<<i<<"] = "<<_G[i] << std::endl;
423 #endif
424   }
425
426
427   NoInterlaceGaussPolicy(const NoInterlaceGaussPolicy & policy,
428                             bool shallowcopie=true)
429     : InterlacingPolicy(policy),_nbtypegeo(policy._nbtypegeo),_cumul(policy._cumul)
430   {
431     //Seuls les tableaux de grande taille sont recopiés superficiellement
432     if(shallowcopie) {
433       this->_G.set(policy._G);
434       this->_S.set(policy._S);
435     } else {
436       this->_G.set(_nbelem+1,policy._G);
437       this->_S.set(_nbelem+1,policy._S);
438     }
439     // Tableaux toujours recopiés par recopie profonde
440     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
441     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
442   }
443
444   NoInterlaceGaussPolicy & operator=(const NoInterlaceGaussPolicy & policy) {
445     if ( this == &policy) return *this;
446
447   const char* LOC = "NoInterlaceGaussPolicy operator =";
448   BEGIN_OF_MED(LOC);
449     InterlacingPolicy::operator=(policy);
450     this->_G.set(policy._G);
451     this->_S.set(policy._S);
452
453     this->_cumul = policy._cumul;
454
455     // Tableaux toujours recopiés par recopie profonde
456     this->_nbtypegeo=policy._nbtypegeo;
457     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
458     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
459
460     return *this;
461   }
462
463   inline int getIndex(int i,int j ) const {
464     return _G[i-1]-1 + (j-1)*_cumul ;
465   }
466
467   inline int getIndex(int i,int j, int k ) const {
468     return _G[i-1]-1 + (j-1)*_cumul + (k-1) ;
469   }
470
471   inline int getNbGauss(int i) const { return _S[i]; }
472
473   inline int getNbGeoType() const {return _nbtypegeo;}
474
475   inline const int * const getNbElemGeoC() const {return _nbelegeoc;}
476
477   inline const int * const getNbGaussGeo() const {return _nbgaussgeo;}
478
479 };
480
481 class MEDMEM_EXPORT NoInterlaceByTypeGaussPolicy : public InterlacingPolicy {
482
483 protected:
484   ~NoInterlaceByTypeGaussPolicy() {} //pour éviter qu'un utilisateur cast la class array en politique
485
486   PointerOf<int> _T; //!< type of element
487   PointerOf<int> _G; //!< where type begin
488   int _nbtypegeo;
489   PointerOf<int> _nbelegeoc;
490   PointerOf<int> _nbgaussgeo;
491
492 public :
493
494   NoInterlaceByTypeGaussPolicy():InterlacingPolicy(),_nbtypegeo(-1) {
495     InterlacingPolicy::_gaussPresence=true;
496   }
497
498   NoInterlaceByTypeGaussPolicy(int nbelem, int dim, int nbtypegeo,
499                                const int * const nbelgeoc, const int * const nbgaussgeo)
500     : InterlacingPolicy(nbelem, dim, -1, MED_EN::MED_NO_INTERLACE_BY_TYPE),_nbtypegeo(nbtypegeo) {
501
502     InterlacingPolicy::_gaussPresence=true;
503
504     _nbelegeoc.set(_nbtypegeo+1,nbelgeoc);
505     _nbgaussgeo.set(_nbtypegeo+1,nbgaussgeo);
506     _G.set(_nbtypegeo+1);
507     _T.set(nbelem+1);
508     int elemno = 1;
509     int cumul = 0;
510
511     for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
512       int nbelcurtype = nbelgeoc[ntyp]-nbelgeoc[ntyp-1];
513       for (int i=0; i < nbelcurtype; i++ ) {
514         _T[ elemno ] = ntyp;
515         elemno++;
516       };
517       _G[ ntyp ] = cumul;
518       cumul += nbelcurtype * _dim * nbgaussgeo[ntyp];
519 #ifdef ARRAY_DEBUG
520       std::cout << "Valeur de cumul " << cumul << std::endl;
521 #endif
522     };
523
524     _arraySize = cumul;
525
526 #ifdef ARRAY_DEBUG
527     for (int i =0; i< nbelem+1; i++ )
528       std::cout << "Valeur de _T["<<i<<"] = "<<_T[i] << std::endl;
529 #endif
530   }
531
532
533   NoInterlaceByTypeGaussPolicy(const NoInterlaceByTypeGaussPolicy & policy,
534                                bool shallowcopie=true)
535     : InterlacingPolicy(policy),_nbtypegeo(policy._nbtypegeo)
536   {
537     //Seuls les tableaux de grande taille sont recopiés superficiellement
538     if(shallowcopie) {
539       this->_G.set(policy._G);
540       this->_T.set(policy._T);
541     } else {
542       this->_G.set(_nbtypegeo+1,policy._G);
543       this->_T.set(_nbelem+1,policy._T);
544     }
545     // Tableaux toujours recopiés par recopie profonde
546     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
547     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
548   }
549
550   NoInterlaceByTypeGaussPolicy & operator=(const NoInterlaceByTypeGaussPolicy & policy) {
551     if ( this == &policy) return *this;
552
553   const char* LOC = "NoInterlaceGaussPolicy operator =";
554   BEGIN_OF_MED(LOC);
555     InterlacingPolicy::operator=(policy);
556     this->_G.set(policy._G);
557     this->_T.set(policy._T);
558
559     // Tableaux toujours recopiés par recopie profonde
560     this->_nbtypegeo=policy._nbtypegeo;
561     this->_nbelegeoc.set(_nbtypegeo+1,policy._nbelegeoc);
562     this->_nbgaussgeo.set(_nbtypegeo+1,policy._nbgaussgeo);
563
564     return *this;
565   }
566
567   inline int getIndex(int t) const {
568     return _G[t];
569   }
570   inline int getIndex(int i,int j ) const {
571     int t = _T[i];
572     return getIndexByType( i-(_nbelegeoc[t-1]-_nbelegeoc[0]), j, t );
573   }
574
575   inline int getIndex(int i,int j, int k ) const {
576     return getIndex( i, j ) + (k-1);
577   }
578
579   inline int getIndexByType(int i,int j,int t) const {
580     return _G[t] + (i-1 + (j-1)*(_nbelegeoc[t]-_nbelegeoc[t-1])) * _nbgaussgeo[t];
581   }
582
583   inline int getIndexByType(int i,int j,int k,int t) const {
584     return getIndexByType( i,j,t ) + (k-1);
585   }
586
587   inline int getNbGauss(int i) const { return _nbgaussgeo[ _T[i] ]; }
588
589   inline int getNbGaussByType(int t) const { return _nbgaussgeo[ t ]; }
590
591   inline int getNbGeoType() const {return _nbtypegeo;}
592
593   inline const int * const getNbElemGeoC() const {return _nbelegeoc;}
594
595   inline const int * const getNbGaussGeo() const {return _nbgaussgeo;}
596
597   inline int getLengthOfType(int t) const {
598     return (_nbelegeoc[t]-_nbelegeoc[t-1]) * _dim * _nbgaussgeo[t];
599   }
600
601 };
602
603 } //END NAMESPACE
604
605 #endif