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 = 0;
239 _my_local_nb_ref = 1;
241 aSatify = isSatisfy();
246 _my_local_ref_dim = 1;
247 _my_local_nb_ref = 2;
249 aSatify = isSatisfy();
254 _my_local_ref_dim = 1;
255 _my_local_nb_ref = 3;
257 aSatify = isSatisfy();
262 _my_local_ref_dim = 2;
263 _my_local_nb_ref = 3;
265 aSatify = isSatisfy();
270 aSatify = isSatisfy();
276 _my_local_ref_dim = 2;
277 _my_local_nb_ref = 6;
279 aSatify = isSatisfy();
283 aSatify = isSatisfy();
289 _my_local_ref_dim = 2;
290 _my_local_nb_ref = 7;
292 aSatify = isSatisfy();
298 _my_local_ref_dim = 2;
299 _my_local_nb_ref = 4;
300 MapToShapeFunction QUAD4PTR[]={Quad4aInit,Quad4bInit,Quad4cInit,Quad4DegSeg2Init};
301 std::size_t NB_OF_QUAD4PTR(sizeof(QUAD4PTR)/sizeof(MapToShapeFunction));
302 for(std::size_t i=0;i<NB_OF_QUAD4PTR && !aSatify;i++)
304 (QUAD4PTR[i])(*this);
305 aSatify = isSatisfy();
313 _my_local_ref_dim = 2;
314 _my_local_nb_ref = 8;
316 aSatify = isSatisfy();
321 aSatify = isSatisfy();
327 _my_local_ref_dim = 2;
328 _my_local_nb_ref = 9;
330 aSatify = isSatisfy();
335 _my_local_ref_dim = 3;
336 _my_local_nb_ref = 4;
338 aSatify = isSatisfy();
343 aSatify = isSatisfy();
349 _my_local_ref_dim = 3;
350 _my_local_nb_ref = 10;
352 aSatify = isSatisfy();
357 aSatify = isSatisfy();
363 _my_local_ref_dim = 3;
364 _my_local_nb_ref = 5;
366 aSatify = isSatisfy();
371 aSatify = isSatisfy();
377 _my_local_ref_dim = 3;
378 _my_local_nb_ref = 13;
380 aSatify = isSatisfy();
385 aSatify = isSatisfy();
392 _my_local_ref_dim = 3;
393 _my_local_nb_ref = 6;
394 MapToShapeFunction PENTA6PTR[]={Penta6aInit,Penta6bInit,Penta6DegTria3aInit,Penta6DegTria3bInit};
395 std::size_t NB_OF_PENTA6PTR(sizeof(PENTA6PTR)/sizeof(MapToShapeFunction));
396 for(std::size_t i=0;i<NB_OF_PENTA6PTR && !aSatify;i++)
398 (PENTA6PTR[i])(*this);
399 aSatify = isSatisfy();
406 _my_local_ref_dim = 3;
407 _my_local_nb_ref = 6;
409 aSatify = isSatisfy();
414 aSatify = isSatisfy();
421 _my_local_ref_dim = 3;
422 _my_local_nb_ref = 15;
423 MapToShapeFunction PENTA15PTR[]={Penta15aInit,Penta15bInit};
424 std::size_t NB_OF_PENTA15PTR(sizeof(PENTA15PTR)/sizeof(MapToShapeFunction));
425 for(std::size_t i=0;i<NB_OF_PENTA15PTR && !aSatify;i++)
427 (PENTA15PTR[i])(*this);
428 aSatify = isSatisfy();
436 _my_local_ref_dim = 3;
437 _my_local_nb_ref = 8;
438 MapToShapeFunction HEXA8PTR[]={Hexa8aInit,Hexa8bInit,Hexa8DegQuad4aInit,Hexa8DegQuad4bInit,Hexa8DegQuad4cInit};
439 std::size_t NB_OF_HEXA8PTR(sizeof(HEXA8PTR)/sizeof(MapToShapeFunction));
440 for(std::size_t i=0;i<NB_OF_HEXA8PTR && !aSatify;i++)
442 (HEXA8PTR[i])(*this);
443 aSatify = isSatisfy();
450 _my_local_ref_dim = 3;
451 _my_local_nb_ref = 20;
453 aSatify = isSatisfy();
458 aSatify = isSatisfy();
464 _my_local_ref_dim = 3;
465 _my_local_nb_ref = 27;
467 aSatify = isSatisfy();
472 throw INTERP_KERNEL::Exception("Not managed cell type !");
478 * Return shape function value by node id
480 const double* GaussInfo::getFunctionValues( const int theGaussId ) const
482 return &_my_function_value[ _my_nb_ref*theGaussId ];
485 void GaussInfo::point1Init()
487 double *funValue(&_my_function_value[0]);
492 * Init Segment 2 Reference coordinates ans Shape function.
494 void GaussInfo::seg2Init()
496 LOCAL_COORD_MACRO_BEGIN;
503 LOCAL_COORD_MACRO_END;
505 SHAPE_FUN_MACRO_BEGIN;
506 funValue[0] = 0.5*(1.0 - gc[0]);
507 funValue[1] = 0.5*(1.0 + gc[0]);
512 * Init Segment 3 Reference coordinates ans Shape function.
514 void GaussInfo::seg3Init()
516 LOCAL_COORD_MACRO_BEGIN;
526 LOCAL_COORD_MACRO_END;
528 SHAPE_FUN_MACRO_BEGIN;
529 funValue[0] = -0.5*(1.0 - gc[0])*gc[0];
530 funValue[1] = 0.5*(1.0 + gc[0])*gc[0];
531 funValue[2] = (1.0 + gc[0])*(1.0 - gc[0]);
536 * Init Triangle Reference coordinates ans Shape function.
539 void GaussInfo::tria3aInit()
541 LOCAL_COORD_MACRO_BEGIN;
554 LOCAL_COORD_MACRO_END;
556 SHAPE_FUN_MACRO_BEGIN;
557 funValue[0] = 0.5*(1.0 + gc[1]);
558 funValue[1] = -0.5*(gc[0] + gc[1]);
559 funValue[2] = 0.5*(1.0 + gc[0]);
564 * Init Triangle Reference coordinates ans Shape function.
567 void GaussInfo::tria3bInit()
569 LOCAL_COORD_MACRO_BEGIN;
582 LOCAL_COORD_MACRO_END;
584 SHAPE_FUN_MACRO_BEGIN;
585 funValue[0] = 1.0 - gc[0] - gc[1];
592 * Init Quadratic Triangle Reference coordinates ans Shape function.
595 void GaussInfo::tria6aInit()
597 LOCAL_COORD_MACRO_BEGIN;
622 LOCAL_COORD_MACRO_END;
624 SHAPE_FUN_MACRO_BEGIN;
625 funValue[0] = 0.5*(1.0 + gc[1])*gc[1];
626 funValue[1] = 0.5*(gc[0] + gc[1])*(gc[0] + gc[1] + 1);
627 funValue[2] = 0.5*(1.0 + gc[0])*gc[0];
628 funValue[3] = -1.0*(1.0 + gc[1])*(gc[0] + gc[1]);
629 funValue[4] = -1.0*(1.0 + gc[0])*(gc[0] + gc[1]);
630 funValue[5] = (1.0 + gc[1])*(1.0 + gc[1]);
635 * Init Quadratic Triangle Reference coordinates ans Shape function.
638 void GaussInfo::tria6bInit()
640 LOCAL_COORD_MACRO_BEGIN;
671 LOCAL_COORD_MACRO_END;
673 SHAPE_FUN_MACRO_BEGIN;
674 funValue[0] = (1.0 - gc[0] - gc[1])*(1.0 - 2.0*gc[0] - 2.0*gc[1]);
675 funValue[1] = gc[0]*(2.0*gc[0] - 1.0);
676 funValue[2] = gc[1]*(2.0*gc[1] - 1.0);
677 funValue[3] = 4.0*gc[0]*(1.0 - gc[0] - gc[1]);
678 funValue[4] = 4.0*gc[0]*gc[1];
679 funValue[5] = 4.0*gc[1]*(1.0 - gc[0] - gc[1]);
683 void GaussInfo::tria7aInit()
685 LOCAL_COORD_MACRO_BEGIN;
711 coords[0] = 0.3333333333333333;
712 coords[1] = 0.3333333333333333;
715 LOCAL_COORD_MACRO_END;
717 SHAPE_FUN_MACRO_BEGIN;
718 funValue[0]=1-3*(gc[0]+gc[1])+2*(gc[0]*gc[0]+gc[1]*gc[1])+7*gc[0]*gc[1]-3*gc[0]*gc[1]*(gc[0]+gc[1]);
719 funValue[1]=gc[0]*(-1+2*gc[0]+3*gc[1]-3*gc[1]*(gc[0]+gc[1]));
720 funValue[2]=gc[1]*(-1.+3.*gc[0]+2.*gc[1]-3.*gc[0]*(gc[0]+gc[1]));
721 funValue[3]=4*gc[0]*(1-gc[0]-4*gc[1]+3*gc[1]*(gc[0]+gc[1]));
722 funValue[4]=4*gc[0]*gc[1]*(-2+3*(gc[0]+gc[1]));
723 funValue[5]=4*gc[1]*(1-4*gc[0]-gc[1]+3*gc[0]*(gc[0]+gc[1]));
724 funValue[6]=27*gc[0]*gc[1]*(1-gc[0]-gc[1]);
729 * Init Quadrangle Reference coordinates ans Shape function.
732 void GaussInfo::quad4aInit()
734 LOCAL_COORD_MACRO_BEGIN;
752 LOCAL_COORD_MACRO_END;
754 SHAPE_FUN_MACRO_BEGIN;
755 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
756 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
757 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
758 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
763 * Init Quadrangle Reference coordinates ans Shape function.
766 void GaussInfo::quad4bInit()
768 LOCAL_COORD_MACRO_BEGIN;
786 LOCAL_COORD_MACRO_END;
788 SHAPE_FUN_MACRO_BEGIN;
789 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
790 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
791 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
792 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
796 void GaussInfo::quad4cInit()
798 LOCAL_COORD_MACRO_BEGIN;
816 LOCAL_COORD_MACRO_END;
818 SHAPE_FUN_MACRO_BEGIN;
819 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
820 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
821 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
822 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
827 * This shapefunc map is same as degenerated seg2Init
829 void GaussInfo::quad4DegSeg2Init()
831 LOCAL_COORD_MACRO_BEGIN;
848 LOCAL_COORD_MACRO_END;
850 SHAPE_FUN_MACRO_BEGIN;
851 funValue[0] = 0.5*(1.0 - gc[0]);
852 funValue[1] = 0.5*(1.0 + gc[0]);
859 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
862 void GaussInfo::quad8aInit()
864 LOCAL_COORD_MACRO_BEGIN;
897 LOCAL_COORD_MACRO_END;
899 SHAPE_FUN_MACRO_BEGIN;
900 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0])*(gc[1] - gc[0] - 1.0);
901 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0])*(-gc[1] - gc[0] - 1.0);
902 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0])*(-gc[1] + gc[0] - 1.0);
903 funValue[3] = 0.25*(1.0 + gc[1])*(1.0 + gc[0])*(gc[1] + gc[0] - 1.0);
904 funValue[4] = 0.5*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
905 funValue[5] = 0.5*(1.0 - gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
906 funValue[6] = 0.5*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
907 funValue[7] = 0.5*(1.0 + gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
912 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
915 void GaussInfo::quad8bInit()
917 LOCAL_COORD_MACRO_BEGIN;
950 LOCAL_COORD_MACRO_END;
952 SHAPE_FUN_MACRO_BEGIN;
953 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1])*(-1.0 - gc[0] - gc[1]);
954 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1])*(-1.0 + gc[0] - gc[1]);
955 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1])*(-1.0 + gc[0] + gc[1]);
956 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1])*(-1.0 - gc[0] + gc[1]);
957 funValue[4] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 - gc[1]);
958 funValue[5] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 + gc[0]);
959 funValue[6] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 + gc[1]);
960 funValue[7] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 - gc[0]);
964 void GaussInfo::quad9aInit()
966 LOCAL_COORD_MACRO_BEGIN;
1003 LOCAL_COORD_MACRO_END;
1005 SHAPE_FUN_MACRO_BEGIN;
1006 funValue[0] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]-1.);
1007 funValue[1] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]-1.);
1008 funValue[2] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]+1.);
1009 funValue[3] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]+1.);
1010 funValue[4] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.);
1011 funValue[5] = 0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1]);
1012 funValue[6] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.);
1013 funValue[7] = 0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1]);
1014 funValue[8] = (1.-gc[0]*gc[0])*(1.-gc[1]*gc[1]);
1015 SHAPE_FUN_MACRO_END;
1019 * Init Tetrahedron Reference coordinates ans Shape function.
1022 void GaussInfo::tetra4aInit()
1024 LOCAL_COORD_MACRO_BEGIN;
1045 LOCAL_COORD_MACRO_END;
1047 SHAPE_FUN_MACRO_BEGIN;
1048 funValue[0] = gc[1];
1049 funValue[1] = gc[2];
1050 funValue[2] = 1.0 - gc[0] - gc[1] - gc[2];
1051 funValue[3] = gc[0];
1052 SHAPE_FUN_MACRO_END;
1056 * Init Tetrahedron Reference coordinates ans Shape function.
1059 void GaussInfo::tetra4bInit()
1061 LOCAL_COORD_MACRO_BEGIN;
1082 LOCAL_COORD_MACRO_END;
1084 SHAPE_FUN_MACRO_BEGIN;
1085 funValue[0] = gc[1];
1086 funValue[2] = gc[2];
1087 funValue[1] = 1.0 - gc[0] - gc[1] - gc[2];
1088 funValue[3] = gc[0];
1089 SHAPE_FUN_MACRO_END;
1094 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1097 void GaussInfo::tetra10aInit()
1099 LOCAL_COORD_MACRO_BEGIN;
1150 LOCAL_COORD_MACRO_END;
1152 SHAPE_FUN_MACRO_BEGIN;
1153 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1154 funValue[1] = gc[2]*(2.0*gc[2] - 1.0);
1155 funValue[2] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1156 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1157 funValue[4] = 4.0*gc[1]*gc[2];
1158 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1159 funValue[6] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1160 funValue[7] = 4.0*gc[0]*gc[1];
1161 funValue[8] = 4.0*gc[0]*gc[2];
1162 funValue[9] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1163 SHAPE_FUN_MACRO_END;
1167 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1170 void GaussInfo::tetra10bInit()
1172 LOCAL_COORD_MACRO_BEGIN;
1223 LOCAL_COORD_MACRO_END;
1225 SHAPE_FUN_MACRO_BEGIN;
1226 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1227 funValue[2] = gc[2]*(2.0*gc[2] - 1.0);
1228 funValue[1] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1229 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1230 funValue[6] = 4.0*gc[1]*gc[2];
1231 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1232 funValue[4] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1233 funValue[7] = 4.0*gc[0]*gc[1];
1234 funValue[9] = 4.0*gc[0]*gc[2];
1235 funValue[8] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1236 SHAPE_FUN_MACRO_END;
1240 * Init Pyramid Reference coordinates ans Shape function.
1243 void GaussInfo::pyra5aInit()
1245 LOCAL_COORD_MACRO_BEGIN;
1271 LOCAL_COORD_MACRO_END;
1273 SHAPE_FUN_MACRO_BEGIN;
1274 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1275 funValue[1] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1276 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1277 funValue[3] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1278 funValue[4] = gc[2];
1279 SHAPE_FUN_MACRO_END;
1282 * Init Pyramid Reference coordinates ans Shape function.
1285 void GaussInfo::pyra5bInit()
1287 LOCAL_COORD_MACRO_BEGIN;
1313 LOCAL_COORD_MACRO_END;
1315 SHAPE_FUN_MACRO_BEGIN;
1316 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1317 funValue[3] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1318 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1319 funValue[1] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1320 funValue[4] = gc[2];
1321 SHAPE_FUN_MACRO_END;
1325 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1328 void GaussInfo::pyra13aInit()
1330 LOCAL_COORD_MACRO_BEGIN;
1397 LOCAL_COORD_MACRO_END;
1399 SHAPE_FUN_MACRO_BEGIN;
1400 funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1401 (gc[0] - 0.5)/(1.0 - gc[2]);
1402 funValue[1] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
1403 (gc[1] - 0.5)/(1.0 - gc[2]);
1404 funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
1405 (-gc[0] - 0.5)/(1.0 - gc[2]);
1406 funValue[3] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1407 (-gc[1] - 0.5)/(1.0 - gc[2]);
1409 funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
1411 funValue[5] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1412 (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1413 funValue[6] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
1414 (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1415 funValue[7] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
1416 (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1417 funValue[8] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1418 (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1420 funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
1422 funValue[10] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
1424 funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
1426 funValue[12] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
1428 SHAPE_FUN_MACRO_END;
1432 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1435 void GaussInfo::pyra13bInit()
1437 LOCAL_COORD_MACRO_BEGIN;
1503 LOCAL_COORD_MACRO_END;
1505 SHAPE_FUN_MACRO_BEGIN;
1506 funValue[0] =0.5*(-gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]-gc[1]+gc[2]-1.0)*(gc[0]-0.5)/(1.0-gc[2]);
1507 funValue[1] =0.5*(+gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]+gc[1]+gc[2]-1.0)*(-gc[1]-0.5)/(1.0-gc[2]);
1508 funValue[2] =0.5*(+gc[0]-gc[1]+gc[2]-1.0)*(+gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]-0.5)/(1.0-gc[2]);
1509 funValue[3] =0.5*(-gc[0]-gc[1]+gc[2]-1.0)*(+gc[0]-gc[1]+gc[2]-1.0)*(gc[1]-0.5)/(1.0-gc[2]);
1511 funValue[4] =2.*gc[2]*(gc[2]-0.5);
1513 funValue[5] =-0.5*(gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]-gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1514 funValue[6] =-0.5*(gc[0]-gc[1]+gc[2]-1.0)*(gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]+gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1515 funValue[7] =-0.5*(-gc[0]-gc[1]+gc[2]-1.0)*(gc[0]-gc[1]+gc[2]-1.0)*(gc[0]+gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1516 funValue[8] =-0.5*(-gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]-gc[1]+gc[2]-1.0)*(gc[0]-gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1518 funValue[9] =gc[2]*(-gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]-gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1519 funValue[10]=gc[2]*(gc[0]+gc[1]+gc[2]-1.0)*(-gc[0]+gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1520 funValue[11]=gc[2]*(gc[0]-gc[1]+gc[2]-1.0)*(gc[0]+gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1521 funValue[12]=gc[2]*(-gc[0]-gc[1]+gc[2]-1.0)*(gc[0]-gc[1]+gc[2]-1.0)/(1.0-gc[2]);
1523 SHAPE_FUN_MACRO_END;
1528 * Init Pentahedron Reference coordinates and Shape function.
1531 void GaussInfo::penta6aInit()
1533 LOCAL_COORD_MACRO_BEGIN;
1564 LOCAL_COORD_MACRO_END;
1566 SHAPE_FUN_MACRO_BEGIN;
1567 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1568 funValue[1] = 0.5*gc[2]*(1.0 - gc[0]);
1569 funValue[2] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1571 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1572 funValue[4] = 0.5*gc[2]*(gc[0] + 1.0);
1573 funValue[5] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1574 SHAPE_FUN_MACRO_END;
1578 * Init Pentahedron Reference coordinates and Shape function.
1581 void GaussInfo::penta6bInit()
1583 LOCAL_COORD_MACRO_BEGIN;
1614 LOCAL_COORD_MACRO_END;
1616 SHAPE_FUN_MACRO_BEGIN;
1617 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1618 funValue[2] = 0.5*gc[2]*(1.0 - gc[0]);
1619 funValue[1] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1620 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1621 funValue[5] = 0.5*gc[2]*(gc[0] + 1.0);
1622 funValue[4] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1623 SHAPE_FUN_MACRO_END;
1627 * This shapefunc map is same as degenerated tria3aInit
1629 void GaussInfo::penta6DegTria3aInit()
1631 LOCAL_COORD_MACRO_BEGIN;
1662 LOCAL_COORD_MACRO_END;
1664 SHAPE_FUN_MACRO_BEGIN;
1665 funValue[0] = 0.5*(1.0 + gc[1]);
1666 funValue[1] = -0.5*(gc[0] + gc[1]);
1667 funValue[2] = 0.5*(1.0 + gc[0]);
1671 SHAPE_FUN_MACRO_END;
1675 * This shapefunc map is same as degenerated tria3bInit
1677 void GaussInfo::penta6DegTria3bInit()
1679 LOCAL_COORD_MACRO_BEGIN;
1710 LOCAL_COORD_MACRO_END;
1712 SHAPE_FUN_MACRO_BEGIN;
1713 funValue[0] = 1.0 - gc[0] - gc[1];
1714 funValue[1] = gc[0];
1715 funValue[2] = gc[1];
1719 SHAPE_FUN_MACRO_END;
1723 * Init Pentahedron Reference coordinates and Shape function.
1726 void GaussInfo::penta15aInit()
1728 LOCAL_COORD_MACRO_BEGIN;
1805 LOCAL_COORD_MACRO_END;
1807 SHAPE_FUN_MACRO_BEGIN;
1808 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1809 funValue[1] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1810 funValue[2] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1812 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1813 funValue[4] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1814 funValue[5] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1816 funValue[6] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1817 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1818 funValue[8] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1820 funValue[9] = gc[1]*(1.0 - gc[0]*gc[0]);
1821 funValue[10] = gc[2]*(1.0 - gc[0]*gc[0]);
1822 funValue[11] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1824 funValue[12] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1825 funValue[13] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1826 funValue[14] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1827 SHAPE_FUN_MACRO_END;
1831 * Init Qaudratic Pentahedron Reference coordinates and Shape function.
1834 void GaussInfo::penta15bInit()
1836 LOCAL_COORD_MACRO_BEGIN;
1913 LOCAL_COORD_MACRO_END;
1915 SHAPE_FUN_MACRO_BEGIN;
1916 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1917 funValue[2] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1918 funValue[1] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1920 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1921 funValue[5] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1922 funValue[4] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1924 funValue[8] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1925 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1926 funValue[6] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1928 funValue[12] = gc[1]*(1.0 - gc[0]*gc[0]);
1929 funValue[14] = gc[2]*(1.0 - gc[0]*gc[0]);
1930 funValue[13] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1932 funValue[11] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1933 funValue[10] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1934 funValue[9] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1935 SHAPE_FUN_MACRO_END;
1939 * Init Hehahedron Reference coordinates and Shape function.
1942 void GaussInfo::hexa8aInit()
1944 LOCAL_COORD_MACRO_BEGIN;
1985 LOCAL_COORD_MACRO_END;
1987 SHAPE_FUN_MACRO_BEGIN;
1988 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1989 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1990 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1991 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1993 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1994 funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1995 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1996 funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1997 SHAPE_FUN_MACRO_END;
2001 * Init Hehahedron Reference coordinates and Shape function.
2004 void GaussInfo::hexa8bInit()
2006 LOCAL_COORD_MACRO_BEGIN;
2047 LOCAL_COORD_MACRO_END;
2049 SHAPE_FUN_MACRO_BEGIN;
2050 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2051 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2052 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2053 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2055 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2056 funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2057 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2058 funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2059 SHAPE_FUN_MACRO_END;
2063 * This shapefunc map is same as degenerated quad4bInit
2065 void GaussInfo::hexa8DegQuad4aInit()
2067 LOCAL_COORD_MACRO_BEGIN;
2108 LOCAL_COORD_MACRO_END;
2110 SHAPE_FUN_MACRO_BEGIN;
2111 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
2112 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
2113 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
2114 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2119 SHAPE_FUN_MACRO_END;
2123 * This shapefunc map is same as degenerated quad4bInit
2125 void GaussInfo::hexa8DegQuad4bInit()
2127 LOCAL_COORD_MACRO_BEGIN;
2168 LOCAL_COORD_MACRO_END;
2170 SHAPE_FUN_MACRO_BEGIN;
2171 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2172 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2173 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2174 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2179 SHAPE_FUN_MACRO_END;
2183 * This shapefunc map is same as degenerated quad4cInit
2185 void GaussInfo::hexa8DegQuad4cInit()
2187 LOCAL_COORD_MACRO_BEGIN;
2229 LOCAL_COORD_MACRO_END;
2231 SHAPE_FUN_MACRO_BEGIN;
2232 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2233 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2234 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2235 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2240 SHAPE_FUN_MACRO_END;
2244 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2247 void GaussInfo::hexa20aInit()
2249 LOCAL_COORD_MACRO_BEGIN;
2351 LOCAL_COORD_MACRO_END;
2353 SHAPE_FUN_MACRO_BEGIN;
2354 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2355 (-2.0 - gc[0] - gc[1] - gc[2]);
2356 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2357 (-2.0 + gc[0] - gc[1] - gc[2]);
2358 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2359 (-2.0 + gc[0] + gc[1] - gc[2]);
2360 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2361 (-2.0 - gc[0] + gc[1] - gc[2]);
2362 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2363 (-2.0 - gc[0] - gc[1] + gc[2]);
2364 funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2365 (-2.0 + gc[0] - gc[1] + gc[2]);
2366 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2367 (-2.0 + gc[0] + gc[1] + gc[2]);
2368 funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2369 (-2.0 - gc[0] + gc[1] + gc[2]);
2371 funValue[8] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2372 funValue[9] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2373 funValue[10] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2374 funValue[11] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2375 funValue[12] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2376 funValue[13] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2377 funValue[14] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2378 funValue[15] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2379 funValue[16] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2380 funValue[17] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2381 funValue[18] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2382 funValue[19] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2383 SHAPE_FUN_MACRO_END;
2387 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2390 void GaussInfo::hexa20bInit()
2392 LOCAL_COORD_MACRO_BEGIN;
2494 LOCAL_COORD_MACRO_END;
2496 SHAPE_FUN_MACRO_BEGIN;
2498 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2499 (-2.0 - gc[0] - gc[1] - gc[2]);
2500 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2501 (-2.0 + gc[0] - gc[1] - gc[2]);
2502 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2503 (-2.0 + gc[0] + gc[1] - gc[2]);
2504 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2505 (-2.0 - gc[0] + gc[1] - gc[2]);
2506 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2507 (-2.0 - gc[0] - gc[1] + gc[2]);
2508 funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
2509 (-2.0 + gc[0] - gc[1] + gc[2]);
2510 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2511 (-2.0 + gc[0] + gc[1] + gc[2]);
2512 funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2513 (-2.0 - gc[0] + gc[1] + gc[2]);
2515 funValue[11] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2516 funValue[10] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2517 funValue[9] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2518 funValue[8] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2519 funValue[16] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2520 funValue[19] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2521 funValue[18] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2522 funValue[17] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2523 funValue[15] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2524 funValue[14] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2525 funValue[13] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2526 funValue[12] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2527 SHAPE_FUN_MACRO_END;
2530 void GaussInfo::hexa27aInit()
2532 LOCAL_COORD_MACRO_BEGIN;
2668 LOCAL_COORD_MACRO_END;
2670 SHAPE_FUN_MACRO_BEGIN;
2672 funValue[0] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
2673 funValue[1] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
2674 funValue[2] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
2675 funValue[3] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
2676 funValue[4] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
2677 funValue[5] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
2678 funValue[6] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
2679 funValue[7] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
2680 funValue[8] =0.25*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1])*gc[2]*(gc[2]-1.);
2681 funValue[9] =0.25*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
2682 funValue[10]=0.25*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1])*gc[2]*(gc[2]-1.);
2683 funValue[11]=0.25*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
2684 funValue[12]=0.25*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1])*gc[2]*(gc[2]+1.);
2685 funValue[13]=0.25*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
2686 funValue[14]=0.25*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1])*gc[2]*(gc[2]+1.);
2687 funValue[15]=0.25*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
2688 funValue[16]=0.25*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*(1.-gc[2]*gc[2]);
2689 funValue[17]=0.25*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*(1.-gc[2]*gc[2]);
2690 funValue[18]=0.25*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*(1.-gc[2]*gc[2]);
2691 funValue[19]=0.25*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*(1.-gc[2]*gc[2]);
2692 funValue[20]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]-1.);
2693 funValue[21]=0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2694 funValue[22]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.)*(1.-gc[2]*gc[2]);
2695 funValue[23]=0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2696 funValue[24]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.)*(1.-gc[2]*gc[2]);
2697 funValue[25]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]+1.);
2698 funValue[26]=(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
2700 SHAPE_FUN_MACRO_END;
2703 ////////////////////////////////////////////////////////////////////////////////////////////////
2704 // GAUSS COORD CLASS //
2705 ////////////////////////////////////////////////////////////////////////////////////////////////
2709 GaussCoords::GaussCoords()
2716 GaussCoords::~GaussCoords()
2718 GaussInfoVector::iterator it = _my_gauss_info.begin();
2719 for( ; it != _my_gauss_info.end(); it++ )
2727 * Add Gauss localization info
2729 void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
2731 const double* theGaussCoord,
2733 const double* theReferenceCoord,
2736 GaussInfoVector::iterator it = _my_gauss_info.begin();
2737 for( ; it != _my_gauss_info.end(); it++ )
2739 if( (*it)->getCellType() == theGeometry )
2745 DataVector aGaussCoord;
2746 for(int i = 0 ; i < theNbGauss*coordDim; i++ )
2747 aGaussCoord.push_back(theGaussCoord[i]);
2749 DataVector aReferenceCoord;
2750 for(int i = 0 ; i < theNbRef*coordDim; i++ )
2751 aReferenceCoord.push_back(theReferenceCoord[i]);
2754 GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, theNbGauss, aReferenceCoord, theNbRef);
2755 info->initLocalInfo();
2757 //If info with cell type doesn't exist add it
2758 if( it == _my_gauss_info.end() )
2760 _my_gauss_info.push_back(info);
2762 // If information exists, update it
2766 int index = std::distance(_my_gauss_info.begin(),it);
2768 _my_gauss_info[index] = info;
2774 * Calculate gauss points coordinates
2776 double* GaussCoords::calculateCoords( NormalizedCellType theGeometry,
2777 const double *theNodeCoords,
2778 const int theSpaceDim,
2779 const int *theIndex)
2781 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2782 int nbCoords = theSpaceDim * info->getNbGauss();
2783 double *aCoords = new double[nbCoords];
2784 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,aCoords);
2789 void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2791 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2792 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,result);
2795 void GaussCoords::calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2797 int aConn = info->getNbRef();
2799 int nbCoords = theSpaceDim * info->getNbGauss();
2800 std::fill(result,result+nbCoords,0.);
2802 for( int gaussId = 0; gaussId < info->getNbGauss(); gaussId++ )
2804 double *coord=result+gaussId*theSpaceDim;
2805 const double *function=info->getFunctionValues(gaussId);
2806 for ( int connId = 0; connId < aConn ; connId++ )
2808 const double* nodeCoord = theNodeCoords + (theIndex[connId]*theSpaceDim);
2809 for( int dimId = 0; dimId < theSpaceDim; dimId++ )
2810 coord[dimId] += nodeCoord[dimId]*function[connId];
2815 const GaussInfo *GaussCoords::getInfoGivenCellType(NormalizedCellType cellType)
2817 GaussInfoVector::const_iterator it = _my_gauss_info.begin();
2818 //Try to find gauss localization info
2819 for( ; it != _my_gauss_info.end() ; it++ )
2820 if( (*it)->getCellType()==cellType)
2822 throw INTERP_KERNEL::Exception("Can't find gauss localization information !");