Calculix adapter: Assertion `adapterConfig.numInterfaces > 0' failed

I’m attempting to transition from running to tutorials to running my own FSI simulation using OpenFOAM and CalculiX. Somewhere along the way, I’ve messed up the configuration files and ccx_preCICE isn’t setting up its interface properly. My solid.log file picks finds the config.yml file, but then reports back that the number of interfaces it reads from it is not greater than 0:

Setting up preCICE participant Calculix, using config file: config.yml
ccx_preCICE: adapter/PreciceInterface.c:31: Precice_Setup: Assertion `adapterConfig.numInterfaces > 0' failed.

I’ve checked on the contents of my config.yml file to make sure they coincide appropriately with the precice-config.xml file, and I believe they do. It has to be something like that, thought, right? Can I get someone to quickly put a set of eyes on this and let me know what they see that I’m missing?

solid.log (2.6 KB)
config.yml (225 Bytes)
precice-config.xml (2.2 KB)

Check your config.yml for indentation. In YAML, every level needs to be indented by one tab.

I checked my config.yml file for the correct indentation, and it is valid. I then put in a few cout commands into the source code and re-compiled. Ultimately, this led to me finding the detail I was overlooking. I am submitting this analysis to a cluster via slurm and had specified

-precice-participant Calculix

in my submit script, but left the config.yml file participant as “Solid”. This is what was causing the issue.

Also, for clarification, my understanding is that tab characters are actually invalid in YAML. One may be using the tab key on their keyboard, but should make sure this is interpreted as spaces in the actual file.

3 Likes

Your understanding is partially correct. The tab character is is not per se illegal, but it is illegal for indentation. The YAML specification says

To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently. Note that most modern editors may be configured so that pressing the tab key results in the insertion of an appropriate number of spaces.
Source: https://yaml.org/spec/1.2/spec.html#id2777534

The specification also gives examples at what places the tab characters would be legal. For the simple configuration files as used in the Calculix it is indeed safest to just not tab characters. I do not know if there would be a legal use case for the adapter’s configuration.

1 Like

Mea culpa, thank you for correcting! :sweat_smile: The important part here is that indentation matters in YAML.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.