I have written a question in:
https://stackoverflow.com/questions/66892826/problem-in-opening-of-mesh-file-by-fipy-gmsh3d-module
It was recommended to send this subject to the mailing lists.

I'm trying to couple ITASCA software named PFC v7 demo with FiPy using PFC
embedded python environment to solve a coupled solid-fluid interaction. The
mesh file and a short sample code is as follows:

https://drive.google.com/file/d/1O89bRXT7xu_msMJda4QJmi1wCSuy5xze/view?usp=sharing

import fipy as fp
fp.meshes.gmshMesh._gmshVersion = lambda **kwargs: 2.0def Mesh():
    print("Test")
    mesh = fp.Gmsh3D('small.msh')
    print("Ok")
Mesh()

or

if __name__ == '__main__':
    import fipy as fp
    fp.meshes.gmshMesh._gmshVersion = lambda **kwargs: 2.0
    class DD(object):
        def __init__(self):
            print("Test")
            self.mesh = fp.Gmsh3D('small.msh')
            print("Ok")
    solver = DD()

I have simulated the coupling with PFC v5 (where python v: 2.7.9, FiPy v:
3.1, and numpy v: 1.9.2) and v6 (where python v: 3.6.1, FiPy v: 3.1, and
numpy v: 1.13) before. In PFC v7, where python and its libraries are the
same version as PFC v6, I have got the following error:

Traceback (most recent call last):
  File "'<itasca-code-1-fa569b32e3be>'", line 151, in <module>
  File "'<itasca-code-1-fa569b32e3be>'", line 13, in __init__
  File "C:\Program
Files\Itasca\PFC700\exe64\python36\lib\site-packages\fipy\meshes\gmshMesh.py",
line 1948, in __init__
    background=background)
  File "C:\Program
Files\Itasca\PFC700\exe64\python36\lib\site-packages\fipy\meshes\gmshMesh.py",
line 124, in openMSHFile
    if version < StrictVersion("2.0"):
  File "C:\Program
Files\Itasca\PFC700\exe64\python36\lib\distutils\version.py", line 64,
in __gt__
    c = self._cmp(other)
  File "C:\Program
Files\Itasca\PFC700\exe64\python36\lib\distutils\version.py", line
170, in _cmp
    if self.version != other.version:
AttributeError: 'float' object has no attribute 'version'

I'm guessing it is related to FiPy mesh file opening because my code
stopped at there (error is related to: line 136,
https://github.com/usnistgov/fipy/blob/master/fipy/meshes/gmshMesh.py),
where the code reach self.mesh = fp.Gmsh3D('small.msh'), and mesh elements
were not applied even by mesh file location addressing; the mesh file is
converted from VTK to gmsh2_ascii and is working in PFC v6. It is not
related to incompatibility of old FiPy library version 3.1 and Python
version upper 3 because this error was not appeared by these FiPy and
python versions in PFC v6 !! I think this error is not related to 'demo'
PFC version and is related to another reason. I would be appreciated if
anybody could advise on this error. Where the error is related to? Is there
any solution without FiPy upgrading to 3.3 and upper?

*Note that, it seems, the final error "AttributeError: 'float' object has
no attribute 'version'" is due to unrecognized mesh file.*

-- 
To unsubscribe from this group, send email to [email protected]

View this message at https://list.nist.gov/fipy
--- 
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to