Skip to content
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

Some missing functionality from MFEM? #160

Closed
i3s93 opened this issue Dec 18, 2022 · 1 comment
Closed

Some missing functionality from MFEM? #160

i3s93 opened this issue Dec 18, 2022 · 1 comment
Assignees

Comments

@i3s93
Copy link

i3s93 commented Dec 18, 2022

Hello! I would like to inquire about particular features from MFEM that do not seem to be supported in PyMFEM and was wondering if there are any possible workarounds or plans to support these capabilities. The two scenarios I'm concerned with are as follows:

  1. For non-conforming meshes, how can I access the mfem::Mesh::FaceInfo structure to discern master and slave elements on shared faces? Additionally, there does not seem to be support for mfem::Mesh::GetFaceElementTransformations. In the latter case, the workaround I used was to call mfem::Mesh::GetFaceElements then ask for the corresponding transformations, etc., so this is less of a concern.

  2. For CUDA builds, I would like to call the fast assembly methods, e.g., mfem::LinearForm::UseFastAssembly, which do not seem to be supported after checking with the mfem::LinearForm::SupportsDevice method. Is there a particular reason this feature was not included, or am I missing something?

Thank you in advance!

@sshiraiwa
Copy link
Member

Hi @i3s93 i3s98
Looks like that mfem::Mesh::FaceInfo currently does not return NCFace information. This is easy to fix.
mfem::Mesh::GetFaceElementTransformations should return mfem._ser.eltrans.FaceElementTransformations (or mfem._par....). Here is what happened in my environment.

>>> mesh = mfem.Mesh("beam-quad-amr.mesh")
>>> trs = mesh.GetFaceElementTransformations(3)
>>> trs
<mfem._ser.eltrans.FaceElementTransformations; proxy of <Swig Object of type 'mfem::FaceElementTransformations *' at 0x7f67395262a0> >
>>> dir(trs)
['AdjugateJacobian', 'Attribute', 'BDR_ELEMENT', 'BDR_FACE', 'CheckConsistency', 'EDGE', 'ELEMENT', 'Elem1', 'Elem1No', 'Elem2', 'Elem2No', 'ElementNo', 'ElementType', 'FACE', 'Face', 'FaceGeom', 'FinalizeTransformation', 'GetConfigurationMask', 'GetDimension', 'GetElement1IntPoint', 'GetElement1Transformation', 'GetElement2IntPoint', 'GetElement2Transformation', 'GetFE', 'GetGeometryType', 'GetIntPoint', 'GetIntPoint1Transformation', 'GetIntPoint2Transformation', 'GetPointMat', 'GetSpaceDim', 'HAVE_ELEM1', 'HAVE_ELEM2', 'HAVE_FACE', 'HAVE_LOC1', 'HAVE_LOC2', 'Hessian', 'InverseJacobian', 'Jacobian', 'Loc1', 'Loc2', 'Order', 'OrderGrad', 'OrderJ', 'OrderW', 'Reset', 'SetAllIntPoints', 'SetFE', 'SetGeometryType', 'SetIdentityTransformation', 'SetIntPoint', 'SetPointMat', 'Transform', 'TransformBack', 'TransposeAdjugateJacobian', 'Weight', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__weakref__', 'mesh', 'this', 'thisown']

I think UseFastAssembly is a new feature in MFEM4.5. PyMFEM for MFEM 4.5 is in development in mfem_45_dev.
You also need --mfem-branch=master if you want to build PyMFEM with the newest MFEM master.

>>> python setup.py install --ext-only --mfem-branch=master --with-cuda
>>> python setup.py clean --swig (# just in case delete existing wrapper...)
>>> python setup.py install --swig --mfem-branch=master --with-cuda
>>> python setup.py install --skip-ext --skip-swig --mfem-branch=master --with-cuda

@sshiraiwa sshiraiwa self-assigned this Dec 20, 2022
@i3s93 i3s93 closed this as completed Dec 28, 2022
@sshiraiwa sshiraiwa mentioned this issue Jan 4, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants