Replies: 4 comments
|
Thanks for describing this @javijv4! I think that all the applications you describe share a requirement for spatial queries (e.g. find the mesh node closest to a given point, or find the point in the mesh - including element interiors - closest to a given point, or find the mesh nodes that are within a certain distance of a given point). Similar tasks are implemented for URIS ( I suggest that that is the first thing that can be abstracted. This could be done through a class, say (As a bonus: those nearest-neighbor searches are mostly linear searches right now, which is possibly quite inefficient. Once this is centralized in a single class, it becomes easier to optimize this operation through e.g. spatial partitioning trees.) Having done that, we could look into the similarities (if any) between the different kinds of couplings that rely on this. I think that the four use cases that you describe look different enough to warrant different classes or functions, if nothing else to clearly communicate projection/interpolation semantics. However, a lot of the logic can probably be abstracted away to the spatial query helper. (Partially related, I think that for the EP application matching the nodes of the 1D and 3D meshes leads to an ill-posed problem, but I've explained this better here.) |
|
Sounds good! I think it makes sense to implement first a class that deals with the spatial search and query first. I will open an issue about it soon. |
|
For efficient spatial queries, in the past I have used R-trees from Anyways, these optimizations can come after the basic infrastructure for spatial queries is established. |
|
I agree with first creating classes for spatial search. Both the uris and remeshing code use linear search for point location.
|
Uh oh!
There was an error while loading. Please reload this page.
Currently, svMultiPhysics has the option to link DOFs from different meshes using
<Add_Projection>. The current implementation is used in two main applicationstests/cases/fsi/pipe_3dfor example) to match the inner-wall DOFs from the structure problem to the lumen wall DOFs from the fluid.tests/cases/cep/cylinder_purkinje_1d3d).Both applications match nodal positions between meshes and assign the same DOFs to both meshes. I believe the fluid and solid meshes are always conforming in the FSI case, so the nodal position match is direct. In EP, however, the 1D mesh nodes will not match the 3D mesh nodal positions, so the code finds the nearest-neighbor node, which changes the geometry (see #499).
The current implementation exists mostly in
read_msh.cppwhere the mainset_projector()function calls thematch_faces()function, where the matching of nodes occurs, and the shared DOFs are assigned.Related desired features
In EP, the amount of current you inject into the myocardium determines whether depolarization is triggered, making this approach more appropriate because it is not mesh-dependent (like the others).
These two more complex approaches require calling "projector" related functions during the solve, so not everything is contained in the presolve stage.
Proposed implementation
Create a
Projectorclass (not sure about the name) that handles the setup of these projections (like thematch_faces()function) and contains all the required functions that can be called during the solve if needed.This branch has a (mostly vibe-coded) object-oriented implementation of my old MPC implementation. I can extend it to the other projection types (and clean up the implementation), but I have a few questions.
Questions
com_modowns theProjectorobject, so it is easy to access from anywhere, but I am not sure this is the best option.All reactions