aAMG
This class is used to manage the adaptive AMG preconditioner. More…
#include "aAMG.h"
Inherits from Preconditioner, MatrixProd
Public Functions
| Name | |
|---|---|
| virtual void | Prepare_MxV(const iReg nRHS) Prepares the preconditioner application to a vector (DDMat). |
| virtual void | UndoPrepare_MxV() Undo the data structure necessary for MxV. |
| virtual void | MxV(DDMat & RHS, DDMat & SOL, bool Barrier_flag) Applies the preconditioner to a vector (DDMat): prec(A) * RHS = SOL. |
| virtual void | MxM(DSMat & Mat, DSMat & PrecMat) Applies the preconditioner to a matrix (DSMat). |
| virtual iReg | get_nrows() const Retrieve the number of rows. |
| virtual iExt | Get_nnz() const Returns an estimate of the number of non-zeroes of the preconditioner application. |
| virtual long int | Get_FlopEst() const Returns an estimate of the number of FLOPS needed to perform the preconditioner application. |
| virtual void | Set_Parameters(const void * params) Sets the aAMG parameters. |
| virtual void | Print_ASCII(const string & filename) const Prints the Operator in ASCII format. |
| virtual bool | isOnGPU() const Check if the matrix is on GPU. |
| aAMG() Constructs the object. |
|
| aAMG & | operator=(aAMG const & other) Copy operator. |
| void | print_OperStats(FILE * ofile) Prints the operator statistics for the whole hierarchy. |
| void | print_Times(FILE * ofile) Prints the times needed to compute the whole hierarchy. |
| ~aAMG() Deletes the object. |
|
| virtual void | copy(MatrixProd const & other) Copy operator. |
| virtual void | Compute(DSMat & mat_A, DDMat *restrict V0 =nullptr) Computes the AMG preconditioner in a distributed memory environment. |
| virtual void | Compute(MatrixProd & mat_A, DDMat *restrict V0 =nullptr) |
| int | Set_mech() Sets default configuration for mechanical problems. |
| int | Set_mech_SRQCG(int niter_SRQCG) Sets the number of iterations of SRQGC for the construction of the test space for mechanical problems. |
| int | Set_mech_smoother_type(int smoother_type) Sets the smoother type for mechanical problems. |
| int | Set_mech_prol_SmoothEmin(int prol_SmoothEmin) Sets the flag for the prolongation smoothing for mechanical problems. |
| int | Set_mech_prol_Emin_tol(rExt prol_Emin_tol) Sets the tol for the prolongation emin for mechanical problems. |
| int | Set_cfd() Sets default configuration for cfd problems. |
| int | Set_cfd_smoother_type(int smoother_type) Sets the smoother type for cfd problems. |
| int | Set_cfd_prolongation_type(int prolongation_type) Sets the prolongationr type for cfd problems. |
| void | SetParms_from_XML(const xml_document & input_xml) Set AMG parameters from XML file. |
| virtual void | DumpAllParms(FILE * ofile) const Dumps all of the AMG parameters. |
| void | setDefaultParameters() Set default parameters. |
| void | Set_CycleType(const int input_CycleType) Sets the multigrid cycle type. |
| void | Set_maxNlevel(const int input_maxNlevel) Sets the maximum number of levels. |
| void | Set_maxCoarseSize(const int input_maxCoarseSize) Sets the maximum size of the coarsen grid. |
| void | TSPACE_Set_ntv(const int input_ntv) Sets the Tspace’s number of test vectors. |
| void | TSPACE_Set_method(const int input_method) Sets the Eigensolver used to compute test vectors. |
| void | TSPACE_Set_maxITER(const int input_maxITER) Sets the Tspace’s Maximum number of iterations. |
| void | TSPACE_Set_exitTOL(const double input_exitTOL) Sets the Tspace’s exit tolerance. |
| void | TSPACE_Set_orth_freq(const int input_orth_freq) Sets the Tspace’s orth_freq. |
| void | TSPACE_Set_ritz_freq(const int input_ritz_freq) Sets the Tspace’s ritz_freq. |
| void | COARSEN_Set_type(const int input_type) Sets the Coarsen’s type. |
| void | COARSEN_Set_tau(const double input_tau) Sets the Coarsen’s tolerance for filtering. |
| void | COARSEN_Set_tau_jump(const double input_tau_jump) Sets the Coarsen’s tolerance for filtering. |
| void | PROLONGATION_Set_type(const int input_type) Sets the Prolongation’s type. |
| void | PROLONGATION_Set_nPow(const int input_nPow) Sets the Prolongation’s power pattern. |
| void | PROLONGATION_Set_SmoothEmin(int input_SmoothEmin) Sets the Prolongation’s smoothing/emin. |
| void | PROLONGATION_Set_maxrownrm(const double input_maxrownrm) Sets the Prolongation’s maxrownrm. |
| void | PROLONGATION_Set_maxcond(const double input_maxcond) Sets the Prolongation’s maxcond. |
| void | PROLONGATION_Set_itmax_vol(const int input_itmax_vol) Sets the Prolongation’s itmax_vol. |
| void | PROLONGATION_Set_tol_vol(const double input_tol_vol) Sets the Prolongation’s tol_vol. |
| void | PROLONGATION_Set_eps(const double input_eps) Sets the Prolongation’s eps. |
| void | PROLONGATION_Set_dist_min(const int input_dist_min) Sets the Prolongation’s dist_min. |
| void | PROLONGATION_Set_dist_max(const int input_dist_max) Sets the Prolongation’s dist_max. |
| void | PROLONGATION_Set_mmax(const int input_mmax) Sets the Prolongartion’s mmax. |
| void | EMIN_Set_SoC_type(const int input_SoC_type) Sets the type of Strength of Connection (SoC) |
| void | EMIN_Set_SoC_tau(const double input_SoC_tau) Sets the Strength of Connection (SoC) drop tolerance. |
| void | EMIN_Set_patt_power(const int input_patt_power) Sets the power for P sparsity pattern. |
| void | EMIN_Set_nnzr_patt(const int input_nnzr_patt) Sets the number of nonzeroes per row in P. |
| void | EMIN_Set_condmax(const double input_condmax) Sets the max conditioning allowed in a subblock. |
| void | EMIN_Set_prec_type(const int input_prec_type) Sets the preconditioning type. |
| void | EMIN_Set_itmax(const int input_itmax) Sets the max PCG iterations. |
| void | EMIN_Set_tol(const double input_tol) Sets the exit PCG tolerance. |
| void | FILTER_Set_Prol_Weight(const double input_Prol_Weight) Sets Prol_Weight. |
| void | FILTER_Set_Prol_Tol(const double input_Prol_Tol) Sets Prol_Tol. |
| void | FILTER_Set_Oper_Weight(const double input_Oper_Weight) Sets Oper_Weight. |
| void | FILTER_Set_Oper_nlevel(const int input_Oper_nlevel) Sets Oper_nlevel. |
| void | SMOOTHER_Set_type(const int input_type) Sets the Smoother’s type. |
| void | SMOOTHER_Set_omega(const double input_omega) Sets the Smoother’s weight. |
| void | SMOOTHER_Set_itmax_maxeig(const int input_itmax_maxeig) Sets the Maximum number of iterations to compute max eigenvalue (estimate omega). |
| void | SMOOTHER_Set_tol_maxeig(const double input_tol_maxeig) Sets the Exit tolerance to compute max eigenvalue (estimate omega). |
| void | SMOOTHER_Set_nupre(const int input_nupre) Sets the Number of pre-smoothing steps. |
| void | SMOOTHER_Set_nupost(const int input_nupost) Sets the Number of post-smoothing steps. |
| void | SMOOTHER_Set_aFSAI_CompType(const int input_afsai_CompType) Sets the computation type. |
| void | SMOOTHER_Set_aFSAI_GatherType(const int input_afsai_GatherType) Sets the Gather type. |
| void | SMOOTHER_Set_aFSAI_BPowerDistK(const int input_afsai_BPowerDistK) Sets the Requested power for the gathered matrix. |
| void | SMOOTHER_Set_aFSAI_nstep(const int input_afsai_nstep) Sets the Number of steps for computing the adaptive FSAI Smoother. |
| void | SMOOTHER_Set_aFSAI_step_size(const int input_afsai_step_size) Sets the Step size for computing the adaptive FSAI Smoother. |
| void | SMOOTHER_Set_aFSAI_eps(const double input_afsai_eps) Sets the Exit tolerance for computing the adaptive FSAI Smoother. |
| void | SMOOTHER_Set_aFSAI_tau_pref(const double input_afsai_tau_pref) Sets the pre-filtering Drop tolerance (static). |
| void | SMOOTHER_Set_aFSAI_pow_patt(const int input_afsai_pow_patt) Sets the power of the static pattern (static). |
| void | SMOOTHER_Set_aFSAI_nnzr_max(const int input_afsai_nnzr_max) Sets the maximum number of non-zeros per row (static). |
| void | SMOOTHER_Set_aFSAI_tau_posf(const double input_afsai_tau_posf) Sets the pre-filtering Drop tolerance (static). |
Protected Functions
| Name | |
|---|---|
| virtual iGlo | Get_Globalnrows_inner() const Retrieve the global number of rows. |
| virtual bool | Check_inner() const |
| void | copy_aAMG(aAMG const & other) Copy members. |
Additional inherited members
Public Functions inherited from Preconditioner
| Name | |
|---|---|
| virtual | ~Preconditioner() =0 Deletes the object. |
Protected Functions inherited from Preconditioner
| Name | |
|---|---|
| void | copy_Preconditioner(Preconditioner const & other) Copy members. |
Public Functions inherited from MatrixProd
| Name | |
|---|---|
| bool | get_Prepared_flag() const Get flag for MxV prepare. |
| iReg | get_nRHS_prep() const Get the number of rhs the matrix is prepared for. |
| iGlo | Get_Globalnrows() const Retrieve the global number of rows using internal variable. |
| iGlo | Get_Globalnrows() Retrieve the global number of rows using internal variable. |
| void | set_Prepared_flag(const bool input_Prepared_flag) Get flag for MxV prepare. |
| bool | Check() Checks that the MatrixProd instance has been correctly constructed. |
| virtual | ~MatrixProd() =0 Deletes the object. |
Protected Functions inherited from MatrixProd
| Name | |
|---|---|
| void | copy_MatrixProd(MatrixProd const & other) Copy members. |
Protected Attributes inherited from MatrixProd
| Name | |
|---|---|
| iGlo | glob_nrows total number of rows (matrix size). |
| bool | Prepared_flag flag for MxV prepare. |
| iReg | nRHS_prep number of rhs the matrix is prepared for |
Detailed Description
class aAMG;
This class is used to manage the adaptive AMG preconditioner.
class aAMG.
Public Functions Documentation
function Prepare_MxV
virtual void Prepare_MxV(
const iReg nRHS
)
Prepares the preconditioner application to a vector (DDMat).
Parameters:
- nRHS number of Right Hand Sides.
Reimplements: Preconditioner::Prepare_MxV
function UndoPrepare_MxV
virtual void UndoPrepare_MxV()
Undo the data structure necessary for MxV.
Reimplements: Preconditioner::UndoPrepare_MxV
function MxV
virtual void MxV(
DDMat & RHS,
DDMat & SOL,
bool Barrier_flag
)
Applies the preconditioner to a vector (DDMat): prec(A) * RHS = SOL.
Parameters:
- x vector that multiplies the Preconditioner.
- b vector where result is stored.
- Barrier_flag if true global Barrier is called before return.
Reimplements: Preconditioner::MxV
function MxM
virtual void MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the preconditioner to a matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
Reimplements: Preconditioner::MxM
function get_nrows
virtual iReg get_nrows() const
Retrieve the number of rows.
Reimplements: Preconditioner::get_nrows
function Get_nnz
virtual iExt Get_nnz() const
Returns an estimate of the number of non-zeroes of the preconditioner application.
Reimplements: Preconditioner::Get_nnz
function Get_FlopEst
virtual long int Get_FlopEst() const
Returns an estimate of the number of FLOPS needed to perform the preconditioner application.
Reimplements: Preconditioner::Get_FlopEst
function Set_Parameters
virtual void Set_Parameters(
const void * params
)
Sets the aAMG parameters.
Parameters:
- params input parameters.
Reimplements: Preconditioner::Set_Parameters
function Print_ASCII
virtual void Print_ASCII(
const string & filename
) const
Prints the Operator in ASCII format.
Reimplements: Preconditioner::Print_ASCII
function isOnGPU
virtual bool isOnGPU() const
Check if the matrix is on GPU.
Reimplements: Preconditioner::isOnGPU
function aAMG
aAMG()
Constructs the object.
function operator=
aAMG & operator=(
aAMG const & other
)
Copy operator.
function print_OperStats
void print_OperStats(
FILE * ofile
)
Prints the operator statistics for the whole hierarchy.
Parameters:
- *ofile output file.
function print_Times
void print_Times(
FILE * ofile
)
Prints the times needed to compute the whole hierarchy.
Parameters:
- *ofile output file.
function ~aAMG
~aAMG()
Deletes the object.
function copy
virtual void copy(
MatrixProd const & other
)
Copy operator.
Reimplements: Preconditioner::copy
function Compute
virtual void Compute(
DSMat & mat_A,
DDMat *__restrict__ V0 =nullptr
)
Computes the AMG preconditioner in a distributed memory environment.
Parameters:
- mat_A system matrix.
Reimplements: Preconditioner::Compute
function Compute
virtual void Compute(
MatrixProd & mat_A,
DDMat *__restrict__ V0 =nullptr
)
Reimplements: Preconditioner::Compute
function Set_mech
int Set_mech()
Sets default configuration for mechanical problems.
Return: 0 → no errors 1 → wrong input data
niter_SRQCG = 10 smoother_type = medium aFSAI prol_smoothing = true
function Set_mech_SRQCG
int Set_mech_SRQCG(
int niter_SRQCG
)
Sets the number of iterations of SRQGC for the construction of the test space for mechanical problems.
Return: 0 → no errors 1 → wrong input data
function Set_mech_smoother_type
int Set_mech_smoother_type(
int smoother_type
)
Sets the smoother type for mechanical problems.
Return: 0 → no errors 1 → wrong input data
0 → Jacobi 1 → light aFSAI 2 → medium aFSAI 3 → heavy aFSAI
function Set_mech_prol_SmoothEmin
int Set_mech_prol_SmoothEmin(
int prol_SmoothEmin
)
Sets the flag for the prolongation smoothing for mechanical problems.
Return: 0 → no errors 1 → wrong input data
function Set_mech_prol_Emin_tol
int Set_mech_prol_Emin_tol(
rExt prol_Emin_tol
)
Sets the tol for the prolongation emin for mechanical problems.
Return: 0 → no errors 1 → wrong input data
function Set_cfd
int Set_cfd()
Sets default configuration for cfd problems.
Return: 0 → no errors 1 → wrong input data
smoother_type = light aFSAI prolong_type = Exti+i
function Set_cfd_smoother_type
int Set_cfd_smoother_type(
int smoother_type
)
Sets the smoother type for cfd problems.
Return: 0 → no errors 1 → wrong input data
0 → Jacobi 1 → light aFSAI (DEFAULT) 2 → medium aFSAI 3 → heavy aFSAI
function Set_cfd_prolongation_type
int Set_cfd_prolongation_type(
int prolongation_type
)
Sets the prolongationr type for cfd problems.
Return: 0 → no errors 1 → wrong input data
0 → Classical 1 → EXT+I (DEFAULT) 2 → Hybrid
function SetParms_from_XML
void SetParms_from_XML(
const xml_document & input_xml
)
Set AMG parameters from XML file.
function DumpAllParms
virtual void DumpAllParms(
FILE * ofile
) const
Dumps all of the AMG parameters.
Reimplements: Preconditioner::DumpAllParms
function setDefaultParameters
void setDefaultParameters()
Set default parameters.
Parameters:
- paramsOut aAMG general parameters
function Set_CycleType
inline void Set_CycleType(
const int input_CycleType
)
Sets the multigrid cycle type.
function Set_maxNlevel
inline void Set_maxNlevel(
const int input_maxNlevel
)
Sets the maximum number of levels.
function Set_maxCoarseSize
inline void Set_maxCoarseSize(
const int input_maxCoarseSize
)
Sets the maximum size of the coarsen grid.
function TSPACE_Set_ntv
inline void TSPACE_Set_ntv(
const int input_ntv
)
Sets the Tspace’s number of test vectors.
function TSPACE_Set_method
inline void TSPACE_Set_method(
const int input_method
)
Sets the Eigensolver used to compute test vectors.
function TSPACE_Set_maxITER
inline void TSPACE_Set_maxITER(
const int input_maxITER
)
Sets the Tspace’s Maximum number of iterations.
function TSPACE_Set_exitTOL
inline void TSPACE_Set_exitTOL(
const double input_exitTOL
)
Sets the Tspace’s exit tolerance.
function TSPACE_Set_orth_freq
inline void TSPACE_Set_orth_freq(
const int input_orth_freq
)
Sets the Tspace’s orth_freq.
function TSPACE_Set_ritz_freq
inline void TSPACE_Set_ritz_freq(
const int input_ritz_freq
)
Sets the Tspace’s ritz_freq.
function COARSEN_Set_type
inline void COARSEN_Set_type(
const int input_type
)
Sets the Coarsen’s type.
function COARSEN_Set_tau
inline void COARSEN_Set_tau(
const double input_tau
)
Sets the Coarsen’s tolerance for filtering.
function COARSEN_Set_tau_jump
inline void COARSEN_Set_tau_jump(
const double input_tau_jump
)
Sets the Coarsen’s tolerance for filtering.
function PROLONGATION_Set_type
inline void PROLONGATION_Set_type(
const int input_type
)
Sets the Prolongation’s type.
function PROLONGATION_Set_nPow
inline void PROLONGATION_Set_nPow(
const int input_nPow
)
Sets the Prolongation’s power pattern.
function PROLONGATION_Set_SmoothEmin
inline void PROLONGATION_Set_SmoothEmin(
int input_SmoothEmin
)
Sets the Prolongation’s smoothing/emin.
function PROLONGATION_Set_maxrownrm
inline void PROLONGATION_Set_maxrownrm(
const double input_maxrownrm
)
Sets the Prolongation’s maxrownrm.
function PROLONGATION_Set_maxcond
inline void PROLONGATION_Set_maxcond(
const double input_maxcond
)
Sets the Prolongation’s maxcond.
function PROLONGATION_Set_itmax_vol
inline void PROLONGATION_Set_itmax_vol(
const int input_itmax_vol
)
Sets the Prolongation’s itmax_vol.
function PROLONGATION_Set_tol_vol
inline void PROLONGATION_Set_tol_vol(
const double input_tol_vol
)
Sets the Prolongation’s tol_vol.
function PROLONGATION_Set_eps
inline void PROLONGATION_Set_eps(
const double input_eps
)
Sets the Prolongation’s eps.
function PROLONGATION_Set_dist_min
inline void PROLONGATION_Set_dist_min(
const int input_dist_min
)
Sets the Prolongation’s dist_min.
function PROLONGATION_Set_dist_max
inline void PROLONGATION_Set_dist_max(
const int input_dist_max
)
Sets the Prolongation’s dist_max.
function PROLONGATION_Set_mmax
inline void PROLONGATION_Set_mmax(
const int input_mmax
)
Sets the Prolongartion’s mmax.
function EMIN_Set_SoC_type
inline void EMIN_Set_SoC_type(
const int input_SoC_type
)
Sets the type of Strength of Connection (SoC)
function EMIN_Set_SoC_tau
inline void EMIN_Set_SoC_tau(
const double input_SoC_tau
)
Sets the Strength of Connection (SoC) drop tolerance.
function EMIN_Set_patt_power
inline void EMIN_Set_patt_power(
const int input_patt_power
)
Sets the power for P sparsity pattern.
function EMIN_Set_nnzr_patt
inline void EMIN_Set_nnzr_patt(
const int input_nnzr_patt
)
Sets the number of nonzeroes per row in P.
function EMIN_Set_condmax
inline void EMIN_Set_condmax(
const double input_condmax
)
Sets the max conditioning allowed in a subblock.
function EMIN_Set_prec_type
inline void EMIN_Set_prec_type(
const int input_prec_type
)
Sets the preconditioning type.
function EMIN_Set_itmax
inline void EMIN_Set_itmax(
const int input_itmax
)
Sets the max PCG iterations.
function EMIN_Set_tol
inline void EMIN_Set_tol(
const double input_tol
)
Sets the exit PCG tolerance.
function FILTER_Set_Prol_Weight
inline void FILTER_Set_Prol_Weight(
const double input_Prol_Weight
)
Sets Prol_Weight.
function FILTER_Set_Prol_Tol
inline void FILTER_Set_Prol_Tol(
const double input_Prol_Tol
)
Sets Prol_Tol.
function FILTER_Set_Oper_Weight
inline void FILTER_Set_Oper_Weight(
const double input_Oper_Weight
)
Sets Oper_Weight.
function FILTER_Set_Oper_nlevel
inline void FILTER_Set_Oper_nlevel(
const int input_Oper_nlevel
)
Sets Oper_nlevel.
function SMOOTHER_Set_type
inline void SMOOTHER_Set_type(
const int input_type
)
Sets the Smoother’s type.
function SMOOTHER_Set_omega
inline void SMOOTHER_Set_omega(
const double input_omega
)
Sets the Smoother’s weight.
function SMOOTHER_Set_itmax_maxeig
inline void SMOOTHER_Set_itmax_maxeig(
const int input_itmax_maxeig
)
Sets the Maximum number of iterations to compute max eigenvalue (estimate omega).
function SMOOTHER_Set_tol_maxeig
inline void SMOOTHER_Set_tol_maxeig(
const double input_tol_maxeig
)
Sets the Exit tolerance to compute max eigenvalue (estimate omega).
function SMOOTHER_Set_nupre
inline void SMOOTHER_Set_nupre(
const int input_nupre
)
Sets the Number of pre-smoothing steps.
function SMOOTHER_Set_nupost
inline void SMOOTHER_Set_nupost(
const int input_nupost
)
Sets the Number of post-smoothing steps.
function SMOOTHER_Set_aFSAI_CompType
inline void SMOOTHER_Set_aFSAI_CompType(
const int input_afsai_CompType
)
Sets the computation type.
function SMOOTHER_Set_aFSAI_GatherType
inline void SMOOTHER_Set_aFSAI_GatherType(
const int input_afsai_GatherType
)
Sets the Gather type.
function SMOOTHER_Set_aFSAI_BPowerDistK
inline void SMOOTHER_Set_aFSAI_BPowerDistK(
const int input_afsai_BPowerDistK
)
Sets the Requested power for the gathered matrix.
function SMOOTHER_Set_aFSAI_nstep
inline void SMOOTHER_Set_aFSAI_nstep(
const int input_afsai_nstep
)
Sets the Number of steps for computing the adaptive FSAI Smoother.
function SMOOTHER_Set_aFSAI_step_size
inline void SMOOTHER_Set_aFSAI_step_size(
const int input_afsai_step_size
)
Sets the Step size for computing the adaptive FSAI Smoother.
function SMOOTHER_Set_aFSAI_eps
inline void SMOOTHER_Set_aFSAI_eps(
const double input_afsai_eps
)
Sets the Exit tolerance for computing the adaptive FSAI Smoother.
function SMOOTHER_Set_aFSAI_tau_pref
inline void SMOOTHER_Set_aFSAI_tau_pref(
const double input_afsai_tau_pref
)
Sets the pre-filtering Drop tolerance (static).
function SMOOTHER_Set_aFSAI_pow_patt
inline void SMOOTHER_Set_aFSAI_pow_patt(
const int input_afsai_pow_patt
)
Sets the power of the static pattern (static).
function SMOOTHER_Set_aFSAI_nnzr_max
inline void SMOOTHER_Set_aFSAI_nnzr_max(
const int input_afsai_nnzr_max
)
Sets the maximum number of non-zeros per row (static).
function SMOOTHER_Set_aFSAI_tau_posf
inline void SMOOTHER_Set_aFSAI_tau_posf(
const double input_afsai_tau_posf
)
Sets the pre-filtering Drop tolerance (static).
Protected Functions Documentation
function Get_Globalnrows_inner
virtual iGlo Get_Globalnrows_inner() const
Retrieve the global number of rows.
Reimplements: Preconditioner::Get_Globalnrows_inner
function Check_inner
virtual bool Check_inner() const
Reimplements: Preconditioner::Check_inner
Internal check of consistency of the aAMG instance.
function copy_aAMG
void copy_aAMG(
aAMG const & other
)
Copy members.
Updated on 19 November 2024 at 10:20:48 CET