Chaste  Release::2017.1
ContinuumMechanicsProblemDefinition< DIM > Class Template Reference

#include <ContinuumMechanicsProblemDefinition.hpp>

+ Inheritance diagram for ContinuumMechanicsProblemDefinition< DIM >:
+ Collaboration diagram for ContinuumMechanicsProblemDefinition< DIM >:

Public Member Functions

 ContinuumMechanicsProblemDefinition (AbstractTetrahedralMesh< DIM, DIM > &rMesh)
 
virtual ~ContinuumMechanicsProblemDefinition ()
 
void SetDensity (double density)
 
double GetDensity ()
 
void SetZeroDirichletNodes (std::vector< unsigned > &rZeroDirichletNodes)
 
std::vector< unsigned > & rGetDirichletNodes ()
 
std::vector< c_vector< double, DIM > > & rGetDirichletNodeValues ()
 
void SetBodyForce (c_vector< double, DIM > bodyForce)
 
void SetBodyForce (c_vector< double, DIM >(*pFunction)(c_vector< double, DIM > &rX, double t))
 
c_vector< double, DIM > GetBodyForce (c_vector< double, DIM > &rX, double t=0.0)
 
BodyForceType GetBodyForceType ()
 
c_vector< double, DIM > GetConstantBodyForce ()
 
c_vector< double, DIM > EvaluateBodyForceFunction (c_vector< double, DIM > &rX, double t)
 
TractionBoundaryConditionType GetTractionBoundaryConditionType ()
 
void SetTractionBoundaryConditions (std::vector< BoundaryElement< DIM-1, DIM > * > &rTractionBoundaryElements, std::vector< c_vector< double, DIM > > &rElementwiseTractions)
 
void SetTractionBoundaryConditions (std::vector< BoundaryElement< DIM-1, DIM > * > &rTractionBoundaryElements, c_vector< double, DIM >(*pFunction)(c_vector< double, DIM > &rX, double t))
 
void SetApplyNormalPressureOnDeformedSurface (std::vector< BoundaryElement< DIM-1, DIM > * > &rTractionBoundaryElements, double normalPressure)
 
void SetApplyNormalPressureOnDeformedSurface (std::vector< BoundaryElement< DIM-1, DIM > * > &rTractionBoundaryElements, double(*pFunction)(double t))
 
std::vector< BoundaryElement< DIM-1, DIM > * > & rGetTractionBoundaryElements ()
 
std::vector< c_vector< double, DIM > > & rGetElementwiseTractions ()
 
double GetNormalPressure ()
 
void SetPressureScaling (double scaleFactor)
 
c_vector< double, DIM > EvaluateTractionFunction (c_vector< double, DIM > &rX, double t)
 
double EvaluateNormalPressureFunction (double t)
 
virtual void Validate ()
 
void SetVerboseDuringSolve (bool verboseDuringSolve=true)
 
bool GetVerboseDuringSolve ()
 

Static Public Attributes

static const double FREE = std::numeric_limits<double>::max()
 

Protected Attributes

AbstractTetrahedralMesh< DIM, DIM > & mrMesh
 
double mDensity
 
BodyForceType mBodyForceType
 
c_vector< double, DIM > mConstantBodyForce
 
c_vector< double, DIM >(* mpBodyForceFunction )(c_vector< double, DIM > &rX, double t)
 
TractionBoundaryConditionType mTractionBoundaryConditionType
 
std::vector< BoundaryElement< DIM-1, DIM > * > mTractionBoundaryElements
 
std::vector< c_vector< double, DIM > > mElementwiseTractions
 
double mNormalPressure
 
double mOriginalNormalPressure
 
c_vector< double, DIM >(* mpTractionBoundaryConditionFunction )(c_vector< double, DIM > &rX, double t)
 
double(* mpNormalPressureFunction )(double t)
 
std::vector< unsignedmDirichletNodes
 
std::vector< c_vector< double, DIM > > mDirichletNodeValues
 
bool mVerboseDuringSolve
 

Detailed Description

template<unsigned DIM>
class ContinuumMechanicsProblemDefinition< DIM >

A class for specifying various parts of a continuum mechanics problem, Dirichlet node information (which nodes are in space in a solid problem, which nodes have fixed flow in a fluids problem), the body force (per unit mass) (usually acceleration due to gravity or zero), the traction boundary conditions, and the density.

Definition at line 74 of file ContinuumMechanicsProblemDefinition.hpp.

Constructor & Destructor Documentation

Constructor initialises the body force to zero and density to 1.0

Parameters
rMeshis the mesh being solved on

Definition at line 47 of file ContinuumMechanicsProblemDefinition.cpp.

template<unsigned DIM>
virtual ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition ( )
inlinevirtual

Member Function Documentation

template<unsigned DIM>
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::EvaluateBodyForceFunction ( c_vector< double, DIM > &  rX,
double  t 
)
Returns
the body force function (error if GetBodyForceType()!=FUNCTIONAL_BODY_FORCE)
Parameters
rXspatial location
tcurrent time

Definition at line 98 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mBodyForceType, and ContinuumMechanicsProblemDefinition< DIM >::mpBodyForceFunction.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
double ContinuumMechanicsProblemDefinition< DIM >::EvaluateNormalPressureFunction ( double  t)
template<unsigned DIM>
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::EvaluateTractionFunction ( c_vector< double, DIM > &  rX,
double  t 
)
template<unsigned DIM>
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::GetBodyForce ( c_vector< double, DIM > &  rX,
double  t = 0.0 
)
Returns
the body force at a particular point and time. Note: The user can either call this, or check what type of body force has been set using GetBodyForceType() and then call GetConstantBodyForce() or EvaluateBodyForceFunction(X,t).
Parameters
rXspatial location
tcurrent time

Definition at line 105 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mBodyForceType, ContinuumMechanicsProblemDefinition< DIM >::mConstantBodyForce, ContinuumMechanicsProblemDefinition< DIM >::mpBodyForceFunction, and NEVER_REACHED.

Referenced by StokesFlowAssembler< DIM >::ComputeSpatialVectorTerm(), and ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
BodyForceType ContinuumMechanicsProblemDefinition< DIM >::GetBodyForceType ( )
template<unsigned DIM>
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::GetConstantBodyForce ( )
template<unsigned DIM>
TractionBoundaryConditionType ContinuumMechanicsProblemDefinition< DIM >::GetTractionBoundaryConditionType ( )
template<unsigned DIM>
bool ContinuumMechanicsProblemDefinition< DIM >::GetVerboseDuringSolve ( )
inline
Returns
whether the solver should be verbose or not

Definition at line 340 of file ContinuumMechanicsProblemDefinition.hpp.

References ContinuumMechanicsProblemDefinition< DIM >::mVerboseDuringSolve.

template<unsigned DIM>
std::vector< unsigned > & ContinuumMechanicsProblemDefinition< DIM >::rGetDirichletNodes ( )
template<unsigned DIM>
std::vector< c_vector< double, DIM > > & ContinuumMechanicsProblemDefinition< DIM >::rGetDirichletNodeValues ( )
template<unsigned DIM>
std::vector< c_vector< double, DIM > > & ContinuumMechanicsProblemDefinition< DIM >::rGetElementwiseTractions ( )
template<unsigned DIM>
std::vector< BoundaryElement< DIM-1, DIM > * > & ContinuumMechanicsProblemDefinition< DIM >::rGetTractionBoundaryElements ( )
template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetApplyNormalPressureOnDeformedSurface ( std::vector< BoundaryElement< DIM-1, DIM > * > &  rTractionBoundaryElements,
double  normalPressure 
)

Set traction (Neumann) boundary conditions. This version says that pressures should be applied on surfaces in the DEFORMED body in the outward normal direction.

Parameters
rTractionBoundaryElementsThe boundary elements
normalPressurethe corresponding pressure

