Closed trevilo closed 2 years ago
A few notes/thoughts as we start to look into this functionality...
GridFunction
on a subdomain of a mesh is not possible. See discussion on MFEM #1124. Not immediately clear if subsequent developments have changed this situation.trimmer
miniapp. See discussion on MFEM #1551 and code at trimmer.cppHave we considered creating Vector
s from elements sharing the same attribute? We could build meshes with different "physical attributes" and then create different vectors pointing to the elements of certain attributes. Or just apply different sets of equations to elements with different attributes.
We can get the attribute of an element from the GridFunction
through the FiniteElementSpace
, i.e.
Up->FESpace()->GetAttribute(elemID)
Have we considered creating
Vector
s from elements sharing the same attribute? We could build meshes with different "physical attributes" and then create different vectors pointing to the elements of certain attributes. Or just apply different sets of equations to elements with different attributes.We can get the attribute of an element from the
GridFunction
through theFiniteElementSpace
, i.e.Up->FESpace()->GetAttribute(elemID)
Yes, I think anything we might do on a single mesh would have to be based on the element attribute. But, I'm not following the specifics of your idea. Tzanio contemplated three approaches in the discussion here (in MFEM #1124):
Item 1 seems easy to implement with existing MFEM capabilities, but is inefficient. Item 2 is what I was thinking we would do, but isn't (or at least wasn't) directly supported by MFEM. If it requires significant changes in MFEM or a lot of extra code on our part, maybe it is less attractive. Item 3 seems like a reasonable approach, particularly given that we've contemplated using different mesh resolutions for different physics anyway, but would require an interpolation capability to come online immediately.
Does your idea sit in one of these categories or is it something different?
I guess I was thinking along the lines of item 2. Since generating two grid functions for two domains isn't supported I'd allocate the variables in two independent vectors and operate over the data in those vectors. The drawback would be that we'd need to create functions for the different operators in a way similar to what I've done with the GPU version, i.e., computing gradients wouldn't be as easy as calling GridFunction.ComputeGradient()
@marc-85: ok, I got it. Thanks.
Comment for testing: expect to add additional bats test which runs a current flow and EM (parallel) test at the same time and verifies the solutions against running each independently.
For an example implementation of the "separate meshes + interpolation" approach in MFEM using gslib, see the overlapping grids miniapps, specificially the conjugate heat transfer example.
Noting a couple recent mfem developments...
1) MFEM PR 315 offers a potential alternative to GSLIB-based solution transfer between meshes 2) Improved GSLIB support, including support for mixed meshes, appears to be on the horizon (see MFEM PR 2948)
As an example, start with single mesh that contains both flow-only and EM-only domains and reproduce flow-only and EM-only standalone resuls