Flow123d  JS_before_hm-989-g79825ac
Public Types | Public Member Functions | Protected Attributes | List of all members
MatrixSimple Class Referenceabstract

#include <la_linsys_new.hh>

Collaboration diagram for MatrixSimple:
Collaboration graph
[legend]

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

Distributionget_row_ds ()
 
Distributionget_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...
 

Detailed Description

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:

  1. creation of sub problems up to the global problem (just matrix dimensions and types)
  2. pre assembly - > preallocation
  3. assembly - by the same functions
  4. matrix modifications (schur complements, assembly of one global matrix, preconditioners ...
  5. iterative solution in parallel
  6. for nonlinear/time problems: jump to 3. and reuse the structures

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.

Member Typedef Documentation

Member Enumeration Documentation

possible states of the matrix

Enumerator
INSERT 
ADD 
ALLOCATE 
DONE 
NONE 

Definition at line 65 of file la_linsys_new.hh.

Constructor & Destructor Documentation

MatrixSimple::MatrixSimple ( unsigned int  loc_row_size,
unsigned int  col_size 
)

Construct a parallel system with given local size.

virtual MatrixSimple::~LinSys ( )
virtual

Here is the caller graph for this function:

Member Function Documentation

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)

Here is the caller graph for this function:

Distribution& MatrixSimple::get_col_ds ( )
const Mat& MatrixSimple::get_matrix ( )
inline

Get matrix. SHOULD NOT BE USED !!!

Definition at line 95 of file la_linsys_new.hh.

Distribution& MatrixSimple::get_row_ds ( )
bool MatrixSimple::is_positive_definite ( )
inline

Here is the caller graph for this function:

bool MatrixSimple::is_symmetric ( )
inline

Here is the caller graph for this function:

void MatrixSimple::mat_set_value ( int  row,
int  col,
PetscScalar  val 
)
inline

Set one element of the system matrix.

Here is the caller graph for this function:

void MatrixSimple::mat_set_values ( int  nrow,
int *  rows,
int  ncol,
int *  cols,
PetscScalar *  vals 
)

Set full rectangular submatrix of the system matrix.

Here is the caller graph for this function:

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

virtual void MatrixSimple::preallocate_matrix ( )
pure virtual

Here is the caller graph for this function:

virtual void MatrixSimple::preallocate_values ( int  nrow,
int *  rows,
int  ncol,
int *  cols 
)
pure virtual

Here is the caller graph for this function:

void MatrixSimple::set_positive_definite ( bool  flag = true)
inline

Here is the caller graph for this function:

void MatrixSimple::set_symmetric ( bool  flag = true)
inline

Here is the caller graph for this function:

unsigned int MatrixSimple::size ( )
inline

Get global system size.

void MatrixSimple::start_add_assembly ( )

Here is the caller graph for this function:

virtual void MatrixSimple::start_allocation ( )
pure virtual

Here is the caller graph for this function:

void MatrixSimple::start_insert_assembly ( )

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

virtual void MatrixSimple::view_local_matrix ( )
pure virtual

Here is the caller graph for this function:

Member Data Documentation

Distribution MatrixSimple::col_ds
protected

Distribution of multiplied vector.

Definition at line 128 of file la_linsys_new.hh.

Mat MatrixSimple::matrix
protected

Petsc matrix of the problem.

Definition at line 133 of file la_linsys_new.hh.

bool MatrixSimple::positive_definite
protected

Flag for positive definite system.

Definition at line 130 of file la_linsys_new.hh.

Distribution MatrixSimple::row_ds
protected

Distribution of continuous blocks of system rows among the processors.

Definition at line 127 of file la_linsys_new.hh.

SetValuesMode MatrixSimple::status
protected

Set value status of the linear system.

Definition at line 131 of file la_linsys_new.hh.

bool MatrixSimple::symmetric
protected

Flag for the symmetric system.

Definition at line 129 of file la_linsys_new.hh.


The documentation for this class was generated from the following file: