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

io.import_foam_mesh #11

Open
fbob opened this issue Oct 15, 2015 · 2 comments
Open

io.import_foam_mesh #11

fbob opened this issue Oct 15, 2015 · 2 comments

Comments

@fbob
Copy link

fbob commented Oct 15, 2015

I would like to use io.import_foam_mesh to read the tutorial mesh with io.import_foam_mesh('./buoyantCavity') but got the following issue:

TypeError                                 Traceback (most recent call last)
<ipython-input-28-6999881f8411> in <module>()
----> 1 mesh = ow.io.import_foam_mesh('./buoyantCavity.old/')

/home/beaubert/.local/lib/python2.7/site-packages/Owls-0.0.0-py2.7.egg/Owls/io.pyc in import_foam_mesh(path, exclude)
    271             search="constant\/polyMesh",
    272             files=['faces', 'points', 'owner', 'neighbour'],
--> 273             exclude = exclude,
    274         )
    275     if not fileList:

/home/beaubert/.local/lib/python2.7/site-packages/Owls-0.0.0-py2.7.egg/Owls/io.pyc in find_datafiles(path, files, search, exclude)
     77             list of found files
     78     """
---> 79     data_folders = find_datafolders(search, path, exclude)
     80     return OrderedDict(
     81         [(time, _get_datafiles_from_dir(time, files))

/home/beaubert/.local/lib/python2.7/site-packages/Owls-0.0.0-py2.7.egg/Owls/io.pyc in find_datafolders(regex, path, exclude)
     92     folders = []
     93     for fold, dirs, _ in os.walk(search_folder):
---> 94         dirs[:] = [d for d in dirs for ex in exclude if not re.match(ex, d)]
     95         if re.match(complete_regex, fold):
     96             folders.append(fold)

TypeError: 'NoneType' object is not iterable
@greole
Copy link
Owner

greole commented Oct 22, 2015

The commits 7b86e9b and 12f3523 should fix the error msg. At the moment import_foam_mesh just reads the 'faces', 'points', 'owner', 'neighbour' files and returns a DataFrame. Next step should be a function that generates 'cellCentres' from that DataFrame.

@greole
Copy link
Owner

greole commented Oct 30, 2015

Commits 9c6bcbb and 2f16236 introduces Owls.mesh.Mesh you can create an Mesh object and compute face and cell centres. That already allows us to filter eulerian fields by spatial criteria. However so far this is only experimental and results for tetrahedra or skewed meshes are not correct atm. Next step will be sample lines and then parallel processing.

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