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 throw INTERP_KERNEL::Exception("Not manged cell type !");
453 * Return shape function value by node id
455 const double* GaussInfo::getFunctionValues( const int theGaussId ) const
457 return &_my_function_value[ _my_nb_ref*theGaussId ];
461 * Init Segment 2 Reference coordinates ans Shape function.
463 void GaussInfo::seg2Init()
465 LOCAL_COORD_MACRO_BEGIN;
472 LOCAL_COORD_MACRO_END;
474 SHAPE_FUN_MACRO_BEGIN;
475 funValue[0] = 0.5*(1.0 - gc[0]);
476 funValue[1] = 0.5*(1.0 + gc[0]);
481 * Init Segment 3 Reference coordinates ans Shape function.
483 void GaussInfo::seg3Init()
485 LOCAL_COORD_MACRO_BEGIN;
495 LOCAL_COORD_MACRO_END;
497 SHAPE_FUN_MACRO_BEGIN;
498 funValue[0] = -0.5*(1.0 - gc[0])*gc[0];
499 funValue[1] = 0.5*(1.0 + gc[0])*gc[0];
500 funValue[2] = (1.0 + gc[0])*(1.0 - gc[0]);
505 * Init Triangle Reference coordinates ans Shape function.
508 void GaussInfo::tria3aInit()
510 LOCAL_COORD_MACRO_BEGIN;
523 LOCAL_COORD_MACRO_END;
525 SHAPE_FUN_MACRO_BEGIN;
526 funValue[0] = 0.5*(1.0 + gc[1]);
527 funValue[1] = -0.5*(gc[0] + gc[1]);
528 funValue[2] = 0.5*(1.0 + gc[0]);
533 * Init Triangle Reference coordinates ans Shape function.
536 void GaussInfo::tria3bInit()
538 LOCAL_COORD_MACRO_BEGIN;
551 LOCAL_COORD_MACRO_END;
553 SHAPE_FUN_MACRO_BEGIN;
554 funValue[0] = 1.0 - gc[0] - gc[1];
561 * Init Quadratic Triangle Reference coordinates ans Shape function.
564 void GaussInfo::tria6aInit()
566 LOCAL_COORD_MACRO_BEGIN;
591 LOCAL_COORD_MACRO_END;
593 SHAPE_FUN_MACRO_BEGIN;
594 funValue[0] = 0.5*(1.0 + gc[1])*gc[1];
595 funValue[1] = 0.5*(gc[0] + gc[1])*(gc[0] + gc[1] + 1);
596 funValue[2] = 0.5*(1.0 + gc[0])*gc[0];
597 funValue[3] = -1.0*(1.0 + gc[1])*(gc[0] + gc[1]);
598 funValue[4] = -1.0*(1.0 + gc[0])*(gc[0] + gc[1]);
599 funValue[5] = (1.0 + gc[1])*(1.0 + gc[1]);
604 * Init Quadratic Triangle Reference coordinates ans Shape function.
607 void GaussInfo::tria6bInit()
609 LOCAL_COORD_MACRO_BEGIN;
640 LOCAL_COORD_MACRO_END;
642 SHAPE_FUN_MACRO_BEGIN;
643 funValue[0] = (1.0 - gc[0] - gc[1])*(1.0 - 2.0*gc[0] - 2.0*gc[1]);
644 funValue[1] = gc[0]*(2.0*gc[0] - 1.0);
645 funValue[2] = gc[1]*(2.0*gc[1] - 1.0);
646 funValue[3] = 4.0*gc[0]*(1.0 - gc[0] - gc[1]);
647 funValue[4] = 4.0*gc[0]*gc[1];
648 funValue[5] = 4.0*gc[1]*(1.0 - gc[0] - gc[1]);
653 * Init Quadrangle Reference coordinates ans Shape function.
656 void GaussInfo::quad4aInit()
658 LOCAL_COORD_MACRO_BEGIN;
676 LOCAL_COORD_MACRO_END;
678 SHAPE_FUN_MACRO_BEGIN;
679 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
680 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
681 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
682 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
687 * Init Quadrangle Reference coordinates ans Shape function.
690 void GaussInfo::quad4bInit()
692 LOCAL_COORD_MACRO_BEGIN;
710 LOCAL_COORD_MACRO_END;
712 SHAPE_FUN_MACRO_BEGIN;
713 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
714 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
715 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
716 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
720 void GaussInfo::quad4cInit()
722 LOCAL_COORD_MACRO_BEGIN;
740 LOCAL_COORD_MACRO_END;
742 SHAPE_FUN_MACRO_BEGIN;
743 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
744 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
745 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
746 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
751 * This shapefunc map is same as degenerated seg2Init
753 void GaussInfo::quad4DegSeg2Init()
755 LOCAL_COORD_MACRO_BEGIN;
772 LOCAL_COORD_MACRO_END;
774 SHAPE_FUN_MACRO_BEGIN;
775 funValue[0] = 0.5*(1.0 - gc[0]);
776 funValue[1] = 0.5*(1.0 + gc[0]);
783 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
786 void GaussInfo::quad8aInit()
788 LOCAL_COORD_MACRO_BEGIN;
821 LOCAL_COORD_MACRO_END;
823 SHAPE_FUN_MACRO_BEGIN;
824 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0])*(gc[1] - gc[0] - 1.0);
825 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0])*(-gc[1] - gc[0] - 1.0);
826 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0])*(-gc[1] + gc[0] - 1.0);
827 funValue[3] = 0.25*(1.0 + gc[1])*(1.0 + gc[0])*(gc[1] + gc[0] - 1.0);
828 funValue[4] = 0.5*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
829 funValue[5] = 0.5*(1.0 - gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
830 funValue[6] = 0.5*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
831 funValue[7] = 0.5*(1.0 + gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
836 * Init Quadratic Quadrangle Reference coordinates ans Shape function.
839 void GaussInfo::quad8bInit()
841 LOCAL_COORD_MACRO_BEGIN;
874 LOCAL_COORD_MACRO_END;
876 SHAPE_FUN_MACRO_BEGIN;
877 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1])*(-1.0 - gc[0] - gc[1]);
878 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1])*(-1.0 + gc[0] - gc[1]);
879 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1])*(-1.0 + gc[0] + gc[1]);
880 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1])*(-1.0 - gc[0] + gc[1]);
881 funValue[4] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 - gc[1]);
882 funValue[5] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 + gc[0]);
883 funValue[6] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 + gc[1]);
884 funValue[7] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 - gc[0]);
888 void GaussInfo::quad9aInit()
890 LOCAL_COORD_MACRO_BEGIN;
927 LOCAL_COORD_MACRO_END;
929 SHAPE_FUN_MACRO_BEGIN;
930 funValue[0] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]-1.);
931 funValue[1] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]-1.);
932 funValue[2] = 0.25*gc[0]*gc[1]*(gc[0]+1.)*(gc[1]+1.);
933 funValue[3] = 0.25*gc[0]*gc[1]*(gc[0]-1.)*(gc[1]+1.);
934 funValue[4] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.);
935 funValue[5] = 0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1]);
936 funValue[6] = 0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.);
937 funValue[7] = 0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1]);
938 funValue[8] = (1.-gc[0]*gc[0])*(1.-gc[1]*gc[1]);
943 * Init Tetrahedron Reference coordinates ans Shape function.
946 void GaussInfo::tetra4aInit()
948 LOCAL_COORD_MACRO_BEGIN;
969 LOCAL_COORD_MACRO_END;
971 SHAPE_FUN_MACRO_BEGIN;
974 funValue[2] = 1.0 - gc[0] - gc[1] - gc[2];
980 * Init Tetrahedron Reference coordinates ans Shape function.
983 void GaussInfo::tetra4bInit()
985 LOCAL_COORD_MACRO_BEGIN;
1006 LOCAL_COORD_MACRO_END;
1008 SHAPE_FUN_MACRO_BEGIN;
1009 funValue[0] = gc[1];
1010 funValue[2] = gc[2];
1011 funValue[1] = 1.0 - gc[0] - gc[1] - gc[2];
1012 funValue[3] = gc[0];
1013 SHAPE_FUN_MACRO_END;
1018 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1021 void GaussInfo::tetra10aInit()
1023 LOCAL_COORD_MACRO_BEGIN;
1074 LOCAL_COORD_MACRO_END;
1076 SHAPE_FUN_MACRO_BEGIN;
1077 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1078 funValue[1] = gc[2]*(2.0*gc[2] - 1.0);
1079 funValue[2] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1080 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1081 funValue[4] = 4.0*gc[1]*gc[2];
1082 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1083 funValue[6] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1084 funValue[7] = 4.0*gc[0]*gc[1];
1085 funValue[8] = 4.0*gc[0]*gc[2];
1086 funValue[9] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1087 SHAPE_FUN_MACRO_END;
1091 * Init Quadratic Tetrahedron Reference coordinates ans Shape function.
1094 void GaussInfo::tetra10bInit()
1096 LOCAL_COORD_MACRO_BEGIN;
1147 LOCAL_COORD_MACRO_END;
1149 SHAPE_FUN_MACRO_BEGIN;
1150 funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
1151 funValue[2] = gc[2]*(2.0*gc[2] - 1.0);
1152 funValue[1] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
1153 funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
1154 funValue[6] = 4.0*gc[1]*gc[2];
1155 funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
1156 funValue[4] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
1157 funValue[7] = 4.0*gc[0]*gc[1];
1158 funValue[9] = 4.0*gc[0]*gc[2];
1159 funValue[8] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
1160 SHAPE_FUN_MACRO_END;
1164 * Init Pyramid Reference coordinates ans Shape function.
1167 void GaussInfo::pyra5aInit()
1169 LOCAL_COORD_MACRO_BEGIN;
1195 LOCAL_COORD_MACRO_END;
1197 SHAPE_FUN_MACRO_BEGIN;
1198 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1199 funValue[1] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1200 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1201 funValue[3] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1202 funValue[4] = gc[2];
1203 SHAPE_FUN_MACRO_END;
1206 * Init Pyramid Reference coordinates ans Shape function.
1209 void GaussInfo::pyra5bInit()
1211 LOCAL_COORD_MACRO_BEGIN;
1237 LOCAL_COORD_MACRO_END;
1239 SHAPE_FUN_MACRO_BEGIN;
1240 funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1241 funValue[3] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1242 funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
1243 funValue[1] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
1244 funValue[4] = gc[2];
1245 SHAPE_FUN_MACRO_END;
1249 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1252 void GaussInfo::pyra13aInit()
1254 LOCAL_COORD_MACRO_BEGIN;
1321 LOCAL_COORD_MACRO_END;
1323 SHAPE_FUN_MACRO_BEGIN;
1324 funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1325 (gc[0] - 0.5)/(1.0 - gc[2]);
1326 funValue[1] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
1327 (gc[1] - 0.5)/(1.0 - gc[2]);
1328 funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
1329 (-gc[0] - 0.5)/(1.0 - gc[2]);
1330 funValue[3] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1331 (-gc[1] - 0.5)/(1.0 - gc[2]);
1333 funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
1335 funValue[5] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1336 (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1337 funValue[6] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
1338 (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1339 funValue[7] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
1340 (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1341 funValue[8] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1342 (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1344 funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
1346 funValue[10] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
1348 funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
1350 funValue[12] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
1352 SHAPE_FUN_MACRO_END;
1356 * Init Quadratic Pyramid Reference coordinates ans Shape function.
1359 void GaussInfo::pyra13bInit()
1361 LOCAL_COORD_MACRO_BEGIN;
1427 LOCAL_COORD_MACRO_END;
1429 SHAPE_FUN_MACRO_BEGIN;
1430 funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1431 (gc[0] - 0.5)/(1.0 - gc[2]);
1432 funValue[3] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
1433 (gc[1] - 0.5)/(1.0 - gc[2]);
1434 funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
1435 (-gc[0] - 0.5)/(1.0 - gc[2]);
1436 funValue[1] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1437 (-gc[1] - 0.5)/(1.0 - gc[2]);
1439 funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
1441 funValue[8] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
1442 (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1443 funValue[7] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
1444 (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1445 funValue[6] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
1446 (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1447 funValue[5] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
1448 (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
1450 funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
1452 funValue[12] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
1454 funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
1456 funValue[10] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
1458 SHAPE_FUN_MACRO_END;
1463 * Init Pentahedron Reference coordinates and Shape function.
1466 void GaussInfo::penta6aInit()
1468 LOCAL_COORD_MACRO_BEGIN;
1499 LOCAL_COORD_MACRO_END;
1501 SHAPE_FUN_MACRO_BEGIN;
1502 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1503 funValue[1] = 0.5*gc[2]*(1.0 - gc[0]);
1504 funValue[2] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1506 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1507 funValue[4] = 0.5*gc[2]*(gc[0] + 1.0);
1508 funValue[5] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1509 SHAPE_FUN_MACRO_END;
1513 * Init Pentahedron Reference coordinates and Shape function.
1516 void GaussInfo::penta6bInit()
1518 LOCAL_COORD_MACRO_BEGIN;
1549 LOCAL_COORD_MACRO_END;
1551 SHAPE_FUN_MACRO_BEGIN;
1552 funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
1553 funValue[2] = 0.5*gc[2]*(1.0 - gc[0]);
1554 funValue[1] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1555 funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
1556 funValue[5] = 0.5*gc[2]*(gc[0] + 1.0);
1557 funValue[4] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1558 SHAPE_FUN_MACRO_END;
1562 * This shapefunc map is same as degenerated tria3aInit
1564 void GaussInfo::penta6DegTria3aInit()
1566 LOCAL_COORD_MACRO_BEGIN;
1597 LOCAL_COORD_MACRO_END;
1599 SHAPE_FUN_MACRO_BEGIN;
1600 funValue[0] = 0.5*(1.0 + gc[1]);
1601 funValue[1] = -0.5*(gc[0] + gc[1]);
1602 funValue[2] = 0.5*(1.0 + gc[0]);
1606 SHAPE_FUN_MACRO_END;
1610 * This shapefunc map is same as degenerated tria3bInit
1612 void GaussInfo::penta6DegTria3bInit()
1614 LOCAL_COORD_MACRO_BEGIN;
1645 LOCAL_COORD_MACRO_END;
1647 SHAPE_FUN_MACRO_BEGIN;
1648 funValue[0] = 1.0 - gc[0] - gc[1];
1649 funValue[1] = gc[0];
1650 funValue[2] = gc[1];
1654 SHAPE_FUN_MACRO_END;
1658 * Init Pentahedron Reference coordinates and Shape function.
1661 void GaussInfo::penta15aInit()
1663 LOCAL_COORD_MACRO_BEGIN;
1740 LOCAL_COORD_MACRO_END;
1742 SHAPE_FUN_MACRO_BEGIN;
1743 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1744 funValue[1] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1745 funValue[2] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1747 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1748 funValue[4] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1749 funValue[5] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1751 funValue[6] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1752 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1753 funValue[8] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1755 funValue[9] = gc[1]*(1.0 - gc[0]*gc[0]);
1756 funValue[10] = gc[2]*(1.0 - gc[0]*gc[0]);
1757 funValue[11] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1759 funValue[12] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1760 funValue[13] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1761 funValue[14] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1762 SHAPE_FUN_MACRO_END;
1766 * Init Qaudratic Pentahedron Reference coordinates and Shape function.
1769 void GaussInfo::penta15bInit()
1771 LOCAL_COORD_MACRO_BEGIN;
1848 LOCAL_COORD_MACRO_END;
1850 SHAPE_FUN_MACRO_BEGIN;
1851 funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
1852 funValue[2] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
1853 funValue[1] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1855 funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
1856 funValue[5] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
1857 funValue[4] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
1859 funValue[8] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
1860 funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1861 funValue[6] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
1863 funValue[12] = gc[1]*(1.0 - gc[0]*gc[0]);
1864 funValue[14] = gc[2]*(1.0 - gc[0]*gc[0]);
1865 funValue[13] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
1867 funValue[11] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
1868 funValue[10] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1869 funValue[9] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
1870 SHAPE_FUN_MACRO_END;
1874 * Init Hehahedron Reference coordinates and Shape function.
1877 void GaussInfo::hexa8aInit()
1879 LOCAL_COORD_MACRO_BEGIN;
1920 LOCAL_COORD_MACRO_END;
1922 SHAPE_FUN_MACRO_BEGIN;
1923 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1924 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1925 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1926 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1928 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1929 funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1930 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1931 funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1932 SHAPE_FUN_MACRO_END;
1936 * Init Hehahedron Reference coordinates and Shape function.
1939 void GaussInfo::hexa8bInit()
1941 LOCAL_COORD_MACRO_BEGIN;
1982 LOCAL_COORD_MACRO_END;
1984 SHAPE_FUN_MACRO_BEGIN;
1985 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1986 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
1987 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1988 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
1990 funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1991 funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
1992 funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1993 funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
1994 SHAPE_FUN_MACRO_END;
1998 * This shapefunc map is same as degenerated quad4bInit
2000 void GaussInfo::hexa8DegQuad4aInit()
2002 LOCAL_COORD_MACRO_BEGIN;
2043 LOCAL_COORD_MACRO_END;
2045 SHAPE_FUN_MACRO_BEGIN;
2046 funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
2047 funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
2048 funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
2049 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2054 SHAPE_FUN_MACRO_END;
2058 * This shapefunc map is same as degenerated quad4bInit
2060 void GaussInfo::hexa8DegQuad4bInit()
2062 LOCAL_COORD_MACRO_BEGIN;
2103 LOCAL_COORD_MACRO_END;
2105 SHAPE_FUN_MACRO_BEGIN;
2106 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2107 funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2108 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2109 funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2114 SHAPE_FUN_MACRO_END;
2118 * This shapefunc map is same as degenerated quad4cInit
2120 void GaussInfo::hexa8DegQuad4cInit()
2122 LOCAL_COORD_MACRO_BEGIN;
2164 LOCAL_COORD_MACRO_END;
2166 SHAPE_FUN_MACRO_BEGIN;
2167 funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
2168 funValue[1] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
2169 funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
2170 funValue[3] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
2175 SHAPE_FUN_MACRO_END;
2179 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2182 void GaussInfo::hexa20aInit()
2184 LOCAL_COORD_MACRO_BEGIN;
2286 LOCAL_COORD_MACRO_END;
2288 SHAPE_FUN_MACRO_BEGIN;
2289 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2290 (-2.0 - gc[0] - gc[1] - gc[2]);
2291 funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2292 (-2.0 + gc[0] - gc[1] - gc[2]);
2293 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2294 (-2.0 + gc[0] + gc[1] - gc[2]);
2295 funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2296 (-2.0 - gc[0] + gc[1] - gc[2]);
2297 funValue[4] = 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[5] = 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[6] = 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[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2304 (-2.0 - gc[0] + gc[1] + gc[2]);
2306 funValue[8] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2307 funValue[9] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2308 funValue[10] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2309 funValue[11] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2310 funValue[12] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2311 funValue[13] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2312 funValue[14] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2313 funValue[15] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2314 funValue[16] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2315 funValue[17] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2316 funValue[18] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2317 funValue[19] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2318 SHAPE_FUN_MACRO_END;
2322 * Init Qaudratic Hehahedron Reference coordinates and Shape function.
2325 void GaussInfo::hexa20bInit()
2327 LOCAL_COORD_MACRO_BEGIN;
2429 LOCAL_COORD_MACRO_END;
2431 SHAPE_FUN_MACRO_BEGIN;
2433 funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2434 (-2.0 - gc[0] - gc[1] - gc[2]);
2435 funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
2436 (-2.0 + gc[0] - gc[1] - gc[2]);
2437 funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2438 (-2.0 + gc[0] + gc[1] - gc[2]);
2439 funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
2440 (-2.0 - gc[0] + gc[1] - gc[2]);
2441 funValue[4] = 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[7] = 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[6] = 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[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
2448 (-2.0 - gc[0] + gc[1] + gc[2]);
2450 funValue[11] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
2451 funValue[10] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
2452 funValue[9] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
2453 funValue[8] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
2454 funValue[16] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
2455 funValue[19] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
2456 funValue[18] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
2457 funValue[17] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
2458 funValue[15] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
2459 funValue[14] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
2460 funValue[13] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
2461 funValue[12] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
2462 SHAPE_FUN_MACRO_END;
2467 ////////////////////////////////////////////////////////////////////////////////////////////////
2468 // GAUSS COORD CLASS //
2469 ////////////////////////////////////////////////////////////////////////////////////////////////
2473 GaussCoords::GaussCoords()
2480 GaussCoords::~GaussCoords()
2482 GaussInfoVector::iterator it = _my_gauss_info.begin();
2483 for( ; it != _my_gauss_info.end(); it++ )
2491 * Add Gauss localization info
2493 void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
2495 const double* theGaussCoord,
2497 const double* theReferenceCoord,
2500 GaussInfoVector::iterator it = _my_gauss_info.begin();
2501 for( ; it != _my_gauss_info.end(); it++ )
2503 if( (*it)->getCellType() == theGeometry )
2509 DataVector aGaussCoord;
2510 for(int i = 0 ; i < theNbGauss*coordDim; i++ )
2511 aGaussCoord.push_back(theGaussCoord[i]);
2513 DataVector aReferenceCoord;
2514 for(int i = 0 ; i < theNbRef*coordDim; i++ )
2515 aReferenceCoord.push_back(theReferenceCoord[i]);
2518 GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, theNbGauss, aReferenceCoord, theNbRef);
2519 info->initLocalInfo();
2521 //If info with cell type doesn't exist add it
2522 if( it == _my_gauss_info.end() )
2524 _my_gauss_info.push_back(info);
2526 // If information exists, update it
2530 int index = std::distance(_my_gauss_info.begin(),it);
2532 _my_gauss_info[index] = info;
2538 * Calculate gauss points coordinates
2540 double* GaussCoords::calculateCoords( NormalizedCellType theGeometry,
2541 const double *theNodeCoords,
2542 const int theSpaceDim,
2543 const int *theIndex)
2545 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2546 int nbCoords = theSpaceDim * info->getNbGauss();
2547 double *aCoords = new double[nbCoords];
2548 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,aCoords);
2553 void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2555 const GaussInfo *info = getInfoGivenCellType(theGeometry);
2556 calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,result);
2559 void GaussCoords::calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
2561 int aConn = info->getNbRef();
2563 int nbCoords = theSpaceDim * info->getNbGauss();
2564 std::fill(result,result+nbCoords,0.);
2566 for( int gaussId = 0; gaussId < info->getNbGauss(); gaussId++ )
2568 double *coord=result+gaussId*theSpaceDim;
2569 const double *function=info->getFunctionValues(gaussId);
2570 for ( int connId = 0; connId < aConn ; connId++ )
2572 const double* nodeCoord = theNodeCoords + (theIndex[connId]*theSpaceDim);
2573 for( int dimId = 0; dimId < theSpaceDim; dimId++ )
2574 coord[dimId] += nodeCoord[dimId]*function[connId];
2579 const GaussInfo *GaussCoords::getInfoGivenCellType(NormalizedCellType cellType)
2581 GaussInfoVector::const_iterator it = _my_gauss_info.begin();
2582 //Try to find gauss localization info
2583 for( ; it != _my_gauss_info.end() ; it++ )
2584 if( (*it)->getCellType()==cellType)
2586 throw INTERP_KERNEL::Exception("Can't find gauss localization information !");