-
Notifications
You must be signed in to change notification settings - Fork 5
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
error estimation test #14
Conversation
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.
Looks good to me
test/unit/ErrorEstimationTest.cpp
Outdated
|
||
coupling::error::ErrorEstimation errorControl(velocity, temperature, numberOfParticle, particleMass, soundSpeed, numberOfSamples, cellVolume); | ||
double errorVelo = errorControl.getError(coupling::error::ErrorEstimation::Velocity, coupling::error::ErrorEstimation::Absolute); | ||
CPPUNIT_ASSERT(errorVelo == 0.25); |
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.
Is it safe here to compare doubles using ==
instead of abs(a-b)<epsilon
? (see also _testDensityError(...)
)
test/unit/ErrorEstimationTest.cpp
Outdated
|
||
coupling::error::ErrorEstimation errorControl(velocity, temperature, numberOfParticle, particleMass, soundSpeed, numberOfSamples, cellVolume); | ||
double errorVelo = errorControl.getError(coupling::error::ErrorEstimation::Velocity, coupling::error::ErrorEstimation::Absolute); | ||
CPPUNIT_ASSERT(errorVelo == 0.25); |
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.
Why are the expected values hardcoded here instead of also being passed into the function as a parameter? They seem to depend on the concrete values, right? (also see _testDensityError(...)
)
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.
Please move file to test/unit/coupling
Besides that, looks fine
…o into error_estimation_unit_test
…stimationTest.cpp
No description provided.