-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tempus: Add a new temporal integrator #13669
Comments
Morning @delcmo! The Tempus Stepper Factory is just a simple "if-else if" factory (never got a chance to add in an better factory :) ), so to add another stepper you can just add another "else if" conditional with your stepper in createStepper(stepperType, stepperPL, model). Make sure your new stepper has a non-member constructor, e.g., createStepperNewStepperName(model, pl) for the "else if" statement, and make sure it is included in packages/tempus/src/Tempus_StepperFactory_impl.hpp. If you are looking for the ability to have the application add its stepper to the factory during runtime, Tempus currently does not have that capability, and would need a better factory. :) |
@ccober6 Thanks for your reply. We noticed that each stepper class has a *.ccp file, a *_decl.hpp file, and a *_impl.hpp file. We also noticed that a *.hpp file is also included in the factory class. How is the *hpp file generated? |
The .hpp files are generated during the build. If you look at the Backward Euler stepper files (i.e., Tempus_StepperBackwardEuler), it gives you a template of what is needed. It is pretty much boilerplate. If you would like to talk through the AppAction, it might be better to have a meeting. |
Ok, thanks. We were able to duplicate @ccober6 what do you mean by AppAction? |
AppAction is a generalized Observer class that Steppers use to inject "application actions" into a Stepper (e.g., monitor solution, compute intermediate variables (energy), suggest next time step size, ...). For example, Tempus_StepperBackward_impl.hpp, there are four action locations: BEGIN_STEP, BEFORE_SOLVER, AFTER_SOLVER, and END_STEP. If the application would like it can inject some code at these locations (i.e., a call-back to the application). Each Stepper may have different action locations. For example, DIRK methods (Tempus_StepperDIRK_impl.hpp) have the following action locations: BEGIN_STEP, BEGIN_STAGE, BEFORE_SOLVER, AFTER_SOLVER, BEFORE_EXPLICIT_EVAL, END_STAGE, and END_STEP. For your stepper, you can ignore the AppAction capability unless you would like to have it. If you would like to add it to the Trilinos repo, we can work with you to include the AppAction if you like. |
Thanks for the clarification. I will look into this and let you know if we
need additional help.
Marco
…On Tue, Dec 17, 2024 at 11:51 AM Curtis Ober ***@***.***> wrote:
AppAction is a generalized Observer class that Steppers use to inject
"application actions" into a Stepper (e.g., monitor solution, compute
intermediate variables (energy), suggest next time step size, ...). For
example, Tempus_StepperBackward_impl.hpp, there are four action locations:
BEGIN_STEP, BEFORE_SOLVER, AFTER_SOLVER, and END_STEP. If the application
would like it can inject some code at these locations (i.e., a call-back to
the application).
Each Stepper may have different action locations. For example, DIRK
methods (Tempus_StepperDIRK_impl.hpp) have the following action locations:
BEGIN_STEP, BEGIN_STAGE, BEFORE_SOLVER, AFTER_SOLVER, BEFORE_EXPLICIT_EVAL,
END_STAGE, and END_STEP.
For your stepper, you can ignore the AppAction capability unless you would
like to have it. If you would like to add it to the Trilinos repo, we can
work with you to include the AppAction if you like.
—
Reply to this email directly, view it on GitHub
<#13669 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4GCSHOGNSDYJEOD2NCST2GBJCHAVCNFSM6AAAAABTRCU46WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBZGAYTCMZXHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Marc-Olivier Delchini
|
Question
Hello,
I am looking at adding a new temporal integrator to a Trilinos-based application. I currently rely on SDIRK steppers but would also like to test exponential integrators. As a first step, I would like to duplicate one of the Tempus steppers and have it available in my application. It is not clear to me how to add a new stepper to
packages/tempus/src/Tempus_StepperFactory_impl.hpp
. Is there an example that shows how to do that? Is that the correct approach?Thanks,
Marco
The text was updated successfully, but these errors were encountered: