Solver Class Referenceabstract

#include <Solver.h>

Inheritance diagram for Solver:
ConjugateGradientSolver MassLumpedSolver NoMassCGSolver SparseSubstitutionSolver

Public Member Functions

 Solver ()
 
virtual ~Solver ()
 
virtual int init (int num_nodes, int num_elements, mesh_node *node, tetra_element_linear *elem, SimulationParams *params, int num_pinned_nodes, int *pinned_nodes_list, set< int > bsite_pinned_nodes_list)=0
 
virtual int solve (vector3 *x)=0
 
virtual void apply_matrix (scalar *in, scalar *result)=0
 

Constructor & Destructor Documentation

◆ Solver()

Solver::Solver ( )
inline

Provide an empty constructor (to avoid linker problems)

◆ ~Solver()

virtual Solver::~Solver ( )
inlinevirtual

Make the destructor virtual (so that the destructor of derived classes will be called too)

Member Function Documentation

◆ apply_matrix()

virtual void Solver::apply_matrix ( scalar in,
scalar result 
)
pure virtual

◆ init()

virtual int Solver::init ( int  num_nodes,
int  num_elements,
mesh_node node,
tetra_element_linear elem,
SimulationParams params,
int  num_pinned_nodes,
int *  pinned_nodes_list,
set< int >  bsite_pinned_nodes_list 
)
pure virtual

Initialises the solver (by building whatever representation of the mass matrix it needs) using the given node-element connectivity.

Implemented in NoMassCGSolver, SparseSubstitutionSolver, ConjugateGradientSolver, and MassLumpedSolver.

Referenced by Blob::init(), Blob::reset_solver(), and ~Solver().

◆ solve()

virtual int Solver::solve ( vector3 x)
pure virtual

Solves the linear system Mx = f where f is the force vector (should be 'x' on input), and the mass matrix M has already been constructed (in whatever representation) by the init() function for a particular Blob. The solution is written to x.

Implemented in SparseSubstitutionSolver, NoMassCGSolver, ConjugateGradientSolver, and MassLumpedSolver.

Referenced by Blob::aggregate_forces_and_solve(), and ~Solver().


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