#include <IncompressibleNonlinearElasticitySolver.hpp>
Inherits AbstractNonlinearElasticitySolver< DIM >.
Public Member Functions | |
IncompressibleNonlinearElasticitySolver (QuadraticMesh< DIM > &rQuadMesh, SolidMechanicsProblemDefinition< DIM > &rProblemDefinition, std::string outputDirectory) | |
~IncompressibleNonlinearElasticitySolver () | |
std::vector< double > & | rGetPressures () |
Protected Member Functions | |
virtual void | AssembleOnElement (Element< DIM, DIM > &rElement, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElem, c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > &rAElemPrecond, c_vector< double, STENCIL_SIZE > &rBElem, bool assembleResidual, bool assembleJacobian) |
virtual void | AssembleOnBoundaryElement (BoundaryElement< DIM-1, DIM > &rBoundaryElement, c_matrix< double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE > &rAelem, c_vector< double, BOUNDARY_STENCIL_SIZE > &rBelem, bool assembleResidual, bool assembleJacobian, unsigned boundaryConditionIndex) |
void | FormInitialGuess () |
void | AssembleSystem (bool assembleResidual, bool assembleJacobian) |
Protected Attributes | |
std::vector< double > | mPressures |
Static Protected Attributes | |
static const size_t | NUM_NODES_PER_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_ELEMENT |
static const size_t | NUM_VERTICES_PER_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_VERTICES_PER_ELEMENT |
static const size_t | NUM_NODES_PER_BOUNDARY_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_BOUNDARY_ELEMENT |
static const size_t | STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT |
static const size_t | BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT + DIM |
Friends | |
class | TestIncompressibleNonlinearElasticitySolver |
class | TestCompressibleNonlinearElasticitySolver |
class | TestNonlinearElasticityAdjointSolver |
class | AdaptiveNonlinearElasticityProblem |
Finite elasticity solver. Solves static *incompressible* nonlinear elasticity problems with arbitrary (incompressible) material laws and a body force.
Uses quadratic-linear bases (for displacement and pressure), and is therefore outside other assembler or solver hierarchy.
Definition at line 53 of file IncompressibleNonlinearElasticitySolver.hpp.
IncompressibleNonlinearElasticitySolver< DIM >::IncompressibleNonlinearElasticitySolver | ( | QuadraticMesh< DIM > & | rQuadMesh, | |
SolidMechanicsProblemDefinition< DIM > & | rProblemDefinition, | |||
std::string | outputDirectory | |||
) | [inline] |
Constructor.
rQuadMesh | The quadratic mesh to solve on | |
rProblemDefinition | an object defining in particular the body force and boundary conditions | |
outputDirectory | The output directory |
Definition at line 659 of file IncompressibleNonlinearElasticitySolver.cpp.
References EXCEPTION, IncompressibleNonlinearElasticitySolver< DIM >::FormInitialGuess(), SolidMechanicsProblemDefinition< DIM >::GetCompressibilityType(), and AbstractNonlinearElasticitySolver< DIM >::Initialise().
IncompressibleNonlinearElasticitySolver< DIM >::~IncompressibleNonlinearElasticitySolver | ( | ) | [inline] |
Destructor.
Definition at line 178 of file IncompressibleNonlinearElasticitySolver.hpp.
void IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElement | ( | BoundaryElement< DIM-1, DIM > & | rBoundaryElement, | |
c_matrix< double, BOUNDARY_STENCIL_SIZE, BOUNDARY_STENCIL_SIZE > & | rAelem, | |||
c_vector< double, BOUNDARY_STENCIL_SIZE > & | rBelem, | |||
bool | assembleResidual, | |||
bool | assembleJacobian, | |||
unsigned | boundaryConditionIndex | |||
) | [inline, protected, virtual] |
Compute the term from the surface integral of s*phi, where s is a specified non-zero surface traction (ie Neumann boundary condition) to be added to the Rhs vector.
rBoundaryElement | the boundary element to be integrated on | |
rAelem | The element's contribution to the LHS matrix is returned in this n by n matrix, where n is the no. of nodes in this element. There is no need to zero this matrix before calling. | |
rBelem | The element's contribution to the RHS vector is returned in this vector of length n, the no. of nodes in this element. There is no need to zero this vector before calling. | |
assembleResidual | A bool stating whether to assemble the residual vector. | |
assembleJacobian | A bool stating whether to assemble the Jacobian matrix. | |
boundaryConditionIndex | index of this boundary (in the vectors in the problem definition object, in which the boundary conditions are stored |
Definition at line 524 of file IncompressibleNonlinearElasticitySolver.cpp.
References DeformedBoundaryElement< ELEM_DIM, SPACE_DIM >::ApplyUndeformedElementAndDisplacement(), AbstractTetrahedralElement< ELEMENT_DIM, SPACE_DIM >::CalculateNormal(), AbstractTetrahedralElement< ELEMENT_DIM, SPACE_DIM >::CalculateWeightedDirection(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), AbstractNonlinearElasticitySolver< DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< DIM >::mCurrentTime, AbstractNonlinearElasticitySolver< DIM >::mDeformedBoundaryElement, AbstractNonlinearElasticitySolver< DIM >::mpBoundaryQuadratureRule, AbstractNonlinearElasticitySolver< DIM >::mrProblemDefinition, AbstractNonlinearElasticitySolver< DIM >::mrQuadMesh, NEVER_REACHED, IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT, and GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint().
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().
void IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement | ( | Element< DIM, DIM > & | rElement, | |
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > & | rAElem, | |||
c_matrix< double, STENCIL_SIZE, STENCIL_SIZE > & | rAElemPrecond, | |||
c_vector< double, STENCIL_SIZE > & | rBElem, | |||
bool | assembleResidual, | |||
bool | assembleJacobian | |||
) | [inline, protected, virtual] |
Assemble residual or Jacobian on an element, using the current solution stored in mCurrrentSolution. The ordering assumed is (in 2d) rBElem = [u0 v0 u1 v1 .. u5 v5 p0 p1 p2].
rElement | The element to assemble on. | |
rAElem | The element's contribution to the LHS matrix is returned in this n by n matrix, where n is the no. of nodes in this element. There is no need to zero this matrix before calling. | |
rAElemPrecond | The element's contribution to the matrix passed to PetSC in creating a preconditioner | |
rBElem | The element's contribution to the RHS vector is returned in this vector of length n, the no. of nodes in this element. There is no need to zero this vector before calling. | |
assembleResidual | A bool stating whether to assemble the residual vector. | |
assembleJacobian | A bool stating whether to assemble the Jacobian matrix. |
Definition at line 183 of file IncompressibleNonlinearElasticitySolver.cpp.
References AbstractNonlinearElasticitySolver< DIM >::ComputeStressAndStressDerivative(), Determinant(), AbstractNonlinearElasticitySolver< DIM >::dTdE, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), GaussianQuadratureRule< ELEMENT_DIM >::GetNumQuadPoints(), GaussianQuadratureRule< ELEMENT_DIM >::GetWeight(), Inverse(), AbstractNonlinearElasticitySolver< DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< DIM >::mCurrentTime, AbstractNonlinearElasticitySolver< DIM >::mpQuadratureRule, AbstractNonlinearElasticitySolver< DIM >::mrProblemDefinition, AbstractNonlinearElasticitySolver< DIM >::mrQuadMesh, NEVER_REACHED, IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT, IncompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT, GaussianQuadratureRule< ELEMENT_DIM >::rGetQuadPoint(), and IncompressibleNonlinearElasticitySolver< DIM >::STENCIL_SIZE.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().
void IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem | ( | bool | assembleResidual, | |
bool | assembleJacobian | |||
) | [inline, protected, virtual] |
Assemble the residual vector (using the current solution stored in mCurrentSolution, output going to mpLinearSystem->rGetRhsVector), or Jacobian matrix (using the current solution stored in mCurrentSolution, output going to mpLinearSystem->rGetLhsMatrix).
assembleResidual | A bool stating whether to assemble the residual vector. | |
assembleJacobian | A bool stating whether to assemble the Jacobian matrix. |
Implements AbstractNonlinearElasticitySolver< DIM >.
Definition at line 45 of file IncompressibleNonlinearElasticitySolver.cpp.
References IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElement(), IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), IncompressibleNonlinearElasticitySolver< DIM >::BOUNDARY_STENCIL_SIZE, AbstractNonlinearElasticitySolver< DIM >::FinishAssembleSystem(), PetscTools::GetMyRank(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetOwnership(), AbstractNonlinearElasticitySolver< DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< DIM >::mJacobianMatrix, AbstractNonlinearElasticitySolver< DIM >::mNumDofs, AbstractNonlinearElasticitySolver< DIM >::mPreconditionMatrix, AbstractNonlinearElasticitySolver< DIM >::mResidualVector, AbstractNonlinearElasticitySolver< DIM >::mrProblemDefinition, AbstractNonlinearElasticitySolver< DIM >::mrQuadMesh, IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT, IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT, IncompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT, IncompressibleNonlinearElasticitySolver< DIM >::STENCIL_SIZE, PetscMatTools::Zero(), and PetscVecTools::Zero().
void IncompressibleNonlinearElasticitySolver< DIM >::FormInitialGuess | ( | ) | [inline, protected] |
Set up the current guess to be the solution given no displacement. The current solution (in 2d) is order as [u1 v1 u2 v2 ... uN vN p1 p2 .. pM] (where there are N total nodes and M vertices) so the initial guess is [0 0 0 0 ... 0 0 p1 p2 .. pM] where p_i are such that T is zero (depends on material law).
In a homogeneous problem, all p_i are the same. In a heterogeneous problem, p for a given vertex is the zero-strain-pressure for ONE of the elements containing that vertex (which element containing the vertex is reached LAST). In this case the initial guess will be close but not exactly the solution given zero body force.
Definition at line 631 of file IncompressibleNonlinearElasticitySolver.cpp.
References AbstractNonlinearElasticitySolver< DIM >::mCurrentSolution, AbstractNonlinearElasticitySolver< DIM >::mNumDofs, AbstractNonlinearElasticitySolver< DIM >::mrProblemDefinition, AbstractNonlinearElasticitySolver< DIM >::mrQuadMesh, and IncompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::IncompressibleNonlinearElasticitySolver().
std::vector< double > & IncompressibleNonlinearElasticitySolver< DIM >::rGetPressures | ( | ) | [inline] |
Get pressures for each vertex.
Definition at line 679 of file IncompressibleNonlinearElasticitySolver.cpp.
References AbstractNonlinearElasticitySolver< DIM >::mCurrentSolution, IncompressibleNonlinearElasticitySolver< DIM >::mPressures, and AbstractNonlinearElasticitySolver< DIM >::mrQuadMesh.
const size_t IncompressibleNonlinearElasticitySolver< DIM >::BOUNDARY_STENCIL_SIZE = DIM*NUM_NODES_PER_BOUNDARY_ELEMENT + DIM [static, protected] |
Boundary stencil size.
Definition at line 78 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().
std::vector<double> IncompressibleNonlinearElasticitySolver< DIM >::mPressures [protected] |
The solution pressures. mPressures[i] = pressure at node i (ie vertex i).
Definition at line 83 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::rGetPressures().
const size_t IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_BOUNDARY_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_BOUNDARY_ELEMENT [static, protected] |
Number of nodes per boundary element.
Reimplemented from AbstractNonlinearElasticitySolver< DIM >.
Definition at line 69 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnBoundaryElement(), and IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().
const size_t IncompressibleNonlinearElasticitySolver< DIM >::NUM_NODES_PER_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_NODES_PER_ELEMENT [static, protected] |
Number of nodes per element.
Reimplemented from AbstractNonlinearElasticitySolver< DIM >.
Definition at line 63 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), and IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().
const size_t IncompressibleNonlinearElasticitySolver< DIM >::NUM_VERTICES_PER_ELEMENT = AbstractNonlinearElasticitySolver<DIM>::NUM_VERTICES_PER_ELEMENT [static, protected] |
Number of vertices per element.
Reimplemented from AbstractNonlinearElasticitySolver< DIM >.
Definition at line 66 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem(), and IncompressibleNonlinearElasticitySolver< DIM >::FormInitialGuess().
const size_t IncompressibleNonlinearElasticitySolver< DIM >::STENCIL_SIZE = DIM*NUM_NODES_PER_ELEMENT + NUM_VERTICES_PER_ELEMENT [static, protected] |
Stencil size - number of unknowns per element (DIM*NUM_NODES_PER_ELEMENT displacement unknowns, NUM_VERTICES_PER_ELEMENT pressure unknowns.
Definition at line 75 of file IncompressibleNonlinearElasticitySolver.hpp.
Referenced by IncompressibleNonlinearElasticitySolver< DIM >::AssembleOnElement(), and IncompressibleNonlinearElasticitySolver< DIM >::AssembleSystem().