It seems like we keep having the same conversation. The answer remains the 
same: contact ITASCA for support. They have embedded very old versions of FiPy 
that we don’t support. FiPy is free and open. There is zero reason not to 
upgrade to what we do support.

- FiPy 3.1 is eight years old. Don’t use it. We don’t support it.

- This line:


File "C:\Program 
Files\Itasca\PFC700\exe64\python36\lib\site-packages\fipy\meshes\gmshMesh.py", 
line 124, in openMSHFile
    if version < StrictVersion("2.0"):

means that you’ve now got FiPy 3.3. That’s two years old. Don’t use it. We 
don’t support it.

- Even in FiPy 3.3, `version` is a StrictVersion object, not a float, so the 
error you get is impossible.

- However, in your own script, this line of code breaks FiPy and returns a 
float, causing the error.

fp.meshes.gmshMesh._gmshVersion = lambda **kwargs: 2.0

Don’t do that.



On Mar 31, 2021, at 7:04 PM, Ali Sheikholeslam 
<[email protected]<mailto:[email protected]>> wrote:

I have written a question in:
https://stackoverflow.com/questions/66892826/problem-in-opening-of-mesh-file-by-fipy-gmsh3d-module<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F66892826%2Fproblem-in-opening-of-mesh-file-by-fipy-gmsh3d-module&data=04%7C01%7Cjonathan.guyer%40nist.gov%7Ceccd1c5d4b2644c6767308d8f499654d%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C1%7C637528286962231351%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=bFQWsEhXv0Fa5vFCp4J1miBiKV7y7xfE7Nw9xjo4ugo%3D&reserved=0>
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<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1O89bRXT7xu_msMJda4QJmi1wCSuy5xze%2Fview%3Fusp%3Dsharing&data=04%7C01%7Cjonathan.guyer%40nist.gov%7Ceccd1c5d4b2644c6767308d8f499654d%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C1%7C637528286962231351%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=oNKScKaUNXto1iFo9EoFL%2FlBGXMnHd81788o43tVbQM%3D&reserved=0>

import fipy as fp
fp.meshes.gmshMesh._gmshVersion = lambda **kwargs: 2.0
def 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]<mailto:[email protected]>

View this message at https://list.nist.gov/fipy

-- 
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