OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
solver_utils.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 // $Id: solver_utils.h 2605 2014-08-15 03:36:44Z secanell $
3 //
4 // Copyright (C) 2008 by Marc Secanell
5 //
6 // This file is subject to QPL and may not be distributed
7 // without copyright and license information. Please refer
8 // to the file deal.II/doc/license.html for the text and
9 // further information on this license.
10 //
11 //---------------------------------------------------------------------------
12 
13 
14 #ifndef _SOLVER_UTILS__H
15 #define _SOLVER_UTILS__H
16 
17 //-- deal.II
18 #include <deal.II/lac/block_sparse_matrix.h>
19 #include <deal.II/lac/full_matrix.h>
20 #include <deal.II/lac/block_vector.h>
21 #include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
22 
23 //-- OpenFCST
25 
26 // Include STD classes
27 #include <vector>
28 #include <fstream>
29 #include <iostream>
30 #include <sstream>
31 
32 // Use namespace of deal.II
33 using namespace dealii;
34 
42 namespace SolverUtils
43 {
48  void check_diagonal(const BlockSparseMatrix<double>& A);
49 
53  void output_diagonal(const BlockSparseMatrix<double>& A);
54 
59  void print_diagonal(const BlockSparseMatrix<double>& A,
60  const std::string& file = std::string("diag_matrix.dat"));
82  void repair_diagonal (BlockSparseMatrix<double>& A);
83 #ifdef OPENFCST_WITH_PETSC
84  void repair_diagonal (PETScWrappers::MPI::SparseMatrix & A);
85 #endif
86 
93  void repair_diagonal (BlockSparseMatrix<double>& A, FuelCell::ApplicationCore::FEVector& , const FuelCell::ApplicationCore::FEVector& );
94 
95 
96 };
97 
98 
99 #endif //_SOLVER_UTILS__H
void output_diagonal(const BlockSparseMatrix< double > &A)
Output diagonal elements of the stiffness matrix to the screen.
void check_diagonal(const BlockSparseMatrix< double > &A)
Check that the diagonal of the matrix does not have any zeros.
void print_diagonal(const BlockSparseMatrix< double > &A, const std::string &file=std::string("diag_matrix.dat"))
Print the diagonal elements of a matrix to a file named diag_matrix.dat.
void repair_diagonal(BlockSparseMatrix< double > &A)
This member function is used to make sure that the BlockSpareMatrix has no zeros in the diagonal...
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46