Skip to content
Snippets Groups Projects
Select Git revision
  • dada7259bde2a9cb64b0c5811b573795e24a28e6
  • master default protected
  • dune-tkr-article
  • patrizio-convexity-test
  • releases/2.6-1
  • releases/2.5-1
  • releases/2.4-1
  • releases/2.3-1
  • releases/2.2-1
  • releases/2.1-1
  • releases/2.0-1
  • dune-tkr-article-base
  • dune-tkr-article-patched
  • subversion->git
14 results

nonlinearelasticityproblem.hh

  • Forked from agnumpde / dune-elasticity
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    nonlinearelasticityproblem.hh 1.95 KiB
    // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
    // vi: set ts=8 sw=4 et sts=4:
    #ifndef DUNE_ELASTICITY_COMMON_NONLINEAR_ELASTICITY_PROBLEM_HH
    #define DUNE_ELASTICITY_COMMON_NONLINEAR_ELASTICITY_PROBLEM_HH
    
    #include <dune/elasticity/materials/material.hh>
    
    template <class VectorTypeTEMPLATE, class MatrixTypeTEMPLATE, class Basis>
    class NonlinearElasticityProblem
    {
    public:
        typedef Material<Basis> MaterialType;
        typedef typename MaterialType::GridType GridType;
        typedef VectorTypeTEMPLATE VectorType;
        typedef MatrixTypeTEMPLATE MatrixType;
        typedef typename VectorType::field_type field_type;
        typedef std::shared_ptr< <BasisGridFunction<Basis,VectorType> > GridFunctionPtr;
    
        NonlinearElasticityProblem(const MaterialType& material,
                             VectorType& extForces):
            material_(Dune::stackobject_to_shared_ptr(material)),
            extForces_(Dune::stackobject_to_shared_ptr(extForces))
        {}
    
         //! Set external forces
        void setExternalForces(const VectorType& extForces)
        {
            extForces_ = Dune::stackobject_to_shared_ptr(extForces);
        }
    
        //! Assemble the quadratic problem
        void assembleQP(const VectorType& iterate);
    
        //! Assemble the preconditioned defect problem
        template <class DiagonalMatrixType>
        void assembleDefectQP(const VectorType& iterate,
                              VectorType& residual,
                              DiagonalMatrixType& hessian);
    
        //! Compute the energy of the displacement minimization problem
        field_type energy(const VectorType& iterate) const;
    
        //! Compute the predicted decrease
        field_type modelDecrease(const VectorType& correction) const;
    
        //! The quadratic part
        MatrixType A_;
        //! The linear functional
        VectorType f_;
    
    private:
        //! The involved materials
        std::shared_ptr<MaterialType> material_;
        //! The external forces
        std::shared_ptr<VectorType> extForces_;
    };
    
    #include "nonlinearelasticityproblem.cc"
    
    #endif