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

error estimation test #14

Merged
merged 7 commits into from
Dec 14, 2023
Merged

error estimation test #14

merged 7 commits into from
Dec 14, 2023

Conversation

jafariv
Copy link
Contributor

@jafariv jafariv commented Nov 22, 2023

No description provided.

Copy link
Contributor

@LouieVoit LouieVoit left a 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


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);
Copy link
Contributor

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(...))


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);
Copy link
Contributor

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(...))

Copy link
Member

@Thinkpiet Thinkpiet left a 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

test/unit/ErrorEstimationTest.cpp Outdated Show resolved Hide resolved
@jafariv jafariv merged commit b2ca873 into master Dec 14, 2023
2 checks passed
@Thinkpiet Thinkpiet deleted the error_estimation_unit_test branch December 14, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants