21int main(
int argc,
char *argv[])
23 PetscSession::getInstance(argc,argv);
28 cout <<
"=== Matrix: Example linear sparse solver ===========\n";
33 const double tol = 1.e-10;
37 cout <<
"=== Matrix: complex ==============================\n";
57 cout <<
"Postsolve\n";
59 catch (
const std::runtime_error &error )
61 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
70 std::cout <<
"\033[1;31;48m Simple 2x2 complex sparse system was not solved correctly\033[0m\n";
71 std::cout <<
" residual vector's inf_norm = " << B.
inf_norm() <<
"\n";
76 std::cout <<
" Simple 2x2 complex sparse solve works.\n";
86 catch (
const std::runtime_error &error )
88 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
96 std::cout <<
"\033[1;31;48m Simple 2x2 complex sparse system was not solved correctly\033[0m\n";
97 std::cout <<
" residual vector's inf_norm = " << B.
inf_norm() <<
"\n";
102 std::cout <<
" Simple 2x2 complex sparse solve_using_factorisation works.\n";
111 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
116 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
Specification of a sparse-storage linear system class.
A spec for the CppNoddy Timer object.
A spec for a collection of utility functions.
An DenseVector class – a dense vector object.
double inf_norm() const
Infinity norm.
void sub(const DenseVector< _Type > &x)
Subtract a vector, element wise, equivalent to -=.
A linear system class for vector right-hand sides.
void factorise()
Factorise the Ax=B system.
void solve_using_factorisation()
Resolve the same system using the same factorisation.
void cleanup()
deallocates some objects
A matrix class that constructs a SPARSE matrix as a row major std::vector of SparseVectors.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...