146 if (new_n ==
n)
return false;
165 #ifdef MESSAGE_SUPPORT
166 void FiniteDifferencesVariableGrid::fromMessage(
const messages::FiniteDifferencesVariableGrid& message, std::stringstream* issues)
168 FiniteDifferencesGrid::fromMessage(message.finite_differences_grid(), issues);
182 if (message.has_grid_adapt_strategy())
184 if (message.grid_adapt_strategy().has_no_grid_adapt())
188 else if (message.grid_adapt_strategy().has_time_based_single_step())
191 message.grid_adapt_strategy().time_based_single_step().dt_hyst_ratio());
193 else if (message.grid_adapt_strategy().has_time_based_aggr_estim())
196 message.grid_adapt_strategy().time_based_aggr_estim().dt_hyst_ratio());
198 else if (message.grid_adapt_strategy().has_simple_shrinking_horizon())
209 void FiniteDifferencesVariableGrid::toMessage(messages::FiniteDifferencesVariableGrid& message)
const
211 FiniteDifferencesGrid::toMessage(*message.mutable_finite_differences_grid());
216 message.mutable_xf_fixed()->Resize(
_xf_fixed.size(),
false);
221 message.set_dt_min(
_dt_lb);
222 message.set_dt_max(
_dt_ub);
229 message.mutable_grid_adapt_strategy()->mutable_no_grid_adapt();
234 message.mutable_grid_adapt_strategy()->mutable_time_based_single_step()->set_n_max(
_n_max);
235 message.mutable_grid_adapt_strategy()->mutable_time_based_single_step()->set_dt_hyst_ratio(
_dt_hyst_ratio);
240 message.mutable_grid_adapt_strategy()->mutable_time_based_aggr_estim()->set_n_max(
_n_max);
241 message.mutable_grid_adapt_strategy()->mutable_time_based_aggr_estim()->set_dt_hyst_ratio(
_dt_hyst_ratio);
246 message.mutable_grid_adapt_strategy()->mutable_simple_shrinking_horizon();
251 PRINT_ERROR_NAMED(
"exporting of the selected auto resize strategy not implemented.");
257 message.set_n_min(
_n_min);