OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
Sphere_unit_test.cpp
1/*
2 * Sphere_unit_test.cpp
3 *
4 * Created on: Feb 26, 2020
5 * Author: i-bird
6 */
7
8
9#define BOOST_TEST_DYN_LINK
10#include <boost/test/unit_test.hpp>
11#include "Grid/map_grid.hpp"
12#include "data_type/aggregate.hpp"
13#include "Vector/map_vector.hpp"
14
15BOOST_AUTO_TEST_SUITE( sphere_test )
16
17
18BOOST_AUTO_TEST_CASE( Sphere_test_use)
19{
20 Point<3,double> p({0.1,0.1,0.1});
21 Point<3,double> p1({0.12,0.12,0.12});
22 Point<3,double> p3({0.25,0.25,0.25});
23
24 Sphere<3,double> s(p,0.1);
25
26 BOOST_REQUIRE_EQUAL(s.isInside(p1),true);
27 BOOST_REQUIRE_EQUAL(s.isInside(p3),false);
28
29 double dist = s.distance(p3);
30 BOOST_REQUIRE_EQUAL(dist,0.15980762113533162);
31}
32
33BOOST_AUTO_TEST_SUITE_END()
This class implement the point shape in an N-dimensional space.
Definition Point.hpp:28
This class implement the Sphere concept in an N-dimensional space.
Definition Sphere.hpp:24