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 NONLINEARELASTICITYASSEMBLER_HPP_
00029 #define NONLINEARELASTICITYASSEMBLER_HPP_
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #include "AbstractNonlinearElasticityAssembler.hpp"
00046
00047
00048 #include "QuadraticMesh.hpp"
00049 #include "GaussianQuadratureRule.hpp"
00050
00061 template<size_t DIM>
00062 class NonlinearElasticityAssembler : public AbstractNonlinearElasticityAssembler<DIM>
00063 {
00064 friend class TestNonlinearElasticityAssembler;
00065
00066 protected:
00067
00069 static const size_t NUM_VERTICES_PER_ELEMENT = DIM+1;
00071 static const size_t NUM_NODES_PER_ELEMENT = (DIM+1)*(DIM+2)/2;
00073 static const size_t STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT;
00075 static const size_t NUM_NODES_PER_BOUNDARY_ELEMENT = DIM*(DIM+1)/2;
00077 static const size_t BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT + DIM;
00078
00083 QuadraticMesh<DIM> *mpQuadMesh;
00084
00086 std::vector<BoundaryElement<DIM-1,DIM>*> mBoundaryElements;
00087
00089 GaussianQuadratureRule<DIM> *mpQuadratureRule;
00090
00092 GaussianQuadratureRule<DIM-1> *mpBoundaryQuadratureRule;
00093
00111 virtual void AssembleOnElement(Element<DIM, DIM>& rElement,
00112 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElem,
00113 c_matrix<double, STENCIL_SIZE, STENCIL_SIZE >& rAElemPrecond,
00114 c_vector<double, STENCIL_SIZE>& rBElem,
00115 bool assembleResidual,
00116 bool assembleJacobian);
00117
00134 virtual void AssembleOnBoundaryElement(BoundaryElement<DIM-1, DIM>& rBoundaryElement,
00135 c_matrix<double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE>& rAelem,
00136 c_vector<double, BOUNDARY_STENCIL_SIZE>& rBelem,
00137 c_vector<double, DIM>& rTraction,
00138 bool assembleResidual,
00139 bool assembleJacobian);
00140
00157 void FormInitialGuess();
00158
00168 void AssembleSystem(bool assembleResidual, bool assembleJacobian);
00169
00175 void Initialise(std::vector<c_vector<double,DIM> >* pFixedNodeLocations);
00176
00177 public:
00178
00192 NonlinearElasticityAssembler(QuadraticMesh<DIM>* pQuadMesh,
00193 AbstractIncompressibleMaterialLaw<DIM>* pMaterialLaw,
00194 c_vector<double,DIM> bodyForce,
00195 double density,
00196 std::string outputDirectory,
00197 std::vector<unsigned>& fixedNodes,
00198 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00199
00211 NonlinearElasticityAssembler(QuadraticMesh<DIM>* pQuadMesh,
00212 std::vector<AbstractIncompressibleMaterialLaw<DIM>*>& rMaterialLaws,
00213 c_vector<double,DIM> bodyForce,
00214 double density,
00215 std::string outputDirectory,
00216 std::vector<unsigned>& fixedNodes,
00217 std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00218
00220 ~NonlinearElasticityAssembler();
00221
00230 void SetSurfaceTractionBoundaryConditions(std::vector<BoundaryElement<DIM-1,DIM>*>& rBoundaryElements,
00231 std::vector<c_vector<double,DIM> >& rSurfaceTractions);
00232
00240 void SetFunctionalTractionBoundaryCondition(std::vector<BoundaryElement<DIM-1,DIM>*> rBoundaryElements,
00241 c_vector<double,DIM> (*pFunction)(c_vector<double,DIM>&));
00242
00243
00247 std::vector<double>& rGetPressures();
00248
00252 std::vector<c_vector<double,DIM> >& rGetDeformedPosition();
00253 };
00254
00255 #endif