Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
|
#include <ContinuumMechanicsProblemDefinition.hpp>
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< unsigned > | mDirichletNodes |
std::vector< c_vector< double, DIM > > | mDirichletNodeValues |
bool | mVerboseDuringSolve |
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.
ContinuumMechanicsProblemDefinition< DIM >::ContinuumMechanicsProblemDefinition | ( | AbstractTetrahedralMesh< DIM, DIM > & | rMesh | ) |
Constructor initialises the body force to zero and density to 1.0
rMesh | is the mesh being solved on |
Definition at line 47 of file ContinuumMechanicsProblemDefinition.cpp.
|
inlinevirtual |
Destructor
Definition at line 153 of file ContinuumMechanicsProblemDefinition.hpp.
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::EvaluateBodyForceFunction | ( | c_vector< double, DIM > & | rX, |
double | t | ||
) |
rX | spatial location |
t | current time |
Definition at line 98 of file ContinuumMechanicsProblemDefinition.cpp.
double ContinuumMechanicsProblemDefinition< DIM >::EvaluateNormalPressureFunction | ( | double | t | ) |
t | current time |
Definition at line 225 of file ContinuumMechanicsProblemDefinition.cpp.
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::EvaluateTractionFunction | ( | c_vector< double, DIM > & | rX, |
double | t | ||
) |
rX | spatial location |
t | current time |
Definition at line 218 of file ContinuumMechanicsProblemDefinition.cpp.
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::GetBodyForce | ( | c_vector< double, DIM > & | rX, |
double | t = 0.0 |
||
) |
rX | spatial location |
t | current time |
Definition at line 105 of file ContinuumMechanicsProblemDefinition.cpp.
References NEVER_REACHED.
BodyForceType ContinuumMechanicsProblemDefinition< DIM >::GetBodyForceType | ( | ) |
Definition at line 85 of file ContinuumMechanicsProblemDefinition.cpp.
c_vector< double, DIM > ContinuumMechanicsProblemDefinition< DIM >::GetConstantBodyForce | ( | ) |
Definition at line 91 of file ContinuumMechanicsProblemDefinition.cpp.
double ContinuumMechanicsProblemDefinition< DIM >::GetDensity | ( | ) |
Definition at line 65 of file ContinuumMechanicsProblemDefinition.cpp.
double ContinuumMechanicsProblemDefinition< DIM >::GetNormalPressure | ( | ) |
Definition at line 211 of file ContinuumMechanicsProblemDefinition.cpp.
TractionBoundaryConditionType ContinuumMechanicsProblemDefinition< DIM >::GetTractionBoundaryConditionType | ( | ) |
Definition at line 123 of file ContinuumMechanicsProblemDefinition.cpp.
|
inline |
Definition at line 340 of file ContinuumMechanicsProblemDefinition.hpp.
References ContinuumMechanicsProblemDefinition< DIM >::mVerboseDuringSolve.
std::vector< unsigned > & ContinuumMechanicsProblemDefinition< DIM >::rGetDirichletNodes | ( | ) |
Definition at line 186 of file ContinuumMechanicsProblemDefinition.cpp.
std::vector< c_vector< double, DIM > > & ContinuumMechanicsProblemDefinition< DIM >::rGetDirichletNodeValues | ( | ) |
Definition at line 192 of file ContinuumMechanicsProblemDefinition.cpp.
std::vector< c_vector< double, DIM > > & ContinuumMechanicsProblemDefinition< DIM >::rGetElementwiseTractions | ( | ) |
Definition at line 204 of file ContinuumMechanicsProblemDefinition.cpp.
std::vector< BoundaryElement< DIM-1, DIM > * > & ContinuumMechanicsProblemDefinition< DIM >::rGetTractionBoundaryElements | ( | ) |
Definition at line 198 of file ContinuumMechanicsProblemDefinition.cpp.
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.
rTractionBoundaryElements | The boundary elements |
normalPressure | the corresponding pressure |
Definition at line 149 of file ContinuumMechanicsProblemDefinition.cpp.
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
rTractionBoundaryElements | The boundary elements |
pFunction | the pressure function (a function of time, returning a double) |
Definition at line 160 of file ContinuumMechanicsProblemDefinition.cpp.
void ContinuumMechanicsProblemDefinition< DIM >::SetBodyForce | ( | c_vector< double, DIM > | bodyForce | ) |
Set the body force to be used - this version sets a constant body force
bodyForce | the constant body force |
Definition at line 71 of file ContinuumMechanicsProblemDefinition.cpp.
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
pFunction | a function of space and time returning a vector |
Definition at line 78 of file ContinuumMechanicsProblemDefinition.cpp.
void ContinuumMechanicsProblemDefinition< DIM >::SetDensity | ( | double | density | ) |
Set the density
density |
Definition at line 58 of file ContinuumMechanicsProblemDefinition.cpp.
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)
scaleFactor | scale factor |
Definition at line 232 of file ContinuumMechanicsProblemDefinition.cpp.
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
rTractionBoundaryElements | the boundary elements |
pFunction | the traction function (a function of space and time, returning a vector) |
Definition at line 140 of file ContinuumMechanicsProblemDefinition.cpp.
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.
rTractionBoundaryElements | the boundary elements |
rElementwiseTractions | corresponding tractions |
Definition at line 129 of file ContinuumMechanicsProblemDefinition.cpp.
|
inline |
Tell the solver to be verbose (print details on how the solve is progressing), or not.
verboseDuringSolve | be verbose or not. |
Definition at line 332 of file ContinuumMechanicsProblemDefinition.hpp.
References ContinuumMechanicsProblemDefinition< DIM >::mVerboseDuringSolve.
void ContinuumMechanicsProblemDefinition< DIM >::SetZeroDirichletNodes | ( | std::vector< unsigned > & | rZeroDirichletNodes | ) |
Set a list of nodes (indices) to be given zero Dirichlet boundary condition
rZeroDirichletNodes | the nodes at which the value (displacement/flow) is zero |
Definition at line 169 of file ContinuumMechanicsProblemDefinition.cpp.
Referenced by SolidMechanicsProblemDefinition< DIM >::SetZeroDisplacementNodes(), and StokesFlowProblemDefinition< DIM >::SetZeroFlowNodes().
|
virtual |
Check all variables are set appropriately. Exceptions are thrown if any are not. Derived classes can override but should call this version as well.
Reimplemented in SolidMechanicsProblemDefinition< DIM >, StokesFlowProblemDefinition< DIM >, and ElectroMechanicsProblemDefinition< DIM >.
Definition at line 239 of file ContinuumMechanicsProblemDefinition.cpp.
References EXCEPTION.
Referenced by SolidMechanicsProblemDefinition< DIM >::Validate(), and StokesFlowProblemDefinition< DIM >::Validate().
|
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.
|
protected |
The body force type
Definition at line 93 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The constant body force, only used if mBodyForceType is set appropriately
Definition at line 96 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
Density of the body (constant throughout body)
Definition at line 86 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
All nodes (including non-vertices) which have a dirichlet boundary condition (ie position prescribed in solid mechanics problems, flow prescribed in fluids problems).
Definition at line 137 of file ContinuumMechanicsProblemDefinition.hpp.
Referenced by StokesFlowProblemDefinition< DIM >::SetPrescribedFlowNodes().
|
protected |
The values at the nodes with Dirichlet boundary conditions (displacement
Definition at line 140 of file ContinuumMechanicsProblemDefinition.hpp.
Referenced by StokesFlowProblemDefinition< DIM >::SetPrescribedFlowNodes().
|
protected |
The tractions on each surface element (only used if mTractionBoundaryConditionType is set appropriately)
Definition at line 112 of file ContinuumMechanicsProblemDefinition.hpp.
|
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.
|
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.
|
protected |
The body force as a function of space and time, only used if mBodyForceType is set appropriately
Definition at line 96 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The normal pressure as a function if time (only used if mTractionBoundaryConditionType is set appropriately)
Definition at line 127 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The tractions as a function of space and time (only used if mTractionBoundaryConditionType is set appropriately)
Definition at line 121 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The mesh being solved on
Definition at line 83 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The traction (Neumann) boundary condition type
Definition at line 106 of file ContinuumMechanicsProblemDefinition.hpp.
|
protected |
The surface elements on which tractions are applied
Definition at line 109 of file ContinuumMechanicsProblemDefinition.hpp.
|
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(), and ContinuumMechanicsProblemDefinition< DIM >::SetVerboseDuringSolve().