Replies: 5 comments
-
Should it be solved like this: 1) find the points that map to the quadrature points through the advection map, 2) find out which of them are outside of the domain, 3) evluate rest of them through Then we could have a separate function which checks if a point is inside the domain or not. |
Beta Was this translation helpful? Give feedback.
-
Following the discussion in #646, in particular your question
which is called in the finite difference context the Courant number u Δ t / Δ x or CFL condition after Courant, Friedrich, & Lewy (1928, 1967), I'm thinking that (3) should use a modified version of probes that is already told which cell each point is in and so doesn't have to call scikit-fem/skfem/assembly/basis/cell_basis.py Line 146 in d08af2a To begin with, one might check using the local-to-canonical map whether the point is in the guessed cell. For those that aren't, try the adjacent cell. I haven't looked at the details of what the local-to-canonical map looks like for a point not in the cell to see whether that might guide which facet has been crossed and so which of the adjacent cells is to be taken as the next guess, but if there's something there, it be better to use it than to fall back on an exhaustive search of the neighbours. The mesh's facet connectivity array already indicates which facets are on the boundary of the domain, via the sentinel value −1. Line 670 in 0855dae —
|
Beta Was this translation helpful? Give feedback.
-
On the other hand, in examples like
it's easy to know which feet are upstream of the inlet because the mathematical description of the inlet is so simple (x=const.). That shortcut might arise often enough to be worth exploiting. That would take care of
after which simple application of (3) to the remainder should be valid. (If not optimal, but of course premature optimization is to be avoided.) |
Beta Was this translation helpful? Give feedback.
-
A very simple one-dimensional, uniform advecting velocity, zero diffusion, example is discussed in ‘Is this a good way to implement the method of characteristics for advection equation?’ (FEniCS Q&A, 2017-03-19). |
Beta Was this translation helpful? Give feedback.
-
There is also an efficient "in_polygon" implementation in matplotlib (Path class). There are also algorithms for 3D meshes, e.g. https://github.com/marmakoide/inside-3d-mesh |
Beta Was this translation helpful? Give feedback.
-
(Ern & Guermond 2004, Theory and Practice of Finite Elements, §6.3.3 ‘The method of characteristics’).
(This is a stub which I'll fill out shortly, but for now to refer to from the discussion of the evaluation matrix #593. I expect it to be a heavy load on that or
probes
#572.)Beta Was this translation helpful? Give feedback.
All reactions