|
[Sponsors] |
[swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 27, 2012, 08:33 |
SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers
|
#1 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
For some time I have been working on writing two python plug-in scripts for Blender 3D. The two tools assists the user in creating the blockMeshDict and snappyHexMeshDict with associated files. The tools have no interdependencies, but the users may use SwiftBlock to create more advanced base meshes for snappyHexMesh than just a single block.
I have the hope that the tools are easy to use, but please read the short user guides before starting. If anyone encounters problems, please bring them up here on the forum. The two tools are tested in Blender 2.6x (They may also work for 2.5x, but not older, as Blender has gone through major revisions) using Ubuntu Oneiric 64-bit and Windows XP. Precompiled (recommended) versions are available at http://www.blender.org http://openfoamwiki.net/index.php/SwiftBlock http://openfoamwiki.net/index.php/SwiftSnap I encourage people to suggests improvements and make own versions. Based on Python 3.2, the scripts are very easy to understand and customise. Kalle |
|
April 28, 2012, 14:05 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Kalle,
Many Thanks for these plug-ins and documentation! I hope you don't mind, I've taken the liberty to transcribe the documents into wiki format, as well as doing some formatting tweaks to the wiki pages. I haven't tested the plug-ins myself, but I thought this would help boost the documentation side as well This way it will hopefully easier for people to make additional contributions! Best regards, Bruno
__________________
|
|
April 28, 2012, 15:40 |
|
#3 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Thanks a lot Bruno!
I wanted to do that myself, but yesterday I ran out of time. Really good! Regards, Kalle |
|
May 1, 2012, 06:20 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
May 1, 2012, 07:06 |
|
#5 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Bernhard,
Quote:
Bruno
__________________
|
||
May 1, 2012, 12:45 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
May 5, 2012, 09:42 |
|
#7 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
I've added an example case for SwiftBlock on the wiki.
|
|
May 6, 2012, 11:04 |
|
#8 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
... and now there is also an example case to download for SwiftSnap - see the wiki.
One note though: Blender is not known for having great compatibility between versions. Both example cases have been made in v2.61 on 64-bit Ubuntu. I do not know how well these cases open on other Blender versions and/or OS's. Kalle |
|
May 14, 2012, 16:25 |
|
#9 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Another case added for SwiftBlock, the same bent T-junction as above, but using blockMesh instead of snappy.
I will give a talk on these two tools at the upcoming workshop also. K |
|
May 30, 2012, 05:53 |
|
#10 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
I just found out that Blender has undergone a major update on mesh handling with v2.63; faces can now have any number of vertices, compared to 3 or 4 in previous versions. This change also influence the python scripts and renders both my tools unusable with this version.
Hence, I recommend to use 2.61 and 2.62 until further notice. K |
|
May 30, 2012, 06:16 |
|
#11 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
BTW: are you planing to put your scripts under version control (git, mercurial, ... anything) somewhere (bitbucket, openfoam-extend, ....)? That would ease deploying intermediate versions to those interested in testing (I'd propose organizing the repos in such a way that a clone of the repo in addons_contrib yields a working version) |
||
May 30, 2012, 08:02 |
|
#12 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Hi!
Good to have caught an issue. Please post here if you have troubles. Both tools should easily be applicable to the default start-up Box in Blender. It seems to work to just replace all calls to xxx.data.faces with xxx.data.polygons in both tools. You can also remove the whole "def faces_from_mesh" function, as it is not used. I had a feeling that revision control was overkill for these tools... now I start to realize it might be useful, especially as there will have to be different versions for different Blender versions. How can I commit to the extend project? K |
|
May 30, 2012, 08:48 |
|
#13 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
Code:
try: val=foo.data.faces except AttributeError: # I THINK this is the exception val=foo.data.polygons # use val (assuming it is still the same) Quote:
You need to be granted write-access. If I put on my admin hat this is possible ... About the choice of the VCS. That depends on what you're comfortable with. The two basic options are:
|
||||
May 30, 2012, 15:11 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
FYI: I've updated the two wiki pages: "v2.6x, with x<3."
__________________
|
|
May 31, 2012, 08:05 |
|
#15 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Thanks Bruno for the update.
Thank you too Bernhard for the tip. try/except looks like a suitable fix. I'll get back to you on how to proceed for revision control. We could also speak at the workshop. Another issue with swiftSnap. If a refinment region is hidden when you write your dicts & stl files, Blender will create an empty stl-file for the refinement region. This is particulary annoying since the user will not be warned, but snappy will crash with a FPE. Keep your objects visible. I'll make the code turn on visibility for the refinment objects in an update. K |
|
May 31, 2012, 14:36 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Looking forward to meeting you at the workshop |
||
June 24, 2012, 01:34 |
|
#17 |
New Member
Join Date: May 2012
Posts: 4
Rep Power: 14 |
does it work for the 2.6.3 already?
Last edited by wilker; June 24, 2012 at 01:45. Reason: my mistake, sorry. my blender version is 2.62... |
|
June 25, 2012, 09:42 |
|
#18 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Hi,
I have been trying out 2.63 on my machine, and it can run after some modifications. I feel the code will be a bit ugly if it should be compatible with both 2.63 and 2.62, so I did not release it though... however, you can find 2.62 on Blender.org. K |
|
August 14, 2012, 15:47 |
|
#19 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
Ok, folks, a new version is here. Now you can set edge resolution and force edges to have certain resolution, by overriding the values automatically calculated. There is also a diagnose button that will mark any edges not participating in the block structure, typically indicating some error - saves some headache. You'll find it on the wiki.
K |
|
August 14, 2012, 18:09 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Kalle,
Two questions:
Bruno
__________________
|
|
|
|