diff --git a/Documentation/ProjectFile/prj/time_loop/output/t_fixed_output_times.md b/Documentation/ProjectFile/prj/time_loop/output/t_fixed_output_times.md new file mode 100644 index 0000000000000000000000000000000000000000..a933a2d49f7fd18cdc8564805763bdfc46c8c79d --- /dev/null +++ b/Documentation/ProjectFile/prj/time_loop/output/t_fixed_output_times.md @@ -0,0 +1,2 @@ +An option input of fixed times, at which the output of the results must be + conducted. diff --git a/Documentation/ProjectFile/prj/time_loop/output/t_specified_times.md b/Documentation/ProjectFile/prj/time_loop/output/t_specified_times.md deleted file mode 100644 index be6096be2f3abb406e19592a21de79f04c65dec6..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/time_loop/output/t_specified_times.md +++ /dev/null @@ -1,2 +0,0 @@ -An option input of specified times, at which the output of the results must be - conducted. diff --git a/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_fixed_output_times.md b/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_fixed_output_times.md new file mode 100644 index 0000000000000000000000000000000000000000..e57ef89f7f00401c2ba2a207b788757d96c9aed8 --- /dev/null +++ b/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_fixed_output_times.md @@ -0,0 +1 @@ +The fixed times that must be reached in the time stepping. diff --git a/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_specified_times.md b/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_specified_times.md deleted file mode 100644 index d75c95a8ae00edf5862927bff3258490df563e1c..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/time_loop/processes/process/time_stepping/EvolutionaryPIDcontroller/t_specified_times.md +++ /dev/null @@ -1 +0,0 @@ -The specified times that must be reached in the time stepping. diff --git a/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp b/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp index 0f3c6db518c3dc3316adf27611773d762d68bade..19837d03975bf3b2a1bfa290dd3de501068b1657 100644 --- a/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp +++ b/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp @@ -42,14 +42,14 @@ std::unique_ptr<TimeStepAlgorithm> createEvolutionaryPIDcontroller( //! \ogs_file_param{prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__rel_dt_max} auto const rel_h_max = config.getConfigParameter<double>("rel_dt_max"); - auto specified_times = - //! \ogs_file_param{prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__specified_times} - config.getConfigParameter<std::vector<double>>("specified_times", + auto fixed_output_times = + //! \ogs_file_param{prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__fixed_output_times} + config.getConfigParameter<std::vector<double>>("fixed_output_times", std::vector<double>{}); - if (!specified_times.empty()) + if (!fixed_output_times.empty()) { // Remove possible duplicated elements and sort in descending order. - BaseLib::makeVectorUnique(specified_times, std::greater<double>()); + BaseLib::makeVectorUnique(fixed_output_times, std::greater<double>()); } //! \ogs_file_param{prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__tol} @@ -57,6 +57,6 @@ std::unique_ptr<TimeStepAlgorithm> createEvolutionaryPIDcontroller( return std::make_unique<EvolutionaryPIDcontroller>( t0, t_end, h0, h_min, h_max, rel_h_min, rel_h_max, - std::move(specified_times), tol); + std::move(fixed_output_times), tol); } } // end of namespace NumLib diff --git a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp index bfb8240cb784f8b56e38dd10cf269fba9d7e6be0..f98d91a426b371f6d8b26374c4bb49ec168845f2 100644 --- a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp +++ b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.cpp @@ -143,28 +143,28 @@ double EvolutionaryPIDcontroller::limitStepSize( double EvolutionaryPIDcontroller::checkSpecificTimeReached(const double h_new) { - if (_specified_times.empty()) + if (_fixed_output_times.empty()) return h_new; - const double specific_time = _specified_times.back(); + const double specific_time = _fixed_output_times.back(); if ((specific_time > _ts_current.current()) && (_ts_current.current() + h_new - specific_time > 0.0)) { - _specified_times.pop_back(); + _fixed_output_times.pop_back(); return specific_time - _ts_current.current(); } return h_new; } -void EvolutionaryPIDcontroller::addSpecifiedTimes( - std::vector<double> const& extra_specified_times) +void EvolutionaryPIDcontroller::addFixedOutputTimes( + std::vector<double> const& extra_fixed_output_times) { - _specified_times.insert(_specified_times.end(), extra_specified_times.begin(), - extra_specified_times.end()); + _fixed_output_times.insert(_fixed_output_times.end(), + extra_fixed_output_times.begin(), + extra_fixed_output_times.end()); // Remove possible duplicated elements and sort in descending order. - BaseLib::makeVectorUnique(_specified_times, std::greater<double>()); + BaseLib::makeVectorUnique(_fixed_output_times, std::greater<double>()); } - } // end of namespace NumLib diff --git a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.h b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.h index 9d18dfb6efcbf3e8bd61d659ed4ffc8902266360..3b308b0d2015d706f50df97276afc99afcd00052 100644 --- a/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.h +++ b/NumLib/TimeStepping/Algorithms/EvolutionaryPIDcontroller.h @@ -55,7 +55,7 @@ public: const double h0, const double h_min, const double h_max, const double rel_h_min, const double rel_h_max, - const std::vector<double>&& specified_times, + const std::vector<double>&& fixed_output_times, const double tol) : TimeStepAlgorithm(t0, t_end), _h0(h0), @@ -63,7 +63,7 @@ public: _h_max(h_max), _rel_h_min(rel_h_min), _rel_h_max(rel_h_max), - _specified_times(std::move(specified_times)), + _fixed_output_times(std::move(fixed_output_times)), _tol(tol), _e_n_minus1(0.), _e_n_minus2(0.), @@ -92,9 +92,9 @@ public: /// solution error. bool isSolutionErrorComputationNeeded() override { return true; } - /// \copydoc NumLib::TimeStepAlgorithm::addSpecifiedTimes - void addSpecifiedTimes( - std::vector<double> const& extra_specified_times) override; + /// \copydoc NumLib::TimeStepAlgorithm::addFixedOutputTimes + void addFixedOutputTimes( + std::vector<double> const& extra_fixed_output_times) override; private: const double _kP = 0.075; ///< Parameter. \see EvolutionaryPIDcontroller @@ -111,7 +111,7 @@ private: const double _rel_h_max; // Given times that steps have to reach. - std::vector<double> _specified_times; + std::vector<double> _fixed_output_times; const double _tol; diff --git a/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h b/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h index 3dc899ab986ba0ebef7ca830291ea7681c2ebcba..48cd0da6212fd8912e85c19b0378dbe728caf43c 100644 --- a/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h +++ b/NumLib/TimeStepping/Algorithms/TimeStepAlgorithm.h @@ -93,7 +93,8 @@ public: * the specified times. The function is mainly used to accept the specified * times from the configuration of output. */ - virtual void addSpecifiedTimes(std::vector<double> const& /*specified_times*/) + virtual void addFixedOutputTimes( + std::vector<double> const& /*fixed_output_times*/) { } diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index 8ef7c8d88cfe5aef9875cafd2215d49db2cb0509..972f759221bd16974e27452df30b7020da70966c 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -44,7 +44,7 @@ std::unique_ptr<Output> createOutput(const BaseLib::ConfigTree& config, // Construction of output times std::vector<Output::PairRepeatEachSteps> repeats_each_steps; - std::vector<double> specified_times; + std::vector<double> fixed_output_times; //! \ogs_file_param{prj__time_loop__output__timesteps} if (auto const timesteps = config.getConfigSubtreeOptional("timesteps")) @@ -74,15 +74,15 @@ std::unique_ptr<Output> createOutput(const BaseLib::ConfigTree& config, repeats_each_steps.emplace_back(1, 1); } - auto specified_times_ptr = - //! \ogs_file_param{prj__time_loop__output__specified_times} + auto fixed_output_times_ptr = + //! \ogs_file_param{prj__time_loop__output__fixed_output_times} config.getConfigParameterOptional<std::vector<double>>( - "specified_times"); - if (specified_times_ptr) + "fixed_output_times"); + if (fixed_output_times_ptr) { - specified_times = std::move(*specified_times_ptr); + fixed_output_times = std::move(*fixed_output_times_ptr); // Remove possible duplicated elements and sort in descending order. - BaseLib::makeVectorUnique(specified_times, std::greater<double>()); + BaseLib::makeVectorUnique(fixed_output_times, std::greater<double>()); } bool const output_iteration_results = @@ -92,7 +92,7 @@ std::unique_ptr<Output> createOutput(const BaseLib::ConfigTree& config, return std::make_unique<Output>(output_directory, prefix, compress_output, data_mode, output_iteration_results, std::move(repeats_each_steps), - std::move(specified_times)); + std::move(fixed_output_times)); } } // namespace ProcessLib diff --git a/ProcessLib/Output/Output.cpp b/ProcessLib/Output/Output.cpp index a3e8652e229142689c22ef124c96144e27130607..e62fc84c96f04ffd61f57d4babd6d2ab259db5a0 100644 --- a/ProcessLib/Output/Output.cpp +++ b/ProcessLib/Output/Output.cpp @@ -67,14 +67,14 @@ bool Output::shallDoOutput(unsigned timestep, double const t) bool make_output = timestep % each_steps == 0; - if (_specified_times.empty()) + if (_fixed_output_times.empty()) return make_output; - const double specific_time = _specified_times.back(); + const double specific_time = _fixed_output_times.back(); const double zero_threshold = std::numeric_limits<double>::min(); if (std::fabs(specific_time - t) < zero_threshold) { - _specified_times.pop_back(); + _fixed_output_times.pop_back(); make_output = true; } @@ -85,14 +85,14 @@ 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<double>&& specified_times) + std::vector<double>&& fixed_output_times) : _output_directory(std::move(output_directory)), _output_file_prefix(std::move(prefix)), _output_file_compression(compress_output), _output_file_data_mode(convertVtkDataMode(data_mode)), _output_nonlinear_iteration_results(output_nonlinear_iteration_results), _repeats_each_steps(std::move(repeats_each_steps)), - _specified_times(std::move(specified_times)) + _fixed_output_times(std::move(fixed_output_times)) { } diff --git a/ProcessLib/Output/Output.h b/ProcessLib/Output/Output.h index 5f04d41f2783ee74d4e992b794e525c028483235..4200f0c6de6c1e73463ccedfd17e741951ad5ee0 100644 --- a/ProcessLib/Output/Output.h +++ b/ProcessLib/Output/Output.h @@ -43,7 +43,7 @@ public: bool const compress_output, std::string const& data_mode, bool const output_nonlinear_iteration_results, std::vector<PairRepeatEachSteps> repeats_each_steps, - std::vector<double>&& specified_times); + std::vector<double>&& fixed_output_times); //! TODO doc. Opens a PVD file for each process. void addProcess(ProcessLib::Process const& process, const int process_id); @@ -78,7 +78,7 @@ public: GlobalVector const& x, const unsigned iteration); - std::vector<double> getSpecifiedTimes() {return _specified_times;} + std::vector<double> getFixedOutputTimes() {return _fixed_output_times;} private: struct ProcessData @@ -104,7 +104,7 @@ private: std::vector<PairRepeatEachSteps> _repeats_each_steps; //! Given times that steps have to reach. - std::vector<double> _specified_times; + std::vector<double> _fixed_output_times; std::multimap<Process const*, ProcessData> _process_to_process_data; diff --git a/ProcessLib/RichardsFlow/Tests.cmake b/ProcessLib/RichardsFlow/Tests.cmake index 1e1906ca58fd6ef7bcdf5821a59781ed99025a01..454713a71520e94478069778109f3c54fea7ce2e 100644 --- a/ProcessLib/RichardsFlow/Tests.cmake +++ b/ProcessLib/RichardsFlow/Tests.cmake @@ -38,7 +38,7 @@ AddTest( DIFF_DATA ref_t_1600.000000.vtu richards_pcs_0_ts_803_t_1600.000000.vtu pressure pressure 1e-8 1e-3 # The following three comparisons are used just to check whether the output is -# made at the specific times of 50, 100 and 500, which are given in the project +# made at the fixed times of 50, 100 and 500, which are given in the project # file of RichardsFlow_2d_small_adaptive_dt.prj richards_pcs_0_ts_28_spec_t_50.000000.vtu richards_pcs_0_ts_28_t_50.000000.vtu pressure pressure 1e-10 1e-10 richards_pcs_0_ts_53_spec_t_100.000000.vtu richards_pcs_0_ts_53_t_100.000000.vtu pressure pressure 1e-10 1e-10 diff --git a/ProcessLib/UncoupledProcessesTimeLoop.cpp b/ProcessLib/UncoupledProcessesTimeLoop.cpp index 0f114f0a9f23121957bd34f41db1dacb16a16521..488bc004eeb4668caa5afc0e1cf191f1f32223b0 100644 --- a/ProcessLib/UncoupledProcessesTimeLoop.cpp +++ b/ProcessLib/UncoupledProcessesTimeLoop.cpp @@ -532,12 +532,12 @@ bool UncoupledProcessesTimeLoop::loop() pcs.getMesh()); } - // Add the specific times of output to time stepper in order that + // Add the fixed times of output to time stepper in order that // the time stepping is performed and the results are output at // these times. Note: only the adaptive time steppers can have the - // the specific times. + // the fixed times. auto& timestepper = process_data->timestepper; - timestepper->addSpecifiedTimes(_output->getSpecifiedTimes()); + timestepper->addFixedOutputTimes(_output->getFixedOutputTimes()); ++process_id; } diff --git a/Tests/Data/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme_adaptive_dt.prj b/Tests/Data/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme_adaptive_dt.prj index 04ed44ae095039b34df7c8833a983a58ac401ca3..d71de36f310daf5039fb1a9fe3504fdc96b34d83 100644 --- a/Tests/Data/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme_adaptive_dt.prj +++ b/Tests/Data/Parabolic/HT/StaggeredCoupling/ConstViscosity/square_5500x5500_staggered_scheme_adaptive_dt.prj @@ -100,7 +100,7 @@ <rel_dt_min> 0.1 </rel_dt_min> <rel_dt_max> 10 </rel_dt_max> <tol> 10.0 </tol> - <specified_times>5.0e9 2.e10</specified_times> + <fixed_output_times>5.0e9 2.e10</fixed_output_times> </time_stepping> </process> <process ref="ConstViscosityThermalConvection"> @@ -128,7 +128,7 @@ <rel_dt_min> 0.1 </rel_dt_min> <rel_dt_max> 10 </rel_dt_max> <tol> 10.0 </tol> - <specified_times>5.0e9 2.e10</specified_times> + <fixed_output_times>5.0e9 2.e10</fixed_output_times> </time_stepping> </process> </processes> diff --git a/Tests/Data/Parabolic/Richards/RichardsFlow_2d_small_adaptive_dt.prj b/Tests/Data/Parabolic/Richards/RichardsFlow_2d_small_adaptive_dt.prj index 932fce40aa55685db7b1f960e67d5e5c11effc18..3f64bd298833cfc21e442868f49c5832c49490a7 100644 --- a/Tests/Data/Parabolic/Richards/RichardsFlow_2d_small_adaptive_dt.prj +++ b/Tests/Data/Parabolic/Richards/RichardsFlow_2d_small_adaptive_dt.prj @@ -109,7 +109,7 @@ <each_steps>100000000</each_steps> </pair> </timesteps> - <specified_times> 50.0 100.0 500.</specified_times> + <fixed_output_times> 50.0 100.0 500.</fixed_output_times> <output_iteration_results>false</output_iteration_results> </output> </time_loop>