Flow123d
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
LinSys Class Referenceabstract

Abstract linear system class. More...

#include <la_linsys_new.hh>

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

Public Types

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 Member Functions

 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_allocation ()
 
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 ()
 
virtual void start_allocation ()=0
 
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 ()
 

Public Attributes

LinSysType type
 Particular type of the linear system. More...
 

Static Public Attributes

static Input::Type::AbstractRecord input_type
 

Protected Types

typedef std::pair< unsigned,
double > 
Constraint_
 
typedef std::vector< Constraint_ConstraintVec_
 

Protected Member Functions

virtual void preallocate_matrix ()=0
 
virtual void preallocate_values (int nrow, int *rows, int ncol, int *cols)=0
 

Protected Attributes

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...
 

Private Member Functions

LinSysblock (i, j) MatrixArray *matrix() virtual solve(Vector solution
 

Private Attributes

LinSys Vector RHS
 

Friends

class SchurComplement
 
void SchurComplement::form_schur ()
 

Detailed Description

Abstract linear system class.

LinSys - matrix and a particular way how to compute solution for given RHS, i.e. this class can perform action of the matrix inverse

This is abstract class for members of possible hierarchical tree of the whole system.

Linear system consists of Matrix, RHS and solution. It provides general methods for:

Method operates on the system as single object. But some methods for matrix only manipulation can be provided until we have matrix as separate class.

TODO:

Linear system consists of Matrix, RHS and solution. It provides general methods for:

Method operates on the system as single object. But some methods for matrix only manipulation can be provided until we have matrix as separate class.

Definition at line 182 of file la_linsys_new.hh.

Member Typedef Documentation

typedef std::pair<unsigned,double> LinSys::Constraint_
protected

Definition at line 111 of file linsys.hh.

Definition at line 112 of file linsys.hh.

Member Enumeration Documentation

Enumerator
PETSC_MPIAIJ_preallocate_by_assembly 
PETSC_MPIAIJ_assembly_by_triples 
BDDC 
PETSC_schur_complement 

Definition at line 81 of file linsys_proposed.hh.

Enumerator
INSERT 
ADD 
ALLOCATE 
DONE 
NONE 
INSERT 
ADD 
ALLOCATE 
DONE 
NONE 

Definition at line 73 of file linsys_proposed.hh.

Enumerator
INSERT 
ADD 
ALLOCATE 
DONE 
NONE 
INSERT 
ADD 
ALLOCATE 
DONE 
NONE 

Definition at line 94 of file linsys.hh.

Constructor & Destructor Documentation

LinSys::LinSys ( const Distribution rows_ds)
inline

Constructor. Constructor of abstract class should not be called directly, but is used for initialization of member common to all particular solvers.

Parameters
comm- MPI communicator

TODO: Vector solution_ is now initialized to NULL, but it should be rather allocated in the constructor instead of the method set_solution().

Definition at line 125 of file linsys.hh.

LinSys::LinSys ( LinSys other)
inline

Copy constructor.

Definition at line 140 of file linsys.hh.

virtual LinSys::~LinSys ( )
inlinevirtual

Definition at line 577 of file linsys.hh.

LinSys::LinSys ( unsigned int  lsize,
double *  sol_array = NULL 
)

Constructor. Constructor of abstract class should not be called directly, but is used for initialization of member common to all particular solvers.

Parameters
lsize- local size of the solution vector
sol_array- optionally one can provide pointer to array allocated to size lsize, where the solution should be stored,
virtual LinSys::~LinSys ( )
virtual

Member Function Documentation

void LinSys::add_constrain ( int  row,
double  value 
)

Adds Dirichlet constrain.

Parameters
row- global numeb of row that should be eliminated.
value- solution value at the given row
void LinSys::add_constraint ( int  row,
double  value 
)
inline

Adds Dirichlet constrain.

Parameters
row- global number of row that should be eliminated.
value- solution value at the given row

Definition at line 440 of file linsys.hh.

void LinSys::apply_constrains ( std::vector< Constrain > &  constraints)

Apply constrains to assembled matrix. Constrains are given by pairs: global row index, value. i.e. typedef pair<unsigned int, double> Constrain;

What is th meaning of ( const double factor ) form Cambridge code?

virtual void LinSys::apply_constrains ( double  scalar)
pure virtual

Apply constrains to assembled matrix. Constrains are given by pairs: global row index, value. i.e. typedef pair<unsigned int, double> Constrain;

What is th meaning of ( const double factor ) form Cambridge code?

Implemented in LinSys_PETSC, and LinSys_BDDC.

LinSys* LinSys::block ( ,
 
)
private
const Distribution& LinSys::ds ( )
inline

Returns whole Distribution class for distribution of the solution.

Definition at line 119 of file linsys_proposed.hh.

void LinSys::finish_assembly ( )

Finish assembly of the whole system. For PETSC this should call MatEndAssembly with MAT_FINAL_ASSEMBLY

virtual void LinSys::finish_assembly ( )
pure virtual

Finish assembly of the whole system. For PETSC this should call MatEndAssembly with MAT_FINAL_ASSEMBLY

Implemented in LinSys_PETSC, and LinSys_BDDC.

Here is the caller graph for this function:

virtual double LinSys::get_absolute_accuracy ( )
inlinevirtual

Returns information on absolute solver accuracy

Reimplemented in LinSys_PETSC.

Definition at line 475 of file linsys.hh.

const Mat& LinSys::get_matrix ( )
inline

Returns PETSC matrix (only for PETSC solvers)

Definition at line 125 of file linsys_proposed.hh.

virtual const Mat& LinSys::get_matrix ( )
inlinevirtual

Returns PETSC matrix (only for PETSC solvers)

If matrix is changed, method set_matrix_changed() must be called. Example: MatDiagonalSet(schur->get_matrix(), new_diagonal, ADD_VALUES); schur->set_matrix_changed();

Reimplemented in LinSys_PETSC.

Definition at line 180 of file linsys.hh.

Here is the caller graph for this function:

double LinSys::get_relative_accuracy ( )
inline

Returns information on relative solver accuracy

Definition at line 468 of file linsys.hh.

double LinSys::get_residual_norm ( )
inline

Returns norm of the initial right hand side

Definition at line 461 of file linsys.hh.

const Vec& LinSys::get_rhs ( )
inline

Returns RHS vector (only for PETSC solvers)

Definition at line 131 of file linsys_proposed.hh.

virtual const Vec& LinSys::get_rhs ( )
inlinevirtual

Returns RHS vector (only for PETSC solvers)

If vector is changed, method set_rhs_changed() must be called. Example: VecScale(schur->get_rhs(), -1.0); schur->set_rhs_changed();

Reimplemented in LinSys_PETSC.

Definition at line 195 of file linsys.hh.

Here is the caller graph for this function:

const Vec& LinSys::get_solution ( )
inline

Returns PETSC vector with solution. Underlying array can be provided on construction. Can this be implemented for BDDC?

Definition at line 138 of file linsys_proposed.hh.

const Vec& LinSys::get_solution ( )
inline

Returns PETSC vector with solution. Underlying array can be provided on construction.

Definition at line 260 of file linsys.hh.

Here is the caller graph for this function:

double* LinSys::get_solution_array ( )
inline

Returns local part of solution vector. Can this be implemented for BDDC?

Definition at line 145 of file linsys_proposed.hh.

double* LinSys::get_solution_array ( )
inline

Returns PETSC subarray with solution. Underlying array can be provided on construction.

Definition at line 284 of file linsys.hh.

Here is the caller graph for this function:

virtual double LinSys::get_solution_precision ( )
pure virtual

Get precision of solving

Implemented in LinSys_PETSC, SchurComplement, and LinSys_BDDC.

Here is the caller graph for this function:

virtual void LinSys::get_whole_solution ( std::vector< double > &  globalSolution)
inlinevirtual

Returns whole solution vector.

Reimplemented in LinSys_PETSC, and LinSys_BDDC.

Definition at line 293 of file linsys.hh.

bool LinSys::is_matrix_changed ( )
inline

Returns true if the system matrix has changed since the last solve.

Definition at line 215 of file linsys.hh.

Here is the caller graph for this function:

bool LinSys::is_negative_definite ( )
inline

Definition at line 520 of file linsys.hh.

Here is the caller graph for this function:

bool LinSys::is_new ( )
inline

TODO: In fact we want to know if the matrix is already preallocated However to do this we need explicit finalisation of preallocating cycle.

Definition at line 525 of file linsys.hh.

bool LinSys::is_positive_definite ( )
inline

Definition at line 284 of file linsys_proposed.hh.

bool LinSys::is_positive_definite ( )
inline

Definition at line 517 of file linsys.hh.

Here is the caller graph for this function:

bool LinSys::is_preallocated ( )
inline

Definition at line 529 of file linsys.hh.

Here is the caller graph for this function:

bool LinSys::is_rhs_changed ( )
inline

Returns true if the system RHS has changed since the last solve.

Definition at line 221 of file linsys.hh.

bool LinSys::is_spd_via_symmetric_general ( )
inline

Definition at line 545 of file linsys.hh.

bool LinSys::is_symmetric ( )
inline

Definition at line 272 of file linsys_proposed.hh.

bool LinSys::is_symmetric ( )
inline

Definition at line 490 of file linsys.hh.

Here is the caller graph for this function:

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

Shortcut for assembling just one element into the matrix. Similarly we can provide method accepting armadillo matrices.

Definition at line 183 of file linsys_proposed.hh.

void LinSys::mat_set_value ( int  row,
int  col,
double  val 
)
inline

Shortcut for assembling just one element into the matrix. Similarly we can provide method accepting armadillo matrices.

Definition at line 345 of file linsys.hh.

Here is the caller graph for this function:

virtual void LinSys::mat_set_values ( int  nrow,
int *  rows,
int  ncol,
int *  cols,
PetscScalar *  vals 
)
pure virtual

Assembly full rectangular submatrix into the system matrix. Should be virtual, implemented differently in particular solvers.

virtual void LinSys::mat_set_values ( int  nrow,
int *  rows,
int  ncol,
int *  cols,
double *  vals 
)
pure virtual

Assembly full rectangular submatrix into the system matrix. Should be virtual, implemented differently in particular solvers.

Implemented in LinSys_PETSC, and LinSys_BDDC.

Here is the caller graph for this function:

virtual PetscErrorCode LinSys::mat_zero_entries ( )
inlinevirtual

Clears entries of the matrix

Reimplemented in LinSys_PETSC, and LinSys_BDDC.

Definition at line 244 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::partial_assembly ( )

May not be necessary. For PETSC this should call MatEndAssembly with MAT_PARTIAL_ASSEMBLY

virtual void LinSys::preallocate_matrix ( )
protectedpure virtual

Protected methods used in preallocate_by_assembly solvers.

Implemented in LinSys_MATIS, LinSys_MPIAIJ, and LinSys_PETSC.

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

Protected methods used in preallocate_by_assembly solvers.

Implemented in LinSys_MATIS, LinSys_MPIAIJ, and LinSys_PETSC.

void LinSys::rhs_set_value ( int  row,
PetscScalar  val 
)
inline

Shorcut for assembling just one element into RHS vector.

Definition at line 204 of file linsys_proposed.hh.

void LinSys::rhs_set_value ( int  row,
double  val 
)
inline

Shorcut for assembling just one element into RHS vector.

Definition at line 357 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::rhs_set_values ( int  nrow,
int *  rows,
PetscScalar *  vals 
)
inline

Set values of the system right-hand side. Should be virtual, implemented differently in particular solvers.

Definition at line 190 of file linsys_proposed.hh.

virtual void LinSys::rhs_set_values ( int  nrow,
int *  rows,
double *  vals 
)
pure virtual

Set values of the system right-hand side. Should be virtual, implemented differently in particular solvers.

Implemented in LinSys_PETSC, and LinSys_BDDC.

Here is the caller graph for this function:

virtual PetscErrorCode LinSys::rhs_zero_entries ( )
inlinevirtual

Clears entries of the right-hand side

Reimplemented in LinSys_PETSC, and LinSys_BDDC.

Definition at line 252 of file linsys.hh.

Here is the caller graph for this function:

virtual void LinSys::set_from_input ( const Input::Record  in_rec)
inlinevirtual

Sets basic parameters of LinSys defined by user in input file and used to calculate

Reimplemented in LinSys_PETSC, and LinSys_BDDC.

Definition at line 562 of file linsys.hh.

Here is the caller graph for this function:

virtual PetscErrorCode LinSys::set_matrix ( Mat &  matrix,
MatStructure  str 
)
inlinevirtual

Sets PETSC matrix (only for PETSC solvers)

Reimplemented in LinSys_PETSC.

Definition at line 228 of file linsys.hh.

void LinSys::set_matrix_changed ( )
inline

Sets matrix changed flag.

Definition at line 203 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::set_negative_definite ( bool  flag = true)
inline

Provides user knowledge about negative definiteness.

Definition at line 508 of file linsys.hh.

Here is the caller graph for this function:

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

Provides user knowledge about positive definiteness.

Definition at line 278 of file linsys_proposed.hh.

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

Provides user knowledge about positive definiteness.

Definition at line 496 of file linsys.hh.

Here is the caller graph for this function:

virtual PetscErrorCode LinSys::set_rhs ( Vec &  rhs)
inlinevirtual

Sets RHS vector (only for PETSC solvers)

Reimplemented in LinSys_PETSC.

Definition at line 236 of file linsys.hh.

void LinSys::set_rhs_changed ( )
inline

Sets rhs changed flag (only for PETSC solvers)

Definition at line 209 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::set_solution ( double *  sol_array)
inline

Create PETSc solution

Definition at line 268 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::set_spd_via_symmetric_general ( bool  flag = true)
inline

Provides user knowledge about positive definiteness via symmetric general approach. This is useful for solving Darcy flow by mixed hybrid method, where blocks on subdomains are saddle point but interface among subdomains is only at the block of Lagrange multipliers and is symmetric positive definite. Problem condensed to interface can thus be solved by PCG method, although original problem is saddle point.

Definition at line 539 of file linsys.hh.

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

Provides user knowledge about symmetry.

Definition at line 266 of file linsys_proposed.hh.

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

Provides user knowledge about symmetry.

Definition at line 481 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::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 
)
inline

