Skip to content

Commit

Permalink
Fix a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Jan 27, 2024
1 parent 27f023c commit 97ca6a8
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions tests/ellipsoidal_chunk_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,9 @@ int f()

const unsigned int dim=3;

InitialTopographyModel::ZeroTopography<dim> topography;
GeometryModel::internal::EllipsoidalChunkGeometry<dim> ellipsoidal_manifold;
ellipsoidal_manifold.initialize(&topography);

std::vector<Point<2>> corners(2,Point<2>(-15.0,-15.0));
corners[1] *= -1.0;

std::cout << "Simple sphere test" << std::endl;
ellipsoidal_manifold.set_manifold_parameters(6371000.0,
0.0,
6371000.0,
2890000.0,
corners);

std::vector<Point<3>> test_points;
test_points.push_back(Point<3> (6371000.0,0,0));
test_points.push_back(Point<3> (6171000.0,0,0));
Expand All @@ -78,33 +67,50 @@ int f()
test_points.push_back(Point<3> (25000.0,25000.0,500000.0));
test_points.push_back(Point<3> (25000.0,25000.0,50000.0));

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);

std::cout << "WGS84 test" << std::endl;
InitialTopographyModel::ZeroTopography<dim> topography;
{
std::cout << "Simple sphere test" << std::endl;
GeometryModel::internal::EllipsoidalChunkGeometry<dim> ellipsoidal_manifold(topography,
6371000.0,
0.0,
6371000.0,
2890000.0,
corners);

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);
}

const double semi_major_axis_a = 6378137.0;
const double eccentricity = 8.1819190842622e-2;
const double semi_minor = std::sqrt((1 - pow(eccentricity,2)) * pow(semi_major_axis_a,2));

ellipsoidal_manifold.set_manifold_parameters(semi_major_axis_a,
eccentricity,
semi_minor,
2890000.0,
corners);

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);


std::cout << "Test for points outside of the provided depth range" << std::endl;
ellipsoidal_manifold.set_manifold_parameters(semi_major_axis_a,
eccentricity,
semi_minor,
500000.0,
corners);

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);
{
std::cout << "WGS84 test" << std::endl;

GeometryModel::internal::EllipsoidalChunkGeometry<dim> ellipsoidal_manifold(topography,
semi_major_axis_a,
eccentricity,
semi_minor,
2890000.0,
corners);

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);
}

{
std::cout << "Test for points outside of the provided depth range" << std::endl;
GeometryModel::internal::EllipsoidalChunkGeometry<dim> ellipsoidal_manifold(topography,
semi_major_axis_a,
eccentricity,
semi_minor,
500000.0,
corners);

for (unsigned int i=0; i<test_points.size(); ++i)
test_point(ellipsoidal_manifold,test_points[i]);
}

exit (0);
return 42;
Expand Down

0 comments on commit 97ca6a8

Please sign in to comment.