Trixi.jl icon indicating copy to clipboard operation
Trixi.jl copied to clipboard

simplified interface

Open rveltz opened this issue 2 years ago • 2 comments

Hi,

I am really interested in using your package for solving McKean-Vlasov equations describing the distribution of mean field of particles. All examples I have in mind are like (say in 2d), x=(x1,x2)

However, I find there is quite some boilerplate to implement in order to use your package.

  1. Would it be possible to borrow the definition of the problem like in Gridap? I understand if this is akinng for too much ;)

You could focus on nonlinear reaction diffusion equations like

du/dt = ∇(c(x,u) + d(x,u) ∇ NL(x,u)) + f(x, u)

Could you not define a struct asking for the functions c,d,NL,f, the discretisation, the boundary conditions and return a problem that implement the discretisation.

Even if this is a subset of what your package can handle, I'd say it would be helpful.

That you for your valuable tool

PS: I posted the same issue on (VoronoiFVM)[https://github.com/j-fu/VoronoiFVM.jl/issues/20] which is akin to Trixi

rveltz avatar Sep 30 '21 10:09 rveltz

Right now, Trixi.jl focuses on first-order hyperbolic systems. Second-order terms still need to be implemented and are on our radar (see, e.g., #704, #356, #497). Thus, we need to focus on first-order terms in this request for now. What kind of c do you have in mind - linear, scalar? The Your function f is basically what we have as source_terms right now, so that's basically done.

ranocha avatar Oct 01 '21 06:10 ranocha

I imagine it could be possible to define some more general interfaces for problem setups. However, creating proper and stable (!) discretizations out of it for general hyperbolic problems is quite demanding... So far, most of our developers are working on high-order methods and stability issues etc. and a lot of effort has been spent to come up with the type of discretizations in use today (not only in Trixi.jl). Currently, I don't think it's possible to automate this completely. However, it might be an option to start looking at some general and robust low-order methods to get something like this. In general, I definitely like the idea of creating an interface like

prob = HyperbolicProblem(flux, source_terms, boundary_conditions, initial_condition, geometry) # flux == your c, source_terms == your f
sol = solve(prob, tolerances_or_size) # choose some method automagically

ranocha avatar Oct 01 '21 06:10 ranocha

In case it's still helpful, we now have (somewhat experimental) support for parabolic terms. See https://trixi-framework.github.io/Trixi.jl/stable/tutorials/adding_new_parabolic_terms/ and the tutorial before it.

jlchan avatar Jun 01 '23 14:06 jlchan