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 // Include deal.II classes
18 #include <lac/block_sparse_matrix.h>
19 #include <lac/full_matrix.h>
20 #include "lac/block_vector.h"
21 #include <lac/petsc_parallel_block_sparse_matrix.h>
22 
23 #include "fe_vectors.h"
24 #include "application_data.h"
25 #include "event.h"
26 #include "application_base.h"
27 #include "application_wrapper.h"
28 
29 // Include STD classes
30 #include <vector>
31 #include <fstream>
32 #include <iostream>
33 #include <sstream>
34 
35 // Use namespace of deal.II
36 using namespace dealii;
37 
45 namespace SolverUtils
46 {
51  void check_diagonal(const BlockSparseMatrix<double>& A);
52 
56  void output_diagonal(const BlockSparseMatrix<double>& A);
57 
62  void print_diagonal(const BlockSparseMatrix<double>& A,
63  const std::string& file = std::string("diag_matrix.dat"));
85  void repair_diagonal (BlockSparseMatrix<double>& A);
86 #ifdef OPENFCST_WITH_PETSC
87  void repair_diagonal (PETScWrappers::MPI::SparseMatrix & A);
88 #endif
89 
96  void repair_diagonal (BlockSparseMatrix<double>& A, FuelCell::ApplicationCore::FEVector& , const FuelCell::ApplicationCore::FEVector& );
97 
98 
99 };
100 
101 
102 #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:39