-
Notifications
You must be signed in to change notification settings - Fork 110
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
Adding more user controls #2148
Comments
I may not understand everything correctly. What exactly would you like to achieve? Could you please provide an example that is as simple as possible, e.g., for a 1D linear advection equation? |
@ranocha I made a simple 1D example of 2 coupled strongly nonlinear advection equations: https://github.com/erny123/TRIXIExamples/blob/main/TRIXI-Coupled-Nonlinear.ipynb You can see in the first solution using the regular method, that The point is, there needs to be more flexibility for users to solve the terms of the semidiscretized equations with their own algorithms. |
You mentioned that everything was very slow on Discourse. My first impression is that this is caused by non-constant global variables like |
If you want to use use a function rhs_nonlin!(du_ode, u_ode, parameters, t)
semi = parameters.semi_nonlin
Trixi.rhs!(du_ode, u_ode, semi, t)
end
function rhs_lin!(du_ode, u_ode, parameters, t)
semi = parameters.semi_lin
Trixi.rhs!(du_ode, u_ode, semi, t)
end
parameters = (; semi_nonlin, semi_lin)
ode = SplitODEProblem(rhs_nonlin!, rhs_lin!, u0, tspan, parameters) |
Thanks @ranocha . I'll give it a shot. Yes, the code is not minimal. I'm not sure there is a way to minimize it, however. Given the |
Is the example representative of the kind of problems you need to solve or will they be more complicated (e.g., multiple space dimensions)? |
The ultimate goal is to model 3D with a system of In optics, the complex representation is important because of the phase of the wave and how it effects the diffraction (diffusion) along with the nonlinear coupling terms. Additionally, in general, Maxwell's equations in a medium are represented by a complex relative permittivity (e.g. Kramers-Kronig relation). In a 1D setting, I would use the split step method and treat the linear part of the system with an explicit SSP method and the nonlinear part with an implicit method. I believe this is generally the standard way to solve coupled advection wave equations, but I could be wrong |
Here's an example of the coupled nonlinear schrodinger equation: https://w1.mtsu.edu/faculty/wding/files/ShuNLS.pdf Although these have small couplilng factors. and this work has done work on IMEX SSPRK methods: |
Here's another reason I believe we need more controls: Say a system has a flux equal to the convolution in time of a response function and a variable at that point in space. where To do this convolution, I would do a Z-transform (discrete Laplace transform) of the Then plug it into the hyperbolic equation: For this, I would need access the values at each point at previous times. |
Hi all, sure you've seen my slack messages.
Trixi.jl
has a great user interface and it's very flexible. However, anyone who is visiting theTrixi.jl
page and is actually using it for research is at least familiar with the basics of Spectral Elements and the Discontinuous Galerkin Method and will probably be extremely familiar with numerical methods (linear and nonlinear solvers). I think the one thing thatTrixi.jl
is missing is the flexibility and malleability to customize the solving algorithms for each term. For example, if one wants to treat a linear terms in a different manner than nonlinear. We also need more flexibility in how to individually treat the hyperbolic and parabolic terms.As much as I like the
DifferentialEquations.jl
, it assumes far too much and it is not flexible for new problems and equations, at least from a surface user view.Suggestions:
LinearSolve.jl
andNonlinearSolve.jl
. Allowing the flexibility to use these packages will be extremely usefulsemidiscretization()
should give either the matrix operator and it's inverse, a matrix free operator and its matrix free inverse (this can either beLinearMaps.jl
orLinearOperators.jl
. For a term that needs to be solved implicitly (usually nonlinear but could be parabolic terms) it should return asemidiscretization()
should return a nonlinear function to be used inSciMLBase.NonlinearProblem
orSciMLBase.NonlinearFunction
Dr. Doering suggested it be part of
rhs!
and arhs_parabolic!
. Additionally, matrix formulations are definitely costly and I think more people would be interested in iterative solvers likeKrylov.jl
The text was updated successfully, but these errors were encountered: