print.hpp
Go to the documentation of this file.
1 #ifndef PRINT_H
2 #define PRINT_H
3 #include "class.hpp"
4 
5 #include <petscksp.h>
6 namespace SPE
7 {
11  PetscErrorCode printScalar(
12  const PetscScalar x[],
13  const PetscInt n=1,
14  char const name[]="x",
15  const PetscViewer viewer=PETSC_VIEWER_STDOUT_WORLD
16  );
17 
21  PetscErrorCode printReal(
22  const PetscReal x[],
23  const PetscInt n=1,
24  char const name[]="x",
25  const PetscViewer viewer=PETSC_VIEWER_STDOUT_WORLD
26  );
27 
31  PetscErrorCode printVec(
32  const Vec &x,
33  const PetscInt n,
34  char const name[]="x"
35  );
39  PetscErrorCode printInt(
40  const PetscInt x[],
41  const PetscInt n=1,
42  char const name[]="x"
43  );
54  void printVecView(
55  const Vec &x,
56  char const name[]="x viewer",
57  const PetscViewerFormat format=PETSC_VIEWER_DEFAULT
58  );
69  PetscInt printMatView(
70  const Mat &A,
71  char const name[]="A viewer",
72  const PetscViewerFormat format=PETSC_VIEWER_DEFAULT
73  );
81  PetscInt printMatASCII(
82  const Mat &A,
83  char const name[]="printMatASCII.txt",
84  const PetscViewerFormat format=PETSC_VIEWER_DEFAULT
85  );
93  PetscInt printMatASCII(
94  const Mat &A,
95  std::string name,
96  const PetscViewerFormat format=PETSC_VIEWER_DEFAULT
97  );
106  const Mat &A,
107  char const name[]="printMatGetDiagonalASCII.txt",
108  const PetscViewerFormat format=PETSC_VIEWER_ASCII_MATLAB
109  );
110  //const PetscViewerFormat format=PETSC_VIEWER_DEFAULT ///< [in] format for viewer
118  void printVecASCII(
119  const Vec &b,
120  char const name[]="printVecASCII.txt",
121  const PetscViewerFormat format=PETSC_VIEWER_ASCII_MATLAB
122  );
125  PetscErrorCode printClosureIter(
126  SPE &data
127  );
130  PetscErrorCode printNonlinearIter(
131  SPE &data
132  );
135  void printHeaderIter();
136 
139  PetscErrorCode printBaseNonlinearIter(
140  SPE &data,
141  PetscReal basenonlinear_error,
142  PetscInt basenonlinear_iter
143  );
144 }
145 
146 #endif
PetscErrorCode printClosureIter(SPE &data)
print iteration residuals to screen from update_Closure iterations
Definition: print.cpp:153
void printVecView(const Vec &x, char const name[]="x viewer", const PetscViewerFormat format=PETSC_VIEWER_DEFAULT)
view PetscVec variable to screen Open an X-window viewer. Note that we specify the same communicator ...
Definition: print.cpp:75
void printVecASCII(const Vec &b, char const name[]="printVecASCII.txt", const PetscViewerFormat format=PETSC_VIEWER_ASCII_MATLAB)
view Petsc Vec variable to ASCII file
Definition: print.cpp:141
Namespace containing all functions and data classes for this solver.
Definition: Ax_b.hpp:5
PetscErrorCode printVec(const Vec &x, const PetscInt n, char const name[]="x")
Print Vec from PETSc type variable to screen.
Definition: print.cpp:43
PetscErrorCode printScalar(const PetscScalar x[], const PetscInt n=1, char const name[]="x", const PetscViewer viewer=PETSC_VIEWER_STDOUT_WORLD)
Print PetscScalar variable to screen.
Definition: print.cpp:9
void printMatGetDiagonalASCII(const Mat &A, char const name[]="printMatGetDiagonalASCII.txt", const PetscViewerFormat format=PETSC_VIEWER_ASCII_MATLAB)
print diagonal of Petsc Mat variable to ASCII file
Definition: print.cpp:126
PetscErrorCode printBaseNonlinearIter(SPE &data, PetscReal basenonlinear_error, PetscInt basenonlinear_iter)
print iteration residuals to screen from baseflow nonlinear iterations
Definition: print.cpp:201
void printHeaderIter()
print iteration residuals header to screen
Definition: print.cpp:180
PetscErrorCode printReal(const PetscReal x[], const PetscInt n=1, char const name[]="x", const PetscViewer viewer=PETSC_VIEWER_STDOUT_WORLD)
Print PetscReal variable to screen.
Definition: print.cpp:26
PetscErrorCode printNonlinearIter(SPE &data)
print iteration residuals to screen from update_Nonlinear iterations
Definition: print.cpp:164
PetscInt printMatASCII(const Mat &A, char const name[]="printMatASCII.txt", const PetscViewerFormat format=PETSC_VIEWER_DEFAULT)
view Petsc Mat variable to ASCII file
Definition: print.cpp:102
PetscInt printMatView(const Mat &A, char const name[]="A viewer", const PetscViewerFormat format=PETSC_VIEWER_DEFAULT)
view Petsc Mat variable to screen Open an X-window viewer. Note that we specify the same communicator...
Definition: print.cpp:88
PetscErrorCode printInt(const PetscInt x[], const PetscInt n=1, char const name[]="x")
Print PetscInt variable to screen.
Definition: print.cpp:58