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 NONLINEARELASTICITYSOLVER_HPP_
00029 #define NONLINEARELASTICITYSOLVER_HPP_
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "AbstractNonlinearElasticitySolver.hpp"
00043 #include "AbstractIncompressibleMaterialLaw.hpp"
00044
00052 template<size_t DIM>
00053 class NonlinearElasticitySolver : public AbstractNonlinearElasticitySolver<INCOMPRESSIBLE,DIM>
00054 {
00055 friend class TestNonlinearElasticitySolver;
00056 friend class TestNonlinearElasticityAdjointSolver;
00057 friend class AdaptiveNonlinearElasticityProblem;
00058
00059 protected:
00060
00062 static const size_t NUM_VERTICES_PER_ELEMENT = DIM+1;
00064 static const size_t NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2;
00067 static const size_t STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT;
00069 static const size_t NUM_NODES_PER_BOUNDARY_ELEMENT = DIM*(DIM+1)/2;
00071 static const size_t BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT + DIM;
00072
00073
00074
00079 std::vector<AbstractIncompressibleMaterialLaw<DIM>*> mMaterialLaws;
00080
00084 std::vector<double> mPressures;
00085
00086
00104 virtual void AssembleOnElement(Element<DIM, DIM>& rElement,
00105 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElem,
00106 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElemPrecond,
00107 c_vector<double, STENCIL_SIZE>& rBElem,
00108 bool assembleResidual,
00109 bool assembleJacobian);
00110
00127 virtual void AssembleOnBoundaryElement(BoundaryElement<DIM-1, DIM>& rBoundaryElement,
00128 c_matrix<double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE>& rAelem,
00129 c_vector<double, BOUNDARY_STENCIL_SIZE>& rBelem,
00130 c_vector<double, DIM>& rTraction,
00131 bool assembleResidual,
00132 bool assembleJacobian);
00133
00150 void FormInitialGuess();
00151
00161 void AssembleSystem(bool assembleResidual, bool assembleJacobian);
00162
00163
00182 virtual void ComputeStressAndStressDerivative(AbstractIncompressibleMaterialLaw<DIM>* pMaterialLaw,
00183 c_matrix<double,DIM,DIM>& rC,
00184 c_matrix<double,DIM,DIM>& rInvC,
00185 double pressure,
00186 unsigned elementIndex,
00187 unsigned currentQuadPointGlobalIndex,
00188 c_matrix<double,DIM,DIM>& rT,
00189 FourthOrderTensor<DIM,DIM,DIM,DIM>& rDTdE,
00190 bool computeDTdE);
00191
00192 public:
00193
00205 NonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00206 AbstractIncompressibleMaterialLaw<DIM>* pMaterialLaw,
00207 c_vector<double,DIM> bodyForce,
00208 double density,
00209 std::string outputDirectory,
00210 std::vector<unsigned>& fixedNodes,
00211 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00212
00224 NonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00225 std::vector<AbstractIncompressibleMaterialLaw<DIM>*>& rMaterialLaws,
00226 c_vector<double,DIM> bodyForce,
00227 double density,
00228 std::string outputDirectory,
00229 std::vector<unsigned>& fixedNodes,
00230 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00231
00233 ~NonlinearElasticitySolver();
00234
00238 std::vector<double>& rGetPressures();
00239
00240 };
00241
00242 #endif