-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve custom quantities API #424
Comments
To be able to use our callbacks for more complicated things that require data from multiple systems, like interpolation, we also need an option to pass a function with the arguments So,
|
I think we (@LasNikas @svchb) discussed a while ago that a good option would be something similar to point 2 above:
|
Currently, custom quantities for
trixi2vtk
,SolutionSavingCallback
andPostprocessCallback
must be functions of(v, u, t, system)
.The problem with that is that one needs to use internal, undocumented functions like
each_moving_particle
,particle_pressure
,current_coords
and so on to properly work withv
andu
.I therefore changed the docs in #423 to mention that functions must have the arguments
(v, u, t, system)
, but I also mentioned that these required undocumented internal functions to work with. I also removed the examples defining such functions and instead used the pre-defined custom quantities likekinetic_energy
.I see the following options:
each_moving_particle
,particle_pressure
,current_coords
and so on. We should probably have such a page anyway, as it's very useful for users who want to develop TrixiParticles.(v, u, t, system)
(which is then non-public API) or(coordinates, velocity, density, pressure)
, similar to how the source terms work, but passing global arrays instead of per-particle quantities. Note, however, that we don't want to allocate these global arrays, so we'll have to pass views, which can be modified by the user, causing unpredictable behavior. This option definitely requires less knowledge about TrixiParticle internals to be able to write simple custom quantity functions.The text was updated successfully, but these errors were encountered: