Interpolate fields from one mesh to another

Hello,

First of all, thank you for the great contribution to the open source community!

I am trying to run a simulation using a temperature filed interpolated from another mesh. Both starting and target meshes are 2D (plane strain CPE6 elements). The two geometries are identical, just the meshes are different due to different line split on the boundaries.

I have followed the CalculiX GraphiX user guide, without success. It is not clear to me how to properly define the “master” and “slave” sets.

My goal is to start a simulartion with the target mesh using the temperature field interpolated from the original mesh as initial condition.

Any help would be greatly appreciated!
Best,
Francesco

Hi Francesco,
I do not have 2D meshes at hand, but I will write for you from my memory what is probably necessary. If problems continue you may send me the two meshes and I have a look. (klaus.wittig@calculix.de).
master is the thermal model, slave the target.
Here I assume the first Dataset of the thermal model stores the temperatures.
You may copy the following lines in a file file.fbl and read that with cgx

Be aware of the “add” parameter after the second "read command!

cgx -b file.fbl

seto slave
read slave.frd
setc
seto master
read thermalmodel.frd add
setc
map slave master surf ds1
send slave abq ds1

1 Like

Hi Klaus,

Many thanks indeed for your reply.

Following your suggestion, I managed to add the results in cgx and send them to a frd file (see inage).

In my previous post, I forgot to mention that the simulations are transient. Hence, to follow your procedure, I had to isolate the results (frd) of the master for the latest time step only. I then run a dummy step for the slave mesh to initialize the output variables. Finally, I managed to write what I believe is the interpolated data file (frd format) with:

send slave frd ds1+

I am now missing the last and crucial step: how do I run the second simulation starting from the results stored in the frd file? I tried running CalculiX using an input file with the slave mesh and bc, but ccx just ignores the interpolated data.

Thank you very much for your time!
Best,
Francesco

Hi Francesco,
first, you can interpolate all datasets if you do not specify a certain one:
map slave master surf ds
This will interpolate all datasets at once.
second, you may write the interpolated data in abaqus format which is also the ccx format when you just use the command I had proposed (include it in the ccx file after *TEMPERATURE):
send slave abq ds1
or
send slave abq tmf
to write all temperature datasets in one file. Please have a look into the manual for further possibilities. And please use always the latest release of cgx and ccx.

Btw, your immage looks a bit strange. Maybe the mapping was not successful. You shoud see the interpolated data when you just display the slave set:
plot ev slave
It could be that you need the commands
comp slave do
comp master do
before you actually map.

Hi Klaus,

Many thanks for clarifying this. It actually helped connect all the dots and I am now able to run the second simulation starting from the data mapped from the previous case. cgx is an amazing tool indeed!

One last step I was missing was how to get the residual plastic strain from the previous simulation (I have an history-dependent plasticity case). I tried outputting the plastic strain with the above precedure, but it came in the form of equivalent plastic strain, i.e. a scalar variable. This can’t be used as initial value as one needs data at integration points. To fix this, I first run a dummy *STATIC simulation with fixed temperature field and imposed displacements (taken from the first simulation). Then, I run a second STEP with a full transient simulation.
Hope this helps to anyone working on similar cases.

Best,
Francesco

Hi Francesco, please look into the ccx manual for *EL PRINT. It writes integration point related results in ascii into the “case”.dat file. I guess this is what you need.