# Can stress be transmitted to calculix instead of force in FSI?

**URL:** https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836
**Category:** Using preCICE
**Created:** [March 15, 2024, 12:09pm UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836 "2024-03-15T12:09:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fan\_wu](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fan_wu/32/1855_2.png) [@fan\_wu](https://precice.discourse.group/u/fan_wu)
#### Post date: [March 15, 2024, 12:09pm UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836/1 "2024-03-15T12:09:39Z")

</div>

Hello,  
I want to know how to transmit the stress calculated by openfoam to calculix instead of force in FSI?  
Can stress be transmitted to calculix instead of force in FSI calculations?

Thanks

---

<div class="post-metadata">

### Author: ![Gong\_CHEN](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/gong_chen/32/2212_2.png) [@Gong\_CHEN](https://precice.discourse.group/u/Gong_CHEN)
#### Post date: [March 23, 2024, 5:45am UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836/2 "2024-03-23T05:45:11Z")

</div>

Hi, fan\_wu

When I read the openfoam adapter code, I found out that there are four data can be used for coupling, `force, stress, displacement, displacementDelta`. So I think it’s possible to use stress instead of force, although I don’t know how the stress can be used hhh 😁.

---

<div class="post-metadata">

### Author: ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)
#### Post date: [May 6, 2024, 12:06pm UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836/3 "2024-05-06T12:06:52Z")

</div>

This is the configuration documentation page of the CalculiX adapter: [Configure the CalculiX adapter | preCICE - The Coupling Library](https://precice.org/adapter-calculix-config.html)

Unfortunately, the CalculiX adapter does not support reading stresses at the moment, but it should not be too complicated to add it:

> <https://github.com/precice/calculix-adapter/issues/111>
>
> Our \[Turek Hron FSI3 tutorial\](https://precice.org/tutorials-turek-hron-fsi3.htm…l) (OpenFOAM-deal.II) exchanges stress and displacement data. However, CalculiX does not currently know how to handle stress data. Supporting stresses would make adding a CalculiX case to this tutorial much easier.

I have not tried it, but it was already suggested in the issue that reading `Pressure` could work if you only need the normal stress.

---

<div class="post-metadata">

### Author: ![marinlauber](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/marinlauber/32/695_2.png) [@marinlauber](https://precice.discourse.group/u/marinlauber)
#### Post date: [January 8, 2025, 2:05pm UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836/4 "2025-01-08T14:05:01Z")

</div>

Hi @fan_wu @Makis @Gong_CHEN  
Any update on this? It seems to be working only for tetrahedral and hexahedral “interface” elements; is that correct?  
Best,  
Marin

---

<div class="post-metadata">

### Author: ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)
#### Post date: [March 20, 2025, 9:20am UTC](https://precice.discourse.group/t/can-stress-be-transmitted-to-calculix-instead-of-force-in-fsi/1836/5 "2025-03-20T09:20:31Z")

</div>

Recently we have been trying to solve multiscale mechanics problems with CalculiX. For this, we need to read the stress tensor from preCICE. We currently have a working version of the adapter which reads the stress tensor in [Add functionality for volumetric coupling of material models by kalupaika · Pull Request #118 · precice/calculix-adapter · GitHub](https://github.com/precice/calculix-adapter/pull/118)

The relevant lines of code are [these ones](https://github.com/precice/calculix-adapter/pull/118/files#diff-8b1b5d835db2d665931c4880420403b1bbb2f4fe4902bc2bbc7893a6f61dad78R356-R378). preCICE cannot handle tensor data directly, so we split the stress tensor into two vectors while writing to preCICE, and assemble it again before handing over to CalculiX.

I hope this helps.
