CompressibleNonlinearElasticitySolver.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 #ifndef COMPRESSIBLENONLINEARELASTICITYSOLVER_HPP_
00029 #define COMPRESSIBLENONLINEARELASTICITYSOLVER_HPP_
00030 
00031 /*
00032  * NOTE ON COMPILATION ERRORS:
00033  *
00034  * (The following applies to NonlinearElasticityAssembler; possibly/probably holds for this class too).
00035  *
00036  * This file won't compile with Intel icpc version 9.1.039, with error message:
00037  * "Terminate with:
00038   (0): internal error: backend signals"
00039  *
00040  * Try recompiling with icpc version 10.0.025.
00041  */
00042 
00043 
00044 #include "AbstractNonlinearElasticitySolver.hpp"
00045 #include "AbstractCompressibleMaterialLaw.hpp"
00046 #include "QuadraticMesh.hpp"
00047 #include "GaussianQuadratureRule.hpp"
00048 
00055 template<size_t DIM>
00056 class CompressibleNonlinearElasticitySolver : public AbstractNonlinearElasticitySolver<DIM>
00057 {
00058     friend class TestCompressibleNonlinearElasticitySolver;
00059 
00060 protected:
00062     static const size_t NUM_NODES_PER_ELEMENT    = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_ELEMENT;
00064     static const size_t NUM_VERTICES_PER_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_VERTICES_PER_ELEMENT;
00066     static const size_t NUM_NODES_PER_BOUNDARY_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_BOUNDARY_ELEMENT;
00067 
00071     static const size_t STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT;
00073     static const size_t BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT;
00074 
00075 
00080     std::vector<AbstractCompressibleMaterialLaw<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 public:
00143 
00155     CompressibleNonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00156                                           AbstractMaterialLaw<DIM>* pMaterialLaw,
00157                                           c_vector<double,DIM> bodyForce,
00158                                           double density,
00159                                           std::string outputDirectory,
00160                                           std::vector<unsigned>& fixedNodes,
00161                                           std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00162 
00174     CompressibleNonlinearElasticitySolver(QuadraticMesh<DIM>* pQuadMesh,
00175                                           std::vector<AbstractMaterialLaw<DIM>*>& rMaterialLaws,
00176                                           c_vector<double,DIM> bodyForce,
00177                                           double density,
00178                                           std::string outputDirectory,
00179                                           std::vector<unsigned>& fixedNodes,
00180                                           std::vector<c_vector<double,DIM> >* pFixedNodeLocations = NULL);
00181 
00183     ~CompressibleNonlinearElasticitySolver();
00184 };
00185 
00186 #endif /*COMPRESSIBLENONLINEARELASTICITYSOLVER_HPP_*/

Generated on Tue May 31 14:31:49 2011 for Chaste by  doxygen 1.5.5