exasim-project / NeoFOAM

WIP Prototype of a modern CFD core
19 stars 1 forks source link

49 basic error handling #63

Closed bevanwsjones closed 1 month ago

bevanwsjones commented 1 month ago

This adds some basic assert checking and error messaging to the project. Additionally in Debug and RelWithDebInfo additional stack tracing is added, via the cpptrace library.

@greole I think we will need to update their cmake presets with this, so I am not 100% about the 'correct' approach for creating target_compile_definitions.

Also I have never really done exceptions before, so if you see room for improvement go ahead :).

bevanwsjones commented 1 month ago

Outstanding questions:

  1. Do we always use a stack trace? (See above comment).
  2. Should I go further and replace some of the macros with more c++20-style inline functions (if possible)?
  3. What do we do with minimal - I have hacked it to death to get it compiling?
greole commented 1 month ago

Regarding

  1. What do we do with minimal - I have hacked it to death to get it compiling?

We are going to remove it. See https://github.com/exasim-project/NeoFOAM/pull/61

  1. Should I go further and replace some of the macros with more c++20-style inline functions (if possible)?

Please go ahead.

HenningScheufler commented 1 month ago

Regarding:

  1. I would argue that at this stage the stacktrace is helpful
greole commented 1 month ago

Regarding the minimal example I would say we merge #54 first, then we complete #61 which removes the minimal example. Then we can remove it from this PR as well.

bevanwsjones commented 1 month ago

Regarding the minimal example I would say we merge #54 first, then we complete #61 which removes the minimal example. Then we can remove it from this PR as well.

Does it matter if this is before or after we remove minimal, since its going to be removed whether we do it earlier or later I am not sure makes much difference?

greole commented 1 month ago

Does it matter if this is before or after we remove minimal, since its going to be removed whether we do it earlier or later I am not sure makes much difference?

Of course you could also remove the applications folder and the unneeded files in this PR.

bevanwsjones commented 1 month ago

Of course you could also remove the applications folder and the unneeded files in this PR.

done :)

bevanwsjones commented 1 month ago

@greole think we ready.