CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree67Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2017, 05:26
Default
  #261
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 176
Rep Power: 6
Flowkersma is on a distinguished road
Hi,


@Vignesh, this error is related to NumPy. You have too old version.

@Eero, your testcase works well on my computer. Can you look at the blockMeshDict file and see if the projections are listed there?

Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   November 8, 2017, 08:28
Default
  #262
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 10
ekeero is on a distinguished road
I finally got it working, but only with blender_2.76.b+dfsg0-3build1, I did not got it working with 2.77, 2.78 or 2.79 Blender versions.

The blockMeshDict is showing the projections.

I saved the mesh with Blender 2.76 and with 2.79 from the same test case.
- both created the very same blockMeshDict (checked with diff)

I ran the blockMesh with the constant/geometry/Sphere.stl for both cases
- case generated with 2.76 succeeded in the projections correctly as the preview mesh in Blender
- case generated with 2.79 did not

So this means that the problem is in the Sphere.stl which 2.79 generates because the BlockMeshDicts are exactly same...

BR.
Eero
ekeero is offline   Reply With Quote

Old   November 8, 2017, 10:00
Default
  #263
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 176
Rep Power: 6
Flowkersma is on a distinguished road
Ok, thanks!

A new argument "use_selection" for the stl export has been introduced in the new Blender versions which was causing the bug. I just pushed a bug fix which resolves this.
Flowkersma is offline   Reply With Quote

Old   November 8, 2017, 10:10
Default
  #264
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 10
ekeero is on a distinguished road
Great, now it's all good!

Thanks for the very quick fix, the tool is great!

BR.
Eero
Flowkersma likes this.
ekeero is offline   Reply With Quote

Old   November 8, 2017, 15:04
Default
  #265
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 8
vigneshTG is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi,


@Vignesh, this error is related to NumPy. You have too old version.

@Eero, your testcase works well on my computer. Can you look at the blockMeshDict file and see if the projections are listed there?

Regards, Mikko

Hi Mikko,
Thanks for the quick reply, i updated to the latest numpy (1.8.2). I don't get errors when i use Eero's file and i am able to build the mesh succesfully.

But when i try the sphere meshing tutorial from scratch, i get the same error as below.
(when i click build blocks the error starts showing.)

Code:
Traceback (most recent call last):
  File "/home/vignesh/blender/2.79/scripts/addons/swiftBlock/__init__.py", line 396, in invoke
    log, block_verts, block_edges, face_info, all_edges, faces_as_list_of_nodes = blockBuilder.blockFinder(edges, verts, disabled = disabled, numba = ob.useNumba)
  File "/home/vignesh/blender/2.79/scripts/addons/swiftBlock/blockBuilder.py", line 105, in blockFinder
    tmp_v,tmp_e = cycleFinder(edges,range(len(vertices_coord)))
  File "/home/vignesh/blender/2.79/scripts/addons/swiftBlock/blockBuilder.py", line 59, in cycleFinder
    temp, u = np.unique(np.sort(faces), axis=0, return_index=True)
TypeError: unique() got an unexpected keyword argument 'axis'
Attached Files
File Type: gz sphere.tar.gz (96.5 KB, 0 views)
__________________
Thanks and Regards

Vignesh
vigneshTG is offline   Reply With Quote

Old   November 9, 2017, 05:16
Default
  #266
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 176
Rep Power: 6
Flowkersma is on a distinguished road
Hi Vignesh,

The latest numpy version is 1.13 and only that version has the axis argument for the numpy.unique function. When I have the time I will remove this dependency so that SwiftBlock works also with older versions of numpy.
Flowkersma is offline   Reply With Quote

Old   November 11, 2017, 06:06
Default
  #267
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 8
vigneshTG is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi Vignesh,

The latest numpy version is 1.13 and only that version has the axis argument for the numpy.unique function. When I have the time I will remove this dependency so that SwiftBlock works also with older versions of numpy.
Hi Mikko,

I was finally able to solve the problem and get the mesh done. The error happens even if the numpy is updated to the latest version. It can be rectified by

Code:
copying the numpy folder  from the lib/python3.x/site-packages subdirectory of 
your local Python 3.x installation into the scripts/modules subdirectory of Blender
 (not into the python/lib/python3.2/site-packages subdirectory
This solves the problem.
__________________
Thanks and Regards

Vignesh
vigneshTG is offline   Reply With Quote

Old   November 13, 2017, 03:13
Default
  #268
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 176
Rep Power: 6
Flowkersma is on a distinguished road
Hi Vignesh,

I am glad to hear that you got SwiftBlock finally working!

I should have been more explicit with the installation. The numpy that Blender uses must be updated to latest version. Depending on your installation, Blender may use local numpy or it may come with its own numpy. The numpy version that Blender uses can be found by writing following to the Blender Python console:

Code:
import numpy; print(numpy.__version__)
Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   April 9, 2019, 06:01
Smile Upgrade SwiftBlock to Blender 2.8?
  #269
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 9
Rep Power: 10
tkeskita is on a distinguished road
Hello @Flowkersma and @kalle,

I just tested Mikko's SwiftBlock version on Blender 2.79 with Numpy 1.16.2 and OpenFOAM.org 6. Great work! Does either one of you intend to upgrade your code to Blender 2.8? I recently made a snappyHexMesh GUI addon for Blender 2.8, and I'm thinking about trying to upgrade swiftBlock as well.

BR,
Tuomo
wyldckat likes this.
tkeskita is offline   Reply With Quote

Old   April 11, 2019, 03:41
Default
  #270
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 9
Rep Power: 10
tkeskita is on a distinguished road
Hello @Flowkersma and @kalle,


your github repositories seem to lack specification of license for your codes, although some single files include GPL headers. Could you please add an explicit LICENSE file to your repositories to make it clear, thanks!
wyldckat likes this.
tkeskita is offline   Reply With Quote

Old   April 28, 2019, 05:35
Default SwiftBlock upgraded to Blender 2.8 series
  #271
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 9
Rep Power: 10
tkeskita is on a distinguished road
Hello all,

I got license confirmation from @kalle, and now also Flowkersma repository has updated explicit LICENSE file (GPL v3). Thanks!

I went ahead and upgraded Flowkersma version of SwiftBlock to Blender 2.8 series (currently Blender 2.80 beta). The add-on source code and documentation is available at https://github.com/tkeskita/swiftBlock.


I hope to finetune a few more things in the add-on, but it should be working OK already now.


Happy meshing!
tkeskita is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 18:26.