Back to index

salome-med  6.5.0
InterpKernelGaussCoords.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //Local includes
00021 #include "InterpKernelGaussCoords.hxx"
00022 #include "CellModel.hxx"
00023 
00024 //STL includes
00025 #include <math.h>
00026 #include <algorithm>
00027 #include <sstream>
00028 
00029 using namespace INTERP_KERNEL;
00030 
00031 //Define common part of the code in the MACRO
00032 //---------------------------------------------------------------
00033 #define LOCAL_COORD_MACRO_BEGIN                                         \
00034   _my_local_reference_coord.resize( _my_local_ref_dim*_my_local_nb_ref );           \
00035   for( int refId = 0; refId < _my_local_nb_ref; refId++ )                   \
00036     {                                                                   \
00037       double* coords = &_my_local_reference_coord[ refId*_my_local_ref_dim ];   \
00038       switch(refId)                                                     \
00039         {
00040 
00041 //---------------------------------------------------------------
00042 #define LOCAL_COORD_MACRO_END                   \
00043   }                                             \
00044 }
00045 
00046 //---------------------------------------------------------------
00047 #define SHAPE_FUN_MACRO_BEGIN                                           \
00048   for( int gaussId     = 0 ; gaussId < _my_nb_gauss ; gaussId++ )          \
00049     {                                                                   \
00050       double* funValue =  &_my_function_value[ gaussId * _my_nb_ref ];        \
00051       const double* gc = &_my_gauss_coord[ gaussId * getGaussCoordDim() ];
00052 
00053 //---------------------------------------------------------------
00054 #define SHAPE_FUN_MACRO_END                     \
00055   }
00056 
00057 #define CHECK_MACRO                                                        \
00058   if( ! aSatify )                                                          \
00059     {                                                                      \
00060       std::ostringstream stream;                                           \
00061       stream << "Error in the gauss localization for the cell with type "; \
00062       stream << cellModel.getRepr();                                       \
00063       stream << " !!!";                                                    \
00064       throw INTERP_KERNEL::Exception(stream.str().c_str());                \
00065     }
00066 
00067 
00068 //---------------------------------------------------------------
00069 static bool IsEqual(double theLeft, double theRight) 
00070 {
00071   static double EPS = 1.0E-3;
00072   if(fabs(theLeft) + fabs(theRight) > EPS)
00073     return fabs(theLeft-theRight)/(fabs(theLeft)+fabs(theRight)) < EPS;
00074   return true;
00075 }
00076 
00077 
00079 //                                GAUSS INFO CLASS                                            //
00081 
00085 GaussInfo::GaussInfo( NormalizedCellType theGeometry,
00086                       const DataVector& theGaussCoord,
00087                       int theNbGauss,
00088                       const DataVector& theReferenceCoord,
00089                       int theNbRef ) :
00090   _my_geometry(theGeometry),
00091   _my_nb_gauss(theNbGauss),
00092   _my_gauss_coord(theGaussCoord),
00093   _my_nb_ref(theNbRef),
00094   _my_reference_coord(theReferenceCoord)
00095 {
00096 
00097   //Allocate shape function values
00098   _my_function_value.resize( _my_nb_gauss * _my_nb_ref );
00099 }
00100 
00104 GaussInfo::~GaussInfo()
00105 {
00106 }
00107 
00111 int GaussInfo::getGaussCoordDim() const 
00112 {
00113   if( _my_nb_gauss ) 
00114     {
00115       return _my_gauss_coord.size()/_my_nb_gauss;
00116     }
00117   else 
00118     {
00119       return 0;
00120     }
00121 }
00122 
00126 int GaussInfo::getReferenceCoordDim() const 
00127 {
00128   if( _my_nb_ref ) 
00129     {
00130       return _my_reference_coord.size()/_my_nb_ref;
00131     }
00132   else 
00133     {
00134       return 0;
00135     }
00136 }
00137 
00141 NormalizedCellType GaussInfo::getCellType() const 
00142 {
00143   return _my_geometry;
00144 }
00145 
00149 int GaussInfo::getNbGauss() const 
00150 {
00151   return _my_nb_gauss;
00152 }
00153 
00157 int GaussInfo::getNbRef() const 
00158 {
00159   return _my_nb_ref;
00160 }
00161 
00165 bool GaussInfo::isSatisfy() 
00166 {
00167 
00168   bool anIsSatisfy = ((_my_local_nb_ref == _my_nb_ref) && (_my_local_ref_dim == getReferenceCoordDim()));
00169   //Check coordinates
00170   if(anIsSatisfy)
00171     {
00172       for( int refId = 0; refId < _my_local_nb_ref; refId++ ) 
00173         {
00174           double* refCoord = &_my_reference_coord[ refId*_my_local_ref_dim ];
00175           double* localRefCoord = &_my_local_reference_coord[ refId*_my_local_ref_dim ];
00176           bool anIsEqual = false;
00177           for( int dimId = 0; dimId < _my_local_ref_dim; dimId++ ) 
00178             {
00179               anIsEqual = IsEqual( localRefCoord[dimId], refCoord[dimId]);
00180               if(!anIsEqual ) 
00181                 {
00182                   return false;
00183                 }
00184             }
00185         }
00186     }
00187   return anIsSatisfy;
00188 }
00189 
00193 void GaussInfo::initLocalInfo() throw (INTERP_KERNEL::Exception) 
00194 {
00195   bool aSatify = false;
00196   const CellModel& cellModel=CellModel::GetCellModel(_my_geometry);
00197   switch( _my_geometry ) 
00198     {
00199     case NORM_SEG2:
00200       _my_local_ref_dim = 1;
00201       _my_local_nb_ref  = 2;
00202       seg2Init();
00203       aSatify = isSatisfy();
00204       CHECK_MACRO;
00205       break;
00206 
00207     case NORM_SEG3:
00208       _my_local_ref_dim = 1;
00209       _my_local_nb_ref  = 3;
00210       seg3Init();
00211       aSatify = isSatisfy();
00212       CHECK_MACRO;
00213       break;
00214 
00215     case NORM_TRI3:
00216       _my_local_ref_dim = 2;
00217       _my_local_nb_ref  = 3;
00218       tria3aInit();
00219       aSatify = isSatisfy();
00220 
00221       if(!aSatify)
00222         {
00223           tria3bInit();
00224           aSatify = isSatisfy();
00225           CHECK_MACRO;
00226         }
00227       break;
00228 
00229     case NORM_TRI6:
00230       _my_local_ref_dim = 2;
00231       _my_local_nb_ref  = 6;
00232       tria6aInit();
00233       aSatify = isSatisfy();
00234       if(!aSatify)
00235         {
00236           tria6bInit();
00237           aSatify = isSatisfy();
00238           CHECK_MACRO;
00239         }
00240       break;
00241 
00242     case NORM_QUAD4:
00243       _my_local_ref_dim = 2;
00244       _my_local_nb_ref  = 4;
00245       quad4aInit();
00246       aSatify = isSatisfy();
00247 
00248       if(!aSatify)
00249         {
00250           quad4bInit();
00251           aSatify = isSatisfy();
00252           CHECK_MACRO;
00253         }
00254       break;
00255 
00256     case NORM_QUAD8:
00257       _my_local_ref_dim = 2;
00258       _my_local_nb_ref  = 8;
00259       quad8aInit();
00260       aSatify = isSatisfy();
00261 
00262       if(!aSatify)
00263         {
00264           quad8bInit();
00265           aSatify = isSatisfy();
00266           CHECK_MACRO;
00267         }
00268       break;
00269 
00270     case NORM_TETRA4:
00271       _my_local_ref_dim = 3;
00272       _my_local_nb_ref  = 4;
00273       tetra4aInit();
00274       aSatify = isSatisfy();
00275 
00276       if(!aSatify)
00277         {
00278           tetra4bInit();
00279           aSatify = isSatisfy();
00280           CHECK_MACRO;
00281         }
00282       break;
00283 
00284     case NORM_TETRA10:
00285       _my_local_ref_dim = 3;
00286       _my_local_nb_ref  = 10;
00287       tetra10aInit();
00288       aSatify = isSatisfy();
00289 
00290       if(!aSatify)
00291         {
00292           tetra10bInit();
00293           aSatify = isSatisfy();
00294           CHECK_MACRO;
00295         }
00296       break;
00297 
00298     case NORM_PYRA5:
00299       _my_local_ref_dim = 3;
00300       _my_local_nb_ref  = 5;
00301       pyra5aInit();
00302       aSatify = isSatisfy();
00303 
00304       if(!aSatify)
00305         {
00306           pyra5bInit();
00307           aSatify = isSatisfy();
00308           CHECK_MACRO;
00309         }
00310       break;
00311 
00312     case NORM_PYRA13:
00313       _my_local_ref_dim = 3;
00314       _my_local_nb_ref  = 13;
00315       pyra13aInit();
00316       aSatify = isSatisfy();
00317 
00318       if(!aSatify)
00319         {
00320           pyra13bInit();
00321           aSatify = isSatisfy();
00322           CHECK_MACRO;
00323         }
00324       break;
00325 
00326     case NORM_PENTA6:
00327       _my_local_ref_dim = 3;
00328       _my_local_nb_ref  = 6;
00329       penta6aInit();
00330       aSatify = isSatisfy();
00331 
00332       if(!aSatify)
00333         {
00334           penta6bInit();
00335           aSatify = isSatisfy();
00336           CHECK_MACRO;
00337         }
00338       break;
00339 
00340     case NORM_PENTA15:
00341       _my_local_ref_dim = 3;
00342       _my_local_nb_ref  = 15;
00343       penta15aInit();
00344       aSatify = isSatisfy();
00345 
00346       if(!aSatify)
00347         {
00348           penta15bInit();
00349           aSatify = isSatisfy();
00350           CHECK_MACRO;
00351         }
00352       break;
00353 
00354     case NORM_HEXA8:
00355       _my_local_ref_dim = 3;
00356       _my_local_nb_ref  = 8;
00357       hexa8aInit();
00358       aSatify = isSatisfy();
00359 
00360       if(!aSatify)
00361         {
00362           hexa8aInit();
00363           aSatify = isSatisfy();
00364           CHECK_MACRO;
00365         }
00366       break;
00367 
00368     case NORM_HEXA20:
00369       _my_local_ref_dim = 3;
00370       _my_local_nb_ref  = 20;
00371       hexa20aInit();
00372       aSatify = isSatisfy();
00373 
00374       if(!aSatify)
00375         {
00376           hexa20aInit();
00377           aSatify = isSatisfy();
00378           CHECK_MACRO;
00379         }
00380       break;
00381 
00382     default:
00383       throw INTERP_KERNEL::Exception("Not manged cell type !");
00384       break;
00385     }
00386 }
00387 
00391 const double* GaussInfo::getFunctionValues( const int theGaussId ) const 
00392 {
00393   return &_my_function_value[ _my_nb_ref*theGaussId ];
00394 }
00395 
00399 void GaussInfo::seg2Init() 
00400 {
00401   LOCAL_COORD_MACRO_BEGIN;
00402   case  0:
00403     coords[0] = -1.0;
00404     break;
00405   case  1:
00406     coords[0] =  1.0;
00407     break;
00408    LOCAL_COORD_MACRO_END;
00409 
00410    SHAPE_FUN_MACRO_BEGIN;
00411    funValue[0] = 0.5*(1.0 - gc[0]);
00412    funValue[1] = 0.5*(1.0 + gc[0]);
00413    SHAPE_FUN_MACRO_END;
00414 }
00415 
00419 void GaussInfo::seg3Init() 
00420 {
00421   LOCAL_COORD_MACRO_BEGIN;
00422   case  0:
00423     coords[0] = -1.0;
00424     break;
00425   case  1:
00426     coords[0] =  1.0;
00427     break;
00428   case  2:
00429     coords[0] =  0.0;
00430     break;
00431    LOCAL_COORD_MACRO_END;
00432 
00433    SHAPE_FUN_MACRO_BEGIN;
00434    funValue[0] = 0.5*(1.0 - gc[0])*gc[0];
00435    funValue[1] = 0.5*(1.0 + gc[0])*gc[0];
00436    funValue[2] = (1.0 + gc[0])*(1.0 - gc[0]);
00437    SHAPE_FUN_MACRO_END;
00438 }
00439 
00444 void GaussInfo::tria3aInit() 
00445 {
00446   LOCAL_COORD_MACRO_BEGIN;
00447  case  0:
00448    coords[0] = -1.0;
00449    coords[1] =  1.0;
00450    break;
00451  case  1:
00452    coords[0] = -1.0;
00453    coords[1] = -1.0;
00454    break;
00455  case  2:
00456    coords[0] =  1.0;
00457    coords[1] = -1.0;
00458    break;
00459    LOCAL_COORD_MACRO_END;
00460 
00461    SHAPE_FUN_MACRO_BEGIN;
00462    funValue[0] = 0.5*(1.0 + gc[1]);
00463    funValue[1] = -0.5*(gc[0] + gc[1]);
00464    funValue[2] = 0.5*(1.0 + gc[0]);
00465    SHAPE_FUN_MACRO_END;
00466 }
00467 
00472 void GaussInfo::tria3bInit() 
00473 {
00474   LOCAL_COORD_MACRO_BEGIN;
00475  case  0:
00476    coords[0] =  0.0;
00477    coords[1] =  0.0;
00478    break;
00479  case  1:
00480    coords[0] =  1.0;
00481    coords[1] =  0.0;
00482    break;
00483  case  2:
00484    coords[0] =  0.0;
00485    coords[1] =  1.0;
00486    break;
00487    LOCAL_COORD_MACRO_END;
00488 
00489    SHAPE_FUN_MACRO_BEGIN;
00490    funValue[0] = 1.0 - gc[0] - gc[1];
00491    funValue[1] = gc[0];
00492    funValue[2] = gc[1];
00493    SHAPE_FUN_MACRO_END;
00494 }
00495 
00500 void GaussInfo::tria6aInit() 
00501 {
00502   LOCAL_COORD_MACRO_BEGIN;
00503  case  0:
00504    coords[0] = -1.0;
00505    coords[1] =  1.0;
00506    break;
00507  case  1:
00508    coords[0] = -1.0;
00509    coords[1] = -1.0;
00510    break;
00511  case  2:
00512    coords[0] =  1.0;
00513    coords[1] = -1.0;
00514    break;
00515  case  3:
00516    coords[0] = -1.0;
00517    coords[1] =  1.0;
00518    break;
00519  case  4:
00520    coords[0] =  0.0;
00521    coords[1] = -1.0;
00522    break;
00523  case  5:
00524    coords[0] =  0.0;
00525    coords[1] =  0.0;
00526    break;
00527    LOCAL_COORD_MACRO_END;
00528 
00529    SHAPE_FUN_MACRO_BEGIN;
00530    funValue[0] = 0.5*(1.0 + gc[1])*gc[1];
00531    funValue[1] = 0.5*(gc[0] + gc[1])*(gc[0] + gc[1] + 1);
00532    funValue[2] = 0.5*(1.0 + gc[0])*gc[0];
00533    funValue[3] = -1.0*(1.0 + gc[1])*(gc[0] + gc[1]);
00534    funValue[4] = -1.0*(1.0 + gc[0])*(gc[0] + gc[1]);
00535    funValue[5] = (1.0 + gc[1])*(1.0 + gc[1]);
00536    SHAPE_FUN_MACRO_END;
00537 }
00538 
00543 void GaussInfo::tria6bInit() 
00544 {
00545   LOCAL_COORD_MACRO_BEGIN;
00546  case  0:
00547    coords[0] =  0.0;
00548    coords[1] =  0.0;
00549    break;
00550 
00551  case  1:
00552    coords[0] =  1.0;
00553    coords[1] =  0.0;
00554    break;
00555 
00556  case  2:
00557    coords[0] =  0.0;
00558    coords[1] =  1.0;
00559    break;
00560 
00561  case  3:
00562    coords[0] =  0.5;
00563    coords[1] =  0.0;
00564    break;
00565 
00566  case  4:
00567    coords[0] =  0.5;
00568    coords[1] =  0.5;
00569    break;
00570 
00571  case  5:
00572    coords[0] =  0.0;
00573    coords[1] =  0.5;
00574    break;
00575 
00576    LOCAL_COORD_MACRO_END;
00577 
00578    SHAPE_FUN_MACRO_BEGIN;
00579    funValue[0] = (1.0 - gc[0] - gc[1])*(1.0 - 2.0*gc[0] - 2.0*gc[1]);
00580    funValue[1] = gc[0]*(2.0*gc[0] - 1.0);
00581    funValue[2] = gc[1]*(2.0*gc[1] - 1.0);
00582    funValue[3] = 4.0*gc[0]*(1.0 - gc[0] - gc[1]);
00583    funValue[4] = 4.0*gc[0]*gc[1];
00584    funValue[5] = 4.0*gc[1]*(1.0 - gc[0] - gc[1]);
00585    SHAPE_FUN_MACRO_END;
00586 }
00587 
00592 void GaussInfo::quad4aInit() 
00593 {
00594   LOCAL_COORD_MACRO_BEGIN;
00595  case  0:
00596    coords[0] = -1.0;
00597    coords[1] =  1.0;
00598    break;
00599  case  1:
00600    coords[0] = -1.0;
00601    coords[1] = -1.0;
00602    break;
00603  case  2:
00604    coords[0] =  1.0;
00605    coords[1] = -1.0;
00606    break;
00607  case  3:
00608    coords[0] =  1.0;
00609    coords[1] =  1.0;
00610    break;
00611 
00612    LOCAL_COORD_MACRO_END;
00613 
00614    SHAPE_FUN_MACRO_BEGIN;
00615    funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0]);
00616    funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0]);
00617    funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0]);
00618    funValue[3] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
00619    SHAPE_FUN_MACRO_END;
00620 }
00621 
00626 void GaussInfo::quad4bInit() 
00627 {
00628   LOCAL_COORD_MACRO_BEGIN;
00629  case  0:
00630    coords[0] = -1.0;
00631    coords[1] = -1.0;
00632    break;
00633  case  1:
00634    coords[0] =  1.0;
00635    coords[1] = -1.0;
00636    break;
00637  case  2:
00638    coords[0] =  1.0;
00639    coords[1] =  1.0;
00640    break;
00641  case  3:
00642    coords[0] = -1.0;
00643    coords[1] =  1.0;
00644    break;
00645 
00646    LOCAL_COORD_MACRO_END;
00647 
00648    SHAPE_FUN_MACRO_BEGIN;
00649    funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1]);
00650    funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1]);
00651    funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1]);
00652    funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1]);
00653    SHAPE_FUN_MACRO_END;
00654 }
00655 
00656 
00661 void GaussInfo::quad8aInit() 
00662 {
00663   LOCAL_COORD_MACRO_BEGIN;
00664  case  0:
00665    coords[0] = -1.0;
00666    coords[1] =  1.0;
00667    break;
00668  case  1:
00669    coords[0] = -1.0;
00670    coords[1] = -1.0;
00671    break;
00672  case  2:
00673    coords[0] =  1.0;
00674    coords[1] = -1.0;
00675    break;
00676  case  3:
00677    coords[0] =  1.0;
00678    coords[1] =  1.0;
00679    break;
00680  case  4:
00681    coords[0] = -1.0;
00682    coords[1] =  0.0;
00683    break;
00684  case  5:
00685    coords[0] =  0.0;
00686    coords[1] = -1.0;
00687    break;
00688  case  6:
00689    coords[0] =  1.0;
00690    coords[1] =  0.0;
00691    break;
00692  case  7:
00693    coords[0] =  0.0;
00694    coords[1] =  1.0;
00695    break;
00696    LOCAL_COORD_MACRO_END;
00697 
00698    SHAPE_FUN_MACRO_BEGIN;
00699    funValue[0] = 0.25*(1.0 + gc[1])*(1.0 - gc[0])*(gc[1] - gc[0] - 1.0);
00700    funValue[1] = 0.25*(1.0 - gc[1])*(1.0 - gc[0])*(-gc[1] - gc[0] - 1.0);
00701    funValue[2] = 0.25*(1.0 - gc[1])*(1.0 + gc[0])*(-gc[1] + gc[0] - 1.0);
00702    funValue[3] = 0.25*(1.0 + gc[1])*(1.0 + gc[0])*(gc[1] + gc[0] - 1.0);
00703    funValue[4] = 0.5*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
00704    funValue[5] = 0.5*(1.0 - gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
00705    funValue[6] = 0.5*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[1]);
00706    funValue[7] = 0.5*(1.0 + gc[1])*(1.0 - gc[0])*(1.0 + gc[0]);
00707    SHAPE_FUN_MACRO_END;
00708 }
00709 
00714 void GaussInfo::quad8bInit() 
00715 {
00716   LOCAL_COORD_MACRO_BEGIN;
00717  case  0:
00718    coords[0] = -1.0;
00719    coords[1] = -1.0;
00720    break;
00721  case  1:
00722    coords[0] =  1.0;
00723    coords[1] = -1.0;
00724    break;
00725  case  2:
00726    coords[0] =  1.0;
00727    coords[1] =  1.0;
00728    break;
00729  case  3:
00730    coords[0] = -1.0;
00731    coords[1] =  1.0;
00732    break;
00733  case  4:
00734    coords[0] =  0.0;
00735    coords[1] = -1.0;
00736    break;
00737  case  5:
00738    coords[0] =  1.0;
00739    coords[1] =  0.0;
00740    break;
00741  case  6:
00742    coords[0] =  0.0;
00743    coords[1] =  1.0;
00744    break;
00745  case  7:
00746    coords[0] = -1.0;
00747    coords[1] =  0.0;
00748    break;
00749    LOCAL_COORD_MACRO_END;
00750 
00751    SHAPE_FUN_MACRO_BEGIN;
00752    funValue[0] = 0.25*(1.0 - gc[0])*(1.0 - gc[1])*(-1.0 - gc[0] - gc[1]);
00753    funValue[1] = 0.25*(1.0 + gc[0])*(1.0 - gc[1])*(-1.0 + gc[0] - gc[1]);
00754    funValue[2] = 0.25*(1.0 + gc[0])*(1.0 + gc[1])*(-1.0 + gc[0] + gc[1]);
00755    funValue[3] = 0.25*(1.0 - gc[0])*(1.0 + gc[1])*(-1.0 - gc[0] + gc[1]);
00756    funValue[4] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 - gc[1]);
00757    funValue[5] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 + gc[0]);
00758    funValue[6] = 0.5*(1.0 - gc[0]*gc[0])*(1.0 + gc[1]);
00759    funValue[7] = 0.5*(1.0 - gc[1]*gc[1])*(1.0 - gc[0]);
00760    SHAPE_FUN_MACRO_END;
00761 }
00762 
00767 void GaussInfo::tetra4aInit() 
00768 {
00769   LOCAL_COORD_MACRO_BEGIN;
00770  case  0:
00771    coords[0] =  0.0;
00772    coords[1] =  1.0;
00773    coords[2] =  0.0;
00774    break;
00775  case  1:
00776    coords[0] =  0.0;
00777    coords[1] =  0.0;
00778    coords[2] =  1.0;
00779    break;
00780  case  2:
00781    coords[0] =  0.0;
00782    coords[1] =  0.0;
00783    coords[2] =  0.0;
00784    break;
00785  case  3:
00786    coords[0] =  1.0;
00787    coords[1] =  0.0;
00788    coords[2] =  0.0;
00789    break;
00790    LOCAL_COORD_MACRO_END;
00791 
00792    SHAPE_FUN_MACRO_BEGIN;
00793    funValue[0] = gc[1];
00794    funValue[1] = gc[2];
00795    funValue[2] = 1.0 - gc[0] - gc[1] - gc[2];
00796    funValue[3] = gc[0];
00797    SHAPE_FUN_MACRO_END;
00798 }
00799 
00804 void GaussInfo::tetra4bInit() 
00805 {
00806   LOCAL_COORD_MACRO_BEGIN;
00807  case  0:
00808    coords[0] =  0.0;
00809    coords[1] =  1.0;
00810    coords[2] =  0.0;
00811    break;
00812  case  2:
00813    coords[0] =  0.0;
00814    coords[1] =  0.0;
00815    coords[2] =  1.0;
00816    break;
00817  case  1:
00818    coords[0] =  0.0;
00819    coords[1] =  0.0;
00820    coords[2] =  0.0;
00821    break;
00822  case  3:
00823    coords[0] =  1.0;
00824    coords[1] =  0.0;
00825    coords[2] =  0.0;
00826    break;
00827    LOCAL_COORD_MACRO_END;
00828 
00829    SHAPE_FUN_MACRO_BEGIN;
00830    funValue[0] = gc[1];
00831    funValue[2] = gc[2];
00832    funValue[1] = 1.0 - gc[0] - gc[1] - gc[2];
00833    funValue[3] = gc[0];
00834    SHAPE_FUN_MACRO_END;
00835 
00836 }
00837 
00842 void GaussInfo::tetra10aInit() 
00843 {
00844   LOCAL_COORD_MACRO_BEGIN;
00845  case  0:
00846    coords[0] =  0.0;
00847    coords[1] =  1.0;
00848    coords[2] =  0.0;
00849    break;
00850  case  1:
00851    coords[0] =  0.0;
00852    coords[1] =  0.0;
00853    coords[2] =  1.0;
00854    break;
00855  case  2:
00856    coords[0] =  0.0;
00857    coords[1] =  0.0;
00858    coords[2] =  0.0;
00859    break;
00860  case  3:
00861    coords[0] =  1.0;
00862    coords[1] =  0.0;
00863    coords[2] =  0.0;
00864    break;
00865  case  4:
00866    coords[0] =  0.0;
00867    coords[1] =  0.5;
00868    coords[2] =  0.5;
00869    break;
00870  case  5:
00871    coords[0] =  0.0;
00872    coords[1] =  0.0;
00873    coords[2] =  0.5;
00874    break;
00875  case  6:
00876    coords[0] =  0.0;
00877    coords[1] =  0.5;
00878    coords[2] =  0.0;
00879    break;
00880  case  7:
00881    coords[0] =  0.5;
00882    coords[1] =  0.5;
00883    coords[2] =  0.0;
00884    break;
00885  case  8:
00886    coords[0] =  0.5;
00887    coords[1] =  0.0;
00888    coords[2] =  0.5;
00889    break;
00890  case  9:
00891    coords[0] =  0.5;
00892    coords[1] =  0.0;
00893    coords[2] =  0.0;
00894    break;
00895    LOCAL_COORD_MACRO_END;
00896 
00897    SHAPE_FUN_MACRO_BEGIN;
00898    funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
00899    funValue[1] = gc[2]*(2.0*gc[2] - 1.0);
00900    funValue[2] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
00901    funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
00902    funValue[4] = 4.0*gc[1]*gc[2];
00903    funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
00904    funValue[6] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
00905    funValue[7] = 4.0*gc[0]*gc[1];
00906    funValue[8] = 4.0*gc[0]*gc[2];
00907    funValue[9] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
00908    SHAPE_FUN_MACRO_END;
00909 }
00910 
00915 void GaussInfo::tetra10bInit() 
00916 {
00917   LOCAL_COORD_MACRO_BEGIN;
00918  case  0:
00919    coords[0] =  0.0;
00920    coords[1] =  1.0;
00921    coords[2] =  0.0;
00922    break;
00923  case  2:
00924    coords[0] =  0.0;
00925    coords[1] =  0.0;
00926    coords[2] =  1.0;
00927    break;
00928  case  1:
00929    coords[0] =  0.0;
00930    coords[1] =  0.0;
00931    coords[2] =  0.0;
00932    break;
00933  case  3:
00934    coords[0] =  1.0;
00935    coords[1] =  0.0;
00936    coords[2] =  0.0;
00937    break;
00938  case  6:
00939    coords[0] =  0.0;
00940    coords[1] =  0.5;
00941    coords[2] =  0.5;
00942    break;
00943  case  5:
00944    coords[0] =  0.0;
00945    coords[1] =  0.0;
00946    coords[2] =  0.5;
00947    break;
00948  case  4:
00949    coords[0] =  0.0;
00950    coords[1] =  0.5;
00951    coords[2] =  0.0;
00952    break;
00953  case  7:
00954    coords[0] =  0.5;
00955    coords[1] =  0.5;
00956    coords[2] =  0.0;
00957    break;
00958  case  9:
00959    coords[0] =  0.5;
00960    coords[1] =  0.0;
00961    coords[2] =  0.5;
00962    break;
00963  case  8:
00964    coords[0] =  0.5;
00965    coords[1] =  0.0;
00966    coords[2] =  0.0;
00967    break;
00968    LOCAL_COORD_MACRO_END;
00969 
00970    SHAPE_FUN_MACRO_BEGIN;
00971    funValue[0] = gc[1]*(2.0*gc[1] - 1.0);
00972    funValue[2] = gc[2]*(2.0*gc[2] - 1.0);
00973    funValue[1] = (1.0 - gc[0] - gc[1] - gc[2])*(1.0 - 2.0*gc[0] - 2.0*gc[1] - 2.0*gc[2]);
00974    funValue[3] = gc[0]*(2.0*gc[0] - 1.0);
00975    funValue[6] = 4.0*gc[1]*gc[2];
00976    funValue[5] = 4.0*gc[2]*(1.0 - gc[0] - gc[1] - gc[2]);
00977    funValue[4] = 4.0*gc[1]*(1.0 - gc[0] - gc[1] - gc[2]);
00978    funValue[7] = 4.0*gc[0]*gc[1];
00979    funValue[9] = 4.0*gc[0]*gc[2];
00980    funValue[8] = 4.0*gc[0]*(1.0 - gc[0] - gc[1] - gc[2]);
00981    SHAPE_FUN_MACRO_END;
00982 }
00983 
00988 void GaussInfo::pyra5aInit() 
00989 {
00990   LOCAL_COORD_MACRO_BEGIN;
00991  case  0:
00992    coords[0] =  1.0;
00993    coords[1] =  0.0;
00994    coords[2] =  0.0;
00995    break;
00996  case  1:
00997    coords[0] =  0.0;
00998    coords[1] =  1.0;
00999    coords[2] =  0.0;
01000    break;
01001  case  2:
01002    coords[0] = -1.0;
01003    coords[1] =  0.0;
01004    coords[2] =  0.0;
01005    break;
01006  case  3:
01007    coords[0] =  0.0;
01008    coords[1] = -1.0;
01009    coords[2] =  0.0;
01010    break;
01011  case  4:
01012    coords[0] =  0.0;
01013    coords[1] =  0.0;
01014    coords[2] =  1.0;
01015    break;
01016    LOCAL_COORD_MACRO_END;
01017 
01018    SHAPE_FUN_MACRO_BEGIN;
01019    funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01020    funValue[1] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01021    funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01022    funValue[3] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
01023    funValue[4] = gc[2];
01024    SHAPE_FUN_MACRO_END;
01025 }
01030 void GaussInfo::pyra5bInit() 
01031 {
01032   LOCAL_COORD_MACRO_BEGIN;
01033  case  0:
01034    coords[0] =  1.0;
01035    coords[1] =  0.0;
01036    coords[2] =  0.0;
01037    break;
01038  case  3:
01039    coords[0] =  0.0;
01040    coords[1] =  1.0;
01041    coords[2] =  0.0;
01042    break;
01043  case  2:
01044    coords[0] = -1.0;
01045    coords[1] =  0.0;
01046    coords[2] =  0.0;
01047    break;
01048  case  1:
01049    coords[0] =  0.0;
01050    coords[1] = -1.0;
01051    coords[2] =  0.0;
01052    break;
01053  case  4:
01054    coords[0] =  0.0;
01055    coords[1] =  0.0;
01056    coords[2] =  1.0;
01057    break;
01058    LOCAL_COORD_MACRO_END;
01059 
01060    SHAPE_FUN_MACRO_BEGIN;
01061    funValue[0] = 0.25*(-gc[0] + gc[1] - 1.0)*(-gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01062    funValue[3] = 0.25*(-gc[0] - gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01063    funValue[2] = 0.25*(+gc[0] + gc[1] - 1.0)*(+gc[0] - gc[1] - 1.0)*(1.0 - gc[2]);
01064    funValue[1] = 0.25*(+gc[0] + gc[1] - 1.0)*(-gc[0] + gc[1] - 1.0)*(1.0 - gc[2]);
01065    funValue[4] = gc[2];
01066    SHAPE_FUN_MACRO_END;
01067 }
01068 
01073 void GaussInfo::pyra13aInit() 
01074 {
01075   LOCAL_COORD_MACRO_BEGIN;
01076  case  0:
01077    coords[0] =  1.0;
01078    coords[1] =  0.0;
01079    coords[2] =  0.0;
01080    break;
01081  case  1:
01082    coords[0] =  0.0;
01083    coords[1] =  1.0;
01084    coords[2] =  0.0;
01085    break;
01086  case  2:
01087    coords[0] = -1.0;
01088    coords[1] =  0.0;
01089    coords[2] =  0.0;
01090    break;
01091  case  3:
01092    coords[0] =  0.0;
01093    coords[1] = -1.0;
01094    coords[2] =  0.0;
01095    break;
01096  case  4:
01097    coords[0] =  0.0;
01098    coords[1] =  0.0;
01099    coords[2] =  1.0;
01100    break;
01101 
01102  case  5:
01103    coords[0] =  0.5;
01104    coords[1] =  0.5;
01105    coords[2] =  0.0;
01106    break;
01107  case  6:
01108    coords[0] = -0.5;
01109    coords[1] =  0.5;
01110    coords[2] =  0.0;
01111    break;
01112  case  7:
01113    coords[0] = -0.5;
01114    coords[1] = -0.5;
01115    coords[2] =  0.0;
01116    break;
01117  case  8:
01118    coords[0] =  0.5;
01119    coords[1] = -0.5;
01120    coords[2] =  0.0;
01121    break;
01122  case  9:
01123    coords[0] =  0.5;
01124    coords[1] =  0.0;
01125    coords[2] =  0.5;
01126    break;
01127  case 10:
01128    coords[0] =  0.0;
01129    coords[1] =  0.5;
01130    coords[2] =  0.5;
01131    break;
01132  case 11:
01133    coords[0] = -0.5;
01134    coords[1] =  0.0;
01135    coords[2] =  0.5;
01136    break;
01137  case 12:
01138    coords[0] =  0.0;
01139    coords[1] = -0.5;
01140    coords[2] =  0.5;
01141    break;
01142    LOCAL_COORD_MACRO_END;
01143 
01144    SHAPE_FUN_MACRO_BEGIN;
01145    funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
01146      (gc[0] - 0.5)/(1.0 - gc[2]);
01147    funValue[1] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
01148      (gc[1] - 0.5)/(1.0 - gc[2]);
01149    funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
01150      (-gc[0] - 0.5)/(1.0 - gc[2]);
01151    funValue[3] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
01152      (-gc[1] - 0.5)/(1.0 - gc[2]);
01153 
01154    funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
01155 
01156    funValue[5] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
01157      (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01158    funValue[6] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
01159      (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01160    funValue[7] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
01161      (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01162    funValue[8] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
01163      (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01164 
01165    funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
01166      (1.0 - gc[2]);
01167    funValue[10] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
01168      (1.0 - gc[2]);
01169    funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
01170      (1.0 - gc[2]);
01171    funValue[12] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
01172      (1.0 - gc[2]);
01173    SHAPE_FUN_MACRO_END;
01174 }
01175 
01180 void GaussInfo::pyra13bInit() 
01181 {
01182   LOCAL_COORD_MACRO_BEGIN;
01183  case  0:
01184    coords[0] =  1.0;
01185    coords[1] =  0.0;
01186    coords[2] =  0.0;
01187    break;
01188  case  3:
01189    coords[0] =  0.0;
01190    coords[1] =  1.0;
01191    coords[2] =  0.0;
01192    break;
01193  case  2:
01194    coords[0] = -1.0;
01195    coords[1] =  0.0;
01196    coords[2] =  0.0;
01197    break;
01198  case  1:
01199    coords[0] =  0.0;
01200    coords[1] = -1.0;
01201    coords[2] =  0.0;
01202    break;
01203  case  4:
01204    coords[0] =  0.0;
01205    coords[1] =  0.0;
01206    coords[2] =  1.0;
01207    break;
01208  case  8:
01209    coords[0] =  0.5;
01210    coords[1] =  0.5;
01211    coords[2] =  0.0;
01212    break;
01213  case  7:
01214    coords[0] = -0.5;
01215    coords[1] =  0.5;
01216    coords[2] =  0.0;
01217    break;
01218  case  6:
01219    coords[0] = -0.5;
01220    coords[1] = -0.5;
01221    coords[2] =  0.0;
01222    break;
01223  case  5:
01224    coords[0] =  0.5;
01225    coords[1] = -0.5;
01226    coords[2] =  0.0;
01227    break;
01228  case  9:
01229    coords[0] =  0.5;
01230    coords[1] =  0.0;
01231    coords[2] =  0.5;
01232    break;
01233  case 12:
01234    coords[0] =  0.0;
01235    coords[1] =  0.5;
01236    coords[2] =  0.5;
01237    break;
01238  case 11:
01239    coords[0] = -0.5;
01240    coords[1] =  0.0;
01241    coords[2] =  0.5;
01242    break;
01243  case 10:
01244    coords[0] =  0.0;
01245    coords[1] = -0.5;
01246    coords[2] =  0.5;
01247    break;
01248    LOCAL_COORD_MACRO_END;
01249 
01250    SHAPE_FUN_MACRO_BEGIN;
01251    funValue[0] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
01252      (gc[0] - 0.5)/(1.0 - gc[2]);
01253    funValue[3] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] - gc[1] + gc[2] - 1.0)*
01254      (gc[1] - 0.5)/(1.0 - gc[2]);
01255    funValue[2] = 0.5*(+gc[0] - gc[1] + gc[2] - 1.0)*(+gc[0] + gc[1] + gc[2] - 1.0)*
01256      (-gc[0] - 0.5)/(1.0 - gc[2]);
01257    funValue[1] = 0.5*(+gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
01258      (-gc[1] - 0.5)/(1.0 - gc[2]);
01259 
01260    funValue[4] = 2.0*gc[2]*(gc[2] - 0.5);
01261 
01262    funValue[8] = 0.5*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)*
01263      (gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01264    funValue[7] = 0.5*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)*
01265      (gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01266    funValue[6] = 0.5*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)*
01267      (-gc[0] + gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01268    funValue[5] = 0.5*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)*
01269      (-gc[0] - gc[1] + gc[2] - 1.0)/(1.0 - gc[2]);
01270 
01271    funValue[9] = 0.5*gc[2]*(-gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] - gc[1] + gc[2] - 1.0)/
01272      (1.0 - gc[2]);
01273    funValue[12] = 0.5*gc[2]*(-gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] - gc[1] + gc[2] - 1.0)/
01274      (1.0 - gc[2]);
01275    funValue[11] = 0.5*gc[2]*(gc[0] - gc[1] + gc[2] - 1.0)*(gc[0] + gc[1] + gc[2] - 1.0)/
01276      (1.0 - gc[2]);
01277    funValue[10] = 0.5*gc[2]*(gc[0] + gc[1] + gc[2] - 1.0)*(-gc[0] + gc[1] + gc[2] - 1.0)/
01278      (1.0 - gc[2]);
01279    SHAPE_FUN_MACRO_END;
01280 }
01281 
01282 
01287 void GaussInfo::penta6aInit() 
01288 {
01289   LOCAL_COORD_MACRO_BEGIN;
01290  case  0:
01291    coords[0] = -1.0;
01292    coords[1] =  1.0;
01293    coords[2] =  0.0;
01294    break;
01295  case  1:
01296    coords[0] = -1.0;
01297    coords[1] = -0.0;
01298    coords[2] =  1.0;
01299    break;
01300  case  2:
01301    coords[0] = -1.0;
01302    coords[1] =  0.0;
01303    coords[2] =  0.0;
01304    break;
01305  case  3:
01306    coords[0] =  1.0;
01307    coords[1] =  1.0;
01308    coords[2] =  0.0;
01309    break;
01310  case  4:
01311    coords[0] =  1.0;
01312    coords[1] =  0.0;
01313    coords[2] =  1.0;
01314    break;
01315  case  5:
01316    coords[0] =  1.0;
01317    coords[1] =  0.0;
01318    coords[2] =  0.0;
01319    break;
01320    LOCAL_COORD_MACRO_END;
01321 
01322    SHAPE_FUN_MACRO_BEGIN;
01323    funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
01324    funValue[1] = 0.5*gc[2]*(1.0 - gc[0]);
01325    funValue[2] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01326 
01327    funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
01328    funValue[4] = 0.5*gc[2]*(gc[0] + 1.0);
01329    funValue[5] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01330    SHAPE_FUN_MACRO_END;
01331 }
01332 
01337 void GaussInfo::penta6bInit() 
01338 {
01339   LOCAL_COORD_MACRO_BEGIN;
01340  case  0:
01341    coords[0] = -1.0;
01342    coords[1] =  1.0;
01343    coords[2] =  0.0;
01344    break;
01345  case  2:
01346    coords[0] = -1.0;
01347    coords[1] = -0.0;
01348    coords[2] =  1.0;
01349    break;
01350  case  1:
01351    coords[0] = -1.0;
01352    coords[1] =  0.0;
01353    coords[2] =  0.0;
01354    break;
01355  case  3:
01356    coords[0] =  1.0;
01357    coords[1] =  1.0;
01358    coords[2] =  0.0;
01359    break;
01360  case  5:
01361    coords[0] =  1.0;
01362    coords[1] =  0.0;
01363    coords[2] =  1.0;
01364    break;
01365  case  4:
01366    coords[0] =  1.0;
01367    coords[1] =  0.0;
01368    coords[2] =  0.0;
01369    break;
01370    LOCAL_COORD_MACRO_END;
01371 
01372    SHAPE_FUN_MACRO_BEGIN;
01373    funValue[0] = 0.5*gc[1]*(1.0 - gc[0]);
01374    funValue[2] = 0.5*gc[2]*(1.0 - gc[0]);
01375    funValue[1] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01376    funValue[3] = 0.5*gc[1]*(gc[0] + 1.0);
01377    funValue[5] = 0.5*gc[2]*(gc[0] + 1.0);
01378    funValue[4] = 0.5*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01379    SHAPE_FUN_MACRO_END;
01380 }
01385 void GaussInfo::penta15aInit() 
01386 {
01387   LOCAL_COORD_MACRO_BEGIN;
01388  case  0:
01389    coords[0] = -1.0;
01390    coords[1] =  1.0;
01391    coords[2] =  0.0;
01392    break;
01393  case  1:
01394    coords[0] = -1.0;
01395    coords[1] = -0.0;
01396    coords[2] =  1.0;
01397    break;
01398  case  2:
01399    coords[0] = -1.0;
01400    coords[1] =  0.0;
01401    coords[2] =  0.0;
01402    break;
01403  case  3:
01404    coords[0] =  1.0;
01405    coords[1] =  1.0;
01406    coords[2] =  0.0;
01407    break;
01408  case  4:
01409    coords[0] =  1.0;
01410    coords[1] =  0.0;
01411    coords[2] =  1.0;
01412    break;
01413  case  5:
01414    coords[0] =  1.0;
01415    coords[1] =  0.0;
01416    coords[2] =  0.0;
01417    break;
01418 
01419  case  6:
01420    coords[0] = -1.0;
01421    coords[1] =  0.5;
01422    coords[2] =  0.5;
01423    break;
01424  case  7:
01425    coords[0] = -1.0;
01426    coords[1] =  0.0;
01427    coords[2] =  0.5;
01428    break;
01429  case  8:
01430    coords[0] = -1.0;
01431    coords[1] =  0.5;
01432    coords[2] =  0.0;
01433    break;
01434  case  9:
01435    coords[0] =  0.0;
01436    coords[1] =  1.0;
01437    coords[2] =  0.0;
01438    break;
01439  case 10:
01440    coords[0] =  0.0;
01441    coords[1] =  0.0;
01442    coords[2] =  1.0;
01443    break;
01444  case 11:
01445    coords[0] =  0.0;
01446    coords[1] =  0.0;
01447    coords[2] =  0.0;
01448    break;
01449  case 12:
01450    coords[0] =  1.0;
01451    coords[1] =  0.5;
01452    coords[2] =  0.5;
01453    break;
01454  case 13:
01455    coords[0] =  1.0;
01456    coords[1] =  0.0;
01457    coords[2] =  0.5;
01458    break;
01459  case 14:
01460    coords[0] =  1.0;
01461    coords[1] =  0.5;
01462    coords[2] =  0.0;
01463    break;
01464    LOCAL_COORD_MACRO_END;
01465 
01466    SHAPE_FUN_MACRO_BEGIN;
01467    funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
01468    funValue[1] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
01469    funValue[2] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
01470 
01471    funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
01472    funValue[4] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
01473    funValue[5] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
01474 
01475    funValue[6] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
01476    funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01477    funValue[8] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01478 
01479    funValue[9] = gc[1]*(1.0 - gc[0]*gc[0]);
01480    funValue[10] = gc[2]*(1.0 - gc[0]*gc[0]);
01481    funValue[11] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
01482 
01483    funValue[12] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
01484    funValue[13] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01485    funValue[14] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01486    SHAPE_FUN_MACRO_END;
01487 }
01488 
01493 void GaussInfo::penta15bInit() 
01494 {
01495   LOCAL_COORD_MACRO_BEGIN;
01496  case  0:
01497    coords[0] = -1.0;
01498    coords[1] =  1.0;
01499    coords[2] =  0.0;
01500    break;
01501  case  2:
01502    coords[0] = -1.0;
01503    coords[1] = -0.0;
01504    coords[2] =  1.0;
01505    break;
01506  case  1:
01507    coords[0] = -1.0;
01508    coords[1] =  0.0;
01509    coords[2] =  0.0;
01510    break;
01511  case  3:
01512    coords[0] =  1.0;
01513    coords[1] =  1.0;
01514    coords[2] =  0.0;
01515    break;
01516  case  5:
01517    coords[0] =  1.0;
01518    coords[1] =  0.0;
01519    coords[2] =  1.0;
01520    break;
01521  case  4:
01522    coords[0] =  1.0;
01523    coords[1] =  0.0;
01524    coords[2] =  0.0;
01525    break;
01526 
01527  case  8:
01528    coords[0] = -1.0;
01529    coords[1] =  0.5;
01530    coords[2] =  0.5;
01531    break;
01532  case  7:
01533    coords[0] = -1.0;
01534    coords[1] =  0.0;
01535    coords[2] =  0.5;
01536    break;
01537  case  6:
01538    coords[0] = -1.0;
01539    coords[1] =  0.5;
01540    coords[2] =  0.0;
01541    break;
01542  case 12:
01543    coords[0] =  0.0;
01544    coords[1] =  1.0;
01545    coords[2] =  0.0;
01546    break;
01547  case 14:
01548    coords[0] =  0.0;
01549    coords[1] =  0.0;
01550    coords[2] =  1.0;
01551    break;
01552  case 13:
01553    coords[0] =  0.0;
01554    coords[1] =  0.0;
01555    coords[2] =  0.0;
01556    break;
01557  case 11:
01558    coords[0] =  1.0;
01559    coords[1] =  0.5;
01560    coords[2] =  0.5;
01561    break;
01562  case 10:
01563    coords[0] =  1.0;
01564    coords[1] =  0.0;
01565    coords[2] =  0.5;
01566    break;
01567  case  9:
01568    coords[0] =  1.0;
01569    coords[1] =  0.5;
01570    coords[2] =  0.0;
01571    break;
01572    LOCAL_COORD_MACRO_END;
01573 
01574    SHAPE_FUN_MACRO_BEGIN;
01575    funValue[0] = 0.5*gc[1]*(1.0 - gc[0])*(2.0*gc[1] - 2.0 - gc[0]);
01576    funValue[2] = 0.5*gc[2]*(1.0 - gc[0])*(2.0*gc[2] - 2.0 - gc[0]);
01577    funValue[1] = 0.5*(gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(gc[0] + 2.0*gc[1] + 2.0*gc[2]);
01578 
01579    funValue[3] = 0.5*gc[1]*(1.0 + gc[0])*(2.0*gc[1] - 2.0 + gc[0]);
01580    funValue[5] = 0.5*gc[2]*(1.0 + gc[0])*(2.0*gc[2] - 2.0 + gc[0]);
01581    funValue[4] = 0.5*(-gc[0] - 1.0)*(1.0 - gc[1] - gc[2])*(-gc[0] + 2.0*gc[1] + 2.0*gc[2]);
01582 
01583    funValue[8] = 2.0*gc[1]*gc[2]*(1.0 - gc[0]);
01584    funValue[7] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01585    funValue[6] = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 - gc[0]);
01586 
01587    funValue[12] = gc[1]*(1.0 - gc[0]*gc[0]);
01588    funValue[14] = gc[2]*(1.0 - gc[0]*gc[0]);
01589    funValue[13] = (1.0 - gc[1] - gc[2])*(1.0 - gc[0]*gc[0]);
01590 
01591    funValue[11] = 2.0*gc[1]*gc[2]*(1.0 + gc[0]);
01592    funValue[10] = 2.0*gc[2]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01593    funValue[9]  = 2.0*gc[1]*(1.0 - gc[1] - gc[2])*(1.0 + gc[0]);
01594    SHAPE_FUN_MACRO_END;
01595 }
01596 
01601 void GaussInfo::hexa8aInit() 
01602 {
01603   LOCAL_COORD_MACRO_BEGIN;
01604  case  0:
01605    coords[0] = -1.0;
01606    coords[1] = -1.0;
01607    coords[2] = -1.0;
01608    break;
01609  case  1:
01610    coords[0] =  1.0;
01611    coords[1] = -1.0;
01612    coords[2] = -1.0;
01613    break;
01614  case  2:
01615    coords[0] =  1.0;
01616    coords[1] =  1.0;
01617    coords[2] = -1.0;
01618    break;
01619  case  3:
01620    coords[0] = -1.0;
01621    coords[1] =  1.0;
01622    coords[2] = -1.0;
01623    break;
01624  case  4:
01625    coords[0] = -1.0;
01626    coords[1] = -1.0;
01627    coords[2] =  1.0;
01628    break;
01629  case  5:
01630    coords[0] =  1.0;
01631    coords[1] = -1.0;
01632    coords[2] =  1.0;
01633    break;
01634  case  6:
01635    coords[0] =  1.0;
01636    coords[1] =  1.0;
01637    coords[2] =  1.0;
01638    break;
01639  case  7:
01640    coords[0] = -1.0;
01641    coords[1] =  1.0;
01642    coords[2] =  1.0;
01643    break;
01644    LOCAL_COORD_MACRO_END;
01645 
01646    SHAPE_FUN_MACRO_BEGIN;
01647    funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01648    funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01649    funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01650    funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01651 
01652    funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
01653    funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
01654    funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
01655    funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
01656    SHAPE_FUN_MACRO_END;
01657 }
01658 
01663 void GaussInfo::hexa8bInit() 
01664 {
01665   LOCAL_COORD_MACRO_BEGIN;
01666  case  0:
01667    coords[0] = -1.0;
01668    coords[1] = -1.0;
01669    coords[2] = -1.0;
01670    break;
01671  case  3:
01672    coords[0] =  1.0;
01673    coords[1] = -1.0;
01674    coords[2] = -1.0;
01675    break;
01676  case  2:
01677    coords[0] =  1.0;
01678    coords[1] =  1.0;
01679    coords[2] = -1.0;
01680    break;
01681  case  1:
01682    coords[0] = -1.0;
01683    coords[1] =  1.0;
01684    coords[2] = -1.0;
01685    break;
01686  case  4:
01687    coords[0] = -1.0;
01688    coords[1] = -1.0;
01689    coords[2] =  1.0;
01690    break;
01691  case  7:
01692    coords[0] =  1.0;
01693    coords[1] = -1.0;
01694    coords[2] =  1.0;
01695    break;
01696  case  6:
01697    coords[0] =  1.0;
01698    coords[1] =  1.0;
01699    coords[2] =  1.0;
01700    break;
01701  case  5:
01702    coords[0] = -1.0;
01703    coords[1] =  1.0;
01704    coords[2] =  1.0;
01705    break;
01706    LOCAL_COORD_MACRO_END;
01707 
01708    SHAPE_FUN_MACRO_BEGIN;
01709    funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01710    funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01711    funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01712    funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01713 
01714    funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
01715    funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
01716    funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
01717    funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
01718    SHAPE_FUN_MACRO_END;
01719 }
01720 
01725 void GaussInfo::hexa20aInit() 
01726 {
01727   LOCAL_COORD_MACRO_BEGIN;
01728  case  0:
01729    coords[0] = -1.0;
01730    coords[1] = -1.0;
01731    coords[2] = -1.0;
01732    break;
01733  case  1:
01734    coords[0] =  1.0;
01735    coords[1] = -1.0;
01736    coords[2] = -1.0;
01737    break;
01738  case  2:
01739    coords[0] =  1.0;
01740    coords[1] =  1.0;
01741    coords[2] = -1.0;
01742    break;
01743  case  3:
01744    coords[0] = -1.0;
01745    coords[1] =  1.0;
01746    coords[2] = -1.0;
01747    break;
01748  case  4:
01749    coords[0] = -1.0;
01750    coords[1] = -1.0;
01751    coords[2] =  1.0;
01752    break;
01753  case  5:
01754    coords[0] =  1.0;
01755    coords[1] = -1.0;
01756    coords[2] =  1.0;
01757    break;
01758  case  6:
01759    coords[0] =  1.0;
01760    coords[1] =  1.0;
01761    coords[2] =  1.0;
01762    break;
01763  case  7:
01764    coords[0] = -1.0;
01765    coords[1] =  1.0;
01766    coords[2] =  1.0;
01767    break;
01768 
01769  case  8:
01770    coords[0] =  0.0;
01771    coords[1] = -1.0;
01772    coords[2] = -1.0;
01773    break;
01774  case  9:
01775    coords[0] =  1.0;
01776    coords[1] =  0.0;
01777    coords[2] = -1.0;
01778    break;
01779  case 10:
01780    coords[0] =  0.0;
01781    coords[1] =  1.0;
01782    coords[2] = -1.0;
01783    break;
01784  case 11:
01785    coords[0] = -1.0;
01786    coords[1] =  0.0;
01787    coords[2] = -1.0;
01788    break;
01789  case 12:
01790    coords[0] = -1.0;
01791    coords[1] = -1.0;
01792    coords[2] =  0.0;
01793    break;
01794  case 13:
01795    coords[0] =  1.0;
01796    coords[1] = -1.0;
01797    coords[2] =  0.0;
01798    break;
01799  case 14:
01800    coords[0] =  1.0;
01801    coords[1] =  1.0;
01802    coords[2] =  0.0;
01803    break;
01804  case 15:
01805    coords[0] = -1.0;
01806    coords[1] =  1.0;
01807    coords[2] =  0.0;
01808    break;
01809  case 16:
01810    coords[0] =  0.0;
01811    coords[1] = -1.0;
01812    coords[2] =  1.0;
01813    break;
01814  case 17:
01815    coords[0] =  1.0;
01816    coords[1] =  0.0;
01817    coords[2] =  1.0;
01818    break;
01819  case 18:
01820    coords[0] =  0.0;
01821    coords[1] =  1.0;
01822    coords[2] =  1.0;
01823    break;
01824  case 19:
01825    coords[0] = -1.0;
01826    coords[1] =  0.0;
01827    coords[2] =  1.0;
01828    break;
01829    LOCAL_COORD_MACRO_END;
01830 
01831    SHAPE_FUN_MACRO_BEGIN;
01832    funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
01833      (-2.0 - gc[0] - gc[1] - gc[2]);
01834    funValue[1] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
01835      (-2.0 + gc[0] - gc[1] - gc[2]);
01836    funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
01837      (-2.0 + gc[0] + gc[1] - gc[2]);
01838    funValue[3] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
01839      (-2.0 - gc[0] + gc[1] - gc[2]);
01840    funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
01841      (-2.0 - gc[0] - gc[1] + gc[2]);
01842    funValue[5] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
01843      (-2.0 + gc[0] - gc[1] + gc[2]);
01844    funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
01845      (-2.0 + gc[0] + gc[1] + gc[2]);
01846    funValue[7] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
01847      (-2.0 - gc[0] + gc[1] + gc[2]);
01848 
01849    funValue[8] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01850    funValue[9] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
01851    funValue[10] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01852    funValue[11] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
01853    funValue[12] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
01854    funValue[13] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
01855    funValue[14] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
01856    funValue[15] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
01857    funValue[16] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
01858    funValue[17] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
01859    funValue[18] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
01860    funValue[19] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
01861    SHAPE_FUN_MACRO_END;
01862 }
01863 
01868 void GaussInfo::hexa20bInit()
01869 {
01870   LOCAL_COORD_MACRO_BEGIN;
01871  case  0:
01872    coords[0] = -1.0;
01873    coords[1] = -1.0;
01874    coords[2] = -1.0;
01875    break;
01876  case  3:
01877    coords[0] =  1.0;
01878    coords[1] = -1.0;
01879    coords[2] = -1.0;
01880    break;
01881  case  2:
01882    coords[0] =  1.0;
01883    coords[1] =  1.0;
01884    coords[2] = -1.0;
01885    break;
01886  case  1:
01887    coords[0] = -1.0;
01888    coords[1] =  1.0;
01889    coords[2] = -1.0;
01890    break;
01891  case  4:
01892    coords[0] = -1.0;
01893    coords[1] = -1.0;
01894    coords[2] =  1.0;
01895    break;
01896  case  7:
01897    coords[0] =  1.0;
01898    coords[1] = -1.0;
01899    coords[2] =  1.0;
01900    break;
01901  case  6:
01902    coords[0] =  1.0;
01903    coords[1] =  1.0;
01904    coords[2] =  1.0;
01905    break;
01906  case  5:
01907    coords[0] = -1.0;
01908    coords[1] =  1.0;
01909    coords[2] =  1.0;
01910    break;
01911 
01912  case 11:
01913    coords[0] =  0.0;
01914    coords[1] = -1.0;
01915    coords[2] = -1.0;
01916    break;
01917  case 10:
01918    coords[0] =  1.0;
01919    coords[1] =  0.0;
01920    coords[2] = -1.0;
01921    break;
01922  case  9:
01923    coords[0] =  0.0;
01924    coords[1] =  1.0;
01925    coords[2] = -1.0;
01926    break;
01927  case  8:
01928    coords[0] = -1.0;
01929    coords[1] =  0.0;
01930    coords[2] = -1.0;
01931    break;
01932  case 16:
01933    coords[0] = -1.0;
01934    coords[1] = -1.0;
01935    coords[2] =  0.0;
01936    break;
01937  case 19:
01938    coords[0] =  1.0;
01939    coords[1] = -1.0;
01940    coords[2] =  0.0;
01941    break;
01942  case 18:
01943    coords[0] =  1.0;
01944    coords[1] =  1.0;
01945    coords[2] =  0.0;
01946    break;
01947  case 17:
01948    coords[0] = -1.0;
01949    coords[1] =  1.0;
01950    coords[2] =  0.0;
01951    break;
01952  case 15:
01953    coords[0] =  0.0;
01954    coords[1] = -1.0;
01955    coords[2] =  1.0;
01956    break;
01957  case 14:
01958    coords[0] =  1.0;
01959    coords[1] =  0.0;
01960    coords[2] =  1.0;
01961    break;
01962  case 13:
01963    coords[0] =  0.0;
01964    coords[1] =  1.0;
01965    coords[2] =  1.0;
01966    break;
01967  case 12:
01968    coords[0] = -1.0;
01969    coords[1] =  0.0;
01970    coords[2] =  1.0;
01971    break;
01972    LOCAL_COORD_MACRO_END;
01973 
01974    SHAPE_FUN_MACRO_BEGIN;
01975 
01976    funValue[0] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
01977      (-2.0 - gc[0] - gc[1] - gc[2]);
01978    funValue[3] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 - gc[2])*
01979      (-2.0 + gc[0] - gc[1] - gc[2]);
01980    funValue[2] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
01981      (-2.0 + gc[0] + gc[1] - gc[2]);
01982    funValue[1] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 - gc[2])*
01983      (-2.0 - gc[0] + gc[1] - gc[2]);
01984    funValue[4] = 0.125*(1.0 - gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
01985      (-2.0 - gc[0] - gc[1] + gc[2]);
01986    funValue[7] = 0.125*(1.0 + gc[0])*(1.0 - gc[1])*(1.0 + gc[2])*
01987      (-2.0 + gc[0] - gc[1] + gc[2]);
01988    funValue[6] = 0.125*(1.0 + gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
01989      (-2.0 + gc[0] + gc[1] + gc[2]);
01990    funValue[5] = 0.125*(1.0 - gc[0])*(1.0 + gc[1])*(1.0 + gc[2])*
01991      (-2.0 - gc[0] + gc[1] + gc[2]);
01992 
01993    funValue[11] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 - gc[2]);
01994    funValue[10] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 - gc[2]);
01995    funValue[9] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 - gc[2]);
01996    funValue[8] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 - gc[2]);
01997    funValue[16] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 - gc[1]);
01998    funValue[19] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 - gc[1]);
01999    funValue[18] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 + gc[0])*(1.0 + gc[1]);
02000    funValue[17] = 0.25*(1.0 - gc[2]*gc[2])*(1.0 - gc[0])*(1.0 + gc[1]);
02001    funValue[15] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 - gc[1])*(1.0 + gc[2]);
02002    funValue[14] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 + gc[0])*(1.0 + gc[2]);
02003    funValue[13] = 0.25*(1.0 - gc[0]*gc[0])*(1.0 + gc[1])*(1.0 + gc[2]);
02004    funValue[12] = 0.25*(1.0 - gc[1]*gc[1])*(1.0 - gc[0])*(1.0 + gc[2]);
02005    SHAPE_FUN_MACRO_END;
02006 }
02007 
02008 
02009 
02011 //                                GAUSS COORD CLASS                                           //
02013 
02016 GaussCoords::GaussCoords()
02017 {
02018 }
02019 
02023 GaussCoords::~GaussCoords()
02024 {
02025   GaussInfoVector::iterator it = _my_gauss_info.begin();
02026   for( ; it != _my_gauss_info.end(); it++ ) 
02027     {
02028       if((*it) != NULL)
02029         delete (*it);
02030     }
02031 }
02032 
02036 void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
02037                                 int coordDim,
02038                                 const double* theGaussCoord,
02039                                 int theNbGauss,
02040                                 const double* theReferenceCoord,
02041                                 int theNbRef) throw (INTERP_KERNEL::Exception) 
02042 {
02043   GaussInfoVector::iterator it = _my_gauss_info.begin();
02044   for( ; it != _my_gauss_info.end(); it++ ) 
02045     {
02046       if( (*it)->getCellType() == theGeometry ) 
02047         {
02048           break;
02049         }
02050     }
02051 
02052   DataVector aGaussCoord;
02053   for(int i = 0 ; i < theNbGauss*coordDim; i++ )
02054     aGaussCoord.push_back(theGaussCoord[i]);
02055 
02056   DataVector aReferenceCoord;
02057   for(int i = 0 ; i < theNbRef*coordDim; i++ )
02058     aReferenceCoord.push_back(theReferenceCoord[i]);
02059 
02060 
02061   GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, theNbGauss, aReferenceCoord, theNbRef);
02062   info->initLocalInfo();
02063 
02064   //If info with cell type doesn't exist add it
02065   if( it == _my_gauss_info.end() ) 
02066     {
02067       _my_gauss_info.push_back(info);
02068 
02069       // If information exists, update it
02070     }
02071   else 
02072     {
02073       int index = std::distance(_my_gauss_info.begin(),it);
02074       delete (*it);
02075       _my_gauss_info[index] = info;
02076     }
02077 }
02078 
02079 
02083 double* GaussCoords::calculateCoords( NormalizedCellType theGeometry, 
02084                                       const double *theNodeCoords, 
02085                                       const int theSpaceDim,
02086                                       const int *theIndex) throw (INTERP_KERNEL::Exception) 
02087 {
02088   const GaussInfo *info = getInfoGivenCellType(theGeometry);
02089   int nbCoords = theSpaceDim * info->getNbGauss();
02090   double *aCoords = new double[nbCoords];
02091   calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,aCoords);
02092   return aCoords;
02093 }
02094 
02095 
02096 void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result) throw(INTERP_KERNEL::Exception)
02097 {
02098   const GaussInfo *info = getInfoGivenCellType(theGeometry);
02099   calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,result);
02100 }
02101 
02102 void GaussCoords::calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex, double *result)
02103 {
02104   int aConn = info->getNbRef();
02105 
02106   int nbCoords = theSpaceDim * info->getNbGauss();
02107   std::fill(result,result+nbCoords,0.);
02108 
02109   for( int gaussId = 0; gaussId < info->getNbGauss(); gaussId++ ) 
02110     {
02111       double *coord=result+gaussId*theSpaceDim;
02112       const double *function=info->getFunctionValues(gaussId);
02113       for ( int connId = 0; connId < aConn ; connId++ ) 
02114         {
02115           const double* nodeCoord = theNodeCoords + (theIndex[connId]*theSpaceDim);
02116           for( int dimId = 0; dimId < theSpaceDim; dimId++ )
02117             coord[dimId] += nodeCoord[dimId]*function[connId];
02118         }
02119     }
02120 }
02121 
02122 const GaussInfo *GaussCoords::getInfoGivenCellType(NormalizedCellType cellType)
02123 {
02124   GaussInfoVector::const_iterator it = _my_gauss_info.begin();
02125   //Try to find gauss localization info
02126   for( ; it != _my_gauss_info.end() ; it++ ) 
02127     if( (*it)->getCellType()==cellType) 
02128       return (*it);
02129   throw INTERP_KERNEL::Exception("Can't find gauss localization information !");
02130 }