You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For simulations where source terms (aka right hand side, forcing, ...) change over time, we need a way for an external application to provide the respective values.
Trixi.jl expects a method source_terms(u, x, t, ...), which is called in every time step for every DG node, i.e.
time t
coordinates of the DG node x
current values of conservative variables u(x, t)
are given and the values of the source term S(u(x,t), x, t) need to be returned.
The method source_terms(u, x, t, ...) can simply be defined in a libelixir.
At his point there is a lot of flexibility. One could think about caching, interpolation onto DG nodes, ...
But in the end we need a mechanism therein that allows to retrieve whatever values there are from the calling external application.
For simulations where source terms (aka right hand side, forcing, ...) change over time, we need a way for an external application to provide the respective values.
Trixi.jl expects a method
source_terms(u, x, t, ...), which is called in every time step for every DG node, i.e.txu(x, t)are given and the values of the source term
S(u(x,t), x, t)need to be returned.The method
source_terms(u, x, t, ...)can simply be defined in a libelixir.At his point there is a lot of flexibility. One could think about caching, interpolation onto DG nodes, ...
But in the end we need a mechanism therein that allows to retrieve whatever values there are from the calling external application.
We implemented two prototypes for demonstration:
Create a global data storage which can be written to via API functions: RFC: source terms via global vector storage #173
source_termsis calledt,x,uxto an index, needed to access the memory at the correct positionLet the user call her own external functions from a libelixir: RFC: Source terms via callback #172
source_termsand make it available via a shared librarysource_termsis called.