prisms-center / phaseField

PRISMS-PF: An Open-Source Phase-Field Modeling Framework
https://prisms-center.github.io/phaseField/
Other
229 stars 119 forks source link

Adding assertions for model constants #262

Closed landinjm closed 1 month ago

landinjm commented 1 month ago

Added assertions for when we try to access an invalid map entry in model_constants.

Say we have:

double MnV = userInputs.get_model_constant_double("not_a_variable");

This will throw this error when compiled in debug mode:

The violated condition was: 
    model_constant_name_map.find(constant_name) != model_constant_name_map.end()
Additional information: 
    PRISMS-PF Error: Mismatch between constants in parameters.prm and
    customPDE.h. The constant that you attempted to access was not_a_variable.

Closes #102

landinjm commented 1 month ago

Maybe add some more clarity on where the string is coming from