Marine systems simulation
CoRiBoDynamics::SparseMatrixBuilder Class Reference

#include <SparseMatrixBuilder.h>

+ Inheritance diagram for CoRiBoDynamics::SparseMatrixBuilder:
+ Collaboration diagram for CoRiBoDynamics::SparseMatrixBuilder:

Classes

class  ConnectionSolverTask
 
class  SubMultiplicationTask
 
class  TridiagonalSubSolverTask
 

Public Member Functions

 SparseMatrixBuilder (CoreBoundThreadPool *ThreadPool)
 
void StartBuilding (int size)
 
void InitializeElementMatrix (int i, const mat6 &M)
 Resets matrix to zero.
 
void AddToMatrixThreadSafe (int i, int j, const mat6 &M)
 
virtual double ApplyLinearOperator (const Vector &x, Vector &y)
 add to submatrix at index i,j with mutex lock More...
 
virtual double ApplyApproximateInverse (const Vector &b, Vector &x)
 perform matrix multiplication y = Ax More...
 
virtual void ComputeApproximateInverse ()
 approximately solve the linear system Ax = b More...
 
virtual int SystemSize ()
 
mat6 GetElementMatrix (int index)
 
void SetDropSize (int size)
 
virtual int SystemSize ()=0
 
virtual void ComputeApproximateInverse ()=0
 returns the number of unknowns in the system; More...
 
virtual double ApplyLinearOperator (const Vector &V, Vector &Result)=0
 performs any precomputations More...
 
virtual double ApplyApproximateInverse (const Vector &V, Vector &Result)=0
 Applies the linear operator to the vector V and stores the value in Result. Returns Vt * A * V. More...
 

Protected Member Functions

void AddToMatrix (int i, int j, const mat6 &M)
 
void FillSubMatrix (SparseMat &result, std::vector< int >::iterator elements_begin, std::vector< int >::iterator elements_end)
 add to submatrix at index i,j
 

Protected Attributes

std::vector< MatrixConnectome::CRixm_connection_indices
 
std::vector< mat6, Eigen::aligned_allocator< mat6 > > m_connection_matrices
 
std::mutex m_ConnectionElementLock
 
int m_size
 
std::mutex * m_MatrixColumnLocks
 number of 6DOF elements in the system
 
MatrixConnectome m_connectome
 
mat6 * m_A_0_diagonal
 
mat6 * m_A_1_diagonal
 the main diagonal blocks of the system matrix
 
mat6 * m_U_0_diagonal
 first extra-diagonal of the system matrix
 
mat6 * m_U_1_diagonal
 the main diagonal blocks of the block-tridiagonal UtU decomposition
 
bool * m_set
 first extra-diagonal of the block-tridiagonal UtU decomposition
 
std::vector< ConnectionSolverTaskm_connection_solver
 
std::vector< TridiagonalSubSolverTaskm_TridiagonalSubSolverTask
 
std::vector< SubMultiplicationTaskm_SubMultiplicationTask
 List of asynchronous block-tridiagonal sub domain solvers.
 
CoreBoundThreadPoolm_ThreadPool
 list of asynchronous matrix sub domain
 

Detailed Description

Author
Jorgen Haavind Jensen

Matrix class for a symmetric 6x6-block-sparse matrix. The data structure and underlying iterative linear solvers are optimized under the assumption that "almost all" of the non zeros are located at or immediately next to the diagonal and that "almost all" of the tridiagonal blocks are filled.

In terms of structural connection topolgy, this translates loosely to "network of slender structures". Most of the connections are between consecutive elements, and the number of T-junctions or X-junctions are neglible

Manages parallellization for matrix inversion and matrix multiplication. Manages concurrency safety for matrix building

Revision history:
Q1 2012 JHJ: Initial version. Q1 2014 JHJ: Changed data structure from general pattern to tridiagonal pattern. Q2 2016 JHJ: Update to better handle disjoint element groups

Member Function Documentation

◆ ApplyApproximateInverse()

virtual double CoRiBoDynamics::SparseMatrixBuilder::ApplyApproximateInverse ( const Vector &  b,
Vector &  x 
)
virtual

◆ ApplyLinearOperator()

virtual double CoRiBoDynamics::SparseMatrixBuilder::ApplyLinearOperator ( const Vector &  x,
Vector &  y 
)
virtual

◆ ComputeApproximateInverse()

virtual void CoRiBoDynamics::SparseMatrixBuilder::ComputeApproximateInverse ( )
virtual

◆ SetDropSize()

void CoRiBoDynamics::SparseMatrixBuilder::SetDropSize ( int  size)
inline

tuning parameter. Defines size of expansion when building matrix for solving connections that are not on the 1 order diagonal

◆ SystemSize()

virtual int CoRiBoDynamics::SparseMatrixBuilder::SystemSize ( )
virtual

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