3.4.4.4.2. Implementing an MRIStepInnerStepper
To create an MRIStepInnerStepper implementation:
Define the stepper-specific content.
This is typically a user-defined structure in C codes, a user-defined class or structure in C++ codes, or a user-defined module in Fortran codes. This content should hold any data necessary to perform the operations defined by the
MRIStepInnerStepper
member functions.Define implementations of the required member functions (see §3.4.4.4.1.2).
These are typically user-defined functions in C, member functions of the user-defined structure or class in C++, or functions contained in the user-defined module in Fortran.
Note that all member functions are passed the
MRIStepInnerStepper
object and the stepper-specific content can, if necessary, be retrieved usingMRIStepInnerStepper_GetContent()
.In the user code, before creating the MRIStep memory structure with
MRIStepCreate()
, do the following:Create an
MRIStepInnerStepper
object withMRIStepInnerStepper_Create()
.Attach a pointer to the stepper content to the
MRIStepInnerStepper
object withMRIStepInnerStepper_SetContent()
if necessary, e.g., when the content is a C structure.Attach the member function implementations using the functions described in §3.4.4.4.1.1.3.
Attach the
MRIStepInnerStepper
object to the MRIStep memory structure withMRIStepCreate()
.
For an example of creating and attaching a user-defined inner stepper see
the example code examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp
where CVODE is wrapped as an MRIStepInnerStepper
.