mfem / PyMFEM

Python wrapper for MFEM
http://mfem.org
BSD 3-Clause "New" or "Revised" License
225 stars 62 forks source link

How to Install PyMFEM so that it reads Cubit Files? #232

Closed silverrose-llnl closed 4 months ago

silverrose-llnl commented 4 months ago

Hello!

I'm trying to read cubit files and I am getting the following error:

RuntimeError: PyMFEM error (mfem::ErrorException): MFEM abort: NetCDF support requires configuration with MFEM_USE_NETCDF=YES
 ... in function: void mfem::Mesh::Loader(std::istream&, int, std::string)
 ... in file: /__w/PyMFEM/PyMFEM/PyMFEM/external/mfem/mesh/mesh.cpp:4143

I installed PyMFEM using pip install. Is there a way to reinstall it so that it reads cubit files? Do I need to download the repo, change an option in the .cpp file and reinstall from there?

Thanks in advance!

justinlaughlin commented 4 months ago

Hi - some of the dependency builds options are exposed as flags in the PyMFEM build but not all. I think the easiest option may be to install MFEM with what you need (e.g. using the MFEM_USE_NETCDF flag) and then pointing to it when you install PyMFEM. Here is some code that installs using an external MFEM.

silverrose-llnl commented 4 months ago

Thanks! I am now trying to just change the mesh format since I'm trying to keep the installation/use process of my scripts as easy as possible.