Overview
FullFACPreconditioner is a concrete IBTK::FACPreconditioner implementing a FAC (full approximation scheme multigrid) preconditioner. It is optimised for use as a single-pass preconditioner inside a Krylov solver rather than as a stand-alone iterative solver, and is particularly efficient when pre-smoothing sweeps are not required.
Namespace: multiphase
Header: multiphase/FullFACPreconditioner.h
The class extends IBTK::FACPreconditioner and adds support for a dense patch hierarchy. When initialised, it can clone a base AMR hierarchy into a uniformly refined (dense) hierarchy, apply the multigrid cycle on that dense hierarchy, and transfer results back. This avoids complications that arise from applying coarse-level relaxation on a hierarchy with refinement gaps.
This class is not suitable for use as a stand-alone solver. Use it only as a preconditioner in conjunction with an iterative Krylov method such as
IBTK::PETScKrylovLinearSolver.Input database parameters
The following keys are read from the input database passed to the constructor. All have sensible defaults and need not be specified unless you want to override them.Constructor
Unique name for this preconditioner object, used in logging and the SAMRAI object registry.
Strategy object that implements the level smoothing, restriction, and prolongation operations. Typically a
MultiphaseStaggeredStokesBoxRelaxationFACOperator.Input database from which
cycle_type, num_pre_sweeps, num_post_sweeps, and enable_logging are read.Prefix string used when constructing default option names, e.g. for PETSc option handling within the strategy.
Methods
solveSystem
true if the solver converged to the specified tolerances, false otherwise.
Patch data in x and b must be allocated on all patch interiors over the hierarchy range before calling this method. If initializeSolverState has not been called, the solver initialises and deallocates hierarchy-dependent data automatically around the solve.
Solution vector. Must be allocated on all patches; initial values are used as the starting iterate.
Right-hand-side vector. Must have the same patch hierarchy and variable structure as
x.initializeSolverState
solveSystem. Call this once before a sequence of solves on the same hierarchy to avoid redundant setup overhead. Safe to call when state is already initialised; existing state is deallocated first.
When any operator or preconditioner objects have been registered with this class, they are also initialised by this call.
Representative solution vector defining the hierarchy configuration, variable structure, and ghost cell widths.
Representative right-hand-side vector. Must match
x in hierarchy and structure.deallocateSolverState
initializeSolverState. Also deallocates any registered operator or preconditioner objects. Safe to call when already deallocated.
Call this after the last solve in a sequence, or whenever the hierarchy configuration changes and a fresh initializeSolverState will be required.
transferToDense
deallocate_data is true, the dense-hierarchy patch data is automatically deallocated when deallocateSolverState is called.
Use this to make non-solution data (e.g. the volume fraction or drag coefficient) available to the FAC strategy on the dense hierarchy.
When
true, the transferred data on the dense hierarchy is freed during deallocateSolverState. Set to false if you manage deallocation manually.getDenseHierarchy
initializeSolverState by filling all refinement gaps of the base hierarchy with additional patch levels.
Returns a null pointer if initializeSolverState has not yet been called.