https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
SlepcEigenSolverConfiguration Class Reference

#include <SlepcEigenSolverConfiguration.h>

Inheritance diagram for SlepcEigenSolverConfiguration:
[legend]

Public Member Functions

 SlepcEigenSolverConfiguration (EigenProblem &eigen_problem, libMesh::SlepcEigenSolver< libMesh::Number > &slepc_eigen_solver, const NonlinearEigenSystem &nl_eigen_sys)
 Constructur: get a reference to the SlepcEigenSolver variable to be able to manipulate it.
 
virtual void configure_solver () override
 
virtual void set_options_during_init ()
 
virtual void respond_to_solve_failure (unsigned int)
 

Static Public Member Functions

static std::string get_info ()
 
static void print_info (std::ostream &out_stream=libMesh::out)
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 

Public Attributes

std::map< std::string, Real > real_valued_data
 
std::map< std::string, intint_valued_data
 
std::map< std::string, std::string > string_data
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

void increment_constructor_count (const std::string &name) noexcept
 
void increment_destructor_count (const std::string &name) noexcept
 

Static Protected Attributes

static Counts _counts
 
static Threads::atomic< unsigned int_n_objects
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter
 

Private Attributes

EigenProblem_eigen_problem
 
libMesh::SlepcEigenSolver< libMesh::Number > & _slepc_solver
 The slepc eigen solver object that we are configuring.
 
const NonlinearEigenSystem_nl_eigen_sys
 The system that owns the SLEPc solver.
 

Detailed Description

Definition at line 26 of file SlepcEigenSolverConfiguration.h.

Constructor & Destructor Documentation

◆ SlepcEigenSolverConfiguration()

SlepcEigenSolverConfiguration::SlepcEigenSolverConfiguration ( EigenProblem eigen_problem,
libMesh::SlepcEigenSolver< libMesh::Number > &  slepc_eigen_solver,
const NonlinearEigenSystem nl_eigen_sys 
)

Constructur: get a reference to the SlepcEigenSolver variable to be able to manipulate it.

Constructor: get a reference to the SlepcEigenSolver variable to be able to manipulate it.

Definition at line 24 of file SlepcEigenSolverConfiguration.C.

29 _eigen_problem(eigen_problem),
30 _slepc_solver(slepc_eigen_solver),
31 _nl_eigen_sys(nl_eigen_sys)
32{
33}
libMesh::SlepcEigenSolver< libMesh::Number > & _slepc_solver
The slepc eigen solver object that we are configuring.
const NonlinearEigenSystem & _nl_eigen_sys
The system that owns the SLEPc solver.

Member Function Documentation

◆ configure_solver()

void SlepcEigenSolverConfiguration::configure_solver ( )
overridevirtual

Implements libMesh::SolverConfiguration.

Definition at line 36 of file SlepcEigenSolverConfiguration.C.

37{
39 {
40 // Set custom monitors for SNES and KSP
42 // Let us remove extra "eps_power" from SNES since users do not like it
43 LibmeshPetscCallA(_eigen_problem.comm().get(),
45 // Let us hook up a customize PC if users ask. Users still can use PETSc options to override
46 // this setting
48 LibmeshPetscCallA(_eigen_problem.comm().get(),
50 // Let set a default PC side. I would like to have the setting be consistent with
51 // what we do in regular nonlinear executioner. Petsc options are able to override
52 // this setting
53 LibmeshPetscCallA(
56 // A customized stopping test for nonlinear free power iterations.
57 // Nonlinear power iterations need to be marked as converged in EPS to
58 // retrieve solution from SLEPc EPS.
59 LibmeshPetscCallA(_eigen_problem.comm().get(),
60 EPSSetStoppingTestFunction(_slepc_solver.eps(),
63 NULL));
64
65 // Remove all SLEPc monitors.
66 LibmeshPetscCallA(_eigen_problem.comm().get(), EPSMonitorCancel(_slepc_solver.eps()));
67 // A customized EPS monitor in moose. We need to print only eigenvalue
68 LibmeshPetscCallA(
70 EPSMonitorSet(
72 }
73}
bool isNonlinearEigenvalueSolver(unsigned int eigen_sys_num) const
virtual void initPetscOutputAndSomeSolverSettings() override
Hook up monitors for SNES and KSP.
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
bool _customized_pc_for_eigen
unsigned int number() const
Gets the number of this system.
const Parallel::Communicator & comm() const
PetscErrorCode mooseSlepcEPSSNESKSPSetPCSide(FEProblemBase &problem, EPS eps)
Allow users to specify PC side.
PetscErrorCode mooseSlepcEPSSNESSetCustomizePC(EPS eps)
Attach a customized PC.
PetscErrorCode mooseSlepcEPSSNESSetUpOptionPrefix(EPS eps)
Get rid of prefix "-eps_power" for SNES, KSP, PC, etc.
PetscErrorCode mooseSlepcEPSMonitor(EPS eps, PetscInt its, PetscInt nconv, PetscScalar *eigr, PetscScalar *eigi, PetscReal *errest, PetscInt nest, void *mctx)
A customized solver monitor to print out eigenvalue.
PetscErrorCode mooseSlepcStoppingTest(EPS eps, PetscInt its, PetscInt max_it, PetscInt nconv, PetscInt nev, EPSConvergedReason *reason, void *ctx)
A customized convergence checker.

Member Data Documentation

◆ _eigen_problem

EigenProblem& SlepcEigenSolverConfiguration::_eigen_problem
private

Definition at line 39 of file SlepcEigenSolverConfiguration.h.

Referenced by configure_solver().

◆ _nl_eigen_sys

const NonlinearEigenSystem& SlepcEigenSolverConfiguration::_nl_eigen_sys
private

The system that owns the SLEPc solver.

Definition at line 47 of file SlepcEigenSolverConfiguration.h.

Referenced by configure_solver().

◆ _slepc_solver

libMesh::SlepcEigenSolver<libMesh::Number>& SlepcEigenSolverConfiguration::_slepc_solver
private

The slepc eigen solver object that we are configuring.

Definition at line 44 of file SlepcEigenSolverConfiguration.h.

Referenced by configure_solver().


The documentation for this class was generated from the following files: