set_Mat.hpp
Go to the documentation of this file.
1 #ifndef SET_MAT_H
2 #define SET_MAT_H
3 #include <petscksp.h>
4 namespace SPE{
10  PetscInt set_Mat(
11  const PetscScalar* const* Ain,
12  const PetscInt &n,
13  Mat &A,
14  const InsertMode &addv=ADD_VALUES
15  );
16 
22  PetscInt set_Mat(
23  const PetscScalar &diag,
24  const PetscInt &n,
25  Mat &A,
26  const PetscInt &k=0,
27  const PetscBool &parallel=PETSC_TRUE,
28  const InsertMode &addv=ADD_VALUES
29  );
35  PetscInt set_Mat(
36  Mat &A
37  );
38 
44  PetscInt set_Mat(
45  const PetscScalar &value,
46  const PetscInt &row,
47  const PetscInt &col,
48  Mat &A,
49  const PetscBool &parallel=PETSC_TRUE,
50  const InsertMode &addv=ADD_VALUES
51  );
52 
58  PetscInt set_Mat(
59  const PetscScalar &a,
60  const Mat &Asub,
61  const PetscInt &nsub,
62  Mat &A,
63  const PetscInt &n,
64  const PetscInt &rowoffset=0,
65  const PetscInt &coloffset=0,
66  const InsertMode &addv=ADD_VALUES
67  );
68 
74  PetscInt set_Mat(
75  const PetscScalar* Ain,
76  const PetscInt &row,
77  const PetscInt &ncols,
78  const PetscInt cols[],
79  Mat &A,
80  const InsertMode &addv=ADD_VALUES
81  );
82 
88  PetscInt set_Mat(
89  const PetscScalar &a,
90  const Mat &Dz,
91  const PetscInt &nz,
92  const PetscInt &ny,
93  const PetscInt &zi,
94  Mat &A,
95  const PetscInt &n,
96  const PetscInt &nvars=4,
97  const PetscInt &rowoffset=0,
98  const PetscInt &coloffset=0,
99  const InsertMode &addv=ADD_VALUES
100  );
106  PetscInt set_MatDiagonalScale(
107  const Mat &diag_to_scale,
108  const Mat &Asub,
109  const PetscInt &nsub,
110  Mat &A,
111  const PetscInt &n,
112  const PetscInt &rowoffset=0,
113  const PetscInt &coloffset=0,
114  const InsertMode &addv=ADD_VALUES
115  );
122  Vec &x,
123  PetscInt &n,
124  Mat &A
125  );
126 
132  PetscInt set_Mat_from_Vec(
133  Vec &x,
134  PetscInt &ny,
135  PetscInt &nz,
136  PetscInt &rowoffset,
137  Mat &A,
138  const InsertMode &addv=ADD_VALUES
139  );
145  PetscInt set_Mat_kron(
146  const Mat &A,
147  const Mat &B,
148  Mat &C
149  );
150 
155  PetscInt set_Mat_aPDdim_to_A(
156  PetscScalar a,
157  Mat &P,
158  Mat &D,
159  Mat &A
160  );
161 
162 }
163 
164 
165 #endif
Namespace containing all functions and data classes for this solver.
Definition: Ax_b.hpp:5
PetscInt set_Mat_from_Vec(Vec &x, PetscInt &ny, PetscInt &nz, PetscInt &rowoffset, Mat &A, const InsertMode &addv=ADD_VALUES)
set a matrix A (large ny*nz*4) from a vector (ny*nz) (used in the diagonals) at a certain rowoffset (...
Definition: set_Mat.cpp:273
PetscInt set_Mat_broadcast_from_colVec(Vec &x, PetscInt &n, Mat &A)
set a matrix from a column vector (broadcast the column vector to all columns of a matrix Be sure tha...
Definition: set_Mat.cpp:246
PetscInt set_Mat_kron(const Mat &A, const Mat &B, Mat &C)
Kronecker tensor product of two matrices A and B to make C If A is m by n, and B is p by q...
Definition: set_Mat.cpp:317
PetscInt set_Mat(const PetscScalar *const *Ain, const PetscInt &n, Mat &A, const InsertMode &addv=ADD_VALUES)
set a matrix from PetscScalar 2D matrix to PETSc Mat type in parallel
Definition: set_Mat.cpp:8
PetscInt set_Mat_aPDdim_to_A(PetscScalar a, Mat &P, Mat &D, Mat &A)
Definition: set_Mat.cpp:392
PetscInt set_MatDiagonalScale(const Mat &diag_to_scale, const Mat &Asub, const PetscInt &nsub, Mat &A, const PetscInt &n, const PetscInt &rowoffset=0, const PetscInt &coloffset=0, const InsertMode &addv=ADD_VALUES)
set a scaled matrix, (rows are scaled by matrix, using A=LA and MatDiagonalScale) ...
Definition: set_Mat.cpp:217