I am trying to couple CalculiX to a micro-mechanics solver to do a two-scale FE2 simulations. The coupling itself is done via the coupling library preCICE, which has been used to couple FSI or CHT type scenarios where one of the solvers is CalculiX.
In my FE2 scenario, CalculiX is the so-called macro solver. This means that it needs to provide the mechanical strain values to the micro-scale solver, and get mechanical stress values back. I am trying to access strains and modify stresses via a modified nonlingeo.c file. The modified file is nonlingeo_precice.c. I have the following questions:
Is the data structure eei the correct one to access if one wants to access the values of mechanical strain at every integration point or every element?
Is the data structure stx the correct one to modify, to override the mechanical stress values that CalculiX has?
My main problem right now is that when I access values in the data structure eei, I just see zero values. Without non-zero strains, my micro-mechanics solver does not calculate non-zero stresses.
@jbr thanks for your suggestion. I in fact know some of the authors of that paper and have worked with them in the past.
My issue is that my work with CalculiX is part of the CalculiX-preCICE adapter in which the modifications to existing C files from CalculiX is a design decision. I cannot work around it now, and have to find a solution with it. Perhaps I can re-frame my question, by sticking to one data structure. If I look at eei in the file nonlingeo.c, it gets allocated:
NNEW(eei,double,6*mi[0]**ne);
and then it gets passed into the results() function several times, and the premortar() function once. Finally there is an operation to free memory: SFREE(eei);.
I point to the eei pointer from my own data structure in the following way:
with the understanding that I can now access the contents of eei from my struct. But if I try to access these, I simply see zero values. This is what puzzles me and leads me to the question of whether eei is even the right data structure to access values of mechanical strain. In the code documentation I stumbled upon eme which also has mechanical strain component values.