We are currently developing a preCICE adapter for our in-house multiscale modeling toolbox, NASMAT at NASA Glenn Research Center. NASMAT is a multiscale recursive micromechanics platform for massively multiscale modeling of hierarchical materials and structures subjected to thermo-mechanical Paper. As a starting point, we are trying to use Calculix as a macro solver and NASMAT would serve as the micro solver.
I have a basic version of the configuration running as for now. I have implemented additional features in Calculix Adapter to exchange STRESS, STRAIN and MATERIAL_TANGENT matrix and a new NASMAT adapter is also implemented. Since the points of communication between two solvers are different in a multiscale scheme than traditional FSI/CHT configuration, I have added a new linstatic_precice.c for Calculix adapter. For linear static analysis, I used a serial-explicit coupling scheme. I am currently looking to extend the Calculix adapter to undertake quasi-static and dynamic analysis, hence would need serial/parallel-implicit coupling.
I have two questions before I go ahead with the changes:
I want macro solver (Calculix) to be the convergence decision maker and not preCICE or NASMAT. No convergence check needs to be done by preCICE. How would I go about implementing such a feature?
The data that needs to be exchanged are tensors. As for now, I only see bulk vector write and read commands in preCICE API. Therefore, I am calling bulk_vector_read/write commands multiple times to exchange tensors. Does preCICE have tensor exchanging capabilities or such a feature planned in the future?
Nice to hear from you! I am not sure about the first question but let me answer the second one first.
Right now only scalars and vectors can be exchanged via preCICE. We have had examples where tensor data needed to be written and read from preCICE, and the current hack is indeed what you do, which is to slice the tensor into vectors and then reconstruct it on the other side. Reading and writing tensor data will come in the future.
Regarding the first question, to the best of my knowledge a solver cannot communicate convergence information to preCICE, so CalculiX cannot really be the decision maker. This is part of one of the core principles of preCICE, which is that preCICE steers the coupling. I guess one could implement a hack, but I am not aware of discussions in this direction. But here I would wait for others to respond.
Overall its great to know that you have added features to the CalculiX adapter. Do you plan to contribute these features back to the adapter repository? We would be glad if you did so
On what data would you want to base the convergence decision on if you could?
As you say, preCICE could not take this decision, it’s not data that is communicated, right?
In principle, you could also give additional data (which is not communicated) to preCICE and then let preCICE decide.
Btw, do you mean overall convergence of a steady-state simulation (so to end a simulation) or convergence within an implicit coupling scheme?
The first is discussed here already:
The second option, I guess would also not be too complicated to add to preCICE.