Sundance::LinearProblem Class Reference

LinearProblem encapsulates all information needed to form a discrete linear problem. More...

List of all members.

Public Member Functions

 LinearProblem ()
 Empty ctor.
 LinearProblem (const Mesh &mesh, const Expr &eqn, const Expr &bc, const Expr &test, const Expr &unk, const Playa::VectorType< double > &vecType)
 Construct with a mesh, equation set, bcs, test and unknown funcs, and a vector type.
 LinearProblem (const Mesh &mesh, const Expr &eqn, const Expr &bc, const BlockArray &test, const BlockArray &unk)
 Construct with a mesh, equation set, bcs, and blocks of variables.
 LinearProblem (const Mesh &mesh, const Expr &eqn, const Expr &bc, const Expr &test, const Expr &unk, const Expr &unkParams, const Expr &unkParamVals, const Playa::VectorType< double > &vecType)
 Construct with a mesh, equation set, bcs, test and unknown funcs, parameters, and a vector type.
 LinearProblem (const Mesh &mesh, const Expr &eqn, const Expr &bc, const BlockArray &test, const BlockArray &unk, const Expr &unkParams, const Expr &unkParamVals)
 Construct with a mesh, equation set, bcs, parameters, and blocks of variables.
 LinearProblem (const RCP< Assembler > &assembler)
Expr solve (const LinearSolver< double > &solver) const
 Solve the problem using the specified solver algorithm.
SolverState< double > solve (const LinearSolver< double > &solver, Expr &soln) const
 Solve the problem, writing the solution into the given function.
Array< Vector< double > > getRHS () const
 Return the multivector on the right-hand side of the linear equation.
Vector< double > getSingleRHS () const
 Return the vector on the right-hand side of the linear equation.
LinearOperator< double > getOperator () const
 Return the operator on the left-hand side of the equation.
const RCP< DOFMapBase > & rowMap (int blockRow) const
 Return the map from cells and functions to row indices.
const RCP< DOFMapBase > & colMap (int blockCol) const
 Return the map from cells and functions to column indices.
const Array< RCP
< DiscreteSpace > > & 
solnSpace () const
 Return the discrete space in which solutions live.
const RCP< Set< int > > & bcRows (int blockRow) const
 Return the set of row indices marked as essential boundary conditions.
int numBlockRows () const
 Return the number of block rows in the problem.
int numBlockCols () const
 Return the number of block cols in the problem.
void reAssembleProblem () const
 with this function we can force the assembler to reassemble the matrix
Expr formSolutionExpr (const Array< Vector< double > > &vec) const

Static Public Member Functions

static bool & solveFailureIsFatal ()
 Flag indicating whether to stop on a solve failure.
static bool & dumpBadMatrix ()
 Flag indicating whether to write out the matrix and vector after a solve failure.
static std::string & badMatrixFilename ()
 Filename for dump of bad matrix.
static std::string & badVectorFilename ()
 Filename for dump of bad vector.

Private Attributes

RCP< Assemblerassembler_
LinearOperator< double > A_
Array< Vector< double > > rhs_
Array< Array< string > > names_
LinearSolveDriver solveDriver_
Expr params_


Detailed Description

LinearProblem encapsulates all information needed to form a discrete linear problem.

Definition at line 48 of file SundanceLinearProblem.hpp.


Constructor & Destructor Documentation

LinearProblem::LinearProblem (  ) 

Empty ctor.

Definition at line 60 of file SundanceLinearProblem.cpp.

References lpCtorTimer().

LinearProblem::LinearProblem ( const Mesh mesh,
const Expr eqn,
const Expr bc,
const Expr test,
const Expr unk,
const Playa::VectorType< double > &  vecType 
)

Construct with a mesh, equation set, bcs, test and unknown funcs, and a vector type.

Definition at line 70 of file SundanceLinearProblem.cpp.

References assembler_, Sundance::Expr::flattenSpectral(), lpCtorTimer(), names_, Sundance::Expr::size(), and Sundance::toString().

LinearProblem::LinearProblem ( const Mesh mesh,
const Expr eqn,
const Expr bc,
const BlockArray test,
const BlockArray unk 
)

Construct with a mesh, equation set, bcs, and blocks of variables.

Definition at line 163 of file SundanceLinearProblem.cpp.

References assembler_, lpCtorTimer(), names_, and Sundance::toString().

LinearProblem::LinearProblem ( const Mesh mesh,
const Expr eqn,
const Expr bc,
const Expr test,
const Expr unk,
const Expr unkParams,
const Expr unkParamVals,
const Playa::VectorType< double > &  vecType 
)

Construct with a mesh, equation set, bcs, test and unknown funcs, parameters, and a vector type.

Definition at line 116 of file SundanceLinearProblem.cpp.

References assembler_, Sundance::Expr::flattenSpectral(), lpCtorTimer(), names_, Sundance::Expr::size(), and Sundance::toString().

LinearProblem::LinearProblem ( const Mesh mesh,
const Expr eqn,
const Expr bc,
const BlockArray test,
const BlockArray unk,
const Expr unkParams,
const Expr unkParamVals 
)

