FreeCAD and dynamic step by step displacement

Hi,
I’m working on a project that involves me doing step by step runs of calculix.
Here’s the jist of it:

  • Step one .inp file is run on Calculix
  • Displacement is read from the generated .dat file and another software calculates a new load/displacement with the previous displacement
  • Displacement is written into a new inp file as part of a new step, as a *Boundary or *Cload/Dload
  • Run number 2 of CCX with the new inp file
  • Rince and repeat until all required steps are completed

Is there a simple way to save and load data for previous runs of the solver, or do I have to rerun the previous steps every time I want to add a new one?

Can you say what kind of a physical process do you want to simulate ? Maybe there are easier ways to do it. And why do you need another software in the second stage ?

To avoid copying the results data and pasting it into *Boundary or *Cload/*Dload definitions you could write a script that will automate the process.

Yep I’m working as an intern on a seismic dynamic response of a test bench. Thing is part of the test bench is simulated on another program(Matlab but I’m not sure), I don’t know how exactly, but what I’m asked to do is build/program something that can simulate and return the displacement of the physical test bench to the simulated part that is on the other program.
For the copy/pasting, I am indeed writing some Python code that could automate that process.
Endgoal is to automate the entire process on Python, with calls to CCX and the other program, and eventually visualize it with something like Prepromax or CGX.

Small second question:
For repeating Boundaries or Loads like gravity, do you still need to write this or can it be written differently:
*STEP
**Step parameters and caracteristics
*END STEP

*STEP
*Boundary
Node_set_name, first_degree_freedom, last_degree_freedom, new_value

**Same Dload
*Dload

**Same Cload
*Cload

*END STEP

Normally, you have to provide the full input file definition (with all the necessary keywords) for new run. But there are exceptions. In some cases you could use the *Restart keyword and then you just have to define additional steps that you want to solve in addition to those completed in the previous run.

MatLab will let you automate a lot of stuff and the only problem is to make it work together with other software.

For postprocessing you could use ParaView. It’s very powerful and lets you study the results in lots of different ways but also automate the whole postprocessing using Python scripts.

I didn’t know about the *Restart keyword, I’ll look into that, thank you.

I’m currently trying the *Restart method, but there’s seems to be an issue with the file that ccx is running(I’m running the ccx213.exe directly from the powershell window).

When I run the command I usually use for ccx to run a inp file, ccx reads the .rin instead, given that it has the same base name as the .inp file.

Do you have a way to fix that issue, aka direct the .exe to read the .inp instead of the .rin?


Use the newest version of CalculiX (2.19) and try with the example provided in the documentation (files beamwrite.inp and beamread.inp) first.

Just tried with ccx 2.19, works perfect now thank you.

However the powershell can’t find the path to the exe, even though it’s added to the path environment variable, but I’m just writing the full exe path instead and that works.

For CalculiX I use the regular command window (cmd) instead of PowerShell. Give it a try.

Indeed works perfectly fine, it’s just that path environment variable for the exe doesn’t work, but that’s no big deal

Yeah, I just place the solver file in the same folder as the input file, like I described here:

1 Like