Skip to content

Commit 68699aa

Browse files
committed
convert landlab deposition into velocity with timestep
1 parent 9f17050 commit 68699aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/mesh_deformation/landlab.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)