-
Notifications
You must be signed in to change notification settings - Fork 46
Spatially variable Robin BC bug fixes #445
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,6 +29,17 @@ | |||||
| */ | ||||||
|
|
||||||
| #include "RobinBoundaryCondition.h" | ||||||
| #include <iostream> | ||||||
|
|
||||||
| #define n_debug_robin_bc | ||||||
|
|
||||||
| RobinBoundaryCondition::RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face) | ||||||
| : BoundaryCondition({{"Stiffness", uniform_stiffness}, {"Damping", uniform_damping}}, StringBoolMap{{"normal_direction_only", normal_only}}, face) | ||||||
| { | ||||||
| // Warning if both stiffness and damping are zero | ||||||
| if (uniform_stiffness == 0.0 && uniform_damping == 0.0) { | ||||||
| std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. " | ||||||
|
||||||
| std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. " | |
| std::cerr << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no difference between the cout and cerr output message, just that cerr does not buffer data.
Warning messages should be written using simulation->logger so they will appear in the histor.dat file.
Should we throw when the both the stiffness and damping values are zero ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
std::coutdirectly is not recommended for library code. Consider using a proper logging framework or at minimumstd::cerrfor warnings to avoid mixing output streams.