Chi-Tech
|
Data Structures | |
struct | GhostVecLocalRaw |
struct | PETScSolverSetup |
Functions | |
Vec | CreateVector (int64_t local_size, int64_t global_size) |
void | CreateVector (Vec &x, int64_t local_size, int64_t global_size) |
Vec | CreateVectorWithGhosts (int64_t local_size, int64_t global_size, int64_t nghosts, const std::vector< int64_t > &ghost_indices) |
Mat | CreateSquareMatrix (int64_t local_size, int64_t global_size) |
void | CreateSquareMatrix (Mat &A, int64_t local_size, int64_t global_size) |
void | InitMatrixSparsity (Mat &A, const std::vector< int64_t > &nodal_nnz_in_diag, const std::vector< int64_t > &nodal_nnz_off_diag) |
void | InitMatrixSparsity (Mat &A, int64_t nodal_nnz_in_diag, int64_t nodal_nnz_off_diag) |
PETScSolverSetup | CreateCommonKrylovSolverSetup (Mat ref_matrix, const std::string &in_solver_name="KSPSolver", const std::string &in_solver_type=KSPGMRES, const std::string &in_preconditioner_type=PCNONE, double in_relative_residual_tolerance=1.0e-6, int64_t in_maximum_iterations=100) |
PetscErrorCode | RelativeResidualConvergenceTest (KSP ksp, PetscInt n, PetscReal rnorm, KSPConvergedReason *convergedReason, void *monitordestroy) |
PetscErrorCode | KSPMonitorRelativeToRHS (KSP ksp, PetscInt n, PetscReal rnorm, void *) |
PetscErrorCode | KSPMonitorStraight (KSP ksp, PetscInt n, PetscReal rnorm, void *) |
void | CopyVecToSTLvector (Vec x, std::vector< double > &data, size_t N, bool resize_STL=true) |
void | CopyVecToSTLvectorWithGhosts (Vec x, std::vector< double > &data, size_t N, bool resize_STL=true) |
void | CopySTLvectorToVec (const std::vector< double > &data, Vec x, size_t N) |
void | CopyParallelVectorToVec (const ParallelVector &y, Vec x) |
void | CopyGlobalVecToSTLvector (Vec x, const std::vector< int64_t > &global_indices, std::vector< double > &data) |
void | CommunicateGhostEntries (Vec x) |
GhostVecLocalRaw | GetGhostVectorLocalViewRead (Vec x) |
void | RestoreGhostVectorLocalViewRead (Vec x, GhostVecLocalRaw &local_data) |
void chi_math::PETScUtils::CommunicateGhostEntries | ( | Vec | x | ) |
Communicates ghost entries of a ghost vector. This operation is suitable when only a single vector is communicated. When more than vector is communicated it would be more efficient to "Begin" all the vectors followed by and "End" of each vector.
Definition at line 134 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::CopyGlobalVecToSTLvector | ( | Vec | x, |
const std::vector< int64_t > & | global_indices, | ||
std::vector< double > & | data | ||
) |
Copies global values from a PETSc vector to a STL vector.
Definition at line 81 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::CopyParallelVectorToVec | ( | const ParallelVector & | y, |
Vec | x | ||
) |
Definition at line 69 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::CopySTLvectorToVec | ( | const std::vector< double > & | data, |
Vec | x, | ||
size_t | N | ||
) |
Definition at line 57 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::CopyVecToSTLvector | ( | Vec | x, |
std::vector< double > & | data, | ||
size_t | N, | ||
bool | resize_STL = true |
||
) |
Copies a PETSc vector to a STL vector. Only the local portion is copied.
Definition at line 10 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::CopyVecToSTLvectorWithGhosts | ( | Vec | x, |
std::vector< double > & | data, | ||
size_t | N, | ||
bool | resize_STL = true |
||
) |
Copies a PETSc vector to a STL vector. Only the local portion is copied.
Definition at line 36 of file petsc_utils_04_vecmanip.cc.
chi_math::PETScUtils::PETScSolverSetup chi_math::PETScUtils::CreateCommonKrylovSolverSetup | ( | Mat | ref_matrix, |
const std::string & | in_solver_name = "KSPSolver" , |
||
const std::string & | in_solver_type = KSPGMRES , |
||
const std::string & | in_preconditioner_type = PCNONE , |
||
double | in_relative_residual_tolerance = 1.0e-6 , |
||
int64_t | in_maximum_iterations = 100 |
||
) |
Creates a common Krylov-solver setup.
This is a macro for:
Definition at line 35 of file petsc_utils_03_createKSP.cc.
Mat chi_math::PETScUtils::CreateSquareMatrix | ( | int64_t | local_size, |
int64_t | global_size | ||
) |
Creates a general square matrix.
This is a macro for:
Definition at line 25 of file petsc_utils_02_createMat.cc.
void chi_math::PETScUtils::CreateSquareMatrix | ( | Mat & | A, |
int64_t | local_size, | ||
int64_t | global_size | ||
) |
Creates a general square matrix.
This is a macro for:
Definition at line 58 of file petsc_utils_02_createMat.cc.
Vec chi_math::PETScUtils::CreateVector | ( | int64_t | local_size, |
int64_t | global_size | ||
) |
Creates a general vector.
This is a macro for:
Definition at line 18 of file petsc_utils_01_createVec.cc.
void chi_math::PETScUtils::CreateVector | ( | Vec & | x, |
int64_t | local_size, | ||
int64_t | global_size | ||
) |
Creates a general vector.
This is a macro for:
Definition at line 40 of file petsc_utils_01_createVec.cc.
Vec chi_math::PETScUtils::CreateVectorWithGhosts | ( | int64_t | local_size, |
int64_t | global_size, | ||
int64_t | nghosts, | ||
const std::vector< int64_t > & | ghost_indices | ||
) |
Creates a general vector with ghost value support.
This is a macro for:
Definition at line 66 of file petsc_utils_01_createVec.cc.
chi_math::PETScUtils::GhostVecLocalRaw chi_math::PETScUtils::GetGhostVectorLocalViewRead | ( | Vec | x | ) |
Gets a local raw view of a ghost vector.
Definition at line 143 of file petsc_utils_04_vecmanip.cc.
void chi_math::PETScUtils::InitMatrixSparsity | ( | Mat & | A, |
const std::vector< int64_t > & | nodal_nnz_in_diag, | ||
const std::vector< int64_t > & | nodal_nnz_off_diag | ||
) |
Initializes the sparsity pattern of a matrix.
This is a macro for:
Definition at line 84 of file petsc_utils_02_createMat.cc.
void chi_math::PETScUtils::InitMatrixSparsity | ( | Mat & | A, |
int64_t | nodal_nnz_in_diag, | ||
int64_t | nodal_nnz_off_diag | ||
) |
Initializes the sparsity pattern of a matrix.
This is a macro for:
Definition at line 108 of file petsc_utils_02_createMat.cc.
PetscErrorCode chi_math::PETScUtils::KSPMonitorRelativeToRHS | ( | KSP | ksp, |
PetscInt | n, | ||
PetscReal | rnorm, | ||
void * | |||
) |
General monitor that print the residual norm relative to the right-hand side norm.
Definition at line 111 of file petsc_utils_03_createKSP.cc.
PetscErrorCode chi_math::PETScUtils::KSPMonitorStraight | ( | KSP | ksp, |
PetscInt | n, | ||
PetscReal | rnorm, | ||
void * | |||
) |
General monitor that print the residual norm relative to the right-hand side norm.
Definition at line 149 of file petsc_utils_03_createKSP.cc.
PetscErrorCode chi_math::PETScUtils::RelativeResidualConvergenceTest | ( | KSP | ksp, |
PetscInt | n, | ||
PetscReal | rnorm, | ||
KSPConvergedReason * | convergedReason, | ||
void * | monitordestroy | ||
) |
Relative Residual Convergence test. The test uses the L2-norm of the residual ( ), divided by by the L2-norm of the right hand side ( ) compared to a tolerance, .
Definition at line 81 of file petsc_utils_03_createKSP.cc.
void chi_math::PETScUtils::RestoreGhostVectorLocalViewRead | ( | Vec | x, |
GhostVecLocalRaw & | local_data | ||
) |
Gets a local raw view of a ghost vector.
Definition at line 160 of file petsc_utils_04_vecmanip.cc.