Class StaggeredStokesPETScLevelSolver is a concrete PETScLevelSolver for a staggered-grid (MAC) discretization of the incompressible Stokes equations.
More...
#include <ibamr/StaggeredStokesPETScLevelSolver.h>
|
| void | generateASMSubdomains (std::vector< std::set< int > > &overlap_is, std::vector< std::set< int > > &nonoverlap_is) override |
| | Generate IS/subdomains for Schwartz type preconditioners. More...
|
| |
| void | generateFieldSplitSubdomains (std::vector< std::string > &field_names, std::vector< std::set< int > > &field_is) override |
| | Generate IS/subdomains for fieldsplit type preconditioners. More...
|
| |
| void | initializeSolverStateSpecialized (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &b) override |
| | Compute hierarchy dependent data required for solving \(Ax=b\). More...
|
| |
| void | deallocateSolverStateSpecialized () override |
| | Remove all hierarchy dependent data allocated by initializeSolverStateSpecialized(). More...
|
| |
| void | copyToPETScVec (Vec &petsc_x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x) override |
| | Copy a generic vector to the PETSc representation. More...
|
| |
| void | copyFromPETScVec (Vec &petsc_x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x) override |
| | Copy a generic vector from the PETSc representation. More...
|
| |
| void | setupKSPVecs (Vec &petsc_x, Vec &petsc_b, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &b) override |
| | Copy solution and right-hand-side data to the PETSc representation, including any modifications to account for boundary conditions. More...
|
| |
|
| void | setNullSpace (bool contains_constant_vec, const std::vector< SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > > &nullspace_basis_vecs=std::vector< SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > >()) override |
| | Set the nullspace of the linear system. More...
|
| |
| bool | solveSystem (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &b) override |
| | Solve the linear system of equations \(Ax=b\) for \(x\). More...
|
| |
| void | initializeSolverState (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &b) override |
| | Compute hierarchy dependent data required for solving \(Ax=b\). More...
|
| |
| void | deallocateSolverState () override |
| | Remove all hierarchy dependent data allocated by initializeSolverState(). More...
|
| |
| void | init (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, const std::string &default_options_prefix) |
| | Basic initialization. More...
|
| |
| virtual void | setupNullSpace () |
| | Setup the solver nullspace (if any). More...
|
| |
| SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > | d_hierarchy |
| | Associated hierarchy. More...
|
| |
| int | d_level_num = IBTK::invalid_level_number |
| | Associated patch level and C-F boundary (for level numbers > 0). More...
|
| |
| SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > | d_level |
| |
| SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > > | d_cf_boundary |
| |
| SAMRAIDataCache | d_cached_eulerian_data |
| | Scratch data. More...
|
| |
◆ StaggeredStokesPETScLevelSolver() [1/3]
◆ ~StaggeredStokesPETScLevelSolver()
| IBAMR::StaggeredStokesPETScLevelSolver::~StaggeredStokesPETScLevelSolver |
( |
| ) |
|
◆ StaggeredStokesPETScLevelSolver() [2/3]
| IBAMR::StaggeredStokesPETScLevelSolver::StaggeredStokesPETScLevelSolver |
( |
| ) |
|
|
privatedelete |
- Note
- This constructor is not implemented and should not be used.
◆ StaggeredStokesPETScLevelSolver() [3/3]
- Note
- This constructor is not implemented and should not be used.
- Parameters
-
| from | The value to copy to this object. |
◆ allocate_solver()
◆ generateASMSubdomains()
| void IBAMR::StaggeredStokesPETScLevelSolver::generateASMSubdomains |
( |
std::vector< std::set< int > > & |
overlap_is, |
|
|
std::vector< std::set< int > > & |
nonoverlap_is |
|
) |
| |
|
overrideprotectedvirtual |
◆ generateFieldSplitSubdomains()
| void IBAMR::StaggeredStokesPETScLevelSolver::generateFieldSplitSubdomains |
( |
std::vector< std::string > & |
field_names, |
|
|
std::vector< std::set< int > > & |
field_is |
|
) |
| |
|
overrideprotectedvirtual |
◆ initializeSolverStateSpecialized()
◆ deallocateSolverStateSpecialized()
| void IBAMR::StaggeredStokesPETScLevelSolver::deallocateSolverStateSpecialized |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ copyToPETScVec()
◆ copyFromPETScVec()
◆ setupKSPVecs()
◆ operator=()
- Note
- This operator is not implemented and should not be used.
- Parameters
-
| that | The value to assign to this object. |
- Returns
- A reference to this object.
◆ setKSPType()
| void IBTK::PETScLevelSolver::setKSPType |
( |
const std::string & |
ksp_type | ) |
|
|
inherited |
◆ setOptionsPrefix()
| void IBTK::PETScLevelSolver::setOptionsPrefix |
( |
const std::string & |
options_prefix | ) |
|
|
inherited |
◆ getPETScKSP()
| const KSP& IBTK::PETScLevelSolver::getPETScKSP |
( |
| ) |
const |
|
inherited |
◆ getASMSubdomains()
| void IBTK::PETScLevelSolver::getASMSubdomains |
( |
std::vector< IS > ** |
nonoverlapping_subdomains, |
|
|
std::vector< IS > ** |
overlapping_subdomains |
|
) |
| |
|
inherited |
◆ setNullSpace()
◆ solveSystem()
Before calling solveSystem(), the form of the solution x and right-hand-side b vectors must be set properly by the user on all patch interiors on the specified range of levels in the patch hierarchy. The user is responsible for all data management for the quantities associated with the solution and right-hand-side vectors. In particular, patch data in these vectors must be allocated prior to calling this method.
- Parameters
-
| x | solution vector |
| b | right-hand-side vector |
Conditions on Parameters:
- vectors x and b must have same patch hierarchy
- vectors x and b must have same structure, depth, etc.
- Note
- The vector arguments for solveSystem() need not match those for initializeSolverState(). However, there must be a certain degree of similarity, including:
- hierarchy configuration (hierarchy pointer and range of levels)
- number, type and alignment of vector component data
- ghost cell widths of data in the solution x and right-hand-side b vectors
- Note
- The solver need not be initialized prior to calling solveSystem(); however, see initializeSolverState() and deallocateSolverState() for opportunities to save overhead when performing multiple consecutive solves.
- See also
- initializeSolverState
-
deallocateSolverState
- Returns
true if the solver converged to the specified tolerances, false otherwise
Implements IBTK::GeneralSolver.
◆ initializeSolverState()
By default, the solveSystem() method computes some required hierarchy dependent data before solving and removes that data after the solve. For multiple solves that use the same hierarchy configuration, it is more efficient to:
- initialize the hierarchy-dependent data required by the solver via initializeSolverState(),
- solve the system one or more times via solveSystem(), and
- remove the hierarchy-dependent data via deallocateSolverState().
Note that it is generally necessary to reinitialize the solver state when the hierarchy configuration changes.
- Parameters
-
| x | solution vector |
| b | right-hand-side vector |
Conditions on Parameters:
- vectors x and b must have same patch hierarchy
- vectors x and b must have same structure, depth, etc.
- Note
- The vector arguments for solveSystem() need not match those for initializeSolverState(). However, there must be a certain degree of similarity, including:
- hierarchy configuration (hierarchy pointer and range of levels)
- number, type and alignment of vector component data
- ghost cell widths of data in the solution x and right-hand-side b vectors
- Note
- It is safe to call initializeSolverState() when the state is already initialized. In this case, the solver state is first deallocated and then reinitialized.
-
Subclasses of class PETScLevelSolver should not override this method. Instead, they should override the protected method initializeSolverStateSpecialized().
- See also
- deallocateSolverState
Reimplemented from IBTK::GeneralSolver.
◆ deallocateSolverState()
| void IBTK::PETScLevelSolver::deallocateSolverState |
( |
| ) |
|
|
overridevirtualinherited |
- Note
- It is safe to call deallocateSolverState() when the solver state is already deallocated.
-
Subclasses of class PETScLevelSolver should not override this method. Instead, they should override the protected method deallocatedSolverStateSpecialized().
- See also
- initializeSolverState
Reimplemented from IBTK::GeneralSolver.
◆ init() [1/2]
◆ init() [2/2]
| void IBTK::GeneralSolver::init |
( |
const std::string & |
object_name, |
|
|
bool |
homogeneous_bc |
|
) |
| |
|
protectedinherited |
◆ setupNullSpace()
| virtual void IBTK::PETScLevelSolver::setupNullSpace |
( |
| ) |
|
|
protectedvirtualinherited |
◆ PCApply_Additive()
| static PetscErrorCode IBTK::PETScLevelSolver::PCApply_Additive |
( |
PC |
pc, |
|
|
Vec |
x, |
|
|
Vec |
y |
|
) |
| |
|
staticprivateinherited |
◆ PCApply_Multiplicative()
| static PetscErrorCode IBTK::PETScLevelSolver::PCApply_Multiplicative |
( |
PC |
pc, |
|
|
Vec |
x, |
|
|
Vec |
y |
|
) |
| |
|
staticprivateinherited |
◆ PCApply_RedBlackMultiplicative()
| static PetscErrorCode IBTK::PETScLevelSolver::PCApply_RedBlackMultiplicative |
( |
PC |
pc, |
|
|
Vec |
x, |
|
|
Vec |
y |
|
) |
| |
|
staticprivateinherited |
◆ getNullSpaceContainsConstantVector()
| virtual bool IBTK::LinearSolver::getNullSpaceContainsConstantVector |
( |
| ) |
const |
|
virtualinherited |
◆ getNullSpaceBasisVectors()
◆ setInitialGuessNonzero()
| virtual void IBTK::LinearSolver::setInitialGuessNonzero |
( |
bool |
initial_guess_nonzero = true | ) |
|
|
virtualinherited |
◆ getInitialGuessNonzero()
| virtual bool IBTK::LinearSolver::getInitialGuessNonzero |
( |
| ) |
const |
|
virtualinherited |
◆ printClassData()
| virtual void IBTK::LinearSolver::printClassData |
( |
std::ostream & |
stream | ) |
|
|
overridevirtualinherited |
◆ getName()
| const std::string& IBTK::GeneralSolver::getName |
( |
| ) |
const |
|
inherited |
◆ getIsInitialized()
| virtual bool IBTK::GeneralSolver::getIsInitialized |
( |
| ) |
const |
|
virtualinherited |
◆ setHomogeneousBc()
| virtual void IBTK::GeneralSolver::setHomogeneousBc |
( |
bool |
homogeneous_bc | ) |
|
|
virtualinherited |
◆ getHomogeneousBc()
| virtual bool IBTK::GeneralSolver::getHomogeneousBc |
( |
| ) |
const |
|
virtualinherited |
◆ setSolutionTime()
| virtual void IBTK::GeneralSolver::setSolutionTime |
( |
double |
solution_time | ) |
|
|
virtualinherited |
◆ getSolutionTime()
| virtual double IBTK::GeneralSolver::getSolutionTime |
( |
| ) |
const |
|
virtualinherited |
◆ setTimeInterval()
| virtual void IBTK::GeneralSolver::setTimeInterval |
( |
double |
current_time, |
|
|
double |
new_time |
|
) |
| |
|
virtualinherited |
◆ getTimeInterval()
| virtual std::pair<double, double> IBTK::GeneralSolver::getTimeInterval |
( |
| ) |
const |
|
virtualinherited |
◆ getDt()
| virtual double IBTK::GeneralSolver::getDt |
( |
| ) |
const |
|
virtualinherited |
◆ setHierarchyMathOps()
◆ getHierarchyMathOps()
◆ setMaxIterations()
| virtual void IBTK::GeneralSolver::setMaxIterations |
( |
int |
max_iterations | ) |
|
|
virtualinherited |
◆ getMaxIterations()
| virtual int IBTK::GeneralSolver::getMaxIterations |
( |
| ) |
const |
|
virtualinherited |
◆ setAbsoluteTolerance()
| virtual void IBTK::GeneralSolver::setAbsoluteTolerance |
( |
double |
abs_residual_tol | ) |
|
|
virtualinherited |
◆ getAbsoluteTolerance()
| virtual double IBTK::GeneralSolver::getAbsoluteTolerance |
( |
| ) |
const |
|
virtualinherited |
◆ setRelativeTolerance()
| virtual void IBTK::GeneralSolver::setRelativeTolerance |
( |
double |
rel_residual_tol | ) |
|
|
virtualinherited |
◆ getRelativeTolerance()
| virtual double IBTK::GeneralSolver::getRelativeTolerance |
( |
| ) |
const |
|
virtualinherited |
◆ getNumIterations()
| virtual int IBTK::GeneralSolver::getNumIterations |
( |
| ) |
const |
|
virtualinherited |
◆ getResidualNorm()
| virtual double IBTK::GeneralSolver::getResidualNorm |
( |
| ) |
const |
|
virtualinherited |
◆ setLoggingEnabled()
| virtual void IBTK::GeneralSolver::setLoggingEnabled |
( |
bool |
enable_logging = true | ) |
|
|
virtualinherited |
◆ getLoggingEnabled()
| virtual bool IBTK::GeneralSolver::getLoggingEnabled |
( |
| ) |
const |
|
virtualinherited |
◆ initSpecialized()
| virtual void IBTK::GeneralSolver::initSpecialized |
( |
const std::string & |
object_name, |
|
|
bool |
homogeneous_bc |
|
) |
| |
|
protectedvirtualinherited |
◆ setVelocityPoissonSpecifications()
◆ setComponentsHaveNullSpace()
| virtual void IBAMR::StaggeredStokesSolver::setComponentsHaveNullSpace |
( |
const bool |
has_velocity_nullspace, |
|
|
const bool |
has_pressure_nullspace |
|
) |
| |
|
virtualinherited |
◆ setPhysicalBcCoefs()
◆ setPhysicalBoundaryHelper()
◆ d_context
◆ d_num_dofs_per_proc
| std::vector<int> IBAMR::StaggeredStokesPETScLevelSolver::d_num_dofs_per_proc |
|
private |
◆ d_u_dof_index_idx
◆ d_p_dof_index_idx
◆ d_u_nullspace_idx
◆ d_p_nullspace_idx
◆ d_u_dof_index_var
◆ d_u_nullspace_var
◆ d_p_dof_index_var
◆ d_p_nullspace_var
◆ d_data_synch_sched
◆ d_ghost_fill_sched
◆ d_hierarchy
◆ d_level_num
◆ d_level
◆ d_cf_boundary
◆ d_cached_eulerian_data
| SAMRAIDataCache IBTK::PETScLevelSolver::d_cached_eulerian_data |
|
protectedinherited |
◆ d_ksp_type
| std::string IBTK::PETScLevelSolver::d_ksp_type = KSPGMRES |
|
protectedinherited |
◆ d_pc_type
| std::string IBTK::PETScLevelSolver::d_pc_type = PCILU |
|
protectedinherited |
◆ d_shell_pc_type
| std::string IBTK::PETScLevelSolver::d_shell_pc_type |
|
protectedinherited |
◆ d_options_prefix
| std::string IBTK::PETScLevelSolver::d_options_prefix |
|
protectedinherited |
◆ d_petsc_ksp
| KSP IBTK::PETScLevelSolver::d_petsc_ksp = nullptr |
|
protectedinherited |
◆ d_petsc_mat
| Mat IBTK::PETScLevelSolver::d_petsc_mat = nullptr |
|
protectedinherited |
◆ d_petsc_pc
| Mat IBTK::PETScLevelSolver::d_petsc_pc = nullptr |
|
protectedinherited |
◆ d_petsc_nullsp
| MatNullSpace IBTK::PETScLevelSolver::d_petsc_nullsp |
|
protectedinherited |
◆ d_petsc_x
| Vec IBTK::PETScLevelSolver::d_petsc_x = nullptr |
|
protectedinherited |
◆ d_petsc_b
| Vec IBTK::PETScLevelSolver::d_petsc_b = nullptr |
|
protectedinherited |
◆ d_local_x
| Vec IBTK::PETScLevelSolver::d_local_x |
|
protectedinherited |
◆ d_local_y
| Vec IBTK::PETScLevelSolver::d_local_y |
|
protectedinherited |
◆ d_box_size
◆ d_overlap_size
◆ d_n_local_subdomains
| int IBTK::PETScLevelSolver::d_n_local_subdomains |
|
protectedinherited |
◆ d_n_subdomains_max
| int IBTK::PETScLevelSolver::d_n_subdomains_max |
|
protectedinherited |
◆ d_overlap_is
| std::vector<IS> IBTK::PETScLevelSolver::d_overlap_is |
|
protectedinherited |
◆ d_nonoverlap_is
| std::vector<IS> IBTK::PETScLevelSolver::d_nonoverlap_is |
|
protectedinherited |
◆ d_local_overlap_is
| std::vector<IS> IBTK::PETScLevelSolver::d_local_overlap_is |
|
protectedinherited |
◆ d_local_nonoverlap_is
| std::vector<IS> IBTK::PETScLevelSolver::d_local_nonoverlap_is |
|
protectedinherited |
◆ d_restriction
| std::vector<VecScatter> IBTK::PETScLevelSolver::d_restriction |
|
protectedinherited |
◆ d_prolongation
| std::vector<VecScatter> IBTK::PETScLevelSolver::d_prolongation |
|
protectedinherited |
◆ d_sub_ksp
| std::vector<KSP> IBTK::PETScLevelSolver::d_sub_ksp |
|
protectedinherited |
◆ d_sub_mat
| Mat* IBTK::PETScLevelSolver::d_sub_mat |
|
protectedinherited |
◆ d_sub_bc_mat
| Mat * IBTK::PETScLevelSolver::d_sub_bc_mat |
|
protectedinherited |
◆ d_sub_x
| std::vector<Vec> IBTK::PETScLevelSolver::d_sub_x |
|
protectedinherited |
◆ d_sub_y
| std::vector<Vec> IBTK::PETScLevelSolver::d_sub_y |
|
protectedinherited |
◆ d_field_name
| std::vector<std::string> IBTK::PETScLevelSolver::d_field_name |
|
protectedinherited |
◆ d_field_is
| std::vector<IS> IBTK::PETScLevelSolver::d_field_is |
|
protectedinherited |
◆ d_initial_guess_nonzero
| bool IBTK::LinearSolver::d_initial_guess_nonzero = true |
|
protectedinherited |
◆ d_nullspace_contains_constant_vec
| bool IBTK::LinearSolver::d_nullspace_contains_constant_vec = false |
|
protectedinherited |
◆ d_nullspace_basis_vecs
◆ d_object_name
| std::string IBTK::GeneralSolver::d_object_name = "unitialized" |
|
protectedinherited |
◆ d_is_initialized
| bool IBTK::GeneralSolver::d_is_initialized = false |
|
protectedinherited |
◆ d_homogeneous_bc
| bool IBTK::GeneralSolver::d_homogeneous_bc = false |
|
protectedinherited |
◆ d_solution_time
| double IBTK::GeneralSolver::d_solution_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_current_time
| double IBTK::GeneralSolver::d_current_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_new_time
| double IBTK::GeneralSolver::d_new_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_rel_residual_tol
| double IBTK::GeneralSolver::d_rel_residual_tol = 0.0 |
|
protectedinherited |
◆ d_abs_residual_tol
| double IBTK::GeneralSolver::d_abs_residual_tol = 0.0 |
|
protectedinherited |
◆ d_max_iterations
| int IBTK::GeneralSolver::d_max_iterations = 100 |
|
protectedinherited |
◆ d_current_iterations
| int IBTK::GeneralSolver::d_current_iterations = 0 |
|
protectedinherited |
◆ d_current_residual_norm
| double IBTK::GeneralSolver::d_current_residual_norm = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_hier_math_ops
◆ d_hier_math_ops_external
| bool IBTK::GeneralSolver::d_hier_math_ops_external = false |
|
protectedinherited |
◆ d_enable_logging
| bool IBTK::GeneralSolver::d_enable_logging = false |
|
protectedinherited |
◆ d_U_problem_coefs
◆ d_default_U_bc_coef
◆ d_U_bc_coefs
◆ d_default_P_bc_coef
◆ d_P_bc_coef
◆ d_bc_helper
◆ d_has_velocity_nullspace
| bool IBAMR::StaggeredStokesSolver::d_has_velocity_nullspace = false |
|
protectedinherited |
◆ d_has_pressure_nullspace
| bool IBAMR::StaggeredStokesSolver::d_has_pressure_nullspace = false |
|
protectedinherited |
The documentation for this class was generated from the following file: