Loading...
Searching...
No Matches
terra::linalg::util Namespace Reference

Functions

template<typename ScalarType >
Eigen::SparseVector< ScalarType > debug_sparse_assembly_vector_vec_q1_scalar (const VectorQ1Scalar< double > &vec)
 Assembles a VectorQ1Scalar into a Eigen::SparseVector. Likely not efficient - only use for debugging.
 
template<OperatorLike Operator>
Eigen::SparseMatrix< double > debug_sparse_assembly_operator_vec_q1_scalar (const grid::shell::DistributedDomain &domain_src, Operator &A, VectorQ1Scalar< double > &tmp_src, VectorQ1Scalar< double > &tmp_dst)
 Brute force sparse matrix assembly for debugging purposes.
 

Function Documentation

◆ debug_sparse_assembly_operator_vec_q1_scalar()

template<OperatorLike Operator>
Eigen::SparseMatrix< double > terra::linalg::util::debug_sparse_assembly_operator_vec_q1_scalar ( const grid::shell::DistributedDomain domain_src,
Operator &  A,
VectorQ1Scalar< double > &  tmp_src,
VectorQ1Scalar< double > &  tmp_dst 
)

Brute force sparse matrix assembly for debugging purposes.

Let the operator be representable by a nxm matrix. The assembly involves m matrix-vector multiplications, one with each of the standard basis vectors {e^1, ..., e^m} of R^m (per matrix-vector multiplication one column of the operator is 'assembled').

Needless to say, this is a very inefficient but flexible approach as any kind of operator can be assembled easily, but it involves many (n) matrix-vector multiplications.

Note
ONLY FOR TESTING/DEBUGGING PURPOSES - EXPECTED TO BE EXTREMELY SLOW
Only works when running in host space, in serial.

◆ debug_sparse_assembly_vector_vec_q1_scalar()

template<typename ScalarType >
Eigen::SparseVector< ScalarType > terra::linalg::util::debug_sparse_assembly_vector_vec_q1_scalar ( const VectorQ1Scalar< double > &  vec)

Assembles a VectorQ1Scalar into a Eigen::SparseVector. Likely not efficient - only use for debugging.

Note
Only works in the serial case and on host space (only for debugging!).