Shortcut to assembly into matrix and RHS in one call. This can also apply constrains at assembly time (only in add assembly regime).

Constrains can either be set before through add_constrain. Or by additional parameters if we have only per element knowledge about boundary conditions.

Definition at line 215 of file linsys_proposed.hh.

void LinSys::set_values ( int  nrow,
int *  rows,
int  ncol,
int *  cols,
PetscScalar *  mat_vals,
PetscScalar *  rhs_vals 
)
inline

Set values in the system matrix and values in the right-hand side vector on corresponding rows.

Definition at line 362 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::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 
)
inline

Shortcut to assembly into matrix and RHS in one call, possibly apply Dirichlet boundary conditions. row_dofs - are global indices of rows of dense matrix and rows of dense vector in global system col_dofs - are global indices of columns of the matrix, and possibly

Application of Dirichlet conditions: 1) Rows with negative dofs are set to zero. 2) Cols with negative dofs are eliminated. 3) If there are entries on global diagonal. We determine value K either from diagonal of local matrix, or (if it is zero) from diagonal average.

Definition at line 381 of file linsys.hh.

virtual void LinSys::set_whole_solution ( std::vector< double > &  globalSolution)
inlinevirtual

Inserts solution vector.

Reimplemented in LinSys_BDDC.

Definition at line 301 of file linsys.hh.

