-
Notifications
You must be signed in to change notification settings - Fork 239
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
Specific times in output #2079
Specific times in output #2079
Conversation
@@ -91,6 +91,10 @@ class EvolutionaryPIDcontroller final : public TimeStepAlgorithm | |||
/// Get a flag to indicate that this algorithm need to compute | |||
/// solution error. | |||
bool isSolutionErrorComputationNeeded() override { return true; } | |||
/// Add specific times | |||
void addSpecificTimes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to add comment on what this function does aside the info given in the function's name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a more detailed description.
@@ -85,6 +85,12 @@ class TimeStepAlgorithm | |||
/// Get a flag to indicate whether this algorithm needs to compute | |||
/// solution error. The default return value is false. | |||
virtual bool isSolutionErrorComputationNeeded() { return false; } | |||
|
|||
/// Add specific times | |||
virtual void addSpecificTimes(std::vector<double> const& /*specific_times*/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the general description would be here, and the overriding function in PID controller would provide additional info...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use \copydoc
ProcessLib/Output/Output.cpp
Outdated
return make_output; | ||
|
||
const double specific_time = _specific_times.back(); | ||
const double zero_threshold = std::numeric_limits<double>::epsilon(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
epsilon is not zero. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to min, while changed the tolerance for time step size calculation with specified times.
ProcessLib/Output/Output.cpp
Outdated
Output::Output(std::string output_directory, std::string prefix, | ||
bool const compress_output, std::string const& data_mode, | ||
bool const output_nonlinear_iteration_results, | ||
std::vector<PairRepeatEachSteps> repeats_each_steps) | ||
std::vector<PairRepeatEachSteps> repeats_each_steps, | ||
const std::vector<double>&& specific_times) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why the const r-value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed const from there. Just wonder, the code can be compiled with that const.
@@ -109,6 +109,7 @@ | |||
<each_steps>100000000</each_steps> | |||
</pair> | |||
</timesteps> | |||
<specific_times> 50.0 100.0 500.</specific_times> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the "specific" here. Just my opinion, other comments are welcome.
I'd rather call this fixed_output_times
, because for me, the "specific" alone does not necessary mean "output" in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the name to specified times
.
304100f
to
0995620
Compare
Other ideas additionally to Suggestions are welcome!
|
Concerning animations and tool coupling we need two things: |
Any other suggestion about the tag name? If not, |
@wenqing Take |
in descending order
…e constraint of specified times
0995620
to
fc4de95
Compare
OpenGeoSys development has been moved to GitLab. |
This PR adds a functionality to make output of results at given times. For this purpose, an optional input of specified times is introduced to createOutput, with which the specified times for output can be given in project file. For example
For computation, the specified times given in the output data are merged to the specified times in the time stepper. One can input the specified times in any order or even with duplicated data (e.g. by mistakes), however their order is sorted in the descending way and the data are made unique after input. In the computation, the time stepping is conducted at every specified time. So far, the functionality is for the adaptive time stepper, EvolutionaryPIDcontroller.
Test Parabolic/Richards/RichardsFlow_2d_small_adaptive_dt.prj is modified to test the presented functionality.