Construct with a mesh, equation set, bcs, parameters, and blocks of variables.

Definition at line 222 of file SundanceLinearProblem.cpp.

References assembler_, Sundance::Expr::flattenSpectral(), lpCtorTimer(), names_, and Sundance::toString().

LinearProblem::LinearProblem ( const RCP< Assembler > &  assembler  ) 

Definition at line 279 of file SundanceLinearProblem.cpp.

References lpCtorTimer(), names_, and Teuchos::toString().


Member Function Documentation

static std::string& Sundance::LinearProblem::badMatrixFilename (  )  [inline, static]

Filename for dump of bad matrix.

Definition at line 135 of file SundanceLinearProblem.hpp.

static std::string& Sundance::LinearProblem::badVectorFilename (  )  [inline, static]

Filename for dump of bad vector.

Definition at line 139 of file SundanceLinearProblem.hpp.

const RCP< Set< int > > & LinearProblem::bcRows ( int  blockRow  )  const

Return the set of row indices marked as essential boundary conditions.

Definition at line 313 of file SundanceLinearProblem.cpp.

References assembler_.

const RCP< DOFMapBase > & LinearProblem::colMap ( int  blockCol  )  const

Return the map from cells and functions to column indices.

Definition at line 304 of file SundanceLinearProblem.cpp.

References assembler_.

static bool& Sundance::LinearProblem::dumpBadMatrix (  )  [inline, static]

Flag indicating whether to write out the matrix and vector after a solve failure.

Definition at line 131 of file SundanceLinearProblem.hpp.

Expr LinearProblem::formSolutionExpr ( const Array< Vector< double > > &  vec  )  const

Playa::LinearOperator< double > LinearProblem::getOperator (  )  const

Array< Vector< double > > LinearProblem::getRHS (  )  const

Return the multivector on the right-hand side of the linear equation.

Definition at line 322 of file SundanceLinearProblem.cpp.

References assembler_, rhs_, and SUNDANCE_MSG1.

Referenced by getSingleRHS().

Vector<double> Sundance::LinearProblem::getSingleRHS (  )  const [inline]

Return the vector on the right-hand side of the linear equation.

Definition at line 93 of file SundanceLinearProblem.hpp.

References getRHS().

int LinearProblem::numBlockCols (  )  const

Return the number of block cols in the problem.

Definition at line 320 of file SundanceLinearProblem.cpp.

References assembler_.

int LinearProblem::numBlockRows (  )  const

Return the number of block rows in the problem.

Definition at line 317 of file SundanceLinearProblem.cpp.

References assembler_.

void LinearProblem::reAssembleProblem (  )  const

with this function we can force the assembler to reassemble the matrix

Definition at line 402 of file SundanceLinearProblem.cpp.

References assembler_.

const RCP< DOFMapBase > & LinearProblem::rowMap ( int  blockRow  )  const

Return the map from cells and functions to row indices.

Definition at line 300 of file SundanceLinearProblem.cpp.

References assembler_.

const Array< RCP< DiscreteSpace > > & LinearProblem::solnSpace (  )  const

Return the discrete space in which solutions live.

Definition at line 308 of file SundanceLinearProblem.cpp.

References assembler_.

Referenced by formSolutionExpr(), Sundance::LinearEigenproblem::LinearEigenproblem(), and solve().

SolverState< double > LinearProblem::solve ( const LinearSolver< double > &  solver,
Expr soln 
) const

Solve the problem, writing the solution into the given function.

Definition at line 373 of file SundanceLinearProblem.cpp.

References SUNDANCE_MSG1.

Expr LinearProblem::solve ( const LinearSolver< double > &  solver  )  const

Solve the problem using the specified solver algorithm.

Definition at line 341 of file SundanceLinearProblem.cpp.

References A_, assembler_, names_, rhs_, solnSpace(), Sundance::LinearSolveDriver::solve(), solveDriver_, solveFailureIsFatal(), and SUNDANCE_MSG1.

Referenced by Sundance::L2Projector::project(), and Sundance::LPTestBase::solve().

static bool& Sundance::LinearProblem::solveFailureIsFatal (  )  [inline, static]

Flag indicating whether to stop on a solve failure.

Definition at line 125 of file SundanceLinearProblem.hpp.

Referenced by Sundance::LPTestBase::solve(), and solve().


Member Data Documentation

LinearOperator<double> Sundance::LinearProblem::A_ [mutable, private]

Definition at line 151 of file SundanceLinearProblem.hpp.

Referenced by getOperator(), and solve().

Array<Array<string> > Sundance::LinearProblem::names_ [private]

Definition at line 157 of file SundanceLinearProblem.hpp.

Referenced by formSolutionExpr(), LinearProblem(), and solve().

Definition at line 163 of file SundanceLinearProblem.hpp.

Array<Vector<double> > Sundance::LinearProblem::rhs_ [mutable, private]

Definition at line 154 of file SundanceLinearProblem.hpp.

Referenced by getOperator(), getRHS(), and solve().

Definition at line 160 of file SundanceLinearProblem.hpp.

Referenced by formSolutionExpr(), and solve().

Site Contact