unsigned int LinSys::size ( )
inline

Returns global system size.

Definition at line 106 of file linsys_proposed.hh.

unsigned int LinSys::size ( )
inline

Returns global system size.

Definition at line 156 of file linsys.hh.

Here is the caller graph for this function:

virtual int LinSys::solve ( )
virtual
   Solve the system.

   parameters should by provided in input file (currently INI file, but will be changed to JSON)

   If we realize that we need to set something, rather add some set_* function.

   double tol = 1.e-7,                        //!< tolerance on relative residual ||res||/||rhs||
   int  numLevels = 2,                        //!< number of levels
   std::vector<int> *  numSubAtLevels = NULL, //!< number of subdomains at levels
   int verboseLevel = 0,                      //!< level of verbosity of BDDCML library

!< ( 0 - only fatal errors reported, !< 1 - mild output, !< 2 - detailed output ) int maxIt = 1000, //!< maximum number of iterations int ndecrMax = 30 ); //!< maximum number of iterations with non-decreasing residual !< ( used to stop diverging process )

   Returns convergence reason (form PETSC)

Reimplemented in SchurComplement, LinSys_PETSC, and LinSys_BDDC.

virtual int LinSys::solve ( )
pure virtual

Solve the system and return convergence reason.

Implemented in SchurComplement, LinSys_PETSC, and LinSys_BDDC.

Here is the caller graph for this function:

void LinSys::start_add_assembly ( )

Switch linear system into adding assembly. (the only one supported by triplets ??)

virtual void LinSys::start_add_assembly ( )
inlinevirtual

Switch linear system into adding assembly. (the only one supported by triplets ??)

Reimplemented in LinSys_PETSC.

Definition at line 317 of file linsys.hh.

Here is the caller graph for this function:

virtual void LinSys::start_allocation ( )
pure virtual

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

Implemented in LinSys_MATIS, LinSys_MPIAIJ, and LinSys_PETSC.

virtual void LinSys::start_allocation ( )
inlinevirtual

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

Reimplemented in LinSys_MATIS, LinSys_MPIAIJ, and LinSys_PETSC.

Definition at line 309 of file linsys.hh.

Here is the caller graph for this function:

void LinSys::start_insert_assembly ( )

Switch linear system into insert assembly. (not currently used)

virtual void LinSys::start_insert_assembly ( )
inlinevirtual

Switch linear system into insert assembly. (not currently used)

Reimplemented in LinSys_PETSC.

Definition at line 325 of file linsys.hh.

unsigned int LinSys::vec_lsize ( )
inline

Returns local system size. (for partitioning of solution vectors) for PETSC_MPIAIJ it is also partitioning of the matrix

Definition at line 113 of file linsys_proposed.hh.

unsigned int LinSys::vec_lsize ( )
inline

Returns local system size. (for partitioning of solution vectors) for PETSC_MPIAIJ it is also partitioning of the matrix

Definition at line 165 of file linsys.hh.

void LinSys::view ( std::ostream  output_stream,
int *  output_mapping = NULL 
)

Output the system in the Matlab format possibly with given ordering. Rather we shoud provide output operator <<, since it is more flexible.

virtual void LinSys::view ( )
inlinevirtual

Output the system in the Matlab format possibly with given ordering. Rather we shoud provide output operator <<, since it is more flexible.

Reimplemented in LinSys_PETSC.

Definition at line 554 of file linsys.hh.

Friends And Related Function Documentation

Definition at line 89 of file linsys.hh.

void SchurComplement::form_schur ( )
friend

Member Data Documentation

double LinSys::a_tol_
protected

Definition at line 586 of file linsys.hh.

MPI_Comm LinSys::comm_
protected

Definition at line 589 of file linsys.hh.

ConstraintVec_ LinSys::constraints_
protected

Definition at line 611 of file linsys.hh.

std::vector<double> LinSys::globalSolution_
protected

global solution in numbering for linear system

Definition at line 613 of file linsys.hh.

Input::Record LinSys::in_rec_
protected

Definition at line 615 of file linsys.hh.

