CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[CAD formats] MegaCADs

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

Like Tree14Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2019, 04:33
Default
  #21
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
Hi,


I'm afraid, this is one of the issues caused by the incomplete development of MegaCads. But, don't take those too serious as there is normally an easy workaround for any such problem. First, I suggest you to start off always as follows:
  1. Create the directory in which you want to develop your mesh. Since I use MegaCads with OpenFOAM, I always create a folder called mesh in the OpenFOAM case directory.
  2. Then I open the MegaCads GUI and navigate into that folder and initiate the project (File -> Init). However, you don't need to do so as you can simply create a SAVE_PROC_FILE within that folder manually, e.g. from terminal:
    Code:
    touch SAVE_PROC_FILE
  3. You can now place your commands in the SAVE_PROC_FILE. MegaCads reads that file line by line, whereby each line contains a single directive to, e.g., define variables, create vectors, create a hex mesh block etc. (Maybe in the near future, I will find the time to write some sort of command reference for MegaCads).
  4. If you want to refresh the GUI/view, or more correctly, (re)generate the mesh based on your script file, simply (in the GUI) hit Edit -> Edit script file... and press the Restart button.
Question: Do you want to import a popform file or STL?

  • STL won't be of much use. AFAIK you can only view STLs in MegaCads 2.5.2 but neither edit it nor derive geometric entities etc. from it. However, to do so, add to your SAVE_PROC_FILE a line like
Code:
1 0 import_geometry <format> "$PATH_TO_YOUR_FILE" 0 0 = <choose_name>
The <format> flag must be set to "7" (if I remember right) for STL. Choose a brief but meaningful name (<choose_name>) so you can relate to it easily during mesh development.
  • To import a POPINDA file (e.g. .popform), just put into your SAVE_PROC_FILE a line like the one above. The <format> flag needs to be set to "2" (again, I might be wrong. Just try other numbers 0, 1, 2, ... if it doesn't work) and make it point to your POPINDA mesh file.
I think I will at some point post some sort of DIY user guide for MegaCads. Right now, I simply don't have the time to do so.
NablaDyn is offline   Reply With Quote

Old   July 29, 2019, 04:51
Default Current download link BLoOMYBOXX v2.5
  #22
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
https://www.researchgate.net/publica...OMYBOXX_V25tar


I will provide the latest version (2.7) in the coming weeks
NablaDyn is offline   Reply With Quote

Old   September 10, 2019, 09:44
Default
  #23
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 16
yoooodarulez is on a distinguished road
Hello everyone,

I seem to have some kind of difficulties while trying to import the naca12.dat file into MegaCads in order to begin the tutorial sessions. What i am currently doing is this:

1) File > Project > Open > navigate into the directory where i ve placed the .dat file
2) File > Init that directory

I am getting two extra files generated, afterwards, namely SAVE_PROC_FILE and save.sty files.

However, when im trying to File > Import > Point Data, i dont get any pop up window to choose from.

P.S i also get an ENTITY_FILE once i terminate the session.

Any suggestions?

Thanks
Nick
yoooodarulez is offline   Reply With Quote

Old   September 10, 2019, 09:55
Default
  #24
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
Quote:
Originally Posted by yoooodarulez View Post
Hello everyone,

I seem to have some kind of difficulties while trying to import the naca12.dat file into MegaCads in order to begin the tutorial sessions. What i am currently doing is this:

1) File > Project > Open > navigate into the directory where i ve placed the .dat file
2) File > Init that directory

I am getting two extra files generated, afterwards, namely SAVE_PROC_FILE and save.sty files.

However, when im trying to File > Import > Point Data, i dont get any pop up window to choose from.

P.S i also get an ENTITY_FILE once i terminate the session.

Any suggestions?

Thanks
Nick

Hi Nick,


1) The project directory is the one where, either, your SAVE_PROC_FILE already exists (then you don't really need to initialise but just "restart" via "Edit -> Edit Script File... -> Restart"), or, a new SAVE_PROC_FILE will be created as a result. The SAVE_PROC_FILE is the one you want to play with.
2) "Init" will create the SAVE_PROC_FILE if there is none


If you still don't get it work, just send me an example dat file and I'll post the command to read it into the GUI.


good luck

Last edited by NablaDyn; September 16, 2019 at 07:00.
NablaDyn is offline   Reply With Quote

Old   September 10, 2019, 11:06
Default
  #25
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 16
yoooodarulez is on a distinguished road
Dear Martin,

Thanks for the prompt reply!

The thing is that i dont get a popup window, after i choose File > Import > Point Data, or any other type of file (IGES, STL, ICEM) for that matter, even though, i am within my working directory and SAVE_PROC_FILE (either the old one or the new one after init) is present.

By the way im trying to attach the .dat file (naca12.dat which is found inside the CGRID_2D folder of the software) but it seems to be rejected for some reason.

