00001 00029 #ifndef SHAPESEVALUATED 00030 #define SHAPESEVALUATED 00031 00032 #include <string> 00033 00034 #include "Shape.h" 00035 #include "Quadrature.h" 00036 #include "ElementGeometry.h" 00037 #include "BasisFunctions.h" 00038 #include "Linear.h" 00039 00040 00041 00102 class ShapesEvaluated: public BasisFunctions 00103 { 00104 protected: 00105 ShapesEvaluated() {} 00106 inline virtual ~ShapesEvaluated(){} 00107 ShapesEvaluated(const ShapesEvaluated &SEI); 00108 00109 public: 00110 // Accessors/Mutators: 00111 inline const std::vector<double> & getShapes() const { return LocalShapes; } 00112 00113 inline const std::vector<double> & getDShapes() const { return LocalDShapes; } 00114 00115 inline const std::vector<double> & getIntegrationWeights() const 00116 { return LocalWeights;} 00117 00118 inline const std::vector<double> & getQuadraturePointCoordinates() const 00119 { return LocalCoordinates; } 00120 00122 inline size_t getBasisDimension() const 00123 { return accessShape().getNumFunctions(); } 00124 00126 inline size_t getNumberOfDerivativesPerFunction() const 00127 { return LocalDShapes.size()/LocalShapes.size(); } 00128 00130 inline size_t getSpatialDimensions() const 00131 { return LocalCoordinates.size()/LocalWeights.size(); } 00132 00133 protected: 00135 virtual const Shape& accessShape() const = 0; 00136 00139 virtual const Quadrature& accessQuadrature() const = 0; 00140 00144 void createObject(const ElementGeometry& eg); 00145 00146 00147 private: 00148 std::vector<double> LocalShapes; 00149 std::vector<double> LocalDShapes; 00150 std::vector<double> LocalWeights; 00151 std::vector<double> LocalCoordinates; 00152 }; 00153 00154 00155 00185 template <const Shape * const& ShapeObj, const Quadrature * const& QuadObj> 00186 class ShapesEvaluated__:public ShapesEvaluated 00187 { 00188 public: 00189 inline ShapesEvaluated__(const ElementGeometry& EG): ShapesEvaluated() { 00190 createObject(EG); 00191 } 00192 00193 virtual ShapesEvaluated__* clone() const { 00194 return new ShapesEvaluated__(*this); 00195 } 00196 00197 ShapesEvaluated__(const ShapesEvaluated__ & SE): ShapesEvaluated (SE) { 00198 }; 00199 00200 const Shape& accessShape() const { return *ShapeObj;} 00201 const Quadrature& accessQuadrature() const { return *QuadObj;} 00202 }; 00203 00204 00205 00206 00207 // Build specific ShapesEvaluated 00208 00209 00211 class SpecificShapesEvaluated 00212 {}; 00213 00214 00215 00216 00234 00235 class ShapesP12D: public SpecificShapesEvaluated 00236 { 00237 public: 00239 static const Shape * const P12D; 00240 00242 static const Shape * const P11D; 00243 00245 typedef ShapesEvaluated__<P12D,Triangle_1::Bulk> Bulk; 00246 00248 typedef ShapesEvaluated__<P11D,Line_1::Bulk> Faces; 00249 00251 typedef ShapesEvaluated__<P12D,Triangle_1::FaceOne> FaceOne; 00253 typedef ShapesEvaluated__<P12D,Triangle_1::FaceTwo> FaceTwo; 00255 typedef ShapesEvaluated__<P12D,Triangle_1::FaceThree> FaceThree; 00256 }; 00257 00258 00259 00260 00262 class ShapesP11D: public SpecificShapesEvaluated 00263 { 00264 public: 00266 static const Shape * const P11D; 00267 00269 typedef ShapesEvaluated__<P11D,Line_1::Bulk> Bulk; 00270 }; 00271 00272 00273 00274 00275 #endif