ContinuumMechanicsProblemDefinition.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_
00030 #define CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_
00031
00032 #include "QuadraticMesh.hpp"
00033 #include "UblasCustomFunctions.hpp"
00034 #include "AbstractIncompressibleMaterialLaw.hpp"
00035 #include "AbstractCompressibleMaterialLaw.hpp"
00036 #include "CompressibilityType.hpp"
00037
00038
00042 typedef enum BodyForceType_
00043 {
00044 CONSTANT_BODY_FORCE,
00045 FUNCTIONAL_BODY_FORCE
00046 } BodyForceType;
00047
00051 typedef enum TractionBoundaryConditionType_
00052 {
00053 NO_TRACTIONS,
00054 ELEMENTWISE_TRACTION,
00055 FUNCTIONAL_TRACTION,
00056 PRESSURE_ON_DEFORMED
00057 } TractionBoundaryConditionType;
00058
00059
00065 template<unsigned DIM>
00066 class ContinuumMechanicsProblemDefinition
00067 {
00068 public:
00071 static const double FREE;
00072
00073 protected:
00075 QuadraticMesh<DIM>& mrMesh;
00076
00078 double mDensity;
00079
00081
00083
00085 BodyForceType mBodyForceType;
00086
00088 c_vector<double,DIM> mConstantBodyForce;
00089
00091 c_vector<double,DIM> (*mpBodyForceFunction)(c_vector<double,DIM>& rX, double t);
00092
00094
00096
00098 TractionBoundaryConditionType mTractionBoundaryConditionType;
00099
00101 std::vector<BoundaryElement<DIM-1,DIM>*> mTractionBoundaryElements;
00102
00104 std::vector<c_vector<double,DIM> > mElementwiseTractions;
00105
00108 double mNormalPressure;
00109
00111 c_vector<double,DIM> (*mpTractionBoundaryConditionFunction)(c_vector<double,DIM>& rX, double t);
00112
00114
00116
00120 std::vector<unsigned> mDirichletNodes;
00121
00123 std::vector<c_vector<double,DIM> > mDirichletNodeValues;
00124
00125
00126 public:
00131 ContinuumMechanicsProblemDefinition(QuadraticMesh<DIM>& rMesh);
00132
00134 virtual ~ContinuumMechanicsProblemDefinition()
00135 {
00136 }
00137
00138
00143 void SetDensity(double density);
00144
00148 double GetDensity();
00149
00154 void SetZeroDirichletNodes(std::vector<unsigned>& rZeroDirichletNodes);
00155
00156
00157
00161 std::vector<unsigned>& rGetDirichletNodes();
00162
00166 std::vector<c_vector<double,DIM> >& rGetDirichletNodeValues();
00167
00168
00173 void SetBodyForce(c_vector<double,DIM> bodyForce);
00174
00179 void SetBodyForce(c_vector<double,DIM> (*pFunction)(c_vector<double,DIM>& rX, double t));
00180
00189 c_vector<double,DIM> GetBodyForce(c_vector<double,DIM>& rX, double t = 0.0);
00190
00194 BodyForceType GetBodyForceType();
00195
00199 c_vector<double,DIM> GetConstantBodyForce();
00200
00207 c_vector<double,DIM> EvaluateBodyForceFunction(c_vector<double,DIM>& rX, double t);
00208
00212 TractionBoundaryConditionType GetTractionBoundaryConditionType();
00213
00220 void SetTractionBoundaryConditions(std::vector<BoundaryElement<DIM-1,DIM>*>& rTractionBoundaryElements,
00221 std::vector<c_vector<double,DIM> >& rElementwiseTractions);
00222
00230 void SetTractionBoundaryConditions(std::vector<BoundaryElement<DIM-1,DIM>*> rTractionBoundaryElements,
00231 c_vector<double,DIM> (*pFunction)(c_vector<double,DIM>& rX, double t));
00232
00240 void SetApplyNormalPressureOnDeformedSurface(std::vector<BoundaryElement<DIM-1,DIM>*> rTractionBoundaryElements,
00241 double normalPressure);
00242
00246 std::vector<BoundaryElement<DIM-1,DIM>*>& rGetTractionBoundaryElements();
00247
00253 std::vector<c_vector<double,DIM> >& rGetElementwiseTractions();
00254
00260 double GetNormalPressure();
00261
00262
00269 c_vector<double,DIM> EvaluateTractionFunction(c_vector<double,DIM>& rX, double t);
00270
00275 virtual void Validate();
00276 };
00277
00278
00279 #endif // CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_