G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsSolverUtils< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsSolverUtils< T >

Utility class for PDE's solver related utils.

Static Public Member Functions

static T conditionNumber (const gsMatrix< T > &matrix, bool removeSingularity=false)
 Finds the spectral condition number of a small matrix. More...
 
static T conditionNumber (const gsSparseMatrix< T > &matrix)
 Finds the spectral condition number of a small matrix.
 
static T convergenceRateLS (std::vector< T > const &error_list, std::vector< T > const &h_list)
 Finds the convergence rate for a list of errors and a list with elements sizes by the least square method. More...
 

Member Function Documentation

static T conditionNumber ( const gsMatrix< T > &  matrix,
bool  removeSingularity = false 
)
inlinestatic

Finds the spectral condition number of a small matrix.

Find the condition number of a matrix by fist finding the eigenvalues of the matrix and then dividing the highest (absolute) eigenvalue by the lowest (absolute) eigenvalue. This method is computationally expensive and will only work on small matrices. The method assumes that the eigenvalues are reel.

Parameters
[in]matrixis a square matrix hows eigenvalues are found.
[in]removeSingularityis true: ONE eigenvalue is removed to avoid inf condition number.
static T convergenceRateLS ( std::vector< T > const &  error_list,
std::vector< T > const &  h_list 
)
inlinestatic

Finds the convergence rate for a list of errors and a list with elements sizes by the least square method.

This function takes a list with errors and a list with elements sizes and find the convergence rate by fitting a straight line after taking the logarithm of the values. It uses the Least Square method to find the slope/gradient of the fitted line.

Parameters
[in]error_listlist for the errors (in decreasing order)
[in]h_listlist of the elements sizes (in decreasing order) PS: This method of finding convergence rate require some initial refinements