3.4.5.4.2. Implementing an MRIStepInnerStepper

To create an MRIStepInnerStepper implementation:

  1. 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.

  2. Define implementations of the required member functions (see §3.4.5.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 using MRIStepInnerStepper_GetContent().

  3. In the user code, before creating the MRIStep memory structure with MRIStepCreate(), do the following:

    1. Create an MRIStepInnerStepper object with MRIStepInnerStepper_Create().

    2. Attach a pointer to the stepper content to the MRIStepInnerStepper object with MRIStepInnerStepper_SetContent() if necessary, e.g., when the content is a C structure.

    3. Attach the member function implementations using the functions described in §3.4.5.4.1.1.3.

  4. Attach the MRIStepInnerStepper object to the MRIStep memory structure with MRIStepCreate().

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.