it::AbstractRecord LinSys::input_type
static
Initial value:
= it::AbstractRecord("LinSys", "Linear solver setting.")
.declare_key("r_tol", it::Double(0.0, 1.0), it::Default("1.0e-7"),
"Relative residual tolerance (to initial error).")
.declare_key("max_it", it::Integer(0), it::Default("10000"),
"Maximum number of outer iterations of the linear solver.")

Definition at line 92 of file linsys.hh.

Mat LinSys::local_matrix
protected

local matrix of subdomain (used in LinSys_MATIS)

Definition at line 321 of file linsys_proposed.hh.

const unsigned LinSys::lsize_
protected

local number of matrix rows (non-overlapping division of rows)

Definition at line 592 of file linsys.hh.

Mat LinSys::matrix
protected

Petsc matrix of the problem.

Definition at line 313 of file linsys_proposed.hh.

bool LinSys::matrix_changed_
protected

true if the matrix was changed since the last solve

Definition at line 602 of file linsys.hh.

int LinSys::max_it_
protected

Definition at line 587 of file linsys.hh.

bool LinSys::negative_definite_
protected

Definition at line 599 of file linsys.hh.

bool LinSys::own_solution
protected

Indicates if the solution array has been allocated by this class.

Definition at line 310 of file linsys_proposed.hh.

bool LinSys::own_solution_
protected

Indicates if the solution array has been allocated by this class.

Definition at line 607 of file linsys.hh.

bool LinSys::positive_definite
protected

Flag for positive definite system.

Definition at line 309 of file linsys_proposed.hh.

bool LinSys::positive_definite_
protected

Definition at line 598 of file linsys.hh.

double LinSys::r_tol_
protected

Definition at line 585 of file linsys.hh.

double LinSys::residual_norm_
protected

local solution array pointing into Vec solution_

Definition at line 609 of file linsys.hh.

LinSys Vector LinSys::RHS
private

Definition at line 186 of file la_linsys_new.hh.

Vec LinSys::rhs
protected

PETSc vector constructed with vx array.

Definition at line 314 of file linsys_proposed.hh.

bool LinSys::rhs_changed_
protected

true if the right hand side was changed since the last solve

Definition at line 603 of file linsys.hh.

const Distribution* LinSys::rows_ds_
protected

final distribution of rows of MH matrix

Definition at line 595 of file linsys.hh.

unsigned LinSys::size_
protected

global number of matrix rows, i.e. problem size

Definition at line 593 of file linsys.hh.

Vec LinSys::solution
protected

PETSc vector constructed with vb array.

Definition at line 315 of file linsys_proposed.hh.

Vec LinSys::solution_
protected

PETSc vector constructed with vb array.

Definition at line 605 of file linsys.hh.

bool LinSys::spd_via_symmetric_general_
protected

Definition at line 600 of file linsys.hh.

SetValuesMode LinSys::status
protected

Set value status of the linear system.

Definition at line 311 of file linsys_proposed.hh.

SetValuesMode LinSys::status_
protected

Set value status of the linear system.

Definition at line 590 of file linsys.hh.

int* LinSys::subdomain_indices
protected

Remember indices which created mapping.

Definition at line 320 of file linsys_proposed.hh.

bool LinSys::symmetric
protected

Flag for the symmetric system.

Definition at line 308 of file linsys_proposed.hh.

bool LinSys::symmetric_
protected

Definition at line 597 of file linsys.hh.

LinSysType LinSys::type

Particular type of the linear system.

MAT_IS or MAT_MPIAIJ anyone can inquire my type

Definition at line 100 of file linsys_proposed.hh.

double* LinSys::v_rhs
protected

RHS vector.

Definition at line 316 of file linsys_proposed.hh.

double* LinSys::v_solution
protected

Vector of solution.

Definition at line 317 of file linsys_proposed.hh.

double* LinSys::v_solution_
protected

local solution array pointing into Vec solution_

Definition at line 606 of file linsys.hh.

Distribution LinSys::vec_ds
protected

Distribution of continuous blocks of system rows among the processors.

Definition at line 307 of file linsys_proposed.hh.


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