Flow123d
Classes | Public Member Functions | Private Attributes | List of all members
LinSys_MATIS Class Reference

#include <linsys_proposed.hh>

Inheritance diagram for LinSys_MATIS:
Inheritance graph
[legend]
Collaboration diagram for LinSys_MATIS:
Collaboration graph
[legend]

Classes

struct  MatMyIS
 

Public Member Functions

 LinSys_MATIS (unsigned int lsize, int sz, int *global_row_4_sub_row, double *sol_array=NULL)
 
virtual void start_allocation ()
 
virtual void preallocate_matrix ()
 
virtual void preallocate_values (int nrow, int *rows, int ncol, int *cols)
 
virtual void view_local_matrix ()
 
VecScatter get_scatter ()
 
int get_subdomain_size ()
 Get local subdomain size. More...
 
virtual ~LinSys_MATIS ()
 
- Public Member Functions inherited from LinSys
 LinSys (const Distribution *rows_ds)
 
 LinSys (LinSys &other)
 
unsigned int size ()
 
unsigned int vec_lsize ()
 
virtual const Mat & get_matrix ()
 
virtual const Vec & get_rhs ()
 
void set_matrix_changed ()
 
void set_rhs_changed ()
 
bool is_matrix_changed ()
 
bool is_rhs_changed ()
 
virtual PetscErrorCode set_matrix (Mat &matrix, MatStructure str)
 
virtual PetscErrorCode set_rhs (Vec &rhs)
 
virtual PetscErrorCode mat_zero_entries ()
 
virtual PetscErrorCode rhs_zero_entries ()
 
const Vec & get_solution ()
 
void set_solution (double *sol_array)
 
double * get_solution_array ()
 
virtual void get_whole_solution (std::vector< double > &globalSolution)
 
virtual void set_whole_solution (std::vector< double > &globalSolution)
 
virtual void start_add_assembly ()
 
virtual void start_insert_assembly ()
 
virtual void finish_assembly ()=0
 
virtual void mat_set_values (int nrow, int *rows, int ncol, int *cols, double *vals)=0
 
void mat_set_value (int row, int col, double val)
 
virtual void rhs_set_values (int nrow, int *rows, double *vals)=0
 
void rhs_set_value (int row, double val)
 
void set_values (int nrow, int *rows, int ncol, int *cols, PetscScalar *mat_vals, PetscScalar *rhs_vals)
 Set values in the system matrix and values in the right-hand side vector on corresponding rows. More...
 
void set_values (std::vector< int > &row_dofs, std::vector< int > &col_dofs, const arma::mat &matrix, const arma::vec &rhs, const arma::vec &row_solution, const arma::vec &col_solution)
 
void add_constraint (int row, double value)
 
virtual void apply_constrains (double scalar)=0
 
virtual int solve ()=0
 
double get_residual_norm ()
 
double get_relative_accuracy ()
 
virtual double get_absolute_accuracy ()
 
void set_symmetric (bool flag=true)
 
bool is_symmetric ()
 
void set_positive_definite (bool flag=true)
 
void set_negative_definite (bool flag=true)
 
bool is_positive_definite ()
 
bool is_negative_definite ()
 
bool is_new ()
 
bool is_preallocated ()
 
void set_spd_via_symmetric_general (bool flag=true)
 
bool is_spd_via_symmetric_general ()
 
virtual void view ()
 
virtual void set_from_input (const Input::Record in_rec)
 
virtual double get_solution_precision ()=0
 
virtual ~LinSys ()
 
 LinSys (unsigned int lsize, double *sol_array=NULL)
 
unsigned int size ()
 
unsigned int vec_lsize ()
 
const Distributionds ()
 
const Mat & get_matrix ()
 
const Vec & get_rhs ()
 
const Vec & get_solution ()
 
double * get_solution_array ()
 
void start_add_assembly ()
 
void start_insert_assembly ()
 
void partial_assembly ()
 
void finish_assembly ()
 
virtual void mat_set_values (int nrow, int *rows, int ncol, int *cols, PetscScalar *vals)=0
 
void mat_set_value (int row, int col, PetscScalar val)
 
void rhs_set_values (int nrow, int *rows, PetscScalar *vals)
 
void rhs_set_value (int row, PetscScalar val)
 
void set_values (int nrow, int *rows, int ncol, int *cols, PetscScalar *mat_vals, PetscScalar *rhs_vals, std::vector< bool > &constrains_row_mask=std::vector(0), double *constrain_values=NULL)
 
void add_constrain (int row, double value)
 
void apply_constrains (std::vector< Constrain > &constraints)
 
virtual int solve ()
 
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 *output_mapping=NULL)
 
virtual ~LinSys ()
 

Private Attributes

ISLocalToGlobalMapping map_local_to_global
 PETSC mapping form local indexes of subdomain to global indexes. More...
 
int loc_rows_size
 
int * loc_rows
 
VecScatter sub_scatter
 
int subdomain_size
 size of subdomain in MATIS matrix More...
 
int * subdomain_nz
 For counting non-zero enteries of local subdomain. More...
 

Additional Inherited Members

- Public Types inherited from LinSys
enum  SetValuesMode {
  INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE, DONE,
  NONE, INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE,
  DONE, NONE
}
 
enum  SetValuesMode {
  INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE, DONE,
  NONE, INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE,
  DONE, NONE
}
 
enum  LinSysType { PETSC_MPIAIJ_preallocate_by_assembly, PETSC_MPIAIJ_assembly_by_triples, BDDC, PETSC_schur_complement }
 
- Public Attributes inherited from LinSys
LinSysType type
 Particular type of the linear system. More...
 
- Static Public Attributes inherited from LinSys
static Input::Type::AbstractRecord input_type
 
- Protected Types inherited from LinSys
typedef std::pair< unsigned,
double > 
Constraint_
 
typedef std::vector< Constraint_ConstraintVec_
 
- Protected Attributes inherited from LinSys
double r_tol_
 
double a_tol_
 
int max_it_
 
MPI_Comm comm_
 
SetValuesMode status_
 Set value status of the linear system. More...
 
const unsigned lsize_
 local number of matrix rows (non-overlapping division of rows) More...
 
unsigned size_
 global number of matrix rows, i.e. problem size More...
 
const Distributionrows_ds_
 final distribution of rows of MH matrix More...
 
bool symmetric_
 
bool positive_definite_
 
bool negative_definite_
 
bool spd_via_symmetric_general_
 
bool matrix_changed_
 true if the matrix was changed since the last solve More...
 
bool rhs_changed_
 true if the right hand side was changed since the last solve More...
 
Vec solution_
 PETSc vector constructed with vb array. More...
 
double * v_solution_
 local solution array pointing into Vec solution_ More...
 
bool own_solution_
 Indicates if the solution array has been allocated by this class. More...
 
double residual_norm_
 local solution array pointing into Vec solution_ More...
 
ConstraintVec_ constraints_
 
std::vector< double > globalSolution_
 global solution in numbering for linear system More...
 
Input::Record in_rec_
 
Distribution vec_ds
 Distribution of continuous blocks of system rows among the processors. More...
 
bool symmetric
 Flag for the symmetric system. More...
 
bool positive_definite
 Flag for positive definite system. More...
 
bool own_solution
 Indicates if the solution array has been allocated by this class. More...
 
SetValuesMode status
 Set value status of the linear system. More...
 
Mat matrix
 Petsc matrix of the problem. More...
 
Vec rhs
 PETSc vector constructed with vx array. More...
 
Vec solution
 PETSc vector constructed with vb array. More...
 
double * v_rhs
 RHS vector. More...
 
double * v_solution
 Vector of solution. More...
 
int * subdomain_indices
 Remember indices which created mapping. More...
 
Mat local_matrix
 local matrix of subdomain (used in LinSys_MATIS) More...
 

Detailed Description

Definition at line 346 of file linsys_proposed.hh.

Constructor & Destructor Documentation

LinSys_MATIS::LinSys_MATIS ( unsigned int  lsize,
int  sz,
int *  global_row_4_sub_row,
double *  sol_array = NULL 
)
virtual LinSys_MATIS::~LinSys_MATIS ( )
virtual

Member Function Documentation

VecScatter LinSys_MATIS::get_scatter ( )
inline

Definition at line 355 of file linsys_proposed.hh.

int LinSys_MATIS::get_subdomain_size ( )
inline

Get local subdomain size.

Definition at line 358 of file linsys_proposed.hh.

virtual void LinSys_MATIS::preallocate_matrix ( )
virtual

Protected methods used in preallocate_by_assembly solvers.

Implements LinSys.

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

Protected methods used in preallocate_by_assembly solvers.

Implements LinSys.

virtual void LinSys_MATIS::start_allocation ( )
virtual

Switch linear system into allocating assembly. (only for PETSC_MPIAIJ_preallocate_by_assembly)

Reimplemented from LinSys.

virtual void LinSys_MATIS::view_local_matrix ( )
virtual

Member Data Documentation

int* LinSys_MATIS::loc_rows
private

Small auxiliary array for translation of global indexes to local during preallocate_set_values. However for MatSetValues

Definition at line 367 of file linsys_proposed.hh.

int LinSys_MATIS::loc_rows_size
private

Definition at line 366 of file linsys_proposed.hh.

ISLocalToGlobalMapping LinSys_MATIS::map_local_to_global
private

PETSC mapping form local indexes of subdomain to global indexes.

Definition at line 365 of file linsys_proposed.hh.

VecScatter LinSys_MATIS::sub_scatter
private

from global vector with no overlaps constructs local (subdomain) vectors with overlaps copy of scatter created and used in PETSc in Mat_IS

Definition at line 369 of file linsys_proposed.hh.

int* LinSys_MATIS::subdomain_nz
private

For counting non-zero enteries of local subdomain.

Definition at line 374 of file linsys_proposed.hh.

int LinSys_MATIS::subdomain_size
private

size of subdomain in MATIS matrix

Definition at line 373 of file linsys_proposed.hh.


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