19 #ifndef itkFEMLinearSystemWrapper_h
20 #define itkFEMLinearSystemWrapper_h
25 #include "ITKFEMExport.h"
69 m_Order(0), m_NumberOfMatrices(1), m_NumberOfVectors(1), m_NumberOfSolutions(1)
112 m_NumberOfMatrices = nMatrices;
130 return m_NumberOfMatrices;
139 m_NumberOfVectors = nVectors;
147 return m_NumberOfVectors;
156 m_NumberOfSolutions = nSolutions;
164 return m_NumberOfSolutions;
174 virtual void InitializeMatrix(
unsigned int matrixIndex = 0) = 0;
180 virtual bool IsMatrixInitialized(
unsigned int matrixIndex = 0) = 0;
186 virtual void DestroyMatrix(
unsigned int matrixIndex = 0) = 0;
194 virtual void InitializeVector(
unsigned int vectorIndex = 0) = 0;
200 virtual bool IsVectorInitialized(
unsigned int vectorIndex = 0) = 0;
206 virtual void DestroyVector(
unsigned int vectorIndex = 0) = 0;
214 virtual void InitializeSolution(
unsigned int solutionIndex = 0) = 0;
220 virtual bool IsSolutionInitialized(
unsigned int solutionIndex = 0) = 0;
225 virtual void DestroySolution(
unsigned int solutionIndex = 0) = 0;
233 virtual Float GetMatrixValue(
unsigned int i,
unsigned int j,
unsigned int matrixIndex = 0)
const = 0;
242 virtual void SetMatrixValue(
unsigned int i,
unsigned int j, Float value,
unsigned int matrixIndex = 0) = 0;
251 virtual void AddMatrixValue(
unsigned int i,
unsigned int j, Float value,
unsigned int matrixIndex = 0) = 0;
265 virtual void GetColumnsOfNonZeroMatrixElementsInRow(
unsigned int row, ColumnArray & cols,
266 unsigned int matrixIndex = 0);
273 virtual Float GetVectorValue(
unsigned int i,
unsigned int vectorIndex = 0)
const = 0;
281 virtual void SetVectorValue(
unsigned int i, Float value,
unsigned int vectorIndex = 0) = 0;
289 virtual void AddVectorValue(
unsigned int i, Float value,
unsigned int vectorIndex = 0) = 0;
298 virtual void SetSolutionValue(
unsigned int i, Float value,
unsigned int solutionIndex = 0) = 0;
307 virtual void AddSolutionValue(
unsigned int i, Float value,
unsigned int solutionIndex = 0) = 0;
316 virtual void Solve(
void) = 0;
323 virtual void SwapMatrices(
unsigned int matrixIndex1,
unsigned int matrixIndex2) = 0;
332 virtual void CopyMatrix(
unsigned int matrixIndex1,
unsigned int matrixIndex2);
339 virtual void SwapVectors(
unsigned int vectorIndex1,
unsigned int vectorIndex2) = 0;
346 virtual void SwapSolutions(
unsigned int solutionIndex1,
unsigned int solutionIndex2) = 0;
353 virtual void ScaleMatrix(Float scale,
unsigned int matrixIndex = 0);
360 void ScaleVector(Float scale,
unsigned int vectorIndex = 0);
367 void ScaleSolution(Float scale,
unsigned int solutionIndex = 0);
375 virtual void MultiplyMatrixMatrix(
unsigned int resultMatrixIndex,
unsigned int leftMatrixIndex,
376 unsigned int rightMatrixIndex) = 0;
384 virtual void AddMatrixMatrix(
unsigned int matrixIndex1,
unsigned int matrixIndex2);
392 virtual void AddVectorVector(
unsigned int vectorIndex1,
unsigned int vectorIndex2);
400 virtual void MultiplyMatrixVector(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int vectorIndex);
408 virtual void MultiplyMatrixSolution(
unsigned int resultVectorIndex,
unsigned int matrixIndex,
unsigned int solutionIndex);
415 virtual void CopySolution2Vector(
unsigned int solutionIndex,
unsigned int vectorIndex) = 0;
422 virtual void CopyVector2Solution(
unsigned int vectorIndex,
unsigned int solutionIndex) = 0;
429 virtual void CopyVector(
unsigned int vectorSource,
unsigned int vectorDestination);
437 virtual void OptimizeMatrixStorage(
unsigned int matrixIndex,
unsigned int tempMatrixIndex);
444 virtual void ReverseCuthillMckeeOrdering(ColumnArray & newNumbering,
unsigned int matrixIndex = 0);
486 void CuthillMckeeOrdering(
ColumnArray & newNumbering,
int startingRow,
unsigned int matrixIndex = 0);
488 void FollowConnectionsCuthillMckeeOrdering(
unsigned int rowNumber,
ColumnArray & rowDegree,
489 ColumnArray & newNumbering,
unsigned int nextRowNumber,
490 unsigned int matrixIndex = 0);
508 FEMExceptionLinearSystem(
const char *file,
unsigned int lineNumber, std::string location, std::string moreDescription);
527 std::string moreDescription,
528 unsigned int index1);
535 std::string moreDescription,
unsigned int index1,
536 unsigned int index2);
548 #endif // #ifndef itkFEMLinearSystemWrapper_h
unsigned int GetNumberOfSolutions() const
unsigned int m_NumberOfMatrices
void SetSystemOrder(unsigned int N)
void SetNumberOfMatrices(unsigned int nMatrices)
unsigned int GetNumberOfVectors() const
void SetNumberOfSolutions(unsigned int nSolutions)
void SetNumberOfVectors(unsigned int nVectors)
std::vector< unsigned int > ColumnArray
unsigned int m_NumberOfVectors
Declaration of several exception classes that are used within the FEM code.
Defines all functions required by Solver class to allocate, assemble and solve a linear system of equ...
Provides functions to access the values of the solution vector.
unsigned int m_NumberOfSolutions
unsigned int GetNumberOfMatrices() const
const Self * ConstPointer
Base class for all exception's that can occur within FEM classes.
unsigned int GetSystemOrder() const