Flow123d
JS_before_hm-1755-g6249b9fc1
|
#include <la_linsys_new.hh>
Public Types | |
enum | SetValuesMode { INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE, DONE, NONE } |
possible states of the matrix More... | |
typedef * | block |
Public Member Functions | |
MatrixSimple (unsigned int loc_row_size, unsigned int col_size) | |
Construct a parallel system with given local size. More... | |
void | multiply (Vec x, Vec y) |
multiply PETSC vector: y=Ax More... | |
void | multiply_add (Vec x, Vec b, Vec y) |
multiply vector and ad onother one: y=Ax+b More... | |
void | multiply_mat (...) |
multiply matrix .. has to deal with preallocation of result and reuse of structure More... | |
void | axpy (...) |
void | aypx (...) |
virtual void | start_allocation ()=0 |
void | start_add_assembly () |
void | start_insert_assembly () |
void | finalize (MatAssemblyType assembly_type=MAT_FINAL_ASSEMBLY) |
virtual void | preallocate_matrix ()=0 |
virtual void | preallocate_values (int nrow, int *rows, int ncol, int *cols)=0 |
virtual void | view_local_matrix ()=0 |
void | mat_set_values (int nrow, int *rows, int ncol, int *cols, PetscScalar *vals) |
Set full rectangular submatrix of the system matrix. More... | |
void | mat_set_value (int row, int col, PetscScalar val) |
Set one element of the system matrix. More... | |
void | set_symmetric (bool flag=true) |
bool | is_symmetric () |
void | set_positive_definite (bool flag=true) |
bool | is_positive_definite () |
void | view (std::ostream output_stream, int *row_mapping=NULL, int *col_mapping=NULL) |
Output the matrix in the Matlab format possibly with given renumbering of rows/cols. More... | |
virtual | ~LinSys () |
access members @{ | |
Access to distribution of rows, thhrou that you can get also matix size and local size. But for convenience we provide also direct functions | |
Distribution & | get_row_ds () |
Distribution & | get_col_ds () |
unsigned int | size () |
Get global system size. More... | |
const Mat & | get_matrix () |
Get matrix. SHOULD NOT BE USED !!! More... | |
Protected Attributes | |
Distribution | row_ds |
Distribution of continuous blocks of system rows among the processors. More... | |
Distribution | col_ds |
Distribution of multiplied vector. More... | |
bool | symmetric |
Flag for the symmetric system. More... | |
bool | positive_definite |
Flag for positive definite system. More... | |
SetValuesMode | status |
Set value status of the linear system. More... | |
Mat | matrix |
Petsc matrix of the problem. More... | |
Classes for block linear systems. Namely it should provide following functionality: 1) interface to various PETSC (or possibly other) matrices, with preallocation through the set_values method 2) For coupling problems creation of the global linear system by connectiong sub systems of individual equations. Working cycle could be:
3) Solution through explicit or implicit schur complements 4) Preconditioning for coupled problems . 5) In assembly, the access to the matrices in LinSys hierarchy is through successive call of block(i,j) method, but there also should be a class or another mechanism how to represent a coordinate in the hierarchy. Then one can access a MatriSimple directly by two coordinates and constantly access correct part of rhs vector
Virtual test cases:
Questions:
Definition at line 62 of file la_linsys_new.hh.
typedef * MatrixSimple::block |
possible states of the matrix
Enumerator | |
---|---|
INSERT | |
ADD | |
ALLOCATE | |
DONE | |
NONE |
Definition at line 65 of file la_linsys_new.hh.
MatrixSimple::MatrixSimple | ( | unsigned int | loc_row_size, |
unsigned int | col_size | ||
) |
Construct a parallel system with given local size.
|
virtual |
void MatrixSimple::axpy | ( | ... | ) |
add and scale sparse matrices ... has to deal with different nonzero structures, in such a case petsc rutines are inceribly slow
void MatrixSimple::aypx | ( | ... | ) |
void MatrixSimple::finalize | ( | MatAssemblyType | assembly_type = MAT_FINAL_ASSEMBLY | ) |
Distribution& MatrixSimple::get_col_ds | ( | ) |
|
inline |
Get matrix. SHOULD NOT BE USED !!!
Definition at line 95 of file la_linsys_new.hh.
Distribution& MatrixSimple::get_row_ds | ( | ) |
|
inline |
|
inline |
|
inline |
Set one element of the system matrix.
void MatrixSimple::mat_set_values | ( | int | nrow, |
int * | rows, | ||
int | ncol, | ||
int * | cols, | ||
PetscScalar * | vals | ||
) |
Set full rectangular submatrix of the system matrix.
void MatrixSimple::multiply | ( | Vec | x, |
Vec | y | ||
) |
multiply PETSC vector: y=Ax
void MatrixSimple::multiply_add | ( | Vec | x, |
Vec | b, | ||
Vec | y | ||
) |
multiply vector and ad onother one: y=Ax+b
void MatrixSimple::multiply_mat | ( | ... | ) |
multiply matrix .. has to deal with preallocation of result and reuse of structure
|
pure virtual |
|
pure virtual |
|
inline |
|
inline |
|
inline |
Get global system size.
void MatrixSimple::start_add_assembly | ( | ) |
|
pure virtual |
void MatrixSimple::start_insert_assembly | ( | ) |
void MatrixSimple::view | ( | std::ostream | output_stream, |
int * | row_mapping = NULL , |
||
int * | col_mapping = NULL |
||
) |
Output the matrix in the Matlab format possibly with given renumbering of rows/cols.
|
pure virtual |
|
protected |
Distribution of multiplied vector.
Definition at line 128 of file la_linsys_new.hh.
|
protected |
Petsc matrix of the problem.
Definition at line 133 of file la_linsys_new.hh.
|
protected |
Flag for positive definite system.
Definition at line 130 of file la_linsys_new.hh.
|
protected |
Distribution of continuous blocks of system rows among the processors.
Definition at line 127 of file la_linsys_new.hh.
|
protected |
Set value status of the linear system.
Definition at line 131 of file la_linsys_new.hh.
|
protected |
Flag for the symmetric system.
Definition at line 129 of file la_linsys_new.hh.