LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > Class Template Reference

#include <LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp>

Inherits AbstractAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NORMAL >, and AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Collaboration diagram for LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LinearParabolicPdeSystemWithCoupledOdeSystemSolver (TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, AbstractLinearParabolicPdeSystemForCoupledOdeSystem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > *pPdeSystem, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > *pBoundaryConditions, std::vector< AbstractOdeSystemForCoupledPdeSystem * > odeSystemsAtNodes=std::vector< AbstractOdeSystemForCoupledPdeSystem * >(), boost::shared_ptr< AbstractIvpOdeSolver > pOdeSolver=boost::shared_ptr< AbstractIvpOdeSolver >())
 ~LinearParabolicPdeSystemWithCoupledOdeSystemSolver ()
void PrepareForSetupLinearSystem (Vec currentPdeSolution)
void SetOutputDirectory (std::string outputDirectory)
void SetSamplingTimeStep (double samplingTimeStep)
void SolveAndWriteResultsToFile ()
void WriteVtkResultsToFile (Vec solution, unsigned numTimeStepsElapsed)

Private Member Functions

void WriteVtkResultsToFile ()
c_matrix< double, PROBLEM_DIM
*(ELEMENT_DIM+1), PROBLEM_DIM
*(ELEMENT_DIM+1)> 
ComputeMatrixTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
c_vector< double, PROBLEM_DIM
*(ELEMENT_DIM+1)> 
ComputeVectorTerm (c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, PROBLEM_DIM > &rU, c_matrix< double, PROBLEM_DIM, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
void ResetInterpolatedQuantities ()
void IncrementInterpolatedQuantities (double phiI, const Node< SPACE_DIM > *pNode)
void InitialiseForSolve (Vec initialSolution=NULL)
void SetupLinearSystem (Vec currentSolution, bool computeMatrix)

Private Attributes

AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh
AbstractLinearParabolicPdeSystemForCoupledOdeSystem
< ELEMENT_DIM, SPACE_DIM,
PROBLEM_DIM > * 
mpPdeSystem
std::vector
< AbstractOdeSystemForCoupledPdeSystem * > 
mOdeSystemsAtNodes
std::vector< doublemInterpolatedOdeStateVariables
boost::shared_ptr
< AbstractIvpOdeSolver
mpOdeSolver
double mSamplingTimeStep
bool mOdeSystemsPresent
out_stream mpVtkMetaFile

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
class LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >

A class for solving systems of parabolic PDEs and ODEs, which may be coupled via their source terms:

d/dt (u_i) = div (D(x) grad (u_i)) + f_i (x, u_1, ..., u_p, v_1, ..., v_q), i=1,...,p, d/dt (v_j) = g_j(x, u_1, ..., u_p, v_1, ..., v_q), j=1,...,q.

The solver class is templated over spatial dimension and PDE problem dimension (p).

Definition at line 53 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LinearParabolicPdeSystemWithCoupledOdeSystemSolver ( TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *  pMesh,
AbstractLinearParabolicPdeSystemForCoupledOdeSystem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > *  pPdeSystem,
BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM > *  pBoundaryConditions,
std::vector< AbstractOdeSystemForCoupledPdeSystem * >  odeSystemsAtNodes = std::vector<AbstractOdeSystemForCoupledPdeSystem*>(),
boost::shared_ptr< AbstractIvpOdeSolver pOdeSolver = boost::shared_ptr<AbstractIvpOdeSolver>() 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::~LinearParabolicPdeSystemWithCoupledOdeSystemSolver (  )  [inline]

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
c_matrix< double, PROBLEM_DIM *(ELEMENT_DIM+1), PROBLEM_DIM *(ELEMENT_DIM+1)> LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeMatrixTerm ( c_vector< double, ELEMENT_DIM+1 > &  rPhi,
c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &  rGradPhi,
ChastePoint< SPACE_DIM > &  rX,
c_vector< double, PROBLEM_DIM > &  rU,
c_matrix< double, PROBLEM_DIM, SPACE_DIM > &  rGradU,
Element< ELEMENT_DIM, SPACE_DIM > *  pElement 
) [inline, private, virtual]

The term to be added to the element stiffness matrix.

Parameters:
rPhi The basis functions, rPhi(i) = phi_i, i=1..numBases
rGradPhi Basis gradients, rGradPhi(i,j) = d(phi_j)/d(X_i)
rX The point in space
rU The unknown as a vector, u(i) = u_i
rGradU The gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)
pElement Pointer to the element

Reimplemented from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >.

Definition at line 226 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.

References PdeSimulationTime::GetPdeTimeStepInverse(), and LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpPdeSystem.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
c_vector< double, PROBLEM_DIM *(ELEMENT_DIM+1)> LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ComputeVectorTerm ( c_vector< double, ELEMENT_DIM+1 > &  rPhi,
c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &  rGradPhi,
ChastePoint< SPACE_DIM > &  rX,
c_vector< double, PROBLEM_DIM > &  rU,
c_matrix< double, PROBLEM_DIM, SPACE_DIM > &  rGradU,
Element< ELEMENT_DIM, SPACE_DIM > *  pElement 
) [inline, private, virtual]

The term to be added to the element stiffness vector.

Parameters:
rPhi The basis functions, rPhi(i) = phi_i, i=1..numBases
rGradPhi Basis gradients, rGradPhi(i,j) = d(phi_j)/d(X_i)
rX The point in space
rU The unknown as a vector, u(i) = u_i
rGradU The gradient of the unknown as a matrix, rGradU(i,j) = d(u_i)/d(X_j)
pElement Pointer to the element

Reimplemented from AbstractFeVolumeIntegralAssembler< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL >.

Definition at line 258 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.

References PdeSimulationTime::GetPdeTimeStepInverse(), LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInterpolatedOdeStateVariables, and LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpPdeSystem.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::IncrementInterpolatedQuantities ( double  phiI,
const Node< SPACE_DIM > *  pNode 
) [inline, private, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseForSolve ( Vec  initialSolution = NULL  )  [inline, private, virtual]

Initialise method: sets up the linear system (using the mesh to determine the number of unknowns per row to preallocate) if it is not already set up. Can use an initial solution as PETSc template, or base it on the mesh size.

Parameters:
initialSolution Initial solution (defaults to NULL) for PETSc to use as a template.

Reimplemented from AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 313 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.

References AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpLinearSystem, LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh, LinearSystem::SetKspType(), and LinearSystem::SetMatrixIsSymmetric().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::PrepareForSetupLinearSystem ( Vec  currentPdeSolution  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::ResetInterpolatedQuantities ( void   )  [inline, private, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetOutputDirectory ( std::string  outputDirectory  )  [inline]

Set mOutputDirectory.

Parameters:
outputDirectory the output directory to use

Definition at line 430 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.

References AbstractDynamicLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOutputDirectory.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetSamplingTimeStep ( double  samplingTimeStep  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SetupLinearSystem ( Vec  currentSolution,
bool  computeMatrix 
) [inline, private, virtual]

Completely set up the linear system that has to be solved each timestep.

Parameters:
currentSolution The current solution which can be used in setting up the linear system if needed (NULL if there isn't a current solution)
computeMatrix Whether to compute the LHS matrix of the linear system (mainly for dynamic solves).

Implements AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >.

Definition at line 339 of file LinearParabolicPdeSystemWithCoupledOdeSystemSolver.hpp.

References AbstractLinearPdeSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpLinearSystem, and AbstractAssemblerSolverHybrid< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, NORMAL >::SetupGivenLinearSystem().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SolveAndWriteResultsToFile (  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteVtkResultsToFile ( Vec  solution,
unsigned  numTimeStepsElapsed 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
void LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::WriteVtkResultsToFile (  )  [private]

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
std::vector<double> LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mInterpolatedOdeStateVariables [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
std::vector<AbstractOdeSystemForCoupledPdeSystem*> LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOdeSystemsAtNodes [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
bool LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mOdeSystemsPresent [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM>* LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpMesh [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
boost::shared_ptr<AbstractIvpOdeSolver> LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpOdeSolver [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
AbstractLinearParabolicPdeSystemForCoupledOdeSystem<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM>* LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpPdeSystem [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
out_stream LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mpVtkMetaFile [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM, unsigned PROBLEM_DIM = 1>
double LinearParabolicPdeSystemWithCoupledOdeSystemSolver< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::mSamplingTimeStep [private]

The documentation for this class was generated from the following file:
Generated on Thu Dec 22 13:05:47 2011 for Chaste by  doxygen 1.6.3