Hey all,
Till now, I used CalculiX by manually writing .fbd files for the geometry and then solving it with ccx.
Is there any option, where I can use a .step/iges file geometry with the ccx, instead of creating the .inp myself ?
My aim is to run an optimisation loop (with another open source optimisation software) where the parameters in the .inp file are changed every loop. Both ccx and the optimisation software are called within a shell script
You will have to mesh the step/iges files and apply analysis features to be written in the input file. If you want to run parametric studies involving geometry, you could try using FreeCAD. It supports CalculiX in its FEM workbench, has Python scripting and even some add-ons specifically for parametric studies.
Thanks for the quick reply and Sorry, there was a mistake in my original question:
What if wanted to say was “instead of writing the .fbd file myself”. So how can the mesh and boundary files usually created by cgx for input to ccx, be created by using a step file ?
Could you please provide little more detail on the method you suggested ?
The other software is dakota
In FreeCAD, you can create geometry like in any other CAD software (no need to use step files if you stay in FreeCAD). Then in the FEM workbench set CalculiX study by meshing the geometry and applying analysis features to it. There are many tutorials covering basic setup. Once you get familiar with that, you can try some parametrization/optimization. There is a Spreadsheet workbench to parameterize many aspects of FreeCAD models but for automatic submission you will need a Python script or some ready-made solution like this add-on workbench: FemByGen Workbench - Parametric FEM Analysis - FreeCAD Forum
That is assuming that you want to change the geometry on every iteration. If it’s just about changing the analysis feature while the geometry and mesh always stay the same then there are easier ways since you can just use a script to change the input deck written in text format.
Thanks… that’s sounds great and I will look into it.
But for now, I actually have solidworks files and I do not want to remodel them again in another CAD software. Also I am familiar with using dakota and would like to do the optimisation part with it. So is there also a way I can realise that with solidworks cad files and dakota, instead of having to model the parts again ?
Can this be done with PrePoMax ? and is PrePoMax better than FreeCAD for pre processing (meshing/boundary conditions, etc) ?
FreeCAD can also work with step files. You just won’t be able to parameterize the geometry (unless you add e.g. some cutouts or new extrusions to it). But the rest can be scripted with Python. PrePoMax is great as a pre- and postprocessor for CalculiX but doesn’t have any scripting capabilities yet. The chooce of preprocessor also depends on what kinds of analysis features you want to use - whether they are supported and easy to define in a given preprocessor or not. Of course, basic features like force/pressure loads and displacement boundary conditions are common for all preprocessing tools.
Hi @MS_d,
you could also take a look at Cubit.
There is a free component to allow pre- and postprocessing for calculix that’s already got a pyhton interface to query results.
There is already a webinar that at least describes a Dakota, Cubit Moose workflow too.
There is also to possibility to change geometric features.
Here is a example.
A plate with a hole under tension. I tweak the hole to get a bigger radius and rerun the simulation until a limit mises stress in the hole is reached.
there is a converter available for step/iges files to fbd. You could find that on the download page. For windows there is a binary which needs a certain version of open cascade but for Linux you would have to compile it. You find a README in the downloaded package how to do what is required. Actually I use cgx with my own user functions to generate the geometry based on some geometry parameters (included in my private userFunction.c file) for optimization purposes. I do not use tet elements for that since I prefer to have a deterministic mesh topology. I use the CAD converter only for my manual work with cad geometry. You find some hints in the cgx manual “How to deal with CAD geometry”. If the geometry is easy the whole meshing process could work in batch mode but it could turn out that some of the examples would need manual corrections for line divisions etc.
Calc_em is right, the question is what are you changing in your parameters. That’s what is driving the whole scenario. I’m working in Process Integration and Design Optimization for 20+ years…
Based on what you write, I think you have different geometries for which you want to perform the same analysis (or maybe vary also the BC/Loads).
I have played with FreeCAD, SW etc and basically, if yo ustart sith a set of step file, you need to mesh them 1st, then apply BC/Load/Analysis case and run.
What is important is that you work in iso-topology, otherwise, you won’t be able to script.
What I mean is that your geometry should be “similar”. A simple example is a cantilever H beam, if you modify the lengths, thicknesses etc but that remains a H, it’s an isotopology, but if you have a C,H,I beam, that’s almost impossible to automate the scripting.
Personnaly, I used Gmsh a lot to go from the Step, to a compatible mesh.
thne in my inp that I created manually for my load case, I #include that mesh.