hello, when trying to import a CGNS mesh (YF-17 from cgns website), I am getting:
jrcc@bilbo:/data/projects/JrcC/pyfr/cgns_test$ pyfr import yf17.cgns qqq.pyfrm
Traceback (most recent call last):
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/cgns.py", line 114, in _errcheck
raise self._statuses[status]
KeyError: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pyfr", line 11, in <module>
load_entry_point('pyfr==1.9.0', 'console_scripts', 'pyfr')()
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/__main__.py", line 110, in main
args.process(args)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/__main__.py", line 121, in process_import
reader = get_reader_by_extn(extn, args.inmesh)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/__init__.py", line 19, in get_reader_by_extn
return reader_map[extn](*args, **kwargs)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/cgns.py", line 375, in __init__
self._file = file = cgns.open(msh.name)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/cgns.py", line 120, in open
self.lib.cg_open(bytes(name, 'utf-8'), self.CG_MODE_READ, file)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/cgns.py", line 116, in _errcheck
raise CGNSError
pyfr.readers.cgns.CGNSError
I have CGNS 3.4 installed, also created a path variable PYFR_LIBRARY_PATH and link to libcgns.so. Previously, it was complaining libcgns.so not found.
So, I would recommend to build and install from the source using cmake:
$ git clone https://github.com/CGNS/CGNS.git
$ cd CGNS
$ mkdir build
$ cd build
$ cmake ..
$ ccmake .
Then, followings are what I set. I have once experienced enabling 64bit caused error in CGNS3.3.0, so I have turned it off (but not sure if it’s ok now).
CGNS_BUILD_CGNSTOOLS ON
CGNS_BUILD_SHARED ON
CGNS_BUILD_TESTING OFF
CGNS_ENABLE_64BIT OFF
CGNS_ENABLE_BASE_SCOPE OFF
CGNS_ENABLE_FORTRAN OFF
CGNS_ENABLE_HDF5 ON
CGNS_ENABLE_LEGACY OFF
CGNS_ENABLE_MEM_DEBUG OFF
CGNS_ENABLE_SCOPING OFF
CGNS_ENABLE_TESTS OFF
CGNS_USE_SHARED ON
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /data/home/yoshiaki/local/CGNS/build
HDF5_C_LIBRARY_dl /usr/lib64/libdl.so
HDF5_C_LIBRARY_hdf5 /usr/lib64/libhdf5.so
HDF5_C_LIBRARY_m /usr/lib64/libm.so
HDF5_C_LIBRARY_sz /usr/lib64/libsz.so
HDF5_C_LIBRARY_z /usr/lib64/libz.so
HDF5_NEED_MPI OFF
HDF5_NEED_SZIP OFF
HDF5_NEED_ZLIB OFF
Thanks a lot, Yoshiaki. With your help I have successfully (no error message) installed CGNS and linked it to HDF5, also reinstalled pyfr and linked libcgns.so. I did exactly what you showed me. I have also read the thread you provided.
But still, when when i call pyfr import yf17_hdf5.cgns aaa.pyfrm, there is no output file with pyfrm extension generated, also no warning or error reported. Can you tell me what went wrong? Thanks!
Besides, could you just try $ export LD_LIBRARY_PATH=/data/sofrware/mesher/CGNS/build/src/:$LD_LIBRARY_PATH
before reinstalling, executing etc? I would suspect that the libcgns.so is not correctly referred.
So I have successfully imported a sample mesh from CGNS website.
However, when trying to load created with the mesher I am using (cfMesh+ tetMesh), pyfr gives me the following message:
jrcc@bilbo:/data/projects/JrcC/Mesher/cfmesh/PLW_project/case2_coarse$ pyfr import mesh.cgns aaa.pyfrm
Traceback (most recent call last):
File "/usr/local/bin/pyfr", line 11, in <module>
load_entry_point('pyfr==1.9.0', 'console_scripts', 'pyfr')()
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/__main__.py", line 110, in main
args.process(args)
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/__main__.py", line 124, in process_import
mesh = reader.to_pyfrm()
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/base.py", line 20, in to_pyfrm
mesh = self._to_raw_pyfrm()
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/cgns.py", line 422, in _to_raw_pyfrm
rawm.update(mesh.get_connectivity())
File "/home/jrcc/.local/lib/python3.6/site-packages/pyfr/readers/base.py", line 192, in get_connectivity
raise ValueError('Unpaired faces in mesh')
ValueError: Unpaired faces in mesh
Can you tell why pyfr doesn’t like this mesh? I may be able to ask the mesher provider to improve on the issue.