|
[Sponsors] |
[Other] HexBlocker a GUI for blockMeshDict, alpha release |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 17, 2013, 14:30 |
HexBlocker a GUI for blockMeshDict, alpha release
|
#1 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi Foamers!
I've been developing a GUI for blockMesh and I think it's ready for an early alpha release (under GPL). For now it goes under the name of hexBlocker. It's written in C++ and is based on Qt and VTK. I've attached a couple of screenshots. As of now hexBlocker has the following features and limitations
If you'd like to try it out you'll need to clone it with git and compile. Don't worry there's a script included. If you can compile OpenFOAM and ParaView then you have all the required dependencies. Listed below are the packages I needed on a more or less clean install of Ubuntu 12.04. Code:
sudo apt-get install git cmake qt4-dev-tools libqt4-dev libxt-dev Code:
git clone git://github.com/nicolasedh/hexBlocker cd hexBlocker ./install.sh Bear in mind that this is a spare time project. The intention was for me to learn some C++ outside OpenFOAM nevertheless I think hexBlocker might evolve to something useful. If you'd like to chip in just send me an PM or email. HexBlocker is not not endorsed by, approved by nor affiliated with anyone but me. OpenFOAM(R) is a trademark of OpenCFD. |
|
March 18, 2013, 07:40 |
|
#2 |
Senior Member
Join Date: Dec 2011
Posts: 111
Rep Power: 19 |
Wow, this looks really nice. This is a really useful tool, because you can make a lot of different high-quality meshes with blockMesh, but it's not very user-friendly. However, I get a build error:
Code:
[ 48%] Building CXX object CMakeFiles/HexBlocker.dir/HexPatch.cpp.o /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp: In member function ‘void HexBlock::initPatches()’: /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:382:32: error: taking address of temporary array /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:384:32: error: taking address of temporary array /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:386:32: error: taking address of temporary array /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:388:32: error: taking address of temporary array /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:390:32: error: taking address of temporary array /home/haakon/Downloads/hexBlocker/src/HexBlock.cpp:392:32: error: taking address of temporary array make[2]: *** [CMakeFiles/HexBlocker.dir/HexBlock.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/HexBlocker.dir/all] Error 2 make: *** [all] Error 2 error in make for hexBlocker |
|
March 18, 2013, 13:59 |
|
#3 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi,
Thank you for trying out the code! I would seem that newer gcc version don't like the way I was calling the initPatches function. I've pushed a change which I think fixes that issue. I would appreciate if you could pull it and try to recompile. Since my only machine with 12.10 is an old Asus eee. I suspect it will take one day or more to compile vtk on that one. I was doing Code:
initPatch((int[4]){0,3,2,1}); Code:
initPatch(0,3,2,1); Best Nicolas Edit: I just noted Hĺkon already had submited a patch on gitHub. I noticed it after I submited the same fix. Thanks again Hĺkon! By the way, I found a bug which caused extrude patch to misbehave. I've submitted a fix and also added the possibility to load a blockMeshDict from the commandline. Last edited by nsf; March 18, 2013 at 17:15. Reason: noted a Hĺkons pull request on gitHub |
|
April 10, 2013, 16:40 |
New features
|
#4 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi all,
Just wanted to let you know that I've implemented a couple of new features.
I have no experience with packaging, if anybody would like to chip in please send a pm or reply to this thread. Best Nicolas |
|
April 15, 2013, 15:36 |
|
#5 |
New Member
Join Date: Feb 2010
Posts: 28
Rep Power: 16 |
Cool !
Thanks for your efforts developing very useful tool. Unfortunately I cannot compile it, pls. find the attached log file, maybe it helps find reason for the error. BR/Pekka |
|
April 15, 2013, 16:13 |
Possible fix commited
|
#6 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi Pekka!
Thanks for trying out the program and the comment!. I've built and tested hexBlocker with qt-2.8.1 I see from the log file that you are using qt-4.7.4. The first error you're getting is Code:
/home/Pekka/OpenFOAM/Pekka-1.6-ext/applications/hexBlocker/src/GradingCalculatorDialog.cpp: In constructor ‘GradingCalculatorDialog::GradingCalculatorDialog(QWidget*)’: /home/Pekka/OpenFOAM/Pekka-1.6-ext/applications/hexBlocker/src/GradingCalculatorDialog.cpp:38: error: no matching function for call to ‘QDoubleValidator::QDoubleValidator(double, double, int)’ /home/Pekka/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/qt-everywhere-opensource-src-4.7.4/platforms/linux64GccDPOpt/include/QtGui/qvalidator.h:174: note: candidates are: QDoubleValidator::QDoubleValidator(const QDoubleValidator&) /home/Pekka/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/qt-everywhere-opensource-src-4.7.4/platforms/linux64GccDPOpt/include/QtGui/qvalidator.h:169: note: QDoubleValidator::QDoubleValidator(double, double, int, QObject*, const char*) /home/Pekka/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/qt-everywhere-opensource-src-4.7.4/platforms/linux64GccDPOpt/include/QtGui/qvalidator.h:168: note: QDoubleValidator::QDoubleValidator(QObject*, const char*) /home/Pekka/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/qt-everywhere-opensource-src-4.7.4/platforms/linux64GccDPOpt/include/QtGui/qvalidator.h:145: note: QDoubleValidator::QDoubleValidator(double, double, int, QObject*) /home/Pekka/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/qt-everywhere-opensource-src-4.7.4/platforms/linux64GccDPOpt/include/QtGui/qvalidator.h:144: note: QDoubleValidator::QDoubleValidator(QObject*) Code:
git pull If you'd like to chip in I recommend installing qt-creator. And then just go to open project and select the file CMakeLists.txt. Qtcreator will ask you to run cmake (which you'll need to install). It will also prompt you for extra variables. Add Code:
-DVTK_DIR=pathtoHexBlocker/vtk Nicolas Last edited by nsf; April 15, 2013 at 16:13. Reason: typo |
|
April 16, 2013, 06:13 |
|
#7 |
Member
Join Date: Nov 2012
Posts: 58
Rep Power: 14 |
Looks like a great tool! But unfortunately I am stuck in the installation process.
Please pardon my low linux skills. For those of you using OpenSUSE 12.3 and being as ignorant as I was, here are some minor changes that helped me. 1) Some package names mentioned in README-install.txt are different libqt4-dev ---> libqt4-devel zlib1g-dev ---> zlib-devel libreadline-dev ---> readline-devel libncurses-dev ---> ncurses-devel libxt-dev ---> libXt-devel 2) In install.sh change MOC=$(which moc-qt4) ---> MOC=$(which moc) UIC=$(which uic-qt4) ---> UIC=$(which uic) No problems occured during the compilation of vtk. However, I tried running bin/HexBlocker but I got the message Code:
./bin/HexBlocker: error while loading shared libraries: libvtkftgl.so.5.10: cannot open shared object file: No such file or directory |
|
April 16, 2013, 14:09 |
|
#8 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hey,
Thank you for the note about the required packages! I'll add them to the README-file. I'll also improve the install script. I've made the following changes: Code:
MOC=$(which moc-qt4 moc | head -n1) UIC=$(which uic-qt4 uic | head -n1) As for the third point. Are you sure that vtk compiled? Is the missing library present? What does Code:
find -name libvtkftgl.so.5.10 If the library is present then cmake probably hasn't done it's job or something else went wrong. Maybe you moved the executable after compilation? The location of the vtk libraries used by HexBlocker are relative to the executable. You may move the entire install directory but you can't move HexBlocker with respect to the vtk folder. If the library is present you can try to set LD_LIBRARY_PATH or LD_PRELOAD with the absolute path to the vtk libraries. Code:
LD_LIBRARY_PATH=/absolute/path/to/vtk/lib/vtk-5.10 HexBlocker If the library isn't present then VTK did not compile. You'll have to investigate that. I'll go on a two week vacation now so I'll be "afk". I might have time to answer a question or two but don't count on it. I'll be back the 2nd of May. Best Nicolas |
|
April 16, 2013, 14:25 |
|
#9 |
Member
Join Date: Nov 2012
Posts: 58
Rep Power: 14 |
Are you still there?? I hope I caught you before leaving! :-D
The find command returns: ./vtk/lib/vtk-5.10/libvtkftgl.so.5.10 ./build/VTK/bin/libvtkftgl.so.5.10 ./build/VTK/Utilities/ftgl/CMakeFiles/CMakeRelink.dir/libvtkftgl.so.5.10 I did not move anything. I will check the rest tomorrow. Thanks for the answer! |
|
April 16, 2013, 16:06 |
|
#10 |
New Member
Join Date: Feb 2010
Posts: 28
Rep Power: 16 |
Hi Nicolas !
Thanks for your quick reply. Now it compile by using "install.sh" and I can tested it. I tried also build project with QT Creator 2.4.1 and found the following type of problem: BR/Pekka |
|
April 16, 2013, 17:01 |
|
#11 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi,
I'm backing the bags so be out soon but I'm still here. I can't be sure what the problem is. Are you using an older version of cmake? You could try to compare the output of Code:
ldd bin/HexBlocker | grep ibvtkftgl.so.5.10 Best Nicolas |
|
April 16, 2013, 17:08 |
|
#12 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi Pekka,
I'm also using qtcreator 2.4.1 so that shouldn't be the problem. If you go to help->about Qtcreator. What Qt-version is it using? From the documentation I see that "setPlaceholderText()" was introduced in Qt4.7. Most likely your qt-creator has not found the custom compiled qt you are using when you compile HexBlocker. It's probably possible to "point" QtCreator to a custom compilation of Qt. I don't know how though. Best Nicolas |
|
April 17, 2013, 04:15 |
|
#13 |
Member
Join Date: Nov 2012
Posts: 58
Rep Power: 14 |
Ok, I updated my LD_LIBRARY_PATH variable by adding the following line to ~/.bashrc:
Code:
export LD_LIBRARY_PATH=/home/username/OpenFOAM/hexBlocker/vtk/lib/vtk-5.10:$LD_LIBRARY_PATH I will provide feedback about the program as soon as I get a bit more familiar with it. |
|
June 11, 2013, 10:11 |
Installation
|
#14 |
New Member
Join Date: Sep 2012
Posts: 1
Rep Power: 0 |
Hi,
Use Ubuntu 12.04 LTS and during the installation process after the command: Code:
./install.sh Code:
/bin/bash^M: bad interpreter: no such file or director Code:
dos2unix install.sh |
|
June 11, 2013, 18:18 |
|
#15 | |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Quote:
I played around with some settings with git and it borked end of line characters. I've fixed it in the latest commit (hopefully). Your welcome to try it out. Best Nicolas |
||
June 11, 2013, 18:22 |
New Features
|
#16 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi all,
I've implemented a couple of more features. It's now possible to create arcs on edges. HexBlocker will read and write arc and line but will ignore polyLines, simpleSpline and polySpline. You can select a patch and optionally a radius and HexBlocker will calculate the third arc point for you. Just update with git clone or follow the steps in the first post. Best Nicolas |
|
June 24, 2013, 06:59 |
blockMeshDict format
|
#17 |
New Member
Peter Reupke
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
Hi Nicolas
As a newcomer to OpenFoam (and returning to CFD after many years) I've found your GUI very useful - initially for debugging meshes and then for creating them. Many thanks for your efforts. I have just one little request: when writing the blockMeshDict file, it would be help readability and text editing if a CR or LF (as appropriate) were inserted after each hex () declaration. On my system (Ubuntu 12.04, OF 2.2) all the blocks are on one line. Peter |
|
June 24, 2013, 13:18 |
|
#18 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi Peter and welcome to the forums!
Thank you for trying out the code and giving feed back. I'v committed and pushed a change which adds line breaks between blocks. Recently I've been busy with other spare time projects so there has been little activity. My plan is to add support for splines and lines. After that I'll look in to splitting blocks. I'll just have to find the time. There is summer time in Sweden so there are other activities with higher priorities right now =) Let me know if you encounter other issues. Best Nicolas Ps to update just run Code:
git pull ./install.sh Last edited by nsf; June 24, 2013 at 13:19. Reason: Note on how to update |
|
July 5, 2013, 11:04 |
Feedback
|
#19 |
New Member
Peter Reupke
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
Nicolas
Many thanks for that little change - it makes it a lot easier to use a text editor alongside the GUI. Enjoy your Swedish summer and don't spend too much time at the computer! I know it's an Alpha release, but I hope you won't mind if I report a few bugs and observations about the program's behaviour, in case you haven't found them yourself. (all these relate to the latest version with OF 2.2 and Ubuntu 12.04). Bugs ---- 1. Edges on the slave block don't move to the correct position after patches are merged. Work around: save and reload file. 2. Simplegrading values of less than 1 often get overwritten as 0. I haven't yet worked out when this behaviour occurs. 3. On one occasion, the program reordered the vertices in a file that I had started in a text editor. I haven't had a repeat, but I haven't been trying to recreate it. 4. Occasional crashes (but very rare). Problems that aren't strictly bugs -------------------------------- 1. Extruding adjacent patches to create adjacent blocks creates duplicate vertices even if the patches are extruded by the same distance. This creates non-empty internal patches (i.e. baffles) that are tricky to remove. If it is possible to code it easily, it would be great to be able to extrude a multiple selection of patches at one go to avoid this problem. 2. No delete vertices tool (this might help solve the first problem), but would also need vertices to be renumbered throughout. 3. Manually entered comments are lost when saving from hexBlocker. And to finish on a positive note: Things that are brilliant! ----------------------- 1. Being able to select all the dependent edges in one go and change the mesh size and grading for all of them. 2. Defining boundary conditions for multiple patches by clicking on them - no more trying to think inside the box! Peter |
|
July 5, 2013, 13:39 |
|
#20 |
Senior Member
Nicolas Edh
Join Date: Mar 2010
Location: Uppsala, Sweden
Posts: 123
Rep Power: 18 |
Hi Peter, thanks for the feedback, I do appreciate it!
I was aware of bugs 1 and 4. I can't recreate number 4 it could be a race condition where the code starts a rerender and then starts a second rerender before the first completes. If you find a way to recreate the crashes please let me know. The first was introduced when I enabled arcs I haven't found the time to work on it. The fix should be easy. Bug 2 is interesting. I haven't seen it before, does it get replaced in the GUI or in the blockMeshDict or both? If you can find a way to repeat bug 3 I'm interested. I'll keep an eye out for it. There is no intentional reordering of vertices, the Ids are only changed when merging patches. It could perhaps be related to bug 1. Semi bug 1: I've noticed this as well when I coded the extrude algorithm. I can't really get my head around how one would extrude them simultaneously. One would have to search all other patches that also extruded and check if they share a vertice. And then I'm not sure how to continue. Semi bug2: This is intentional, the idea is to simplify block creation by eliminating the need to manually create (or delete) patches, edges and vertices. The code should do this for you. Semibug3: Well, currently the entire file is rewritten and comments are filtered out. I think it would take quite a bit of coding to be able to save all comments. Also polyLines, simpleSplines and polySplines will be overridden. I could create a table of vertices, where there position is edited manually. This would provide a work around for semibugs 1:3. No real need to work simultaneously with a text editor If you have ideas and wan't to help out I'm willing to help and explain what the code does. I've put some effort in keeping the code well documented so others could chip in. And thanks for the positive feedback! I'm glad you find hexBlocker use full! Best Nicolas |
|
Tags |
blockmesh, gui, mesh, pre-processing |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ANSYS Workbench on "Uncertified" Linux Distros | hsr | CFX | 289 | April 20, 2023 10:23 |
New CastNet Release: GUI Environment for OpenFOAM and CalculiX | MartinB | OpenFOAM Announcements from Other Sources | 0 | January 13, 2017 11:27 |
alphaEqn.H in twoPhaseEulerFoam | cheng1988sjtu | OpenFOAM Bugs | 15 | May 1, 2016 17:12 |
New CastNet release: GUI environment for OpenFOAM® | ulli | OpenFOAM Announcements from Other Sources | 1 | July 31, 2013 07:25 |
Openfoam Ubuntu 12.04 Unmet dependencies | slls33 | OpenFOAM Installation | 10 | April 9, 2013 05:16 |