Thanks,
Nick
yoooodarulez is offline   Reply With Quote

Old   September 10, 2019, 16:59
Default
  #26
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
Quote:
Originally Posted by yoooodarulez View Post
Dear Martin,

Thanks for the prompt reply!

The thing is that i dont get a popup window, after i choose File > Import > Point Data, or any other type of file (IGES, STL, ICEM) for that matter, even though, i am within my working directory and SAVE_PROC_FILE (either the old one or the new one after init) is present.

By the way im trying to attach the .dat file (naca12.dat which is found inside the CGRID_2D folder of the software) but it seems to be rejected for some reason.

Thanks,
Nick

Don't try to use the GUI for file management. As I mentioned somewhere in the forum, MegaCads is a bit buggy and thus some GUI features (especially file management-related) do not behave as expected. For import/export tasks you should refrain to a text editor of your choice (I prefer Gedit with "octave" syntax highlighting) and simply put the respective commands into your SAVE_PROC_FILE manually. For instance:
Code:
1 0 def_working_plane 0
Code:
2 0 read_data "$PATH_TO_DAT_FILE" 0 0 = <choose_significant_name>
Note: AFAIK, process "1" needs to be "def_working_plane ..." (0,1,2 refer to x,y,z, see doc http://www.megacads.dlr.de/). MC always needs a spatial reference plane for specific entities (e.g. vectors) which must be defined at the outset. One can - and normally needs to - change the working plane at any point in the script (SAVE_PROC_FILE).


I recommend you to set up your SAVE_PROC_FILE in the project folder such that it consists only of the above-mentioned commands (adapt $PATH and <name>) and see what happens when you execute from GUI "edit > restart... > restart".

Last edited by NablaDyn; September 10, 2019 at 17:00. Reason: Typo
NablaDyn is offline   Reply With Quote

Old   September 15, 2019, 11:52
Default
  #27
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 16
yoooodarulez is on a distinguished road
Dear Martin,

Thanks for the tip!

There seems to be a beam of light at the end of the tunnel

By doing so, the shape of the airfoil was loaded up, so, for the time being, i m going through this current SAVE_PROC_FILE, the pre made one (situated inside the tutorials folder), which already contains the mesh and the turotial.pdf file (which unfortunately is written in german , in order to figure it out!

Cheers again!
yoooodarulez is offline   Reply With Quote

Old   September 16, 2019, 07:02
Default
  #28
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
Quote:
Originally Posted by yoooodarulez View Post
Dear Martin,

Thanks for the tip!

There seems to be a beam of light at the end of the tunnel

By doing so, the shape of the airfoil was loaded up, so, for the time being, i m going through this current SAVE_PROC_FILE, the pre made one (situated inside the tutorials folder), which already contains the mesh and the turotial.pdf file (which unfortunately is written in german , in order to figure it out!

Cheers again!

Ok, the correct location of the "Restart" button is "Edit -> Edit Script File... -> Restart". I corrected it already in the respective post above (#24)... Sorry for the inconvenience...
NablaDyn is offline   Reply With Quote

Old   September 23, 2019, 07:00
Default
  #29
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 16
yoooodarulez is on a distinguished road
Hey there guys once more.

Unless im wrong and just as it has been mentioned in previous posts, i feel like the software functions, mainly, through the use of scripting, in the SAVE_PROC_FILE, apart from the visualization options, at the bottom section of the gui. So to speak, actions such as splitting, defining polygons, joining curves etc are being deployed through adding the respective command in the aforementioned file and then hitting the restart button from within mcads.

If this is indeed the case, is there any commands line up, with all of the choices (related to the existing gui buttons), so that we know what is the correct syntax etc, in order to implement it in the script file?

I mean, for instance, after going through the first tutorial, there has to be a spline created with the use of the points, loaded from the naca12.dat file. The respective command is:

4 1 spline_polygon P_3(1) = P_4, where 4 is the incremented number (after defining the working plane, reading the .dat file and perhaps defining as variable the airfoil points (?).

By clicking the Spline Button from Cad/Parametrize/Spline, as the tutorial dictates, nothing happens, when i do click the airfoil entity. So i should be able to script it down but then again how are we supposed to know what to script, i.e the spline_polygon syntax as well as the (1) next to the process 3 (P_3).

Thank again!
Nick
yoooodarulez is offline   Reply With Quote

Old   September 23, 2019, 07:30
Default
  #30
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
Quote:
Originally Posted by yoooodarulez View Post
Hey there guys once more.

Unless im wrong and just as it has been mentioned in previous posts, i feel like the software functions, mainly, through the use of scripting, in the SAVE_PROC_FILE, apart from the visualization options, at the bottom section of the gui. So to speak, actions such as splitting, defining polygons, joining curves etc are being deployed through adding the respective command in the aforementioned file and then hitting the restart button from within mcads.

If this is indeed the case, is there any commands line up, with all of the choices (related to the existing gui buttons), so that we know what is the correct syntax etc, in order to implement it in the script file?

I mean, for instance, after going through the first tutorial, there has to be a spline created with the use of the points, loaded from the naca12.dat file. The respective command is:

4 1 spline_polygon P_3(1) = P_4, where 4 is the incremented number (after defining the working plane, reading the .dat file and perhaps defining as variable the airfoil points (?).

By clicking the Spline Button from Cad/Parametrize/Spline, as the tutorial dictates, nothing happens, when i do click the airfoil entity. So i should be able to script it down but then again how are we supposed to know what to script, i.e the spline_polygon syntax as well as the (1) next to the process 3 (P_3).

Thank again!
Nick
Quote:
Unless im wrong and just as it has been mentioned in previous posts, i feel like the software functions, mainly, through the use of scripting, in the SAVE_PROC_FILE, apart from the visualization options, at the bottom section of the gui. So to speak, actions such as splitting, defining polygons, joining curves etc are being deployed through adding the respective command in the aforementioned file and then hitting the restart button from within mcads.
That is in my experience the most efficient way to develop a mesh. This requires the user, of course, to know the command that is to be used.


Quote:
If this is indeed the case, is there any commands line up, with all of the choices (related to the existing gui buttons), so that we know what is the correct syntax etc, in order to implement it in the script file?
An official command reference/manual can be found here: http://www.megacads.dlr.de/
Navigate to "Documentation">"Index" and find what you are looking for. Sometimes even a google search takes you there.


Quote:
I mean, for instance, after going through the first tutorial, there has to be a spline created with the use of the points, loaded from the naca12.dat file. The respective command is:

4 1 spline_polygon P_3(1) = P_4, where 4 is the incremented number (after defining the working plane, reading the .dat file and perhaps defining as variable the airfoil points (?).

By clicking the Spline Button from Cad/Parametrize/Spline, as the tutorial dictates, nothing happens, when i do click the airfoil entity. So i should be able to script it down but then again how are we supposed to know what to script, i.e the spline_polygon syntax as well as the (1) next to the process 3 (P_3).
As far as I remember, the spline button in the GUI works. After you clicked it, you pre-select the respective entities in the GUI window or in the entity list (right. You can extend the list by pulling the tiny grey knob upwards) using the left mouse button (LMB). Don't forget to confirm each pre-selection by hitting the right mouse button (RBM) directly afterwards. Let's assume your command (e.g. "spline") needs two entities A and B. After selecting the spline command in the GUI proceed as follows:
1. LMB entity A
2. RMB entity A
then
3. LMB entity B
4. RMB entity B
then, hit "Exec". You should now see the spline, probably wrongly orientated in the GUI. Also, the command should have been appended to your SAVE_PROC_FILE by MEGACADS. You can check it by looking at your restart file ("Edit>Edit Script File..."). "START"/"POSITIV" relate to the directions of the spline with respect to the entities used for construction (A,B) and can be changed manually in the SAVE_PROC_FILE once the process has been appended. To find the just performed command in your SAVE_PROC_FILE, open - or if already open, refresh - the SAVE_PROC_FILE in your text editor. Be careful not interfere with your SAVE_PROC_FILE whilst using the GUI. Otherwise changes/commands might not take effect or the GUI might crash. By the way, a GUI crash happens always at the same point in your script, there is something wrong with your command or the used entities. You can use the "break_if 1" command to halt MEGACADS during restart at a point of your choice, e.g. "1000 0 break_if 1"


As you see, this is also a nice way to learn a new command. First execute it in the GUI and let MEGACADS append it to your SAVE_PROC_FILE. You can then simply adapt the obtained command line to your needs and reuse it as you wish.
NablaDyn is offline   Reply With Quote

Old   September 23, 2019, 07:39
Default
  #31
Senior Member
 
NablaDyn's Avatar
 
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 10
NablaDyn is on a distinguished road
I opened up a new Thread for usage-related issues concerning MEGACADS:
How to use MEGACADS (DLR)
NablaDyn is offline   Reply With Quote

Old   September 23, 2019, 08:02
Default
  #32
Member
 
yoooodarulez's Avatar
 
Nick
Join Date: Nov 2009
Posts: 45
Rep Power: 16
yoooodarulez is on a distinguished road
Dear NablaDyn,

Thanks for the prompt reply.

I will go through the index which seems to be what i was really looking for.
You were correct, regarding the spline option inside the gui. I simply didnt right click properly!

Cheers for all your effort and the help provided so far!

Nick
yoooodarulez 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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[CAD formats] MegaCads Installation on Ubuntu NablaDyn OpenFOAM Meshing & Mesh Conversion 13 May 29, 2020 13:17
Free structured grid generator: MegaCads Olaf Brodersen Main CFD Forum 0 February 11, 1999 03:16


All times are GMT -4. The time now is 11:45.