1 // Copyright (C) 2007-2014 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
21 #include "InterpKernelGaussCoords.hxx"
22 #include "CellModel.hxx"
29 using namespace INTERP_KERNEL;
31 //Define common part of the code in the MACRO
32 //---------------------------------------------------------------
33 #define LOCAL_COORD_MACRO_BEGIN \
34 _my_local_reference_coord.resize( _my_local_ref_dim*_my_local_nb_ref ); \
35 for( int refId = 0; refId < _my_local_nb_ref; refId++ ) \
37 double* coords = &_my_local_reference_coord[ refId*_my_local_ref_dim ]; \
41 //---------------------------------------------------------------
42 #define LOCAL_COORD_MACRO_END \
46 //---------------------------------------------------------------
47 #define SHAPE_FUN_MACRO_BEGIN \
48 for( int gaussId = 0 ; gaussId < _my_nb_gauss ; gaussId++ ) \
50 double* funValue = &_my_function_value[ gaussId * _my_nb_ref ]; \
51 const double* gc = &_my_gauss_coord[ gaussId * getGaussCoordDim() ];
53 //---------------------------------------------------------------
54 #define SHAPE_FUN_MACRO_END \
60 std::ostringstream stream; \
61 stream << "Error in the gauss localization for the cell with type "; \
62 stream << cellModel.getRepr(); \
64 throw INTERP_KERNEL::Exception(stream.str().c_str()); \
68 //---------------------------------------------------------------
69 static bool IsEqual(double theLeft, double theRight)
71 static double EPS = 1.0E-3;
72 if(fabs(theLeft) + fabs(theRight) > EPS)
73 return fabs(theLeft-theRight)/(fabs(theLeft)+fabs(theRight)) < EPS;
78 ////////////////////////////////////////////////////////////////////////////////////////////////
79 // GAUSS INFO CLASS //
80 ////////////////////////////////////////////////////////////////////////////////////////////////
83 * Constructor of the GaussInfo
85 GaussInfo::GaussInfo( NormalizedCellType theGeometry,
86 const DataVector& theGaussCoord,
88 const DataVector& theReferenceCoord,
90 _my_geometry(theGeometry),
91 _my_nb_gauss(theNbGauss),
92 _my_gauss_coord(theGaussCoord),
94 _my_reference_coord(theReferenceCoord)
97 //Allocate shape function values
98 _my_function_value.resize( _my_nb_gauss * _my_nb_ref );
104 GaussInfo::~GaussInfo()
109 * Return dimension of the gauss coordinates
111 int GaussInfo::getGaussCoordDim() const
115 return _my_gauss_coord.size()/_my_nb_gauss;
124 * Return dimension of the reference coordinates
126 int GaussInfo::getReferenceCoordDim() const
130 return _my_reference_coord.size()/_my_nb_ref;
139 * Return type of the cell.
141 NormalizedCellType GaussInfo::getCellType() const
147 * Return Nb of the gauss points.
149 int GaussInfo::getNbGauss() const
155 * Return Nb of the reference coordinates.
157 int GaussInfo::getNbRef() const
165 bool GaussInfo::isSatisfy()
168 bool anIsSatisfy = ((_my_local_nb_ref == _my_nb_ref) && (_my_local_ref_dim == getReferenceCoordDim()));
172 for( int refId = 0; refId < _my_local_nb_ref; refId++ )
174 double* refCoord = &_my_reference_coord[ refId*_my_local_ref_dim ];
175 double* localRefCoord = &_my_local_reference_coord[ refId*_my_local_ref_dim ];
176 bool anIsEqual = false;
177 for( int dimId = 0; dimId < _my_local_ref_dim; dimId++ )
179 anIsEqual = IsEqual( localRefCoord[dimId], refCoord[dimId]);
190 std::vector<double> GaussInfo::NormalizeCoordinatesIfNecessary(NormalizedCellType ct, int inputDim, const std::vector<double>& inputArray)
192 std::size_t sz(inputArray.size()),dim((std::size_t)inputDim);
194 throw INTERP_KERNEL::Exception("GaussInfo::NormalizeCoordinatesIfNecessary : invalid dimension ! Must be !=0 !");
196 throw INTERP_KERNEL::Exception("GaussInfo::NormalizeCoordinatesIfNecessary : invalid input array ! Inconsistent with the given dimension !");
197 const CellModel& cm(CellModel::GetCellModel(ct));
198 std::size_t baseDim((std::size_t)cm.getDimension());
201 std::size_t nbOfItems(sz/dim);
202 std::vector<double> ret(nbOfItems*baseDim);
205 for(std::size_t i=0;i<nbOfItems;i++)
209 ret[i*baseDim+j]=inputArray[i*dim+j];
216 for(std::size_t i=0;i<nbOfItems;i++)
220 ret[i*baseDim+j]=inputArray[i*dim+j];
226 typedef void (*MapToShapeFunction)(GaussInfo& obj);
229 * Initialize the internal vectors
231 void GaussInfo::initLocalInfo()
233 bool aSatify = false;
234 const CellModel& cellModel(CellModel::GetCellModel(_my_geometry));
235 switch( _my_geometry )
238 _my_local_ref_dim = 1;
239 _my_local_nb_ref = 2;
241 aSatify = isSatisfy();
246 _my_local_ref_dim = 1;
247 _my_local_nb_ref = 3;
249 aSatify = isSatisfy();
254 _my_local_ref_dim = 2;
255 _my_local_nb_ref = 3;
257 aSatify = isSatisfy();
262 aSatify = isSatisfy();
268 _my_local_ref_dim = 2;
269 _my_local_nb_ref = 6;
271 aSatify = isSatisfy();
275 aSatify = isSatisfy();
282 _my_local_ref_dim = 2;
283 _my_local_nb_ref = 4;
284 MapToShapeFunction QUAD4PTR[]={Quad4aInit,Quad4bInit,Quad4cInit,Quad4DegSeg2Init};
285 std::size_t NB_OF_QUAD4PTR(sizeof(QUAD4PTR)/sizeof(MapToShapeFunction));
286 for(std::size_t i=0;i<NB_OF_QUAD4PTR && !aSatify;i++)
288 (QUAD4PTR[i])(*this);
289 aSatify = isSatisfy();
297 _my_local_ref_dim = 2;
298 _my_local_nb_ref = 8;
300 aSatify = isSatisfy();
305 aSatify = isSatisfy();
311 _my_local_ref_dim = 2;
312 _my_local_nb_ref = 9;
314 aSatify = isSatisfy();
319 _my_local_ref_dim = 3;
320 _my_local_nb_ref = 4;
322 aSatify = isSatisfy();
327 aSatify = isSatisfy();
333 _my_local_ref_dim = 3;
334 _my_local_nb_ref = 10;
336 aSatify = isSatisfy();
341 aSatify = isSatisfy();
347 _my_local_ref_dim = 3;
348 _my_local_nb_ref = 5;
350 aSatify = isSatisfy();
355 aSatify = isSatisfy();
361 _my_local_ref_dim = 3;
362 _my_local_nb_ref = 13;
364 aSatify = isSatisfy();
369 aSatify = isSatisfy();
376 _my_local_ref_dim = 3;
377 _my_local_nb_ref = 6;
378 MapToShapeFunction PENTA6PTR[]={Penta6aInit,Penta6bInit,Penta6DegTria3aInit,Penta6DegTria3bInit};
379 std::size_t NB_OF_PENTA6PTR(sizeof(PENTA6PTR)/sizeof(MapToShapeFunction));
380 for(std::size_t i=0;i<NB_OF_PENTA6PTR && !aSatify;i++)
382 (PENTA6PTR[i])(*this);
383 aSatify = isSatisfy();
390 _my_local_ref_dim = 3;
391 _my_local_nb_ref = 6;
393 aSatify = isSatisfy();
398 aSatify = isSatisfy();
404 _my_local_ref_dim = 3;
405 _my_local_nb_ref = 15;
407 aSatify = isSatisfy();
412 aSatify = isSatisfy();
419 _my_local_ref_dim = 3;
420 _my_local_nb_ref = 8;
421 MapToShapeFunction HEXA8PTR[]={Hexa8aInit,Hexa8bInit,Hexa8DegQuad4aInit,Hexa8DegQuad4bInit,Hexa8DegQuad4cInit};
422 std::size_t NB_OF_HEXA8PTR(sizeof(HEXA8PTR)/sizeof(MapToShapeFunction));
423 for(std::size_t i=0;i<NB_OF_HEXA8PTR && !aSatify;i++)
425 (HEXA8PTR[i])(*this);
426 aSatify = isSatisfy();
433 _my_local_ref_dim = 3;
434 _my_local_nb_ref = 20;
436 aSatify = isSatisfy();
441 aSatify = isSatisfy();
447 _my_local_ref_dim = 3;
448 _my_local_nb_ref = 27;
450 aSatify = isSatisfy();
455 throw INTERP_KERNEL::Exception("Not managed cell type !");
461 * Return shape function value by node id
463 const double* GaussInfo::getFunctionValues( const int theGaussId ) const
465 return &_my_function_value[ _my_nb_ref*theGaussId ];
469 * Init Segment 2 Reference coordinates ans Shape function.
471 void GaussInfo::seg2Init()
473 LOCAL_COORD_MACRO_BEGIN;
480 LOCAL_COORD_MACRO_END;
482 SHAPE_FUN_MACRO_BEGIN;
483 funValue[0] = 0.5*(1.0 - gc[0]);
484 funValue[1] = 0.5*(1.0 + gc[0]);
489 * Init Segment 3 Reference coordinates ans Shape function.
491 void GaussInfo::seg3Init()
493 LOCAL_COORD_MACRO_BEGIN;
503 LOCAL_COORD_MACRO_END;
505 SHAPE_FUN_MACRO_BEGIN;
506 funValue[0] = -0.5*(1.0 - gc[0])*gc[0];
507 funValue[1] = 0.5*(1.0 + gc[0])*gc[0];
508 funValue[2] = (1.0 + gc[0])*(1.0 - gc[0]);
513 * Init Triangle Reference coordinates ans Shape function.
516 void GaussInfo::tria3aInit()
518 LOCAL_COORD_MACRO_BEGIN;
531 LOCAL_COORD_MACRO_END;
533 SHAPE_FUN_MACRO_BEGIN;
534 funValue[0] = 0.5*(1.0 + gc[1]);
535 funValue[1] = -0.5*(gc[0] + gc[1]);
536 funValue[2] = 0.5*(1.0 + gc[0]);
541 * Init Triangle Reference coordinates ans Shape function.
544 void GaussInfo::tria3bInit()
546 LOCAL_COORD_MACRO_BEGIN;
559 LOCAL_COORD_MACRO_END;
561 SHAPE_FUN_MACRO_BEGIN;
562 funValue[0] = 1.0 - gc[0] - gc[1];
569 * Init Quadratic Triangle Reference coordinates ans Shape function.
572 void GaussInfo::tria6aInit()
574 LOCAL_COORD_MACRO_BEGIN;
599 LOCAL_COORD_MACRO_END;
601 SHAPE_FUN_MACRO_BEGIN;
602 funValue[0] = 0.5*(1.0 + gc[1])*gc[1];
603 funValue[1] = 0.5*(gc[0] + gc[1])*(gc[0] + gc[1] + 1);
604 funValue[2] = 0.5*(1.0 + gc[0])*gc[0];
605 funValue[3] = -1.0*(1.0 + gc[1])*(gc[0] + gc[1]);
606 funValue[4] = -1.0*(1.0 + gc[0])*(gc[0] + gc[1]);
607 funValue[5] = (1.0 + gc[1])*(1.0 + gc[1]);
612 * Init Quadratic Triangle Reference coordinates ans Shape function.
615 void GaussInfo::tria6bInit()
617 LOCAL_COORD_MACRO_BEGIN;
648 LOCAL_COORD_MACRO_END;
650 SHAPE_FUN_MACRO_BEGIN;
651 funValue[0] = (1.0 - gc[0] - gc[1])*(1.0 - 2.0*gc[0] - 2.0*gc[1]);
652 funValue[1] = gc[0]*(2.0*gc[0] - 1.0);
653 funValue[2] = gc[1]*(2.0*gc[1] - 1.0);
654 funValue[3] = 4.0*gc[0]*(1.0 - gc[0] - gc[1]);
655 funValue[4] = 4.0*gc[0]*gc[1];
656 funValue[5] = 4.0*gc[1]*(1.0 - gc[0] - gc[1]);
661 * Init Quadrangle Reference coordinates ans Shape function.
664 void GaussInfo::quad4aInit()
666 LOCAL_COORD_MACRO_BEGIN;
684 LOCAL_COORD_MACRO_END;
686 SHAPE_FUN_MACRO_BEGIN;
687 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
688 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
689 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
690 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
695 * Init Quadrangle Reference coordinates ans Shape function.
698 void GaussInfo::quad4bInit()
700 LOCAL_COORD_MACRO_BEGIN;
718 LOCAL_COORD_MACRO_END;
720 SHAPE_FUN_MACRO_BEGIN;
721 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
722 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
723 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
724 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
728 void GaussInfo::quad4cInit()
730 LOCAL_COORD_MACRO_BEGIN;
748 LOCAL_COORD_MACRO_END;
750 SHAPE_FUN_MACRO_BEGIN;
751 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
752 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
753 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
754 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
759 * This shapefunc map is same as degenerated seg2Init
761 void GaussInfo::quad4DegSeg2Init()
763 LOCAL_COORD_MACRO_BEGIN;
780 LOCAL_COORD_MACRO_END;
782 SHAPE_FUN_MACRO_BEGIN;
783 funValue[0] = 0.5*(1.0 - gc[0]);
784 funValue[1] = 0.5*(1.0 + gc[0]);
791 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
794 void GaussInfo::quad8aInit()
796 LOCAL_COORD_MACRO_BEGIN;
829 LOCAL_COORD_MACRO_END;
831 SHAPE_FUN_MACRO_BEGIN;
832 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0])*(gc[1] - gc[0] - 1.0);
833 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0])*(-gc[1] - gc[0] - 1.0);
834 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0])*(-gc[1] + gc[0] - 1.0);
835 funValue[3] = 0.25*(1.0 + gc[1])*(1.0 + gc[0])*(gc[1] + gc[0] - 1.0);
836 funValue[4] = 0.5*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
837 funValue[5] = 0.5*(1.0 - gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
838 funValue[6] = 0.5*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
839 funValue[7] = 0.5*(1.0 + gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
844 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
847 void GaussInfo::quad8bInit()
849 LOCAL_COORD_MACRO_BEGIN;
882 LOCAL_COORD_MACRO_END;
884 SHAPE_FUN_MACRO_BEGIN;
885 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1])*(-1.0 - gc[0] - gc[1]);
886 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1])*(-1.0 + gc[0] - gc[1]);
887 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1])*(-1.0 + gc[0] + gc[1]);
888 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1])*(-1.0 - gc[0] + gc[1]);
889 funValue[4] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 - gc[1]);
890 funValue[5] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 + gc[0]);
891 funValue[6] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 + gc[1]);
892 funValue[7] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 - gc[0]);
896 void GaussInfo::quad9aInit()
898 LOCAL_COORD_MACRO_BEGIN;
935 LOCAL_COORD_MACRO_END;
937 SHAPE_FUN_MACRO_BEGIN;
938 funValue[0] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]-1.);
939 funValue[1] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]-1.);
940 funValue[2] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]+1.);
941 funValue[3] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]+1.);
942 funValue[4] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.);
943 funValue[5] = 0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1]);
944 funValue[6] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.);
945 funValue[7] = 0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1]);
946 funValue[8] = (1.-gc[0]*gc[0])*(1.-gc[1]*gc[1]);
951 * Init Tetrahedron Reference coordinates ans Shape function.
954 void GaussInfo::tetra4aInit()
956 LOCAL_COORD_MACRO_BEGIN;
977 LOCAL_COORD_MACRO_END;
979 SHAPE_FUN_MACRO_BEGIN;
982 funValue[2] = 1.0 - gc[0] - gc[1] - gc[2];
988 * Init Tetrahedron Reference coordinates ans Shape function.
991 void GaussInfo::tetra4bInit()
993 LOCAL_COORD_MACRO_BEGIN;
1014 LOCAL_COORD_MACRO_END;
1016 SHAPE_FUN_MACRO_BEGIN;
1017 funValue[0] = gc[1];
1018 funValue[2] = gc[2];
1019 funValue[1] = 1.0 - gc[0] - gc[1] - gc[2];
1020 funValue[3] = gc[0];
1021 SHAPE_FUN_MACRO_END;
1026 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1029 void GaussInfo::tetra10aInit()
1031 LOCAL_COORD_MACRO_BEGIN;
1082 LOCAL_COORD_MACRO_END;
1084 SHAPE_FUN_MACRO_BEGIN;
1085 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1086 funValue[1] = gc[2]*(2.0*gc[2] - 1.0);
1087 funValue[2] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1088 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1089 funValue[4] = 4.0*gc[1]*gc[2];
1090 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1091 funValue[6] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1092 funValue[7] = 4.0*gc[0]*gc[1];
1093 funValue[8] = 4.0*gc[0]*gc[2];
1094 funValue[9] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1095 SHAPE_FUN_MACRO_END;
1099 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1102 void GaussInfo::tetra10bInit()
1104 LOCAL_COORD_MACRO_BEGIN;
1155 LOCAL_COORD_MACRO_END;
1157 SHAPE_FUN_MACRO_BEGIN;
1158 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1159 funValue[2] = gc[2]*(2.0*gc[2] - 1.0);
1160 funValue[1] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1161 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1162 funValue[6] = 4.0*gc[1]*gc[2];
1163 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1164 funValue[4] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1165 funValue[7] = 4.0*gc[0]*gc[1];
1166 funValue[9] = 4.0*gc[0]*gc[2];
1167 funValue[8] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1168 SHAPE_FUN_MACRO_END;
1172 * Init Pyramid Reference coordinates ans Shape function.
1175 void GaussInfo::pyra5aInit()
1177 LOCAL_COORD_MACRO_BEGIN;
1203 LOCAL_COORD_MACRO_END;
1205 SHAPE_FUN_MACRO_BEGIN;
1206 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1207 funValue[1] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1208 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1209 funValue[3] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1210 funValue[4] = gc[2];
1211 SHAPE_FUN_MACRO_END;
1214 * Init Pyramid Reference coordinates ans Shape function.
1217 void GaussInfo::pyra5bInit()
1219 LOCAL_COORD_MACRO_BEGIN;
1245 LOCAL_COORD_MACRO_END;
1247 SHAPE_FUN_MACRO_BEGIN;
1248 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1249 funValue[3] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1250 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1251 funValue[1] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1252 funValue[4] = gc[2];
1253 SHAPE_FUN_MACRO_END;
1257 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1260 void GaussInfo::pyra13aInit()
1262 LOCAL_COORD_MACRO_BEGIN;
1329 LOCAL_COORD_MACRO_END;
1331 SHAPE_FUN_MACRO_BEGIN;
1332 funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1333 (gc[0] - 0.5)/(1.0 - gc[2]);
1334 funValue[1] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
1335 (gc[1] - 0.5)/(1.0 - gc[2]);
1336 funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
1337 (-gc[0] - 0.5)/(1.0 - gc[2]);
1338 funValue[3] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1339 (-gc[1] - 0.5)/(1.0 - gc[2]);
1341 funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
1343 funValue[5] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1344 (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1345 funValue[6] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
1346 (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1347 funValue[7] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
1348 (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1349 funValue[8] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1350 (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1352 funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
1354 funValue[10] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
1356 funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
1358 funValue[12] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
1360 SHAPE_FUN_MACRO_END;
1364 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1367 void GaussInfo::pyra13bInit()
1369 LOCAL_COORD_MACRO_BEGIN;
1435 LOCAL_COORD_MACRO_END;
1437 SHAPE_FUN_MACRO_BEGIN;
1438 funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1439 (gc[0] - 0.5)/(1.0 - gc[2]);
1440 funValue[3] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
1441 (gc[1] - 0.5)/(1.0 - gc[2]);
1442 funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
1443 (-gc[0] - 0.5)/(1.0 - gc[2]);
1444 funValue[1] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1445 (-gc[1] - 0.5)/(1.0 - gc[2]);
1447 funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
1449 funValue[8] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1450 (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1451 funValue[7] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
1452 (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1453 funValue[6] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
1454 (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1455 funValue[5] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1456 (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1458 funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
1460 funValue[12] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
1462 funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
1464 funValue[10] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
1466 SHAPE_FUN_MACRO_END;
1471 * Init Pentahedron Reference coordinates and Shape function.
1474 void GaussInfo::penta6aInit()
1476 LOCAL_COORD_MACRO_BEGIN;
1507 LOCAL_COORD_MACRO_END;
1509 SHAPE_FUN_MACRO_BEGIN;
1510 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1511 funValue[1] = 0.5*gc[2]*(1.0 - gc[0]);
1512 funValue[2] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1514 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1515 funValue[4] = 0.5*gc[2]*(gc[0] + 1.0);
1516 funValue[5] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1517 SHAPE_FUN_MACRO_END;
1521 * Init Pentahedron Reference coordinates and Shape function.
1524 void GaussInfo::penta6bInit()
1526 LOCAL_COORD_MACRO_BEGIN;
1557 LOCAL_COORD_MACRO_END;
1559 SHAPE_FUN_MACRO_BEGIN;
1560 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1561 funValue[2] = 0.5*gc[2]*(1.0 - gc[0]);
1562 funValue[1] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1563 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1564 funValue[5] = 0.5*gc[2]*(gc[0] + 1.0);
1565 funValue[4] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1566 SHAPE_FUN_MACRO_END;
1570 * This shapefunc map is same as degenerated tria3aInit
1572 void GaussInfo::penta6DegTria3aInit()
1574 LOCAL_COORD_MACRO_BEGIN;
1605 LOCAL_COORD_MACRO_END;
1607 SHAPE_FUN_MACRO_BEGIN;
1608 funValue[0] = 0.5*(1.0 + gc[1]);
1609 funValue[1] = -0.5*(gc[0] + gc[1]);
1610 funValue[2] = 0.5*(1.0 + gc[0]);
1614 SHAPE_FUN_MACRO_END;
1618 * This shapefunc map is same as degenerated tria3bInit
1620 void GaussInfo::penta6DegTria3bInit()
1622 LOCAL_COORD_MACRO_BEGIN;
1653 LOCAL_COORD_MACRO_END;
1655 SHAPE_FUN_MACRO_BEGIN;
1656 funValue[0] = 1.0 - gc[0] - gc[1];
1657 funValue[1] = gc[0];
1658 funValue[2] = gc[1];
1662 SHAPE_FUN_MACRO_END;
1666 * Init Pentahedron Reference coordinates and Shape function.
1669 void GaussInfo::penta15aInit()
1671 LOCAL_COORD_MACRO_BEGIN;
1748 LOCAL_COORD_MACRO_END;
1750 SHAPE_FUN_MACRO_BEGIN;
1751 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1752 funValue[1] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1753 funValue[2] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1755 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1756 funValue[4] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1757 funValue[5] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1759 funValue[6] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1760 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1761 funValue[8] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1763 funValue[9] = gc[1]*(1.0 - gc[0]*gc[0]);
1764 funValue[10] = gc[2]*(1.0 - gc[0]*gc[0]);
1765 funValue[11] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1767 funValue[12] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1768 funValue[13] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1769 funValue[14] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1770 SHAPE_FUN_MACRO_END;
1774 * Init Qaudratic Pentahedron Reference coordinates and Shape function.
1777 void GaussInfo::penta15bInit()
1779 LOCAL_COORD_MACRO_BEGIN;
1856 LOCAL_COORD_MACRO_END;
1858 SHAPE_FUN_MACRO_BEGIN;
1859 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1860 funValue[2] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1861 funValue[1] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1863 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1864 funValue[5] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1865 funValue[4] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1867 funValue[8] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1868 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1869 funValue[6] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1871 funValue[12] = gc[1]*(1.0 - gc[0]*gc[0]);
1872 funValue[14] = gc[2]*(1.0 - gc[0]*gc[0]);
1873 funValue[13] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1875 funValue[11] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1876 funValue[10] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1877 funValue[9] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1878 SHAPE_FUN_MACRO_END;
1882 * Init Hehahedron Reference coordinates and Shape function.
1885 void GaussInfo::hexa8aInit()
1887 LOCAL_COORD_MACRO_BEGIN;
1928 LOCAL_COORD_MACRO_END;
1930 SHAPE_FUN_MACRO_BEGIN;
1931 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1932 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1933 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1934 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1936 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1937 funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1938 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1939 funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1940 SHAPE_FUN_MACRO_END;
1944 * Init Hehahedron Reference coordinates and Shape function.
1947 void GaussInfo::hexa8bInit()
1949 LOCAL_COORD_MACRO_BEGIN;
1990 LOCAL_COORD_MACRO_END;
1992 SHAPE_FUN_MACRO_BEGIN;
1993 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1994 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1995 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1996 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1998 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1999 funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2000 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2001 funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2002 SHAPE_FUN_MACRO_END;
2006 * This shapefunc map is same as degenerated quad4bInit
2008 void GaussInfo::hexa8DegQuad4aInit()
2010 LOCAL_COORD_MACRO_BEGIN;
2051 LOCAL_COORD_MACRO_END;
2053 SHAPE_FUN_MACRO_BEGIN;
2054 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
2055 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
2056 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
2057 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2062 SHAPE_FUN_MACRO_END;
2066 * This shapefunc map is same as degenerated quad4bInit
2068 void GaussInfo::hexa8DegQuad4bInit()
2070 LOCAL_COORD_MACRO_BEGIN;
2111 LOCAL_COORD_MACRO_END;
2113 SHAPE_FUN_MACRO_BEGIN;
2114 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2115 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2116 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2117 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2122 SHAPE_FUN_MACRO_END;
2126 * This shapefunc map is same as degenerated quad4cInit
2128 void GaussInfo::hexa8DegQuad4cInit()
2130 LOCAL_COORD_MACRO_BEGIN;
2172 LOCAL_COORD_MACRO_END;
2174 SHAPE_FUN_MACRO_BEGIN;
2175 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2176 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2177 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2178 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2183 SHAPE_FUN_MACRO_END;
2187 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2190 void GaussInfo::hexa20aInit()
2192 LOCAL_COORD_MACRO_BEGIN;
2294 LOCAL_COORD_MACRO_END;
2296 SHAPE_FUN_MACRO_BEGIN;
2297 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2298 (-2.0 - gc[0] - gc[1] - gc[2]);
2299 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2300 (-2.0 + gc[0] - gc[1] - gc[2]);
2301 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2302 (-2.0 + gc[0] + gc[1] - gc[2]);
2303 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2304 (-2.0 - gc[0] + gc[1] - gc[2]);
2305 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2306 (-2.0 - gc[0] - gc[1] + gc[2]);
2307 funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2308 (-2.0 + gc[0] - gc[1] + gc[2]);
2309 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2310 (-2.0 + gc[0] + gc[1] + gc[2]);
2311 funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2312 (-2.0 - gc[0] + gc[1] + gc[2]);
2314 funValue[8] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2315 funValue[9] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2316 funValue[10] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2317 funValue[11] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2318 funValue[12] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2319 funValue[13] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2320 funValue[14] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2321 funValue[15] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2322 funValue[16] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2323 funValue[17] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2324 funValue[18] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2325 funValue[19] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2326 SHAPE_FUN_MACRO_END;
2330 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2333 void GaussInfo::hexa20bInit()
2335 LOCAL_COORD_MACRO_BEGIN;
2437 LOCAL_COORD_MACRO_END;
2439 SHAPE_FUN_MACRO_BEGIN;
2441 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2442 (-2.0 - gc[0] - gc[1] - gc[2]);
2443 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2444 (-2.0 + gc[0] - gc[1] - gc[2]);
2445 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2446 (-2.0 + gc[0] + gc[1] - gc[2]);
2447 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2448 (-2.0 - gc[0] + gc[1] - gc[2]);
2449 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2450 (-2.0 - gc[0] - gc[1] + gc[2]);
2451 funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2452 (-2.0 + gc[0] - gc[1] + gc[2]);
2453 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2454 (-2.0 + gc[0] + gc[1] + gc[2]);
2455 funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2456 (-2.0 - gc[0] + gc[1] + gc[2]);
2458 funValue[11] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2459 funValue[10] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2460 funValue[9] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2461 funValue[8] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2462 funValue[16] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2463 funValue[19] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2464 funValue[18] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2465 funValue[17] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2466 funValue[15] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2467 funValue[14] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2468 funValue[13] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2469 funValue[12] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2470 SHAPE_FUN_MACRO_END;
2473 void GaussInfo::hexa27aInit()
2475 LOCAL_COORD_MACRO_BEGIN;
2611 LOCAL_COORD_MACRO_END;
2613 SHAPE_FUN_MACRO_BEGIN;
2615 funValue[0] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
2616 funValue[1] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
2617 funValue[2] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
2618 funValue[3] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
2619 funValue[4] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
2620 funValue[5] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
2621 funValue[6] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
2622 funValue[7] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
2623 funValue[8] =0.25*(1.-gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]);
2624 funValue[9] =0.25*(1.-gc[0]*gc[0])*(1.+gc[1])*(1.-gc[2]);
2625 funValue[10]=0.25*(1.+gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]);
2626 funValue[11]=0.25*(1.-gc[0]*gc[0])*(1.-gc[1])*(1.-gc[2]);
2627 funValue[12]=0.25*(1.-gc[0])*(1.-gc[1]*gc[1])*(1.+gc[2]);
2628 funValue[13]=0.25*(1.-gc[0]*gc[0])*(1.+gc[1])*(1.+gc[2]);
2629 funValue[14]=0.25*(1.+gc[0])*(1.-gc[1]*gc[1])*(1.+gc[2]);
2630 funValue[15]=0.25*(1.-gc[0]*gc[0])*(1.-gc[1])*(1.+gc[2]);
2631 funValue[16]=0.25*(1.-gc[0])*(1.-gc[1])*(1.-gc[2]*gc[2]);
2632 funValue[17]=0.25*(1.-gc[0])*(1.+gc[1])*(1.-gc[2]*gc[2]);
2633 funValue[18]=0.25*(1.+gc[0])*(1.+gc[1])*(1.-gc[2]*gc[2]);
2634 funValue[19]=0.25*(1.+gc[0])*(1.-gc[1])*(1.-gc[2]*gc[2]);
2635 funValue[20]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]-1.);
2636 funValue[21]=0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2637 funValue[22]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.)*(1.-gc[2]*gc[2]);
2638 funValue[23]=0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2639 funValue[24]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.)*(1.-gc[2]*gc[2]);
2640 funValue[25]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]+1.);
2641 funValue[26]=(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2643 SHAPE_FUN_MACRO_END;
2646 ////////////////////////////////////////////////////////////////////////////////////////////////
2647 // GAUSS COORD CLASS //
2648 ////////////////////////////////////////////////////////////////////////////////////////////////
2652 GaussCoords::GaussCoords()
2659 GaussCoords::~GaussCoords()
2661 GaussInfoVector::iterator it = _my_gauss_info.begin();
2662 for( ; it != _my_gauss_info.end(); it++ )
2670 * Add Gauss localization info
2672 void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
2674 const double* theGaussCoord,
2676 const double* theReferenceCoord,
2679 GaussInfoVector::iterator it = _my_gauss_info.begin();
2680 for( ; it != _my_gauss_info.end(); it++ )
2682 if( (*it)->getCellType() == theGeometry )
2688 DataVector aGaussCoord;
2689 for(int i = 0 ; i < theNbGauss*coordDim; i++ )
2690 aGaussCoord.push_back(theGaussCoord[i]);
2692 DataVector aReferenceCoord;
2693 for(int i = 0 ; i < theNbRef*coordDim; i++ )
2694 aReferenceCoord.push_back(theReferenceCoord[i]);
2697 GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, theNbGauss, aReferenceCoord, theNbRef);
2698 info->initLocalInfo();
2700 //If info with cell type doesn't exist add it
2701 if( it == _my_gauss_info.end() )
2703 _my_gauss_info.push_back(info);
2705 // If information exists, update it
2709 int index = std::distance(_my_gauss_info.begin(),it);
2711 _my_gauss_info[index] = info;
2717 * Calculate gauss points coordinates
2719 double* GaussCoords::calculateCoords( NormalizedCellType theGeometry,
2720 const double *theNodeCoords,
2721 const int theSpaceDim,
2722 const int *theIndex)
2724 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2725 int nbCoords = theSpaceDim * info->getNbGauss();
2726 double *aCoords = new double[nbCoords];
2727 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,aCoords);
2732 void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2734 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2735 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,result);
2738 void GaussCoords::calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2740 int aConn = info->getNbRef();
2742 int nbCoords = theSpaceDim * info->getNbGauss();
2743 std::fill(result,result+nbCoords,0.);
2745 for( int gaussId = 0; gaussId < info->getNbGauss(); gaussId++ )
2747 double *coord=result+gaussId*theSpaceDim;
2748 const double *function=info->getFunctionValues(gaussId);
2749 for ( int connId = 0; connId < aConn ; connId++ )
2751 const double* nodeCoord = theNodeCoords + (theIndex[connId]*theSpaceDim);
2752 for( int dimId = 0; dimId < theSpaceDim; dimId++ )
2753 coord[dimId] += nodeCoord[dimId]*function[connId];
2758 const GaussInfo *GaussCoords::getInfoGivenCellType(NormalizedCellType cellType)
2760 GaussInfoVector::const_iterator it = _my_gauss_info.begin();
2761 //Try to find gauss localization info
2762 for( ; it != _my_gauss_info.end() ; it++ )
2763 if( (*it)->getCellType()==cellType)
2765 throw INTERP_KERNEL::Exception("Can't find gauss localization information !");