Patate Lib  0.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Vitelotte::FemSolver< _Mesh, _ElementBuilder > Class Template Reference

Detailed Description

template<class _Mesh, class _ElementBuilder>
class Vitelotte::FemSolver< _Mesh, _ElementBuilder >

A diffusion solver based on the Finite Element Method.

Template Parameters
_MeshThe VGMesh type on which the solver operates.
_ElementBuilderAn ElementBuilder class that describe the type of elements used by the solver, and by extension the kind of diffusion to do.

Classes

struct  Block
 
struct  BlockIndex
 

Public Types

typedef _Mesh Mesh
 
typedef _ElementBuilder ElementBuilder
 
typedef FemSolver< Mesh,
ElementBuilder > 
Self
 
typedef ElementBuilder::Scalar Scalar
 
typedef Eigen::Matrix< Scalar,
Eigen::Dynamic, Eigen::Dynamic > 
Matrix
 
typedef Eigen::Triplet< Scalar > Triplet
 
typedef Eigen::SparseMatrix
< Scalar > 
StiffnessMatrix
 
typedef std::vector< Triplet > TripletVector
 
typedef TripletVector::iterator TripletVectorIterator
 
typedef std::vector< bool > BoolVector
 
typedef std::vector< unsigned > IndexMap
 
typedef Eigen::SimplicialLDLT
< StiffnessMatrix,
Eigen::Lower > 
LDLT
 
typedef std::vector< BlockBlockVector
 
typedef BlockVector::iterator BlockIterator
 
typedef std::vector< BlockIndexNodeMap
 

Public Member Functions

 FemSolver (const ElementBuilder &elementBuilder=ElementBuilder())
 
void build (const Mesh &mesh)
 Build the internal stiffness matrix from mesh.
 
void solve (Mesh &mesh)
 Solve the diffusion problem created by build() on mesh. More...
 
const SolverError error ()
 Returns a SolverError object describing the state of the solver.
 

Protected Types

typedef Mesh::Node Node
 
typedef Mesh::Vertex Vertex
 
typedef Mesh::Face Face
 
typedef Mesh::FaceIterator FaceIterator
 

Protected Member Functions

void preSort (const Mesh &mesh)
 
void buildMatrix (const Mesh &mesh)
 
void factorize ()
 

Protected Attributes

ElementBuilder m_elementBuilder
 
SolverError m_error
 
unsigned m_nUnknowns
 
unsigned m_nConstraints
 
BlockVector m_blocks
 
Eigen::VectorXi m_faceBlockMap
 
TripletVector m_constraintTriplets
 
StiffnessMatrix m_constraintBlock
 
NodeMap m_nodeMap
 
BoolVector m_fMask
 
BoolVector m_nMask
 
Eigen::VectorXi m_fExtraIndices
 
NodeMap m_fExtraMap
 
Matrix m_x
 

Member Function Documentation

template<class _Mesh , class _ElementBuilder >
void Vitelotte::FemSolver< _Mesh, _ElementBuilder >::solve ( Mesh &  mesh)

Solve the diffusion problem created by build() on mesh.

Parameters of build() and solve() do not need to be the same, but they must have the same connectivity. (In other words, only constrained nodes values should differ.)