Improved error message (for missing mesh)#88
Conversation
Was fixed last year, but it seems we somehow overrode it at some point
MakisH
left a comment
There was a problem hiding this comment.
I like this! It will probably help users that get confused at the mesh generation step.
How could I trigger this case, to test it?
adapter/PreciceInterface.c
Outdated
| { | ||
| if (interface->nodesMeshID < 0) { | ||
| printf("Nodes mesh not provided in YAML config file\n"); | ||
| printf("Nodes mesh not provided in YAML config file. They are required for writing/reading the data %s.\n", type); |
There was a problem hiding this comment.
I am wondering a bit about the action call: should the user change something in the adapter config file, or in the mesh itself? Maybe refering to the documentation would help.
There was a problem hiding this comment.
Actually the original sentence is a bit misleading, as the problem is not providing the mesh, it's configuring correctly the YAML file. Given a mesh, either we configure the adapter to build a preCICE mesh from the nodes, or from the face centers. We can do both by configuring two interfaces in the YAML file (and creating two different preCICE meshes)
A different formulation would probably be more suited. Something like "This interface was configured to use nodes/faces, but it must be configured to use faces/nodes to transfer data Y". I'm open to suggestions.
To trigger the error, simply take any valid CalculiX test case and, in the config.yaml file, replace faces-mesh by nodes-mesh or vice-versa. (mesh seems to be an alias for faces-mesh and there's another one for connectivity, see #87).
I first noticed this because it is actually impossible to do CHT with Dirichlet-Neumann coupling on the same mesh, since one requires nodes and the other one requires faces.
There was a problem hiding this comment.
I like your suggestion, let's go with that! 👍 Maybe even include some information about which "this interface" is?
* Improved error message (for missing mesh) (#88) * Added error message for missing faces mesh * Improved error message for missing nodes mesh * 2D simulations major overhaul (#92) Fixed 2D simulations being unusable with Temperature BC. Arbitrary number of elements on the Z-axis is now allowed and handled assuming data independant of the Z-axis. * Added Pressure ExchangeData, hexaedral elements and Modal Dynamic Modus (#91) * Added Pressure ExchangeData, hexaedral elements and Modal Dynamic Modus * Update dyna_precice.c Co-authored-by: Matthias Freimuth <[email protected]> Co-authored-by: Boris Martin <[email protected]> * format * Added warning of broken implicit coupling when using modal dynamic simulations * Fixed mesh configuration 2D coupling with Face meshes (#94) * Fixed mesh config for face mesh * Removed dead code * Fixed missing include * Fixed crash when using face meshes and element IDs don't start to 0 (#95) * Fixed crashing simulation when using face meshes and element IDs don't start to 0 * Typo Co-authored-by: Ishaan Desai <[email protected]> * Typo Co-authored-by: Ishaan Desai <[email protected]> * Typo Co-authored-by: Ishaan Desai <[email protected]> * Update adapter/CCXHelpers.h Co-authored-by: Ishaan Desai <[email protected]> * format * reverted fallow-argument-mismatch * format Co-authored-by: Ishaan Desai <[email protected]> * Revert "Fixed crash when using face meshes and element IDs don't start to 0 (#95)" (#96) This reverts commit 9cfc0cf. * Update packaging script to Ubuntu 22.04 LTS (#98) * added ubuntu 22.04 to the list of OSes in Github action * updated to 2 Ubuntu LTS only, added fflags * fixed wrong distribution name * added preivous Ubuntu non-LTS * fixd missing os * typo * removed non LTS * Fixed face mesh config(correct PR) (#97) * Fixed crashing simulation when using face meshes and element IDs don't start to 0 * Typo Co-authored-by: Ishaan Desai <[email protected]> * Typo Co-authored-by: Ishaan Desai <[email protected]> * Typo Co-authored-by: Ishaan Desai <[email protected]> * Update adapter/CCXHelpers.h Co-authored-by: Ishaan Desai <[email protected]> Co-authored-by: Ishaan Desai <[email protected]> * format * format * restored script * Fixed implicit coupling in modal dynamic simulation. (#99) * Fixed missing checkpointing * fixed extra output in implicit coupling * removed deprecated warnings * Fixed crash when freeing unused pointers (#102) * init NULL pointers * Enable Static Step for FSI (#101) * Update ccx_2.19.c Enable basic Static Step * Update ccx_2.19.c * Update ccx_2.19.c * Add error messages when reading invalid data in modal dynamic simulations (#103) * registering modal dynamic * added forbidden reading types to modal dynamic sims * added actual error * Update adapter/PreciceInterface.c Co-authored-by: Gerasimos Chourdakis <[email protected]> * Update adapter/PreciceInterface.h Co-authored-by: Gerasimos Chourdakis <[email protected]> Co-authored-by: Gerasimos Chourdakis <[email protected]> * basic infrastructure for proper checkpointingin dyna_precice * seemingly working implict + subcycling modal dynamic simulations * Prototype output buffer * added C API * added missing function * improved Buffer * Actual usage of the buffer, seemingly working * added short description of the buffer mechanism * cleanup * refactoring * format * removed dead code * renamed for consistency * no longer asking for length when loading data * cleanup * documentation * removed apparently useless memcpy (#104) * Make read/write data name parsing consistent (#108) * Update for CalculiX v2.20 (#109) Co-authored-by: Boris Martin <[email protected]> Co-authored-by: MatthiasFreimuth <[email protected]> Co-authored-by: Matthias Freimuth <[email protected]> Co-authored-by: Boris Martin <[email protected]> Co-authored-by: Ishaan Desai <[email protected]> Co-authored-by: Kyle Davis <[email protected]>
Current code contains a message to warn the user when he doesn't provide a nodal mesh (i.e. a face mesh is sent instead) despite being required. But the opposite wasn't true: if you send a nodal mesh when a face mesh is required, you get a very unhelpful "array out of bounds" crash, which was a pain to debug.
I thus added this error message. I also made them (both missing nodal and missing face mesh) slightly more explicit. Roughly speaking, instead of "You don't provide X", it is replaced by "you don't provide X, which is needed for using Y", with Y the cause of the error. (For instance if you try to read displacements on a face mesh, or heat flux on a nodal mesh).
Examples:
Writing a heat flux on a nodes mesh crashed without reason, now it says
Face centers mesh not provided in YAML config file. They are required for writing/reading the data Heat Flux.Reading a temperature on a face centers mesh used to give the message
Nodes mesh not provided in YAML config filebut now it givesNodes mesh not provided in YAML config file. They are required for writing/reading the data Temperature..(I also fixed a typo where "Velocit" is used instead of "Velocity". This was fixed a while ago by @IshaanDesai but it seems we overrode it at some point when merging everything)