OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
HDF5_XdmfWriter_unit_tests.hpp
1/*
2 * H5PartWriter_unit_tests.hpp
3 *
4 * Created on: Feb 22, 2016
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_IO_SRC_HDF5_XDMFWRITER_HDF5_XDMFWRITER_UNIT_TESTS_HPP_
9#define OPENFPM_IO_SRC_HDF5_XDMFWRITER_HDF5_XDMFWRITER_UNIT_TESTS_HPP_
10
11#include "VCluster.hpp"
12#include "util/SimpleRNG.hpp"
13#include "HDF5_XdmfWriter.hpp"
14
15BOOST_AUTO_TEST_SUITE( HDF5_writer_test )
16
17
18BOOST_AUTO_TEST_CASE( HDF5_writer_use)
19{
22
23 SimpleRNG rng;
24
25 Vcluster & v_cl = *global_v_cluster;
26
27 if (v_cl.getProcessingUnits() != 3)
28 return;
29
30 double z_base = v_cl.getProcessUnitID();
31
32 // fill 1000 particles for each processors
33
34 for (size_t i = 0 ; i < 1000 ; i++)
35 {
37 p[0] = rng.GetUniform();
38 p[1] = rng.GetUniform();
39 p[2] = z_base+rng.GetUniform();
40
41 pv.add(p);
42
43 p[0] += 2.0;
44
46 pt.fill();
47
48 pvp.add(pt);
49 }
50
52 h5p.template write<Point<3,double>,Point_test<double>,0,1,4,5>("h5part.h5",pv,pvp,1000);
53
54 // check that match
55
56 bool test = compare("test_h5part.h5part","test_h5part_test.h5part");
57 BOOST_REQUIRE_EQUAL(true,test);
58}
59
60BOOST_AUTO_TEST_SUITE_END()
61
62
63
64#endif /* OPENFPM_IO_SRC_HDF5_XDMFWRITER_HDF5_XDMFWRITER_UNIT_TESTS_HPP_ */
Test structure used for several test.
void fill()
fill
This class implement the point shape in an N-dimensional space.
Definition Point.hpp:28
SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) g...
Definition SimpleRNG.hpp:19
size_t getProcessUnitID()
Get the process unit id.
size_t getProcessingUnits()
Get the total number of processors.
Implementation of VCluster class.
Definition VCluster.hpp:59
Implementation of 1-D std::vector like structure.