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 #ifndef COMPRESSIBLENONLINEARELASTICITYSOLVER_HPP_
00029 #define COMPRESSIBLENONLINEARELASTICITYSOLVER_HPP_
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "AbstractNonlinearElasticitySolver.hpp"
00045 #include "AbstractMaterialLaw.hpp"
00046 #include "QuadraticMesh.hpp"
00047 #include "GaussianQuadratureRule.hpp"
00048
00055 template<size_t DIM>
00056 class CompressibleNonlinearElasticitySolver : public AbstractNonlinearElasticitySolver<COMPRESSIBLE, DIM>
00057 {
00058 friend class TestCompressibleNonlinearElasticitySolver;
00059
00060 protected:
00061
00063 static const size_t NUM_VERTICES_PER_ELEMENT = DIM+1;
00065 static const size_t NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2;
00069 static const size_t STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT;
00071 static const size_t NUM_NODES_PER_BOUNDARY_ELEMENT = DIM*(DIM+1)/2;
00073 static const size_t BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT;
00074
00075
00080 std::vector<AbstractMaterialLaw<DIM>*> mMaterialLaws;
00081
00082
00100 virtual void AssembleOnElement(Element<DIM, DIM>& rElement,
00101 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElem,
00102 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElemPrecond,
00103 c_vector<double, STENCIL_SIZE>& rBElem,
00104 bool assembleResidual,
00105 bool assembleJacobian);
00106
00123 virtual void AssembleOnBoundaryElement(BoundaryElement<DIM-1, DIM>& rBoundaryElement,
00124 c_matrix<double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE>& rAelem,
00125 c_vector<double, BOUNDARY_STENCIL_SIZE>& rBelem,
00126 c_vector<double, DIM>& rTraction,
00127 bool assembleResidual,
00128 bool assembleJacobian);
00129
00130
00140 void AssembleSystem(bool assembleResidual, bool assembleJacobian);
00141
00142
00161 virtual void ComputeStressAndStressDerivative(AbstractMaterialLaw<DIM>* pMaterialLaw,
00162 c_matrix<double,DIM,DIM>& rC,
00163 c_matrix<double,DIM,DIM>& rInvC,
00164 double pressure,
00165 unsigned elementIndex,
00166 unsigned currentQuadPointGlobalIndex,
00167 c_matrix<double,DIM,DIM>& rT,
00168 FourthOrderTensor<DIM,DIM,DIM,DIM>& rDTdE,
00169 bool computeDTdE);
00170
00171 public:
00172
00184 CompressibleNonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00185 AbstractMaterialLaw<DIM>* pMaterialLaw,
00186 c_vector<double,DIM> bodyForce,
00187 double density,
00188 std::string outputDirectory,
00189 std::vector<unsigned>& fixedNodes,
00190 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00191
00203 CompressibleNonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00204 std::vector<AbstractMaterialLaw<DIM>*>& rMaterialLaws,
00205 c_vector<double,DIM> bodyForce,
00206 double density,
00207 std::string outputDirectory,
00208 std::vector<unsigned>& fixedNodes,
00209 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00210
00212 ~CompressibleNonlinearElasticitySolver();
00213 };
00214
00215 #endif