Skip to content
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

Composition time stepper #23961

Closed

Conversation

MengnanLi91
Copy link
Contributor

close #23740

Reason

Sometimes we want to benefit from the behavior of multiple time steppers, but save for re-implementing what s missing (for example IterationAdaptiveDT did that), you cant mix & match

Design

Introduce a timesteppersytem which allows timestepper action to create multiple timesteppers and a composition time stepper which can apply composition rules to input timesteppers to generate composed time step size and support times to hit with input TimeSequenceStepper.

Impact

Reaching the full capability of current time steppers

@MengnanLi91 MengnanLi91 changed the title Composition time stepper 23740 Composition time stepper Apr 4, 2023
MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 4, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from 611e94b to aefb205 Compare April 4, 2023 17:07
@moosebuild
Copy link
Contributor

Job Precheck on aefb205 wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/docs/PRs/23961/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 40ccebf10202cd732f7af7ccfc66764e7271560c

@GiudGiud GiudGiud self-assigned this Apr 4, 2023
MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 5, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from aefb205 to 08ab7ed Compare April 5, 2023 20:20
MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 5, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from 08ab7ed to fb4077f Compare April 5, 2023 20:58
@moosebuild
Copy link
Contributor

moosebuild commented Apr 6, 2023

Job Documentation on a8077c4 wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

moosebuild commented Apr 6, 2023

Job Coverage on 579dde8 wanted to post the following:

Framework coverage

2fdaa7 #23961 579dde
Total Total +/- New
Rate 85.08% 85.09% +0.02% 96.71%
Hits 86264 86407 +143 147
Misses 15132 15137 +5 5

Diff coverage report

Full coverage report

Modules coverage

Coverage did not change

Full coverage reports

Reports

This comment will be updated on new commits.

MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 6, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from 2869ded to b78085a Compare April 6, 2023 15:10
MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 6, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from b78085a to 0b46ecb Compare April 6, 2023 17:59
@moosebuild
Copy link
Contributor

Job Conda (ARM Mac) on 0b46ecb : invalidated by @MengnanLi91

@MengnanLi91 MengnanLi91 marked this pull request as ready for review April 6, 2023 19:05
@MengnanLi91
Copy link
Contributor Author

@GiudGiud I have some basic functions done for composition time stepper and ready for review. If you have time next week, could we schedule a meeting discussing this PR and the overlay mesh generator PR?

## Description

The `CompositionDT` TimeStepper takes TimeSteppers as inputs and generates a composed time step size based on the user specific composition rules. A base TimeStepper is required to provide a baseline time step size. The available composition rules including max, min and hit. The max/min option is specified with [!param](/Executioner/TimeStepper/CompositionDT/composition_type). It produces the maximum/minimum time step size value of all the input TimeSteppers. The hit option ensures the TimeStepper hits user specified time. It requires a TimeSequenceStepper with [!param](/Executioner/TimeStepper/CompositionDT/times_to_hit_timestepper) to specify the time sequence to hit. All together, The `CompositionDT` TimeStepper allows users to have a base time step with upper or lower limits and hit specified time points.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you are doing only one operation per CompositionDT, let s mention that we can nest CompositionDT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we shouldnt compose compositionDT

I think it s more simple to just have all the parameters in one?


## Example Input Syntax

!listing test/tests/time_steppers/composition_dt/composition_dt.i block=Executioner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

describe the example

Comment on lines 66 to 67
// the name of the time sequence stepper
std::string _hit_timestepper_name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there can be more than one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can accept multiple time sequence steppers now

framework/src/executioners/Transient.C Outdated Show resolved Hide resolved
framework/src/timesteppers/CompositionDT.C Outdated Show resolved Hide resolved
Real
CompositionDT::produceHitDT(const Real & composeDT)
{
auto ts = setupSequenceStepper(_hit_timestepper_name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this inits on every time step. that would be surprising?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the function name is misleading. It is not init but gets the current TimeSequence time. I change it to getSequenceStepper

Comment on lines 166 to 168
if (next_time_to_hit - _time <= _dt_min)
{
ts->increaseCurrentStep();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hitting steps should take priority over minimum time steps imo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should document that

framework/src/timesteppers/TimeStepperSystem.C Outdated Show resolved Hide resolved
@GiudGiud
Copy link
Contributor

GiudGiud commented Apr 7, 2023

Tuesday and Thursday might be more difficult next week, otherwise should be good

MengnanLi91 added a commit to MengnanLi91/moose that referenced this pull request Apr 11, 2023
@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from 0b46ecb to 579dde8 Compare April 11, 2023 23:10
@MengnanLi91
Copy link
Contributor Author

@GiudGiud I've addressed most of the easy fix comments. I'll do the rest after our meeting tomorrow.

@MengnanLi91 MengnanLi91 force-pushed the composition_time_stepper_23740 branch from 579dde8 to 7336a70 Compare April 13, 2023 20:20
@moosebuild
Copy link
Contributor

Job Python spack on a8077c4 : invalidated by @MengnanLi91

@GiudGiud
Copy link
Contributor

GiudGiud commented May 3, 2023

Superseded by #24046

@GiudGiud GiudGiud closed this May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a composition time stepper
3 participants