Definition at line 149 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mNormalPressure, ContinuumMechanicsProblemDefinition< DIM >::mOriginalNormalPressure, ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryConditionType, and ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryElements.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetApplyNormalPressureOnDeformedSurface ( std::vector< BoundaryElement< DIM-1, DIM > * > &  rTractionBoundaryElements,
double(*)(double t)  pFunction 
)

Set traction (Neumann) boundary conditions. This version says that pressures should be applied on surfaces in the DEFORMED body in the outward normal direction, and here the pressure is specified in FUNCTIONAL FORM

Parameters
rTractionBoundaryElementsThe boundary elements
pFunctionthe pressure function (a function of time, returning a double)

Definition at line 160 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mpNormalPressureFunction, ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryConditionType, and ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryElements.

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetBodyForce ( c_vector< double, DIM >  bodyForce)

Set the body force to be used - this version sets a constant body force

Parameters
bodyForcethe constant body force

Definition at line 71 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mBodyForceType, and ContinuumMechanicsProblemDefinition< DIM >::mConstantBodyForce.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetBodyForce ( c_vector< double, DIM >(*)(c_vector< double, DIM > &rX, double t)  pFunction)

Set the body force to be used - this version sets a functional body force

Parameters
pFunctiona function of space and time returning a vector

Definition at line 78 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mBodyForceType, and ContinuumMechanicsProblemDefinition< DIM >::mpBodyForceFunction.

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetDensity ( double  density)
template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetPressureScaling ( double  scaleFactor)

Set the value that will be returned by GetNormalPressure() to be a fraction of its full value.

Note: you don't have to take into account previous calls when calling this. SetPressureScaling(0.1); SetPressureScaling(1); will lead to the original pressure being used

(Error if GetTractionBoundaryConditionType()!=PRESSURE_ON_DEFORMED)

Parameters
scaleFactorscale factor

Definition at line 232 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mNormalPressure, ContinuumMechanicsProblemDefinition< DIM >::mOriginalNormalPressure, and ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryConditionType.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetTractionBoundaryConditions ( std::vector< BoundaryElement< DIM-1, DIM > * > &  rTractionBoundaryElements,
std::vector< c_vector< double, DIM > > &  rElementwiseTractions 
)

Set traction (Neumann) boundary conditions. This version takes in a vector of boundary elements, and corresponding tractions for each one.

Parameters
rTractionBoundaryElementsthe boundary elements
rElementwiseTractionscorresponding tractions

Definition at line 129 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mElementwiseTractions, ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryConditionType, and ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryElements.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::~ContinuumMechanicsProblemDefinition().

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetTractionBoundaryConditions ( std::vector< BoundaryElement< DIM-1, DIM > * > &  rTractionBoundaryElements,
c_vector< double, DIM >(*)(c_vector< double, DIM > &rX, double t)  pFunction 
)

Set traction (Neumann) boundary conditions. This version takes in a vector of boundary elements, and a function to be evaluated at points in these boundary elements

Parameters
rTractionBoundaryElementsthe boundary elements
pFunctionthe traction function (a function of space and time, returning a vector)

Definition at line 140 of file ContinuumMechanicsProblemDefinition.cpp.

References ContinuumMechanicsProblemDefinition< DIM >::mpTractionBoundaryConditionFunction, ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryConditionType, and ContinuumMechanicsProblemDefinition< DIM >::mTractionBoundaryElements.

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetVerboseDuringSolve ( bool  verboseDuringSolve = true)
inline

Tell the solver to be verbose (print details on how the solve is progressing), or not.

Parameters
verboseDuringSolvebe verbose or not.

Definition at line 332 of file ContinuumMechanicsProblemDefinition.hpp.

template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::SetZeroDirichletNodes ( std::vector< unsigned > &  rZeroDirichletNodes)
template<unsigned DIM>
void ContinuumMechanicsProblemDefinition< DIM >::Validate ( )
virtual

