# FreeCAD and dynamic step by step displacement

**URL:** <https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134>\
**Category:** Uncategorized\
**Created:** [June 14, 2022, 12:04pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134 "2022-06-14T12:04:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 14, 2022, 12:04pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/1 "2022-06-14T12:04:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [June 14, 2022, 1:55pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/2 "2022-06-14T13:55:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 14, 2022, 2:11pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/3 "2022-06-14T14:11:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 14, 2022, 2:20pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/4 "2022-06-14T14:20:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [June 14, 2022, 2:33pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/5 "2022-06-14T14:33:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 14, 2022, 2:40pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/6 "2022-06-14T14:40:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 22, 2022, 10:00am UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/8 "2022-06-22T10:00:42Z")

</div>

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?

 ![restart_issue](https://global.discourse-cdn.com/free1/uploads/calculix/original/1X/75c70f84f70786a73532906a3e645d1be2a8ec3a.png)  
 ![powershell](https://global.discourse-cdn.com/free1/uploads/calculix/original/1X/d78c776c1ab7189707279467c3401be318794ce2.png)

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [June 22, 2022, 10:23am UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/9 "2022-06-22T10:23:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 22, 2022, 11:17am UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/10 "2022-06-22T11:17:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [June 22, 2022, 11:20am UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/11 "2022-06-22T11:20:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mctheghoul](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@mctheghoul](https://calculix.discourse.group/u/mctheghoul)\
**Post date:** [June 22, 2022, 2:36pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/12 "2022-06-22T14:36:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [June 22, 2022, 2:41pm UTC](https://calculix.discourse.group/t/freecad-and-dynamic-step-by-step-displacement/1134/13 "2022-06-22T14:41:18Z")

</div>

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

> [@Help on installing CalculiX 2.19 on Windows](https://calculix.discourse.group/t/help-on-installing-calculix-2-19-on-windows/1125/3):
>
> I never install CalculiX to use it on Windows. I just: download the solver files from here: [http://www.dhondt.de/calculix\_2.19\_4win.zip](http://www.dhondt.de/calculix_2.19_4win.zip) and unzip them copy the files to the folder with input file defining my analysis open command line in this folder (select address bar in file explorer, type cmd and press Enter) - PowerShell won’t work type: ccx\_static input\_file\_name after the analysis type: cgx\_glut results\_file\_name.frd to postprocess the simulation in GraphiX You could also convert the .…
