aspect icon indicating copy to clipboard operation
aspect copied to clipboard

Mesh deformation function plugin misses conversion to m/yr

Open anne-glerum opened this issue 4 years ago • 2 comments

When prescribing a mesh deformation rate through the function plugin, the velocity always has to be given in m/s, even if Use years in output instead of seconds = true. The function variable time will however be interpreted as years.

Fix suggested by Rene:

I think the way to fix this would be to wrap the stored function inside another function object (not a parsed function) that scales it correctly to years or seconds, similar to what the VectorFunctionFromVelocityFunctionObject inside core.cc does.

anne-glerum avatar May 26 '20 15:05 anne-glerum

@anne-glerum It looks like this is resolved here: https://github.com/geodynamics/aspect/blob/406b2cde9da697bb291656dc08afcaad849100f7/source/mesh_deformation/function.cc#L44-L47, but if I look it was last changed in 2019. Is this still valid. Otherwise this would be a good starter project.

MFraters avatar Jul 07 '23 17:07 MFraters

Hi @MFraters , those lines only correct the time from seconds to years. The unit of the velocity that the function returns, is still m/s, see the plugin description:

                                           "Although the function's time variable is interpreted as "
                                           "years when Use years in output instead of seconds is set to true, "
                                           "the boundary deformation velocity should still be given "
                                           "in m/s.

anne-glerum avatar Jul 07 '23 18:07 anne-glerum