Flow123d  jenkins-Flow123d-linux-release-multijob-282
Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
LinSys_BDDC Class Reference

#include <linsys_BDDC.hh>

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

Public Member Functions

 LinSys_BDDC (const unsigned numDofsSub, const Distribution *rows_ds, const int matrixTypeInt=0, const int numSubLoc=1, const bool swap_sign=false)
 
void load_mesh (const int nDim, const int numNodes, const int numDofs, const std::vector< int > &inet, const std::vector< int > &nnet, const std::vector< int > &nndf, const std::vector< int > &isegn, const std::vector< int > &isngn, const std::vector< int > &isvgvn, const std::vector< double > &xyz, const std::vector< double > &element_permeability, const int meshDim)
 
void mat_set_values (int nrow, int *rows, int ncol, int *cols, double *vals)
 
void rhs_set_values (int nrow, int *rows, double *vals)
 
void diagonal_weights_set_value (int global_index, double value)
 
PetscErrorCode mat_zero_entries () override
 
PetscErrorCode rhs_zero_entries () override
 
void finish_assembly ()
 
void apply_constrains (double scalar=1.)
 
int solve ()
 
void set_from_input (const Input::Record in_rec)
 
double get_solution_precision ()
 
 ~LinSys_BDDC ()
 
- 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)
 
const Vec & get_solution ()
 
void set_solution (double *sol_array)
 
double * get_solution_array ()
 
virtual void start_allocation ()
 
virtual void start_add_assembly ()
 
virtual void start_insert_assembly ()
 
void mat_set_value (int row, int col, double val)
 
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)
 
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 ~LinSys ()
 

Static Public Attributes

static Input::Type::Record input_type
 
- Static Public Attributes inherited from LinSys
static Input::Type::AbstractRecord input_type
 

Private Types

typedef la::BddcmlWrapper Bddcml_
 

Private Attributes

int max_nondecr_it_
 parameters expected from input file: More...
 
int number_of_levels_
 number of levels in the multilevel method More...
 
bool use_adaptive_bddc_
 should adaptive BDDC be used? More...
 
int bddcml_verbosity_level_
 
const bool swap_sign_
 swap sign of matrix and rhs entries, e.g. to make the matrix SPD More...
 
std::vector< int > isngn_
 indices of subdomain nodes in global numbering More...
 
std::vector< double > locSolution_
 subdomain solution More...
 
Vec locSolVec_
 local solution PETSc vector - sequential More...
 
VecScatter VSpetscToSubScatter_
 scatter from solution_ to locSolVec_ More...
 
Bddcml_bddcml_
 BDDCML wrapper. More...
 

Additional Inherited Members

- Public Types inherited from LinSys
enum  SetValuesMode {
  INSERT =INSERT_VALUES, ADD =ADD_VALUES, ALLOCATE, DONE,
  NONE
}
 
- 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_
 

Detailed Description

Definition at line 47 of file linsys_BDDC.hh.

Member Typedef Documentation

Definition at line 114 of file linsys_BDDC.hh.

Constructor & Destructor Documentation

LinSys_BDDC::LinSys_BDDC ( const unsigned  numDofsSub,
const Distribution rows_ds,
const int  matrixTypeInt = 0,
const int  numSubLoc = 1,
const bool  swap_sign = false 
)

Definition at line 62 of file linsys_BDDC.cc.

LinSys_BDDC::~LinSys_BDDC ( )

Definition at line 300 of file linsys_BDDC.cc.

Member Function Documentation

void LinSys_BDDC::apply_constrains ( double  scalar = 1.)
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?

Implements LinSys.

Definition at line 240 of file linsys_BDDC.cc.

void LinSys_BDDC::diagonal_weights_set_value ( int  global_index,
double  value 
)

Definition at line 210 of file linsys_BDDC.cc.

void LinSys_BDDC::finish_assembly ( )
virtual

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

Implements LinSys.

Definition at line 233 of file linsys_BDDC.cc.

double LinSys_BDDC::get_solution_precision ( )
virtual

Get precision of solving

Implements LinSys.

Definition at line 368 of file linsys_BDDC.cc.

void LinSys_BDDC::load_mesh ( const int  nDim,
const int  numNodes,
const int  numDofs,
const std::vector< int > &  inet,
const std::vector< int > &  nnet,
const std::vector< int > &  nndf,
const std::vector< int > &  isegn,
const std::vector< int > &  isngn,
const std::vector< int > &  isvgvn,
const std::vector< double > &  xyz,
const std::vector< double > &  element_permeability,
const int  meshDim 
)

Definition at line 113 of file linsys_BDDC.cc.

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

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

Implements LinSys.

Definition at line 164 of file linsys_BDDC.cc.

PetscErrorCode LinSys_BDDC::mat_zero_entries ( )
overridevirtual

Clears entries of the matrix

Reimplemented from LinSys.

Definition at line 217 of file linsys_BDDC.cc.

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

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

Implements LinSys.

Definition at line 189 of file linsys_BDDC.cc.

PetscErrorCode LinSys_BDDC::rhs_zero_entries ( )
overridevirtual

Clears entries of the right-hand side

Reimplemented from LinSys.

Definition at line 225 of file linsys_BDDC.cc.

void LinSys_BDDC::set_from_input ( const Input::Record  in_rec)
virtual

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

Reimplemented from LinSys.

Definition at line 287 of file linsys_BDDC.cc.

int LinSys_BDDC::solve ( )
virtual

Solve the system and return convergence reason.

Implements LinSys.

Definition at line 247 of file linsys_BDDC.cc.

Member Data Documentation

Bddcml_* LinSys_BDDC::bddcml_
private

BDDCML wrapper.

Definition at line 115 of file linsys_BDDC.hh.

int LinSys_BDDC::bddcml_verbosity_level_
private

level of verbosity of BDDCML library ( 0 - only fatal errors reported, 1 - mild output, 2 - detailed output )//!< should adaptive BDDC be used?

Definition at line 102 of file linsys_BDDC.hh.

it::Record LinSys_BDDC::input_type
static
Initial value:
= it::Record("Bddc", "Solver setting.")
.declare_key("max_nondecr_it", it::Integer(0), it::Default("30"),
"Maximum number of iterations of the linear solver with non-decreasing residual.")
.declare_key("number_of_levels", it::Integer(0), it::Default("2"),
"Number of levels in the multilevel method (=2 for the standard BDDC).")
.declare_key("use_adaptive_bddc", it::Bool(), it::Default("false"),
"Use adaptive selection of constraints in BDDCML.")
.declare_key("bddcml_verbosity_level", it::Integer(0,2), it::Default("0"),
"Level of verbosity of the BDDCML library: 0 - no output, 1 - mild output, 2 - detailed output.")

Definition at line 51 of file linsys_BDDC.hh.

std::vector<int> LinSys_BDDC::isngn_
private

indices of subdomain nodes in global numbering

Definition at line 109 of file linsys_BDDC.hh.

std::vector<double> LinSys_BDDC::locSolution_
private

subdomain solution

Definition at line 110 of file linsys_BDDC.hh.

Vec LinSys_BDDC::locSolVec_
private

local solution PETSc vector - sequential

Definition at line 111 of file linsys_BDDC.hh.

int LinSys_BDDC::max_nondecr_it_
private

parameters expected from input file:

maximum number of iterations of linear solver with non-decreasing residual

Definition at line 99 of file linsys_BDDC.hh.

int LinSys_BDDC::number_of_levels_
private

number of levels in the multilevel method

Definition at line 100 of file linsys_BDDC.hh.

const bool LinSys_BDDC::swap_sign_
private

swap sign of matrix and rhs entries, e.g. to make the matrix SPD

Definition at line 107 of file linsys_BDDC.hh.

bool LinSys_BDDC::use_adaptive_bddc_
private

should adaptive BDDC be used?

Definition at line 101 of file linsys_BDDC.hh.

VecScatter LinSys_BDDC::VSpetscToSubScatter_
private

scatter from solution_ to locSolVec_

Definition at line 112 of file linsys_BDDC.hh.


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