I'd like to use Mecway to run batches (say, 50-500 at a time) of FEA experiments e.g. to find the best variant(s) out of a set of related structures. My plan is to use IronPython inside Mecway to generate structures (rather than externally generate inp files, Abaqus-style).
Can I use a script launched from the command line (using mecway script myfile.py) to set a big batch of solves in motion?
Or is there a better way of using Mecway to achieve the same thing? Thanks!
Comments
Python script like you suggested:
Modify the .liml files externally and solve from command line using a batch file or your own program:
I've already tried building some geometry from scratch via a Python script, and that worked perfectly. However, there doesn't seem to be ways to create loads or constraints via the API, only ways to modify pre-existing ones: which I'm guessing may well be an example of what you mention about not everything being available via the API.
So, it's looking to me as though it isn't (yet) possible to build geometry, add loads and constraints, and then pass the whole lot through to a solver purely via Mecway's Python API. Is that basically correct? If so, are there any plans to extend that Python API to allow it to do that, or is the Python API essentially frozen?
If the API is indeed frozen and incomplete, is there any documentation on the .liml file format that you can point me at? Unsurprisingly, I was really hoping Mecway would be smart enough that I could avoid that whole (fairly stinky) Abaqus inp-generating-Python route, but I guess what I'm doing isn't (yet) the mainstream use case for Mecway.
Thanks again, Nick
The API isn't frozen, and I'm frequently adding to it to make it more complete. It was a late addition to Mecway that hasn't caught up with the GUI yet.
No documentation for the .liml format, sorry. However, it's XML with descriptive names for most things so shouldn't be too hard to work out by looking at examples. You could use an XML library to operate on it, or treat it as plain text.
I'm very pleased to hear that you plan to make the API more complete over time! My use case is pure R&D structural optimisation using straightforward (isotropic) materials, where the final shape gets evolved over numerous generations of experiments.
Role-playing that through a little, all the Python API seems to be missing to support that is the ability to create/delete loads and constraints. Are there other facilities that would be needed beyond that?
Thanks, Nick
https://youtube.com/watch?v=VQINrNWdOHo
Update: I should add that its material integration is basically non-existent, its gmmsh mesh handling often yields meshes that Calculix errors on, and the fem:: constraint scale issue has been an embarrassment for years. But... maybe I've missed something. 😬