Member Data Documentation

template<unsigned DIM>
const double ContinuumMechanicsProblemDefinition< DIM >::FREE = std::numeric_limits<double>::max()
static

Special value for Dirichlet nodes, indicating that a Dirichlet boundary condition in a particular dimension is not specified

Definition at line 79 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by SolidMechanicsProblemDefinition< DIM >::SetFixedNodes().

template<unsigned DIM>
c_vector<double,DIM> ContinuumMechanicsProblemDefinition< DIM >::mConstantBodyForce
protected
template<unsigned DIM>
double ContinuumMechanicsProblemDefinition< DIM >::mDensity
protected
template<unsigned DIM>
std::vector<unsigned> ContinuumMechanicsProblemDefinition< DIM >::mDirichletNodes
protected
template<unsigned DIM>
std::vector<c_vector<double,DIM> > ContinuumMechanicsProblemDefinition< DIM >::mElementwiseTractions
protected

The tractions on each surface element (only used if mTractionBoundaryConditionType is set appropriately)

Definition at line 112 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::rGetElementwiseTractions(), and ContinuumMechanicsProblemDefinition< DIM >::SetTractionBoundaryConditions().

template<unsigned DIM>
double ContinuumMechanicsProblemDefinition< DIM >::mNormalPressure
protected

If the tractions are specified to correspond to a pressure acting on the surface: the pressure for the given boundary elements (only used if mTractionBoundaryConditionType is set appropriately)

Definition at line 116 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::GetNormalPressure(), ContinuumMechanicsProblemDefinition< DIM >::SetApplyNormalPressureOnDeformedSurface(), and ContinuumMechanicsProblemDefinition< DIM >::SetPressureScaling().

template<unsigned DIM>
double ContinuumMechanicsProblemDefinition< DIM >::mOriginalNormalPressure
protected

If the user asks this class to increment the pressure, the variable mNormalPressure will be altered depending on which increment it is. Here we store the original (full) pressure.

Definition at line 121 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::SetApplyNormalPressureOnDeformedSurface(), and ContinuumMechanicsProblemDefinition< DIM >::SetPressureScaling().

template<unsigned DIM>
c_vector<double,DIM>(* ContinuumMechanicsProblemDefinition< DIM >::mpBodyForceFunction) (c_vector< double, DIM > &rX, double t)
protected

The body force as a function of space and time, only used if mBodyForceType is set appropriately

Definition at line 99 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::EvaluateBodyForceFunction(), ContinuumMechanicsProblemDefinition< DIM >::GetBodyForce(), and ContinuumMechanicsProblemDefinition< DIM >::SetBodyForce().

template<unsigned DIM>
double(* ContinuumMechanicsProblemDefinition< DIM >::mpNormalPressureFunction) (double t)
protected

The normal pressure as a function if time (only used if mTractionBoundaryConditionType is set appropriately)

Definition at line 127 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::EvaluateNormalPressureFunction(), and ContinuumMechanicsProblemDefinition< DIM >::SetApplyNormalPressureOnDeformedSurface().

template<unsigned DIM>
c_vector<double,DIM>(* ContinuumMechanicsProblemDefinition< DIM >::mpTractionBoundaryConditionFunction) (c_vector< double, DIM > &rX, double t)
protected

The tractions as a function of space and time (only used if mTractionBoundaryConditionType is set appropriately)

Definition at line 124 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::EvaluateTractionFunction(), and ContinuumMechanicsProblemDefinition< DIM >::SetTractionBoundaryConditions().

template<unsigned DIM>
bool ContinuumMechanicsProblemDefinition< DIM >::mVerboseDuringSolve
protected

Whether the solver will be verbose or not. See dox for Set method below

Definition at line 143 of file ContinuumMechanicsProblemDefinition.hpp.

Referenced by ContinuumMechanicsProblemDefinition< DIM >::GetVerboseDuringSolve().


The documentation for this class was generated from the following files: