#include <catch.hpp>
#include <boost/log/trivial.hpp>
#include "class_particles.hpp"
#include "precision.hpp"
Go to the source code of this file.
| #define BOOST_LOG_DYN_LINK 1 |
| TEST_CASE |
( |
"UNIT TEST: particle class {Particle_x}" |
, |
|
|
"" |
[core] |
|
) |
| |
Definition at line 8 of file test_particles.cpp.
References CHECK, and Particle_x< T >::position.
10 BOOST_LOG_TRIVIAL(info) << "particle
class {
Particle_x}
"; 12 Vec_3D<FTYPE_t> position(0., -3.14, 4E5); 13 Particle_x<FTYPE_t> par1(position); 15 CHECK( par1.position[0] == 0. ); 16 CHECK( par1.position[1] == (FTYPE_t)-3.14 ); 17 CHECK( par1.position[2] == (FTYPE_t)4E5 ); 18 CHECK( par1[1] == (FTYPE_t)-3.14 ); 20 par1.position[0] = par1.position[1]*2+6.28; 21 CHECK( par1[0] == Approx(0) ); 24 Particle_x<FTYPE_t> par3(par1); 25 CHECK( par3[0] == Approx(0) ); 26 CHECK( par3[1] == (FTYPE_t)-3.14 ); 27 CHECK( par3[2] == (FTYPE_t)4E5 ); 31 CHECK( par1[0] == Approx(0) ); 32 CHECK( par1[1] == (FTYPE_t)-3.14 ); 33 CHECK( par1[2] == (FTYPE_t)4E5 ); class handling particles (position only)
| TEST_CASE |
( |
"UNIT TEST: particle class {Particle_v}" |
, |
|
|
"" |
[core] |
|
) |
| |
Definition at line 36 of file test_particles.cpp.
References CHECK.
38 BOOST_LOG_TRIVIAL(info) << "particle
class {
Particle_v}
"; 40 Vec_3D<FTYPE_t> position(0., -3.14, 4E5); 41 Vec_3D<FTYPE_t> velocity(2.3E-6, -4.56E-7, 6.87903E-6); 42 Particle_v<FTYPE_t> par1(position, velocity); 44 CHECK( par1[0] == (FTYPE_t)0. ); 45 CHECK( par1[1] == (FTYPE_t)-3.14 ); 46 CHECK( par1[2] == (FTYPE_t)4E5 ); 47 CHECK( par1(0) == (FTYPE_t)2.3E-6 ); 48 CHECK( par1(1) == (FTYPE_t)-4.56E-7 ); 49 CHECK( par1(2) == (FTYPE_t)6.87903E-6 ); 52 Particle_v<FTYPE_t> par3(par1); 53 CHECK( par3[1] == (FTYPE_t)-3.14 ); 54 CHECK( par3(1) == (FTYPE_t)-4.56E-7 ); 58 CHECK( par1[1] == (FTYPE_t)-3.14 ); 59 CHECK( par1(1) == (FTYPE_t)-4.56E-7 ); 60 }class handling particles (position only)