Skip to content
Snippets Groups Projects
Commit 35829579 authored by wenqing's avatar wenqing
Browse files

[dt] Reduced the tolerance in the time step size calculation under the...

[dt] Reduced the tolerance in the time step size calculation under the constraint of specified times
parent d6b7c2fc
No related branches found
No related tags found
No related merge requests found
...@@ -147,9 +147,8 @@ double EvolutionaryPIDcontroller::checkSpecificTimeReached(const double h_new) ...@@ -147,9 +147,8 @@ double EvolutionaryPIDcontroller::checkSpecificTimeReached(const double h_new)
return h_new; return h_new;
const double specific_time = _specified_times.back(); const double specific_time = _specified_times.back();
const double zero_threshold = std::numeric_limits<double>::epsilon();
if ((specific_time > _ts_current.current()) && if ((specific_time > _ts_current.current()) &&
(_ts_current.current() + h_new - specific_time > zero_threshold)) (_ts_current.current() + h_new - specific_time > 0.0))
{ {
_specified_times.pop_back(); _specified_times.pop_back();
return specific_time - _ts_current.current(); return specific_time - _ts_current.current();
......
...@@ -71,7 +71,7 @@ bool Output::shallDoOutput(unsigned timestep, double const t) ...@@ -71,7 +71,7 @@ bool Output::shallDoOutput(unsigned timestep, double const t)
return make_output; return make_output;
const double specific_time = _specified_times.back(); const double specific_time = _specified_times.back();
const double zero_threshold = std::numeric_limits<double>::epsilon(); const double zero_threshold = std::numeric_limits<double>::min();
if (std::fabs(specific_time - t) < zero_threshold) if (std::fabs(specific_time - t) < zero_threshold)
{ {
_specified_times.pop_back(); _specified_times.pop_back();
...@@ -85,7 +85,7 @@ Output::Output(std::string output_directory, std::string prefix, ...@@ -85,7 +85,7 @@ Output::Output(std::string output_directory, std::string prefix,
bool const compress_output, std::string const& data_mode, bool const compress_output, std::string const& data_mode,
bool const output_nonlinear_iteration_results, bool const output_nonlinear_iteration_results,
std::vector<PairRepeatEachSteps> repeats_each_steps, std::vector<PairRepeatEachSteps> repeats_each_steps,
const std::vector<double>&& specified_times) std::vector<double>&& specified_times)
: _output_directory(std::move(output_directory)), : _output_directory(std::move(output_directory)),
_output_file_prefix(std::move(prefix)), _output_file_prefix(std::move(prefix)),
_output_file_compression(compress_output), _output_file_compression(compress_output),
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
bool const compress_output, std::string const& data_mode, bool const compress_output, std::string const& data_mode,
bool const output_nonlinear_iteration_results, bool const output_nonlinear_iteration_results,
std::vector<PairRepeatEachSteps> repeats_each_steps, std::vector<PairRepeatEachSteps> repeats_each_steps,
const std::vector<double>&& specified_times); std::vector<double>&& specified_times);
//! TODO doc. Opens a PVD file for each process. //! TODO doc. Opens a PVD file for each process.
void addProcess(ProcessLib::Process const& process, const int process_id); void addProcess(ProcessLib::Process const& process, const int process_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment