Class PETScMFFDJacobianOperator provides a method for computing Jacobian-vector products, i.e., \( F'[x]v \), via a matrix-free finite-difference approach.
#include <ibtk/PETScMFFDJacobianOperator.h>
|
| SAMRAI::tbox::Pointer< GeneralOperator > | d_F |
| |
| SAMRAI::tbox::Pointer< PETScNewtonKrylovSolver > | d_nonlinear_solver |
| |
| Mat | d_petsc_jac = nullptr |
| |
| SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > | d_op_u |
| |
| SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > | d_op_x |
| |
| SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > | d_op_y |
| |
| Vec | d_petsc_u = nullptr |
| |
| Vec | d_petsc_x = nullptr |
| |
| Vec | d_petsc_y = nullptr |
| |
| std::string | d_options_prefix |
| |
| void | apply (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &y) override |
| | Compute y=Ax. More...
|
| |
| void | initializeOperatorState (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &in, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &out) override |
| | Compute hierarchy dependent data required for computing y=Ax and z=Ax+y. More...
|
| |
| void | deallocateOperatorState () override |
| | Remove all hierarchy dependent data allocated by initializeOperatorState(). More...
|
| |
| | PETScMFFDJacobianOperator ()=delete |
| | Default constructor. More...
|
| |
| | PETScMFFDJacobianOperator (const PETScMFFDJacobianOperator &from)=delete |
| | Copy constructor. More...
|
| |
| PETScMFFDJacobianOperator & | operator= (const PETScMFFDJacobianOperator &that)=delete |
| | Assignment operator. More...
|
| |
| static PetscErrorCode | FormFunction_SAMRAI (void *p_ctx, Vec x, Vec f) |
| |
◆ PETScMFFDJacobianOperator() [1/3]
| IBTK::PETScMFFDJacobianOperator::PETScMFFDJacobianOperator |
( |
std::string |
object_name, |
|
|
std::string |
options_prefix = "" |
|
) |
| |
◆ ~PETScMFFDJacobianOperator()
| IBTK::PETScMFFDJacobianOperator::~PETScMFFDJacobianOperator |
( |
| ) |
|
◆ PETScMFFDJacobianOperator() [2/3]
| IBTK::PETScMFFDJacobianOperator::PETScMFFDJacobianOperator |
( |
| ) |
|
|
privatedelete |
- Note
- This constructor is not implemented and should not be used.
◆ PETScMFFDJacobianOperator() [3/3]
- Note
- This constructor is not implemented and should not be used.
- Parameters
-
| from | The value to copy to this object. |
◆ setOperator()
◆ setNewtonKrylovSolver()
◆ formJacobian()
◆ getBaseVector()
◆ apply()
Before calling this function, the form of the vectors x and y should be set properly by the user on all patch interiors on the range of levels covered by the operator. All data in these vectors should be allocated. The user is responsible for managing the storage for the vectors.
Conditions on arguments:
- vectors must have same hierarchy
- vectors must have same variables (except that x must have enough ghost cells for computation of Ax).
In general, the vectors x and y cannot be the same.
- Note
- The operator MUST be initialized prior to calling apply.
- See also
- initializeOperatorState
- Parameters
-
Implements IBTK::GeneralOperator.
◆ initializeOperatorState()
The vector arguments for apply(), applyAdd(), etc, need not match those for initializeOperatorState(). However, there must be a certain degree of similarity, including
- hierarchy configuration (hierarchy pointer and level range)
- number, type and alignment of vector component data
- ghost cell widths of data in the input and output vectors
- Note
- It is generally necessary to reinitialize the operator state when the hierarchy configuration changes.
It is safe to call initializeOperatorState() when the state is already initialized. In this case, the operator state is first deallocated and then reinitialized.
Conditions on arguments:
- input and output vectors must have same hierarchy
- input and output vectors must have same structure, depth, etc.
Call deallocateOperatorState() to remove any data allocated by this method.
- See also
- deallocateOperatorState
- Parameters
-
| in | input vector |
| out | output vector |
- Note
- The default implementation is empty.
Reimplemented from IBTK::GeneralOperator.
◆ deallocateOperatorState()
| void IBTK::PETScMFFDJacobianOperator::deallocateOperatorState |
( |
| ) |
|
|
overridevirtual |
◆ 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.
◆ FormFunction_SAMRAI()
| static PetscErrorCode IBTK::PETScMFFDJacobianOperator::FormFunction_SAMRAI |
( |
void * |
p_ctx, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
staticprivate |
◆ modifyRhsForBcs()
Before calling this function, the form of the vector y should be set properly by the user on all patch interiors on the range of levels covered by the operator. All data in this vector should be allocated. The user is responsible for managing the storage for the vectors.
- Note
- The operator MUST be initialized prior to calling modifyRhsForBcs.
- See also
- initializeOperatorState
- Note
- A default implementation evaluates y := y - A*0.
Reimplemented from IBTK::GeneralOperator.
◆ getName()
| const std::string& IBTK::GeneralOperator::getName |
( |
| ) |
const |
|
inherited |
◆ getIsInitialized()
| virtual bool IBTK::GeneralOperator::getIsInitialized |
( |
| ) |
const |
|
virtualinherited |
◆ setHomogeneousBc()
| virtual void IBTK::GeneralOperator::setHomogeneousBc |
( |
bool |
homogeneous_bc | ) |
|
|
virtualinherited |
◆ getHomogeneousBc()
| virtual bool IBTK::GeneralOperator::getHomogeneousBc |
( |
| ) |
const |
|
virtualinherited |
◆ setSolutionTime()
| virtual void IBTK::GeneralOperator::setSolutionTime |
( |
double |
solution_time | ) |
|
|
virtualinherited |
◆ getSolutionTime()
| virtual double IBTK::GeneralOperator::getSolutionTime |
( |
| ) |
const |
|
virtualinherited |
◆ setTimeInterval()
| virtual void IBTK::GeneralOperator::setTimeInterval |
( |
double |
current_time, |
|
|
double |
new_time |
|
) |
| |
|
virtualinherited |
◆ getTimeInterval()
| virtual std::pair<double, double> IBTK::GeneralOperator::getTimeInterval |
( |
| ) |
const |
|
virtualinherited |
◆ getDt()
| virtual double IBTK::GeneralOperator::getDt |
( |
| ) |
const |
|
virtualinherited |
◆ setHierarchyMathOps()
◆ getHierarchyMathOps()
◆ applyAdd()
Before calling applyAdd(), the form of the vectors x, y, and z should 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 vectors. In particular, patch data in these vectors must be allocated prior to calling this method.
- Parameters
-
| x | input vector |
| y | input vector |
| z | output vector, i.e., \(z=F[x]+y\) |
Conditions on Parameters:
- vectors x, y, and z must have same hierarchy
- vectors x, y, and z must have same structure, depth, etc.
In general, the vectors x and y cannot be the same.
- Note
- Subclasses may require that the operator be initialized prior to calling applyAdd().
- See also
- initializeOperatorState
- Note
- A default implementation is provided which employs apply() and SAMRAI::solv::SAMRAIVectorReal::add().
Reimplemented in IBTK::PETScSNESJacobianJOWrapper, and IBTK::PETScMatLOWrapper.
◆ imposeSolBcs()
Before calling this function, the form of the vector y should be set properly by the user on all patch interiors on the range of levels covered by the operator. All data in this vector should be allocated. The user is responsible for managing the storage for the vectors.
- Note
- The operator MUST be initialized prior to calling imposeSolBcs.
- See also
- initializeOperatorState
- Note
- A default implementation does not modify the sol vector u.
◆ setLoggingEnabled()
| virtual void IBTK::GeneralOperator::setLoggingEnabled |
( |
bool |
enable_logging = true | ) |
|
|
virtualinherited |
◆ getLoggingEnabled()
| virtual bool IBTK::GeneralOperator::getLoggingEnabled |
( |
| ) |
const |
|
virtualinherited |
◆ printClassData()
| virtual void IBTK::GeneralOperator::printClassData |
( |
std::ostream & |
stream | ) |
|
|
virtualinherited |
◆ d_F
◆ d_nonlinear_solver
◆ d_petsc_jac
| Mat IBTK::PETScMFFDJacobianOperator::d_petsc_jac = nullptr |
|
private |
◆ d_op_u
◆ d_op_x
◆ d_op_y
◆ d_petsc_u
| Vec IBTK::PETScMFFDJacobianOperator::d_petsc_u = nullptr |
|
private |
◆ d_petsc_x
| Vec IBTK::PETScMFFDJacobianOperator::d_petsc_x = nullptr |
|
private |
◆ d_petsc_y
| Vec IBTK::PETScMFFDJacobianOperator::d_petsc_y = nullptr |
|
private |
◆ d_options_prefix
| std::string IBTK::PETScMFFDJacobianOperator::d_options_prefix |
|
private |
◆ d_object_name
| const std::string IBTK::GeneralOperator::d_object_name |
|
protectedinherited |
◆ d_is_initialized
| bool IBTK::GeneralOperator::d_is_initialized = false |
|
protectedinherited |
◆ d_homogeneous_bc
| bool IBTK::GeneralOperator::d_homogeneous_bc |
|
protectedinherited |
◆ d_solution_time
| double IBTK::GeneralOperator::d_solution_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_current_time
| double IBTK::GeneralOperator::d_current_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_new_time
| double IBTK::GeneralOperator::d_new_time = std::numeric_limits<double>::quiet_NaN() |
|
protectedinherited |
◆ d_hier_math_ops
◆ d_hier_math_ops_external
| bool IBTK::GeneralOperator::d_hier_math_ops_external = false |
|
protectedinherited |
◆ d_enable_logging
| bool IBTK::GeneralOperator::d_enable_logging = false |
|
protectedinherited |
The documentation for this class was generated from the following file: