File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -231,8 +231,9 @@ namespace aspect
231231 Py_DECREF (pArgs);
232232
233233 const ArrayView<const double > data = PythonHelper::numpy_to_array_view (pValue);
234+ const double one_over_dt = 1.0 / ((this ->get_timestep () > 0.0 ) ? this ->get_timestep () : 1.0 );
234235 for (size_t i=0 ; i<data.size (); ++i)
235- velocities[i][dim-1 ] = data[i];
236+ velocities[i][dim-1 ] = data[i] * one_over_dt ;
236237
237238 Py_DECREF (pValue);
238239 }
@@ -246,11 +247,13 @@ namespace aspect
246247 //const auto &mapping = this->get_mapping();
247248 std::vector<Point<dim>> real_evaluation_points(this->evaluation_points.size());
248249 std::vector<std::vector<double>> data(this->evaluation_points.size(), std::vector<double>(dim, 0.0));
250+ const double one_over_dt = 1.0 / ((this->get_timestep() > 0.0) ? this->get_timestep() : 1.0);
251+
249252 for (unsigned int i=0; i<this->evaluation_points.size(); ++i)
250253 {
251254 real_evaluation_points[i] = this->evaluation_points[i]; // TODO: use mapping to compute real position
252255 for (unsigned int c=0; c<dim; ++c)
253- data[i][c] = velocities[i][c];
256+ data[i][c] = velocities[i][c] * one_over_dt ;
254257 }
255258
256259 const std::vector<std::string> data_component_names(dim, "velocity");
You can’t perform that action at this time.
0 commit comments