www.mooseframework.org
Namespaces | Functions
PetscSupport.C File Reference

Go to the source code of this file.

Namespaces

 Moose
 MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to address this in their environment if C++17 compatibility isn't found.
 
 Moose::PetscSupport
 

Functions

void MooseVecView (NumericVector< Number > &vector)
 
void MooseMatView (SparseMatrix< Number > &mat)
 
void MooseVecView (const NumericVector< Number > &vector)
 
void MooseMatView (const SparseMatrix< Number > &mat)
 
std::string Moose::PetscSupport::stringify (const LineSearchType &t)
 
std::string Moose::PetscSupport::stringify (const MffdType &t)
 
void Moose::PetscSupport::setSolverOptions (const SolverParams &solver_params)
 
void Moose::PetscSupport::petscSetupDM (NonlinearSystemBase &nl, const std::string &dm_name)
 Setup the PETSc DM object. More...
 
void Moose::PetscSupport::addPetscOptionsFromCommandline ()
 
void Moose::PetscSupport::petscSetOptions (const PetscOptions &po, const SolverParams &solver_params)
 A function for setting the PETSc options in PETSc from the options supplied to MOOSE. More...
 
PetscErrorCode Moose::PetscSupport::petscSetupOutput (CommandLine *cmd_line)
 
PetscErrorCode Moose::PetscSupport::petscNonlinearConverged (SNES snes, PetscInt it, PetscReal xnorm, PetscReal snorm, PetscReal fnorm, SNESConvergedReason *reason, void *ctx)
 
PCSide Moose::PetscSupport::getPetscPCSide (Moose::PCSideType pcs)
 
KSPNormType Moose::PetscSupport::getPetscKSPNormType (Moose::MooseKSPNormType kspnorm)
 
void Moose::PetscSupport::petscSetDefaultKSPNormType (FEProblemBase &problem, KSP ksp)
 Set norm type. More...
 
void Moose::PetscSupport::petscSetDefaultPCSide (FEProblemBase &problem, KSP ksp)
 Setup which side we want to apply preconditioner. More...
 
void Moose::PetscSupport::petscSetKSPDefaults (FEProblemBase &problem, KSP ksp)
 Set the default options for a KSP. More...
 
void Moose::PetscSupport::petscSetDefaults (FEProblemBase &problem)
 Sets the default options for PETSc. More...
 
void Moose::PetscSupport::storePetscOptions (FEProblemBase &fe_problem, const InputParameters &params)
 Stores the PETSc options supplied from the InputParameters with MOOSE. More...
 
void Moose::PetscSupport::processPetscFlags (const MultiMooseEnum &petsc_flags, PetscOptions &petsc_options)
 Populate flags in a given PetscOptions object using a vector of input arguments. More...
 
void Moose::PetscSupport::processPetscPairs (const std::vector< std::pair< MooseEnumItem, std::string >> &petsc_pair_options, const unsigned int mesh_dimension, PetscOptions &petsc_options)
 Populate name and value pairs in a given PetscOptions object using vectors of input arguments. More...
 
std::set< std::string > Moose::PetscSupport::getPetscValidLineSearches ()
 Returns the valid petsc line search options as a set of strings. More...
 
InputParameters Moose::PetscSupport::getPetscValidParams ()
 Returns the PETSc options that are common between Executioners and Preconditioners. More...
 
MultiMooseEnum Moose::PetscSupport::getCommonPetscFlags ()
 A helper function to produce a MultiMooseEnum with commonly used PETSc single options (flags) More...
 
MultiMooseEnum Moose::PetscSupport::getCommonPetscKeys ()
 A helper function to produce a MultiMooseEnum with commonly used PETSc iname options (keys in key-value pairs) More...
 
bool Moose::PetscSupport::isSNESVI (FEProblemBase &fe_problem)
 check if SNES type is variational inequalities (VI) solver More...
 
void Moose::PetscSupport::setSinglePetscOption (const std::string &name, const std::string &value="")
 A wrapper function for dealing with different versions of PetscOptionsSetValue. More...
 
void Moose::PetscSupport::colorAdjacencyMatrix (PetscScalar *adjacency_matrix, unsigned int size, unsigned int colors, std::vector< unsigned int > &vertex_colors, const char *coloring_algorithm)
 This method takes an adjacency matrix, and a desired number of colors and applies a graph coloring algorithm to produce a coloring. More...
 
void Moose::PetscSupport::disableNonlinearConvergedReason (FEProblemBase &fe_problem)
 disable printing of the nonlinear convergence reason More...
 
void Moose::PetscSupport::disableLinearConvergedReason (FEProblemBase &fe_problem)
 disable printing of the linear convergence reason More...
 

Function Documentation

◆ MooseMatView() [1/2]

void MooseMatView ( SparseMatrix< Number > &  mat)

Definition at line 66 of file PetscSupport.C.

67 {
68  PetscMatrix<Number> & petsc_mat = static_cast<PetscMatrix<Number> &>(mat);
69  MatView(petsc_mat.mat(), 0);
70 }

◆ MooseMatView() [2/2]

void MooseMatView ( const SparseMatrix< Number > &  mat)

Definition at line 81 of file PetscSupport.C.

82 {
83  PetscMatrix<Number> & petsc_mat =
84  static_cast<PetscMatrix<Number> &>(const_cast<SparseMatrix<Number> &>(mat));
85  MatView(petsc_mat.mat(), 0);
86 }

◆ MooseVecView() [1/2]

void MooseVecView ( NumericVector< Number > &  vector)

Definition at line 59 of file PetscSupport.C.

60 {
61  PetscVector<Number> & petsc_vec = static_cast<PetscVector<Number> &>(vector);
62  VecView(petsc_vec.vec(), 0);
63 }

◆ MooseVecView() [2/2]

void MooseVecView ( const NumericVector< Number > &  vector)

Definition at line 73 of file PetscSupport.C.

74 {
75  PetscVector<Number> & petsc_vec =
76  static_cast<PetscVector<Number> &>(const_cast<NumericVector<Number> &>(vector));
77  VecView(petsc_vec.vec(), 0);
78 }