Chi-Tech
petsc_utils.h File Reference
#include <petscksp.h>
#include <vector>

Go to the source code of this file.

Data Structures

struct  chi_math::PETScUtils::PETScSolverSetup
 
struct  chi_math::PETScUtils::GhostVecLocalRaw
 

Namespaces

namespace  chi_math
 
namespace  chi_math::PETScUtils
 

Functions

Vec chi_math::PETScUtils::CreateVector (int64_t local_size, int64_t global_size)
 
void chi_math::PETScUtils::CreateVector (Vec &x, int64_t local_size, int64_t global_size)
 
Vec chi_math::PETScUtils::CreateVectorWithGhosts (int64_t local_size, int64_t global_size, int64_t nghosts, const std::vector< int64_t > &ghost_indices)
 
Mat chi_math::PETScUtils::CreateSquareMatrix (int64_t local_size, int64_t global_size)
 
void chi_math::PETScUtils::CreateSquareMatrix (Mat &A, int64_t local_size, int64_t global_size)
 
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)
 
void chi_math::PETScUtils::InitMatrixSparsity (Mat &A, int64_t nodal_nnz_in_diag, int64_t nodal_nnz_off_diag)
 
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)
 
PetscErrorCode chi_math::PETScUtils::RelativeResidualConvergenceTest (KSP ksp, PetscInt n, PetscReal rnorm, KSPConvergedReason *convergedReason, void *monitordestroy)
 
PetscErrorCode chi_math::PETScUtils::KSPMonitorRelativeToRHS (KSP ksp, PetscInt n, PetscReal rnorm, void *)
 
PetscErrorCode chi_math::PETScUtils::KSPMonitorStraight (KSP ksp, PetscInt n, PetscReal rnorm, void *)
 
void chi_math::PETScUtils::CopyVecToSTLvector (Vec x, std::vector< double > &data, size_t N, bool resize_STL=true)
 
void chi_math::PETScUtils::CopyVecToSTLvectorWithGhosts (Vec x, std::vector< double > &data, size_t N, bool resize_STL=true)
 
void chi_math::PETScUtils::CopySTLvectorToVec (const std::vector< double > &data, Vec x, size_t N)
 
void chi_math::PETScUtils::CopyParallelVectorToVec (const ParallelVector &y, Vec x)
 
void chi_math::PETScUtils::CopyGlobalVecToSTLvector (Vec x, const std::vector< int64_t > &global_indices, std::vector< double > &data)
 
void chi_math::PETScUtils::CommunicateGhostEntries (Vec x)
 
GhostVecLocalRaw chi_math::PETScUtils::GetGhostVectorLocalViewRead (Vec x)
 
void chi_math::PETScUtils::RestoreGhostVectorLocalViewRead (Vec x, GhostVecLocalRaw &local_data)