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
00030
00031
00032
00033
00034
00035
00036 #ifndef CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_
00037 #define CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_
00038
00039 #include "AbstractTetrahedralMesh.hpp"
00040 #include "UblasCustomFunctions.hpp"
00041 #include "AbstractIncompressibleMaterialLaw.hpp"
00042 #include "AbstractCompressibleMaterialLaw.hpp"
00043 #include "CompressibilityType.hpp"
00044
00045
00049 typedef enum BodyForceType_
00050 {
00051 CONSTANT_BODY_FORCE,
00052 FUNCTIONAL_BODY_FORCE
00053 } BodyForceType;
00054
00058 typedef enum TractionBoundaryConditionType_
00059 {
00060 NO_TRACTIONS,
00061 ELEMENTWISE_TRACTION,
00062 FUNCTIONAL_TRACTION,
00063 PRESSURE_ON_DEFORMED,
00064 FUNCTIONAL_PRESSURE_ON_DEFORMED
00065 } TractionBoundaryConditionType;
00066
00067
00073 template<unsigned DIM>
00074 class ContinuumMechanicsProblemDefinition
00075 {
00076 public:
00079 static const double FREE;
00080
00081 protected:
00083 AbstractTetrahedralMesh<DIM,DIM>& mrMesh;
00084
00086 double mDensity;
00087
00089
00091
00093 BodyForceType mBodyForceType;
00094
00096 c_vector<double,DIM> mConstantBodyForce;
00097
00099 c_vector<double,DIM> (*mpBodyForceFunction)(c_vector<double,DIM>& rX, double t);
00100
00102
00104
00106 TractionBoundaryConditionType mTractionBoundaryConditionType;
00107
00109 std::vector<BoundaryElement<DIM-1,DIM>*> mTractionBoundaryElements;
00110
00112 std::vector<c_vector<double,DIM> > mElementwiseTractions;
00113
00116 double mNormalPressure;
00117
00121 double mOriginalNormalPressure;
00122
00124 c_vector<double,DIM> (*mpTractionBoundaryConditionFunction)(c_vector<double,DIM>& rX, double t);
00125
00127 double (*mpNormalPressureFunction)(double t);
00128
00129
00131
00133
00137 std::vector<unsigned> mDirichletNodes;
00138
00140 std::vector<c_vector<double,DIM> > mDirichletNodeValues;
00141
00143 bool mVerboseDuringSolve;
00144
00145 public:
00150 ContinuumMechanicsProblemDefinition(AbstractTetrahedralMesh<DIM,DIM>& rMesh);
00151
00153 virtual ~ContinuumMechanicsProblemDefinition()
00154 {
00155 }
00156
00161 void SetDensity(double density);
00162
00166 double GetDensity();
00167
00172 void SetZeroDirichletNodes(std::vector<unsigned>& rZeroDirichletNodes);
00173
00174
00175
00179 std::vector<unsigned>& rGetDirichletNodes();
00180
00184 std::vector<c_vector<double,DIM> >& rGetDirichletNodeValues();
00185
00186
00191 void SetBodyForce(c_vector<double,DIM> bodyForce);
00192
00197 void SetBodyForce(c_vector<double,DIM> (*pFunction)(c_vector<double,DIM>& rX, double t));
00198
00207 c_vector<double,DIM> GetBodyForce(c_vector<double,DIM>& rX, double t = 0.0);
00208
00212 BodyForceType GetBodyForceType();
00213
00217 c_vector<double,DIM> GetConstantBodyForce();
00218
00225 c_vector<double,DIM> EvaluateBodyForceFunction(c_vector<double,DIM>& rX, double t);
00226
00230 TractionBoundaryConditionType GetTractionBoundaryConditionType();
00231
00238 void SetTractionBoundaryConditions(std::vector<BoundaryElement<DIM-1,DIM>*>& rTractionBoundaryElements,
00239 std::vector<c_vector<double,DIM> >& rElementwiseTractions);
00240
00248 void SetTractionBoundaryConditions(std::vector<BoundaryElement<DIM-1,DIM>*>& rTractionBoundaryElements,
00249 c_vector<double,DIM> (*pFunction)(c_vector<double,DIM>& rX, double t));
00250
00258 void SetApplyNormalPressureOnDeformedSurface(std::vector<BoundaryElement<DIM-1,DIM>*>& rTractionBoundaryElements,
00259 double normalPressure);
00260
00261
00262
00271 void SetApplyNormalPressureOnDeformedSurface(std::vector<BoundaryElement<DIM-1,DIM>*>& rTractionBoundaryElements,
00272 double (*pFunction)(double t));
00273
00277 std::vector<BoundaryElement<DIM-1,DIM>*>& rGetTractionBoundaryElements();
00278
00284 std::vector<c_vector<double,DIM> >& rGetElementwiseTractions();
00285
00291 double GetNormalPressure();
00292
00306 void SetPressureScaling(double scaleFactor);
00307
00314 c_vector<double,DIM> EvaluateTractionFunction(c_vector<double,DIM>& rX, double t);
00315
00321 double EvaluateNormalPressureFunction(double t);
00322
00323
00328 virtual void Validate();
00329
00334 void SetVerboseDuringSolve(bool verboseDuringSolve = true)
00335 {
00336 mVerboseDuringSolve = verboseDuringSolve;
00337 }
00338
00342 bool GetVerboseDuringSolve()
00343 {
00344 return mVerboseDuringSolve;
00345 }
00346
00347 };
00348
00349
00350 #endif // CONTINUUMMECHANICSPROBLEMDEFINITION_HPP_