Classes | |
class | PetscOptions |
A struct for storing the various types of petsc options and values. More... | |
Functions | |
void | petscSetOptions (const PetscOptions &po, const SolverParams &solver_params) |
A function for setting the PETSc options in PETSc from the options supplied to MOOSE. More... | |
void | petscSetKSPDefaults (FEProblemBase &problem, KSP ksp) |
Set the default options for a KSP. More... | |
template<typename T > | |
void | setLinearSolverDefaults (FEProblemBase &problem, LinearSolver< T > &linear_solver) |
Set the defaults for a libMesh LinearSolver. More... | |
void | petscSetDefaults (FEProblemBase &problem) |
Sets the default options for PETSc. More... | |
void | petscSetupDM (NonlinearSystemBase &nl, const std::string &dm_name) |
Setup the PETSc DM object. More... | |
PetscErrorCode | petscSetupOutput (CommandLine *cmd_line) |
void | outputNorm (libMesh::Real old_norm, libMesh::Real norm, bool use_color=false) |
Helper function for outputting the norm values with/without color. More... | |
PetscErrorCode | petscLinearMonitor (KSP, PetscInt its, PetscReal rnorm, void *void_ptr) |
Helper function for displaying the linear residual during PETSC solve. More... | |
void | storePetscOptions (FEProblemBase &fe_problem, const InputParameters ¶ms) |
Stores the PETSc options supplied from the InputParameters with MOOSE. More... | |
void | processPetscFlags (const MultiMooseEnum &petsc_flags, PetscOptions &petsc_options) |
Populate flags in a given PetscOptions object using a vector of input arguments. More... | |
void | 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 > | getPetscValidLineSearches () |
Returns the valid petsc line search options as a set of strings. More... | |
InputParameters | getPetscValidParams () |
Returns the PETSc options that are common between Executioners and Preconditioners. More... | |
MultiMooseEnum | getCommonPetscFlags () |
A helper function to produce a MultiMooseEnum with commonly used PETSc single options (flags) More... | |
MultiMooseEnum | getCommonPetscKeys () |
A helper function to produce a MultiMooseEnum with commonly used PETSc iname options (keys in key-value pairs) More... | |
bool | isSNESVI (FEProblemBase &fe_problem) |
check if SNES type is variational inequalities (VI) solver More... | |
void | setSinglePetscOption (const std::string &name, const std::string &value="") |
A wrapper function for dealing with different versions of PetscOptionsSetValue. More... | |
void | addPetscOptionsFromCommandline () |
void | petscSetDefaultPCSide (FEProblemBase &problem, KSP ksp) |
Setup which side we want to apply preconditioner. More... | |
void | petscSetDefaultKSPNormType (FEProblemBase &problem, KSP ksp) |
Set norm type. More... | |
void | 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 | disableNonlinearConvergedReason (FEProblemBase &fe_problem) |
disable printing of the nonlinear convergence reason More... | |
void | disableLinearConvergedReason (FEProblemBase &fe_problem) |
disable printing of the linear convergence reason More... | |
std::string | stringify (const LineSearchType &t) |
std::string | stringify (const MffdType &t) |
void | setSolverOptions (const SolverParams &solver_params) |
PetscErrorCode | petscNonlinearConverged (SNES snes, PetscInt it, PetscReal xnorm, PetscReal snorm, PetscReal fnorm, SNESConvergedReason *reason, void *ctx) |
PCSide | getPetscPCSide (Moose::PCSideType pcs) |
KSPNormType | getPetscKSPNormType (Moose::MooseKSPNormType kspnorm) |
void Moose::PetscSupport::addPetscOptionsFromCommandline | ( | ) |
Definition at line 221 of file PetscSupport.C.
Referenced by petscSetOptions(), and Moose::SlepcSupport::slepcSetOptions().
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.
The coloring is returned as a vector of unsigned integers indicating which color or group each vextex in the adjacency matrix belongs to.
Definition at line 953 of file PetscSupport.C.
void Moose::PetscSupport::disableLinearConvergedReason | ( | FEProblemBase & | fe_problem | ) |
disable printing of the linear convergence reason
Definition at line 1034 of file PetscSupport.C.
Referenced by CommonOutputAction::act().
void Moose::PetscSupport::disableNonlinearConvergedReason | ( | FEProblemBase & | fe_problem | ) |
disable printing of the nonlinear convergence reason
Definition at line 1021 of file PetscSupport.C.
Referenced by CommonOutputAction::act().
MultiMooseEnum Moose::PetscSupport::getCommonPetscFlags | ( | ) |
A helper function to produce a MultiMooseEnum with commonly used PETSc single options (flags)
Definition at line 883 of file PetscSupport.C.
Referenced by getPetscValidParams(), AddFieldSplitAction::validParams(), and Split::validParams().
MultiMooseEnum Moose::PetscSupport::getCommonPetscKeys | ( | ) |
A helper function to produce a MultiMooseEnum with commonly used PETSc iname options (keys in key-value pairs)
Definition at line 895 of file PetscSupport.C.
Referenced by getPetscValidParams(), and AddFieldSplitAction::validParams().
KSPNormType Moose::PetscSupport::getPetscKSPNormType | ( | Moose::MooseKSPNormType | kspnorm | ) |
Definition at line 433 of file PetscSupport.C.
Referenced by petscSetDefaultKSPNormType().
PCSide Moose::PetscSupport::getPetscPCSide | ( | Moose::PCSideType | pcs | ) |
Definition at line 416 of file PetscSupport.C.
Referenced by petscSetDefaultPCSide().
std::set< std::string > Moose::PetscSupport::getPetscValidLineSearches | ( | ) |
Returns the valid petsc line search options as a set of strings.
Definition at line 842 of file PetscSupport.C.
Referenced by FEProblemSolve::validParams().
InputParameters Moose::PetscSupport::getPetscValidParams | ( | ) |
Returns the PETSc options that are common between Executioners and Preconditioners.
The output of this function should be added to the the parameters object of the overarching class
Definition at line 848 of file PetscSupport.C.
Referenced by FEProblemSolve::validParams(), and MoosePreconditioner::validParams().
bool Moose::PetscSupport::isSNESVI | ( | FEProblemBase & | fe_problem | ) |
check if SNES type is variational inequalities (VI) solver
Definition at line 911 of file PetscSupport.C.
Referenced by BoundsBase::BoundsBase().
void Moose::PetscSupport::outputNorm | ( | libMesh::Real | old_norm, |
libMesh::Real | norm, | ||
bool | use_color = false |
||
) |
Helper function for outputting the norm values with/without color.
PetscErrorCode Moose::PetscSupport::petscLinearMonitor | ( | KSP | , |
PetscInt | its, | ||
PetscReal | rnorm, | ||
void * | void_ptr | ||
) |
Helper function for displaying the linear residual during PETSC solve.
PetscErrorCode Moose::PetscSupport::petscNonlinearConverged | ( | SNES | snes, |
PetscInt | it, | ||
PetscReal | xnorm, | ||
PetscReal | snorm, | ||
PetscReal | fnorm, | ||
SNESConvergedReason * | reason, | ||
void * | ctx | ||
) |
Definition at line 277 of file PetscSupport.C.
Referenced by petscSetDefaults().
void Moose::PetscSupport::petscSetDefaultKSPNormType | ( | FEProblemBase & | problem, |
KSP | ksp | ||
) |
Set norm type.
Definition at line 454 of file PetscSupport.C.
Referenced by Moose::SlepcSupport::mooseSlepcEPSSNESKSPSetPCSide(), and petscSetKSPDefaults().
void Moose::PetscSupport::petscSetDefaultPCSide | ( | FEProblemBase & | problem, |
KSP | ksp | ||
) |
Setup which side we want to apply preconditioner.
Definition at line 464 of file PetscSupport.C.
Referenced by Moose::SlepcSupport::mooseSlepcEPSSNESKSPSetPCSide(), and petscSetKSPDefaults().
void Moose::PetscSupport::petscSetDefaults | ( | FEProblemBase & | problem | ) |
Sets the default options for PETSc.
Definition at line 499 of file PetscSupport.C.
Referenced by FEProblemBase::initPetscOutputAndSomeSolverSettings(), and Moose::setSolverDefaults().
void Moose::PetscSupport::petscSetKSPDefaults | ( | FEProblemBase & | problem, |
KSP | ksp | ||
) |
Set the default options for a KSP.
Definition at line 477 of file PetscSupport.C.
Referenced by petscSetDefaults(), and setLinearSolverDefaults().
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.
Definition at line 239 of file PetscSupport.C.
Referenced by Moose::SlepcSupport::slepcSetOptions(), FEProblemBase::solve(), and FEProblemBase::solveLinearSystem().
void Moose::PetscSupport::petscSetupDM | ( | NonlinearSystemBase & | nl, |
const std::string & | dm_name | ||
) |
Setup the PETSc DM object.
Definition at line 176 of file PetscSupport.C.
Referenced by NonlinearSystemBase::setupDM().
PetscErrorCode Moose::PetscSupport::petscSetupOutput | ( | CommandLine * | cmd_line | ) |
Definition at line 261 of file PetscSupport.C.
Referenced by MooseApp::executeExecutioner().
void Moose::PetscSupport::processPetscFlags | ( | const MultiMooseEnum & | petsc_flags, |
PetscOptions & | petsc_options | ||
) |
Populate flags in a given PetscOptions object using a vector of input arguments.
petsc_flags | Container holding the flags of the petsc options |
petsc_options | Data structure which handles petsc options within moose |
"-log_summary" cannot be used in the input file. This option needs to be set when PETSc is initialized which happens before the parser is even created. We'll throw an error if somebody attempts to add this option later.
"-log_summary" cannot be used in the input file. This option needs to be set when PETSc is initialized which happens before the parser is even created. We'll throw an error if somebody attempts to add this option later.
Definition at line 603 of file PetscSupport.C.
Referenced by storePetscOptions().
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.
petsc_pair_options | Option-value pairs of petsc settings |
mesh_dimension | The mesh dimension, needed for multigrid settings |
petsc_options | Data structure which handles petsc options within moose |
Definition at line 643 of file PetscSupport.C.
Referenced by DiffusionPhysicsBase::addPreconditioning(), and storePetscOptions().
void Moose::PetscSupport::setLinearSolverDefaults | ( | FEProblemBase & | problem, |
LinearSolver< T > & | linear_solver | ||
) |
Set the defaults for a libMesh LinearSolver.
Used in explicit solves
Definition at line 70 of file PetscSupport.h.
Referenced by ExplicitTimeIntegrator::meshChanged().
void Moose::PetscSupport::setSinglePetscOption | ( | const std::string & | name, |
const std::string & | value = "" |
||
) |
A wrapper function for dealing with different versions of PetscOptionsSetValue.
This is not generally called from MOOSE code, it is instead intended to be called by stuff in MOOSE::PetscSupport.
Definition at line 933 of file PetscSupport.C.
Referenced by Moose::SlepcSupport::clearFreeNonlinearPowerIterations(), petscSetOptions(), Moose::SlepcSupport::setEigenProblemOptions(), Moose::SlepcSupport::setEigenSolverOptions(), Moose::SlepcSupport::setFreeNonlinearPowerIterations(), Moose::SlepcSupport::setNewtonPetscOptions(), Moose::SlepcSupport::setNonlinearPowerOptions(), Moose::SlepcSupport::setSlepcEigenSolverTolerances(), setSolverOptions(), Moose::SlepcSupport::setWhichEigenPairsOptions(), and Moose::SlepcSupport::slepcSetOptions().
void Moose::PetscSupport::setSolverOptions | ( | const SolverParams & | solver_params | ) |
Definition at line 139 of file PetscSupport.C.
Referenced by petscSetOptions().
void Moose::PetscSupport::storePetscOptions | ( | FEProblemBase & | fe_problem, |
const InputParameters & | params | ||
) |
Stores the PETSc options supplied from the InputParameters with MOOSE.
Definition at line 543 of file PetscSupport.C.
Referenced by SetupPreconditionerAction::act(), and FEProblemSolve::FEProblemSolve().
std::string Moose::PetscSupport::stringify | ( | const LineSearchType & | t | ) |
Definition at line 95 of file PetscSupport.C.
Referenced by setSolverOptions().
std::string Moose::PetscSupport::stringify | ( | const MffdType & | t | ) |
Definition at line 124 of file PetscSupport.C.