Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dealii::Patterns::Int and dealii::Patterns::Double limits #409

Open
landinjm opened this issue Jan 20, 2025 · 1 comment
Open

dealii::Patterns::Int and dealii::Patterns::Double limits #409

landinjm opened this issue Jan 20, 2025 · 1 comment

Comments

@landinjm
Copy link
Contributor

The constructors for these patterns have limits that we can impose on them. This may be the preferred way to handle errors in mis-input.

@landinjm landinjm changed the title dealii::Patterns::Int and dealii::Patterns::Double dealii::Patterns::Int and dealii::Patterns::Double limits Jan 20, 2025
@landinjm
Copy link
Contributor Author

This is what the error message looks like:

An error occurred in line <1992> of file </home/nephrite/prisms/dealii_spack/dealii/source/base/parameter_handler.cc> in function
    void dealii::ParameterHandler::scan_line(std::string, const string&, unsigned int, bool)
The violated condition was: 
    patterns[pattern_index]->match(entry_value)
Additional information: 
    Line <3> of file <parameters.prm>:
    The entry value
    -1.0
    for the entry named
    Domain size X
    does not match the given pattern:
    [Double 0...MAX_DOUBLE (inclusive)]

It prints relatively descriptive information without having to write explicit error messages ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant