precice / calculix-adapter

preCICE-adapter for the CSM code CalculiX
GNU General Public License v3.0
51 stars 20 forks source link

Improved error message (for missing mesh) #88

Closed boris-martin closed 2 years ago

boris-martin commented 2 years ago

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 file but now it gives Nodes 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)