/Users/jack/Code/basso_dev/inc/Basis.h

Go to the documentation of this file.
00001 
00013 #ifndef _BASIS_BASSO_H_
00014 #define _BASIS_BASSO_H_
00015 
00016 #include "basso.h"
00017 #include "Point.h"
00018 #include "quadrature_rules.h"
00019 #include "shapefunc.h"
00020 
00021 namespace basso
00022 {
00023 
00024 
00028         enum BasisShape
00029         {       kLINE, kTRIANGLE, kQUADRILATERAL, kTETRAHEDRA, kHEXAHEDRA, kPRISM, kPYRAMID };
00030 
00034         enum BasisType
00035                 { kNONE=0, kPOINT1, kLINE2,     kTRIA3, kQUAD4, kTETRA4, kHEXA8, kPRISM6, kPYRAMID5,
00036                         kLINE3, kTRIA6, kQUAD9, kQUAD8, kTETRA10, kHEXA20, kHEXA27, kPYRAMID13, kPYRAMID14, kPRISM15, kPRISM18 };
00037                                                                 
00038 
00040                 int basis_type_numnodes( const BasisType &bt )
00041                 {
00042                         switch ( bt ) {
00043 
00044                                 case kNONE:
00045                                 return 0;
00046                                 break;
00047                                 
00048                                 case kPOINT1:
00049                                 return 1;
00050                                 break;
00051 
00052                                 case kLINE2:
00053                                 return 2;
00054                                 break;
00055 
00056                                 case kTRIA3:
00057                                 return 3;
00058                                 break;
00059 
00060                                 case kQUAD4:
00061                                 return 4;
00062                                 break;
00063 
00064                                 case kTETRA4:
00065                                 return 4;
00066                                 break;
00067 
00068                                 case kHEXA8:
00069                                 return 8;
00070                                 break;
00071 
00072                                 case kPRISM6:
00073                                 return 6;
00074                                 break;
00075 
00076                                 case kPYRAMID5:
00077                                 return 5;
00078                                 break;
00079 
00080                                 case kLINE3:
00081                                 return 3;
00082                                 break;
00083 
00084                                 case kTRIA6:
00085                                 return 6;
00086                                 break;
00087 
00088                                 case kQUAD9:
00089                                 return 9;
00090                                 break;
00091 
00092                                 case kQUAD8:
00093                                 return 8;
00094                                 break;
00095 
00096                                 case kTETRA10:
00097                                 return 10;
00098                                 break;
00099 
00100                                 case kHEXA20:
00101                                 return 20;
00102                                 break;
00103 
00104                                 case kHEXA27:
00105                                 return 27;
00106                                 break;
00107 
00108                                 case kPYRAMID13:
00109                                 return 13;
00110                                 break;
00111                                 
00112                                 case kPYRAMID14:
00113                                 return 14;
00114                                 break;
00115                                 
00116                                 case kPRISM15:
00117                                 return 15;
00118                                 break;                          
00119 
00120                                 case kPRISM18:
00121                                 return 18;
00122                                 break;
00123                                 
00124                                 default:
00125                                 WarningMessage("basis_type_numnodes","unknown BasisType");
00126                                 return 0;
00127 
00128                         }
00129                 }
00130                 
00131                 std::ostream &operator << ( std::ostream &out, const BasisType &bt )
00132                 {
00133                         switch ( bt ) {
00134 
00135                                 case kNONE:
00136                                 out << "NONE";
00137                                 return out;
00138                                 break;
00139                                 
00140                                 case kPOINT1:
00141                                 out << "POINT1";
00142                                 return out;
00143                                 break;
00144 
00145                                 case kLINE2:
00146                                 out << "LINE2";
00147                                 return out;
00148                                 break;
00149 
00150                                 case kTRIA3:
00151                                 out << "TRIA3";
00152                                 return out;
00153                                 break;
00154 
00155                                 case kQUAD4:
00156                                 out << "QUAD4";
00157                                 return out;
00158                                 break;
00159 
00160                                 case kTETRA4:
00161                                 out << "TETRA4";
00162                                 return out;
00163                                 break;
00164 
00165                                 case kHEXA8:
00166                                 out << "HEXA8";
00167                                 return out;
00168                                 break;
00169 
00170                                 case kPRISM6:
00171                                 out << "PRISIM6";
00172                                 return out;
00173                                 break;
00174 
00175                                 case kPYRAMID5:
00176                                 out << "PYRAMID5";
00177                                 return out;
00178                                 break;
00179 
00180                                 case kLINE3:
00181                                 out << "LINE3";
00182                                 return out;
00183                                 break;
00184 
00185                                 case kTRIA6:
00186                                 out << "TRIA6";
00187                                 return out;
00188                                 break;
00189 
00190                                 case kQUAD9:
00191                                 out << "QUAD9";
00192                                 return out;
00193                                 break;
00194 
00195                                 case kQUAD8:
00196                                 out << "QUAD8";
00197                                 return out;
00198                                 break;
00199 
00200                                 case kTETRA10:
00201                                 out << "TETRA10";
00202                                 return out;
00203                                 break;
00204 
00205                                 case kHEXA20:
00206                                 out << "HEXA20";
00207                                 return out;
00208                                 break;
00209 
00210                                 case kHEXA27:
00211                                 out << "HEXA27";
00212                                 return out;
00213                                 break;
00214 
00215                                 case kPYRAMID13:
00216                                 out << "PYRAMD13";
00217                                 return out;
00218                                 break;
00219                                 
00220                                 case kPYRAMID14:
00221                                 out << "PYRAMID14";
00222                                 return out;
00223                                 break;
00224                                 
00225                                 case kPRISM15:
00226                                 out << "PRISIM15";
00227                                 return out;
00228                                 break;                          
00229 
00230                                 case kPRISM18:
00231                                 out << "PRISM18";
00232                                 return out;
00233                                 break;
00234                                 
00235                                 default:
00236                                 out << "UNKNOWN";
00237                                 WarningMessage("basis_type_numnodes","unknown BasisType");
00238                                 return out;
00239 
00240                         }
00241                         return out;
00242                 }       
00243                 
00251         class Basis
00252         {
00253 
00254         public:
00255                 
00256                 Basis() {}
00257                 
00258                 virtual ~Basis() {}
00259 
00261                 virtual BasisType       Type() const=0;
00262                 
00264                 virtual BasisShape Shape() const=0;
00265 
00267                 virtual int     NumNodes() const=0;
00268 
00270                 virtual int     NumEdges() const=0;
00271 
00273                 virtual int     NumFaces() const=0;
00274 
00276                 virtual int     Dimension() const=0;
00277 
00279                 virtual int     Order() const=0; 
00280 
00282                 virtual void ParentCoord( Array< Point > &pts ) const=0;
00283 
00285                 virtual Point Centroid() const=0;
00286 
00289                 virtual void NumNodesOnFaces( iArray &nn_face ) const=0; 
00290 
00293           virtual void NumNodesOnEdges( iArray &nn_edege ) const=0;
00294 
00298                 virtual void NodesOnFace ( int f, iArray &face_nodeids ) const=0;
00299 
00301                 virtual void NodesOnEdge ( int e, iArray &edge_nodeids ) const=0;
00302 
00304                 virtual void FaceBasisType( Array<BasisType> &face_basis ) const=0;
00305 
00307                 virtual void EdgeBasisType( Array< BasisType > &edge_basis ) const=0;
00308 
00310                 virtual void Quadrature( int p, QuadratureRule &quad ) const=0;
00311                 
00315                 virtual void Na( const Point &p, Array<Numeric> &shapefunct ) const=0;
00316 
00318                 virtual void Na( Array<Numeric> &shapefunct ) const=0   ;
00319 
00324                 virtual void DNa( const Point &p, dense_matrix<Numeric> &grad_shape ) const=0;
00325 
00327                 virtual void DNa( dense_matrix<Numeric> &grad_shape ) const=0;
00328 
00329 
00330 
00331         };
00332 
00333 
00334 
00335 
00336 } // end namespace
00337 
00338 #endif

Generated on Sat Jan 19 09:03:57 2008 for Basso by  doxygen 1.5.2