From 81ab45d2281a3326a02614db210878b81274c880 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:32:11 -0500 Subject: [PATCH 1/5] Added new test for periodic KDTree --- sample/CMakeLists.txt | 3 + sample/testkd3.cpp | 186 +++++++++++++++++++++++++++++++++++++ src/replicateGenerator.hpp | 2 + 3 files changed, 191 insertions(+) create mode 100644 sample/testkd3.cpp diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 765e1b3..d158ae2 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -20,6 +20,9 @@ target_link_libraries(testkd ${tolink}) add_executable(testkd2 testkd2.cpp) target_link_libraries(testkd2 ${tolink}) +add_executable(testkd3 testkd3.cpp) +target_link_libraries(testkd3 ${tolink}) + add_executable(testDelaunay testDelaunay.cpp) target_link_libraries(testDelaunay ${tolink}) diff --git a/sample/testkd3.cpp b/sample/testkd3.cpp new file mode 100644 index 0000000..5744985 --- /dev/null +++ b/sample/testkd3.cpp @@ -0,0 +1,186 @@ +/*+ +This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ +#include +#include +#include +#include +#include +#define __KD_TREE_NUMNODES +#include "mykdtree.hpp" +#include "kdtree_splitters.hpp" +#include + +#define NTRY 30 +#define NGB 24 +#define ND 3 + +using namespace std; +using namespace CosmoTool; + +typedef KDTree > MyTree; +//typedef KDTree MyTree; +typedef KDCell MyCell; + +static double periodic(double a) +{ + while (a < -0.5) + a+=1; + while (a > 0.5) + a -= 1; + return a; +} + +MyCell *findNearest(MyTree::coords& xc, MyCell *cells, uint32_t Ncells) +{ + MyCell *near2 = 0; + double R2 = INFINITY; + for (int i = 0; i < Ncells; i++) + { + double d2 = 0; + for (int j = 0; j < ND; j++) + { + double delta = periodic(xc[j]-cells[i].coord[j]); + d2 += delta*delta; + } + if (d2 < R2) + { + near2 = &cells[i]; + R2 = d2; + } + } + return near2; +} + +int main() +{ + uint32_t Ncells = 3000000; + MyCell *cells = new MyCell[Ncells]; + + for (int i = 0; i < Ncells; i++) + { + cells[i].active = true; + for (int l = 0; l < ND; l++) + cells[i].coord[l] = drand48(); + } + + // Check timing + clock_t startTimer = clock(); + MyTree tree(cells, Ncells); + clock_t endTimer = clock(); + + tree.setPeriodic(true, 1.0); + + clock_t delta = endTimer-startTimer; + double myTime = delta*1.0/CLOCKS_PER_SEC * 1.0; + + cout << "KDTree build = " << myTime << " s" << endl; + + MyTree::coords *xc = new MyTree::coords[NTRY]; + + cout << "Generating seeds..." << endl; + for (int k = 0; k < NTRY; k++) + { + for (int l = 0; l < ND; l++) + xc[k][l] = drand48(); + } + + // Check consistency + cout << "Check consistency..." << endl; + MyCell **ngb = new MyCell *[NGB]; + double *distances = new double[NGB]; + + ofstream fngb("nearest.txt"); + for (int k = 0; k < NTRY; k++) { + cout << "Seed = " << xc[k][0] << " " << xc[k][1] << " " << xc[k][2] << endl; + tree.getNearestNeighbours(xc[k], NGB, ngb, distances); + int last = -1; + + for (uint32_t i = 0; i < NGB; i++) + { + if (ngb[i] == 0) + continue; + + last = i; + + double d2 = 0; + for (int l = 0; l < 3; l++) + d2 += ({double delta = periodic(xc[k][l] - ngb[i]->coord[l]); delta*delta;}); + fngb << ngb[i]->coord[0] << " " << ngb[i]->coord[1] << " " << ngb[i]->coord[2] << " " << sqrt(d2) << " " << sqrt(distances[i]) << endl; + } + fngb << endl << endl; + double farther_dist = distances[last]; + for (uint32_t i = 0; i < Ncells; i++) + { + bool found = false; + // If the points is not in the list, it means it is farther than the farthest point + for (int j =0; j < NGB; j++) + { + if (&cells[i] == ngb[j]) { + found = true; + break; + } + } + double dist_to_seed = 0; + for (int l = 0; l < 3; l++) + { + double delta = periodic(xc[k][l]-cells[i].coord[l]); + dist_to_seed += delta*delta; + } + double delta_epsilon = fabs(farther_dist/dist_to_seed-1); + if (!found) + { + if (dist_to_seed <= farther_dist && + delta_epsilon > 1000*sqrt(numeric_limits::epsilon())) + { + cout << "SHOULD BE IN (d=" << dist_to_seed << "): Failed iteration " << k << " particle " << i << " (farthest=" << sqrt(farther_dist) << ")" << endl; + cout << "delta_epsilon = " << delta_epsilon << endl; + abort(); + } + } + else + { + if (dist_to_seed > farther_dist && + delta_epsilon > 1000*sqrt(numeric_limits::epsilon())) + { + cout << "SHOULD BE OUT (d=" << sqrt(dist_to_seed) << "): Failed iteration " << k << " particle " << i << " (farthest=" << sqrt(farther_dist) << ")" << endl; + cout << "delta_epsilon = " << delta_epsilon << " epsilon = " << 100*sqrt(numeric_limits::epsilon()) << endl; + abort(); + } + } + } + } + + return 0; +} diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 8f52ace..3b6d3b8 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -20,6 +20,8 @@ namespace CosmoTool replicate = shift; numFaces = spower(3); std::copy(x, x+N, x_base); + if (!next()) + abort(); } bool next() From 50d830cb97ea6d2230171774487683533acb4d9b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:36:03 -0500 Subject: [PATCH 2/5] Updated correctly the authorship of the flash file reader to P. M. Sutter --- src/h5_readFlash.cpp | 32 +++----------------------------- src/h5_readFlash.hpp | 31 +++---------------------------- src/hdf5_flash.h | 33 +++------------------------------ 3 files changed, 9 insertions(+), 87 deletions(-) diff --git a/src/h5_readFlash.cpp b/src/h5_readFlash.cpp index 8e312bb..e460bdb 100644 --- a/src/h5_readFlash.cpp +++ b/src/h5_readFlash.cpp @@ -1,36 +1,10 @@ /*+ -This is CosmoTool (./src/h5_readFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) +!! -guilhem.lavaux@gmail.com +This file has been developped by P. M. Sutter -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) +!! -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. diff --git a/src/h5_readFlash.hpp b/src/h5_readFlash.hpp index d7e6906..abcf9aa 100644 --- a/src/h5_readFlash.hpp +++ b/src/h5_readFlash.hpp @@ -1,36 +1,11 @@ /*+ -This is CosmoTool (./src/h5_readFlash.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) -guilhem.lavaux@gmail.com +!!! NOTE !!! -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) +This file has been developped by P. M. Sutter. -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". +!!!! -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. diff --git a/src/hdf5_flash.h b/src/hdf5_flash.h index 2d0f29a..bf53f36 100644 --- a/src/hdf5_flash.h +++ b/src/hdf5_flash.h @@ -1,36 +1,9 @@ /*+ -This is CosmoTool (./src/hdf5_flash.h) -- Copyright (C) Guilhem Lavaux (2007-2013) +!! -guilhem.lavaux@gmail.com +This particular file has been developped by P. M. Sutter -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +!! +*/ /* general header file for the HDF 5 IO in FLASH */ From e0e6ea7be21f867f92a8b9fd2417bf80bde66824 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:39:33 -0500 Subject: [PATCH 3/5] Run gather_sources.py --- build_tools/gather_sources.py | 7 ++-- sample/testAlgo.cpp | 1 + sample/testBQueue.cpp | 1 + sample/testBSP.cpp | 1 + sample/testDelaunay.cpp | 1 + sample/testEskow.cpp | 1 + sample/testInterpolate.cpp | 1 + sample/testNewton.cpp | 1 + sample/testPool.cpp | 1 + sample/testReadFlash.cpp | 1 + sample/testSmooth.cpp | 1 + sample/test_cosmopower.cpp | 34 +++++++++++++++++++ sample/test_fft_calls.cpp | 1 + sample/test_healpix_calls.cpp | 1 + sample/testkd.cpp | 1 + sample/testkd2.cpp | 1 + sample/testkd3.cpp | 3 +- src/algo.hpp | 1 + src/bqueue.hpp | 1 + src/bsp_simple.hpp | 1 + src/cic.cpp | 1 + src/cic.hpp | 1 + src/config.hpp | 1 + src/cosmopower.cpp | 1 + src/cosmopower.hpp | 1 + src/dinterpolate.hpp | 1 + src/eskow.hpp | 1 + src/field.hpp | 1 + src/fixArray.hpp | 1 + src/fortran.cpp | 1 + src/fortran.hpp | 1 + src/fourier/base_types.hpp | 1 + src/fourier/details/euclidian_maps.hpp | 1 + src/fourier/details/euclidian_spectrum_1d.hpp | 1 + .../details/euclidian_spectrum_1d_bin.hpp | 1 + src/fourier/details/euclidian_transform.hpp | 1 + src/fourier/details/healpix_alms.hpp | 1 + src/fourier/details/healpix_map.hpp | 1 + src/fourier/details/healpix_spectrum.hpp | 1 + src/fourier/details/healpix_transform.hpp | 1 + src/fourier/details/healpix_utility.hpp | 1 + src/fourier/euclidian.hpp | 1 + src/fourier/fft/fftw_calls.hpp | 1 + src/fourier/healpix.hpp | 1 + src/growthFactor.cpp | 1 + src/growthFactor.hpp | 1 + src/interpolate.cpp | 1 + src/interpolate.hpp | 1 + src/interpolate3d.hpp | 1 + src/kdtree_leaf.hpp | 1 + src/kdtree_splitters.hpp | 1 + src/loadFlash.cpp | 1 + src/loadFlash.hpp | 1 + src/loadFlash_dummy.cpp | 1 + src/loadGadget.cpp | 1 + src/loadGadget.hpp | 1 + src/loadRamses.cpp | 1 + src/loadRamses.hpp | 1 + src/loadSimu.hpp | 1 + src/load_data.cpp | 1 + src/load_data.hpp | 1 + src/mach.hpp | 1 + src/miniargs.cpp | 1 + src/miniargs.hpp | 1 + src/mykdtree.hpp | 1 + src/newton.hpp | 1 + src/octTree.cpp | 1 + src/octTree.hpp | 1 + src/pool.hpp | 1 + src/powerSpectrum.cpp | 1 + src/powerSpectrum.hpp | 1 + src/replicateGenerator.hpp | 34 +++++++++++++++++++ src/sparseGrid.hpp | 1 + src/sphSmooth.hpp | 1 + src/yorick.hpp | 1 + src/yorick_nc3.cpp | 1 + src/yorick_nc4.cpp | 1 + 77 files changed, 148 insertions(+), 3 deletions(-) diff --git a/build_tools/gather_sources.py b/build_tools/gather_sources.py index f787975..ca8c3d1 100644 --- a/build_tools/gather_sources.py +++ b/build_tools/gather_sources.py @@ -5,7 +5,7 @@ # # This software is a computer program whose purpose is to provide a toolbox for cosmological # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - +# # This software is governed by the CeCILL license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/ or redistribute the software under the terms of the CeCILL @@ -61,7 +61,7 @@ def apply_python_license(filename): # # This software is a computer program whose purpose is to provide a toolbox for cosmological # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - +# # This software is governed by the CeCILL license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/ or redistribute the software under the terms of the CeCILL @@ -143,6 +143,9 @@ def analyze_tree(prefix, t): if type(entry) == Tree: analyze_tree(prefix + "/" + ename, entry) elif type(entry) == Blob: + if ename == './src/hdf5_flash.h' or ename == './src/h5_readFlash.cpp' or ename == './src/h5_readFlash.hpp': + continue + if re.match(".*\.(sh|py|pyx)$",ename) != None: fname=prefix+"/"+ename apply_python_license(fname) diff --git a/sample/testAlgo.cpp b/sample/testAlgo.cpp index 07cd7fe..cdf7971 100644 --- a/sample/testAlgo.cpp +++ b/sample/testAlgo.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "algo.hpp" diff --git a/sample/testBQueue.cpp b/sample/testBQueue.cpp index 261321e..08beb6d 100644 --- a/sample/testBQueue.cpp +++ b/sample/testBQueue.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "bqueue.hpp" diff --git a/sample/testBSP.cpp b/sample/testBSP.cpp index 92597a3..def0717 100644 --- a/sample/testBSP.cpp +++ b/sample/testBSP.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #if 0 #include "bsp_simple.hpp" diff --git a/sample/testDelaunay.cpp b/sample/testDelaunay.cpp index 59093db..8d2d9d4 100644 --- a/sample/testDelaunay.cpp +++ b/sample/testDelaunay.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "dinterpolate.hpp" diff --git a/sample/testEskow.cpp b/sample/testEskow.cpp index 318bb48..aa48d2b 100644 --- a/sample/testEskow.cpp +++ b/sample/testEskow.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testInterpolate.cpp b/sample/testInterpolate.cpp index aa5eec0..b863170 100644 --- a/sample/testInterpolate.cpp +++ b/sample/testInterpolate.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "interpolate3d.hpp" diff --git a/sample/testNewton.cpp b/sample/testNewton.cpp index febb5af..5677bbc 100644 --- a/sample/testNewton.cpp +++ b/sample/testNewton.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include diff --git a/sample/testPool.cpp b/sample/testPool.cpp index 53a6fb8..e4ff8c1 100644 --- a/sample/testPool.cpp +++ b/sample/testPool.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "pool.hpp" using namespace CosmoTool; diff --git a/sample/testReadFlash.cpp b/sample/testReadFlash.cpp index b1129ec..93a5b64 100644 --- a/sample/testReadFlash.cpp +++ b/sample/testReadFlash.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testSmooth.cpp b/sample/testSmooth.cpp index 1bb1603..4f3011d 100644 --- a/sample/testSmooth.cpp +++ b/sample/testSmooth.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "sphSmooth.hpp" #include "yorick.hpp" diff --git a/sample/test_cosmopower.cpp b/sample/test_cosmopower.cpp index f87677b..1bf1ec8 100644 --- a/sample/test_cosmopower.cpp +++ b/sample/test_cosmopower.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/test_cosmopower.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include "cosmopower.hpp" diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 0739328..b98fcea 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "yorick.hpp" #include diff --git a/sample/test_healpix_calls.cpp b/sample/test_healpix_calls.cpp index ffd13fd..75473d8 100644 --- a/sample/test_healpix_calls.cpp +++ b/sample/test_healpix_calls.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "fourier/healpix.hpp" diff --git a/sample/testkd.cpp b/sample/testkd.cpp index 71c0000..f810571 100644 --- a/sample/testkd.cpp +++ b/sample/testkd.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #define __KD_TREE_SAVE_ON_DISK #include #include diff --git a/sample/testkd2.cpp b/sample/testkd2.cpp index 457c5b9..7c29b1e 100644 --- a/sample/testkd2.cpp +++ b/sample/testkd2.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testkd3.cpp b/sample/testkd3.cpp index 5744985..50eba07 100644 --- a/sample/testkd3.cpp +++ b/sample/testkd3.cpp @@ -1,5 +1,5 @@ /*+ -This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) +This is CosmoTool (./sample/testkd3.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) guilhem.lavaux@gmail.com @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/algo.hpp b/src/algo.hpp index 927ef4c..2dce3eb 100644 --- a/src/algo.hpp +++ b/src/algo.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_ALGO_HPP #define __COSMOTOOL_ALGO_HPP diff --git a/src/bqueue.hpp b/src/bqueue.hpp index 97d346c..872830e 100644 --- a/src/bqueue.hpp +++ b/src/bqueue.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_QUEUE_HPP #define __COSMO_QUEUE_HPP diff --git a/src/bsp_simple.hpp b/src/bsp_simple.hpp index 3e4cce3..298256e 100644 --- a/src/bsp_simple.hpp +++ b/src/bsp_simple.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_SIMPLE_BSP_HPP #define __COSMOTOOL_SIMPLE_BSP_HPP diff --git a/src/cic.cpp b/src/cic.cpp index 9d7b77f..8a24597 100644 --- a/src/cic.cpp +++ b/src/cic.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/cic.hpp b/src/cic.hpp index 3442c38..31ba069 100644 --- a/src/cic.hpp +++ b/src/cic.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __CICFILTER_HPP #define __CICFILTER_HPP diff --git a/src/config.hpp b/src/config.hpp index afb43f6..8fd7b2d 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_CONFIG_HPP #define __COSMOTOOL_CONFIG_HPP diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp index 5d6b051..a96a6bb 100644 --- a/src/cosmopower.cpp +++ b/src/cosmopower.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp index 1cacfba..dd86cf1 100644 --- a/src/cosmopower.hpp +++ b/src/cosmopower.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _COSMOPOWER_HPP #define _COSMOPOWER_HPP diff --git a/src/dinterpolate.hpp b/src/dinterpolate.hpp index 29b3507..1bf3322 100644 --- a/src/dinterpolate.hpp +++ b/src/dinterpolate.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_DINTERPOLATE_HPP #define __COSMO_DINTERPOLATE_HPP diff --git a/src/eskow.hpp b/src/eskow.hpp index d6516d6..987cb88 100644 --- a/src/eskow.hpp +++ b/src/eskow.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __ESKOW_CHOLESKY_HPP #define __ESKOW_CHOLESKY_HPP diff --git a/src/field.hpp b/src/field.hpp index e78e651..45f6eac 100644 --- a/src/field.hpp +++ b/src/field.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FIELD #define __COSMOTOOL_FIELD diff --git a/src/fixArray.hpp b/src/fixArray.hpp index 2f8744f..0d2e26d 100644 --- a/src/fixArray.hpp +++ b/src/fixArray.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __FIX_ARRAY_HPP #define __FIX_ARRAY_HPP diff --git a/src/fortran.cpp b/src/fortran.cpp index c8c38d6..79641ac 100644 --- a/src/fortran.cpp +++ b/src/fortran.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "config.hpp" #include #include diff --git a/src/fortran.hpp b/src/fortran.hpp index bb98cc3..d63e8d3 100644 --- a/src/fortran.hpp +++ b/src/fortran.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_FORTRAN_HPP #define __COSMO_FORTRAN_HPP diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 5f805ec..f39e3a5 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __BASE_FOURIER_TYPES_HPP #define __BASE_FOURIER_TYPES_HPP diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index 8e78c80..53b0278 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_MAPS #define __DETAILS_EUCLIDIAN_MAPS diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index 613dde4..36b524a 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D diff --git a/src/fourier/details/euclidian_spectrum_1d_bin.hpp b/src/fourier/details/euclidian_spectrum_1d_bin.hpp index 1200f83..ee6cd0b 100644 --- a/src/fourier/details/euclidian_spectrum_1d_bin.hpp +++ b/src/fourier/details/euclidian_spectrum_1d_bin.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN #define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN diff --git a/src/fourier/details/euclidian_transform.hpp b/src/fourier/details/euclidian_transform.hpp index 79bf75b..527d38b 100644 --- a/src/fourier/details/euclidian_transform.hpp +++ b/src/fourier/details/euclidian_transform.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_TRANSFORM #define __DETAILS_EUCLIDIAN_TRANSFORM diff --git a/src/fourier/details/healpix_alms.hpp b/src/fourier/details/healpix_alms.hpp index 5aa31ce..fb438a8 100644 --- a/src/fourier/details/healpix_alms.hpp +++ b/src/fourier/details/healpix_alms.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP diff --git a/src/fourier/details/healpix_map.hpp b/src/fourier/details/healpix_map.hpp index 7e2479a..a2a3f18 100644 --- a/src/fourier/details/healpix_map.hpp +++ b/src/fourier/details/healpix_map.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp index 0ddd58b..92f7085 100644 --- a/src/fourier/details/healpix_spectrum.hpp +++ b/src/fourier/details/healpix_spectrum.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP diff --git a/src/fourier/details/healpix_transform.hpp b/src/fourier/details/healpix_transform.hpp index 564caff..6e89213 100644 --- a/src/fourier/details/healpix_transform.hpp +++ b/src/fourier/details/healpix_transform.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp index 5e9775a..8803ae9 100644 --- a/src/fourier/details/healpix_utility.hpp +++ b/src/fourier/details/healpix_utility.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index ccaeced..efc76e7 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP diff --git a/src/fourier/fft/fftw_calls.hpp b/src/fourier/fft/fftw_calls.hpp index 6cb39ea..c811728 100644 --- a/src/fourier/fft/fftw_calls.hpp +++ b/src/fourier/fft/fftw_calls.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __FFTW_UNIFIED_CALLS_HPP #define __FFTW_UNIFIED_CALLS_HPP diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 975ac00..e8b8b2d 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_HPP #define __COSMOTOOL_FOURIER_HEALPIX_HPP diff --git a/src/growthFactor.cpp b/src/growthFactor.cpp index d954000..b718d4e 100644 --- a/src/growthFactor.cpp +++ b/src/growthFactor.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "interpolate.hpp" diff --git a/src/growthFactor.hpp b/src/growthFactor.hpp index 01f0bd6..1a455df 100644 --- a/src/growthFactor.hpp +++ b/src/growthFactor.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef COSMO_GROWTH_FACTOR_HPP #define COSMO_GROWTH_FACTOR_HPP diff --git a/src/interpolate.cpp b/src/interpolate.cpp index 3c175da..ec6575c 100644 --- a/src/interpolate.cpp +++ b/src/interpolate.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/interpolate.hpp b/src/interpolate.hpp index 4aa0573..2e30e29 100644 --- a/src/interpolate.hpp +++ b/src/interpolate.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __CTOOL_INTERPOLATE_HPP #define __CTOOL_INTERPOLATE_HPP diff --git a/src/interpolate3d.hpp b/src/interpolate3d.hpp index c50a905..0f66d02 100644 --- a/src/interpolate3d.hpp +++ b/src/interpolate3d.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_INTERPOLATE3D_HPP #define __COSMO_INTERPOLATE3D_HPP diff --git a/src/kdtree_leaf.hpp b/src/kdtree_leaf.hpp index f89fa80..0481889 100644 --- a/src/kdtree_leaf.hpp +++ b/src/kdtree_leaf.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __LEAF_KDTREE_HPP #define __LEAF_KDTREE_HPP diff --git a/src/kdtree_splitters.hpp b/src/kdtree_splitters.hpp index 0dbfff7..c0364a6 100644 --- a/src/kdtree_splitters.hpp +++ b/src/kdtree_splitters.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __KDTREE_SPLITTERS_HPP #define __KDTREE_SPLITTERS_HPP diff --git a/src/loadFlash.cpp b/src/loadFlash.cpp index 6da91f6..d437f25 100644 --- a/src/loadFlash.cpp +++ b/src/loadFlash.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + /* Reads in FLASH v3 files in HDF5 format */ #include diff --git a/src/loadFlash.hpp b/src/loadFlash.hpp index fbc017f..62f511b 100644 --- a/src/loadFlash.hpp +++ b/src/loadFlash.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_LOAD_FLASH_HPP #define __COSMO_LOAD_FLASH_HPP diff --git a/src/loadFlash_dummy.cpp b/src/loadFlash_dummy.cpp index f8a2a62..2c6a86c 100644 --- a/src/loadFlash_dummy.cpp +++ b/src/loadFlash_dummy.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "load_data.hpp" #include "loadFlash.hpp" diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index 60e04e6..47100c8 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/loadGadget.hpp b/src/loadGadget.hpp index d50816d..ad0e412 100644 --- a/src/loadGadget.hpp +++ b/src/loadGadget.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_LOAD_GADGET_HPP #define __COSMO_LOAD_GADGET_HPP diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 2b98b0f..3eb909c 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/loadRamses.hpp b/src/loadRamses.hpp index 33f082d..5282a3c 100644 --- a/src/loadRamses.hpp +++ b/src/loadRamses.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _LOAD_RAMSES_HPP #define _LOAD_RAMSES_HPP diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index 1899cb4..1c360a4 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOLBOX_HPP #define __COSMOTOOLBOX_HPP diff --git a/src/load_data.cpp b/src/load_data.cpp index b5c0b22..f23f909 100644 --- a/src/load_data.cpp +++ b/src/load_data.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/load_data.hpp b/src/load_data.hpp index f657e13..6be3bbb 100644 --- a/src/load_data.hpp +++ b/src/load_data.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _LOAD_GADGET_DATA_HPP #define _LOAD_GADGET_DATA_HPP diff --git a/src/mach.hpp b/src/mach.hpp index e383574..6bea525 100644 --- a/src/mach.hpp +++ b/src/mach.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_MACHINE_TEST_HPP #define __COSMO_MACHINE_TEST_HPP diff --git a/src/miniargs.cpp b/src/miniargs.cpp index 400760f..7c23230 100644 --- a/src/miniargs.cpp +++ b/src/miniargs.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/miniargs.hpp b/src/miniargs.hpp index db81c67..9f04b58 100644 --- a/src/miniargs.hpp +++ b/src/miniargs.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _MAK_MINIARGS_HPP #define _MAK_MINIARGS_HPP diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index dd912e1..27d66ae 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __HV_KDTREE_HPP #define __HV_KDTREE_HPP diff --git a/src/newton.hpp b/src/newton.hpp index 7a85b1a..d3975fe 100644 --- a/src/newton.hpp +++ b/src/newton.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _COSMOTOOL_NEWTON_HPP #define _COSMOTOOL_NEWTON_HPP diff --git a/src/octTree.cpp b/src/octTree.cpp index ce3a97d..2c76609 100644 --- a/src/octTree.cpp +++ b/src/octTree.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/octTree.hpp b/src/octTree.hpp index 658d87b..425d8fd 100644 --- a/src/octTree.hpp +++ b/src/octTree.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_AMR_HPP #define __COSMOTOOL_AMR_HPP diff --git a/src/pool.hpp b/src/pool.hpp index a09669b..b3e2637 100644 --- a/src/pool.hpp +++ b/src/pool.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_POOL_HPP #define __COSMO_POOL_HPP diff --git a/src/powerSpectrum.cpp b/src/powerSpectrum.cpp index 0bc741a..b2a34be 100644 --- a/src/powerSpectrum.cpp +++ b/src/powerSpectrum.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/powerSpectrum.hpp b/src/powerSpectrum.hpp index ea19f5f..d4c6761 100644 --- a/src/powerSpectrum.hpp +++ b/src/powerSpectrum.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _POWERSPECTRUM_HPP #define _POWERSPECTRUM_HPP diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 3b6d3b8..fd7035f 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/replicateGenerator.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __REPLICATE_GENERATOR_HPP #define __REPLICATE_GENERATOR_HPP diff --git a/src/sparseGrid.hpp b/src/sparseGrid.hpp index b529a6d..516be9d 100644 --- a/src/sparseGrid.hpp +++ b/src/sparseGrid.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __VOID_SPARSE_GRID_HPP #define __VOID_SPARSE_GRID_HPP diff --git a/src/sphSmooth.hpp b/src/sphSmooth.hpp index 0e6cf55..f6fe582 100644 --- a/src/sphSmooth.hpp +++ b/src/sphSmooth.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_SPH_SMOOTH_HPP #define __COSMOTOOL_SPH_SMOOTH_HPP diff --git a/src/yorick.hpp b/src/yorick.hpp index 802d1cc..39fd20d 100644 --- a/src/yorick.hpp +++ b/src/yorick.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __YORICK_HELPERS_HPP #define __YORICK_HELPERS_HPP diff --git a/src/yorick_nc3.cpp b/src/yorick_nc3.cpp index 9f814b6..d80781e 100644 --- a/src/yorick_nc3.cpp +++ b/src/yorick_nc3.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "ctool_netcdf_ver.hpp" #include "config.hpp" #ifdef NETCDFCPP4 diff --git a/src/yorick_nc4.cpp b/src/yorick_nc4.cpp index 7765093..9a6f501 100644 --- a/src/yorick_nc4.cpp +++ b/src/yorick_nc4.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "ctool_netcdf_ver.hpp" #include "config.hpp" #include From 1dcdde7bf5a2aee2f91c0ebb83697afbe20be30d Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 7 Mar 2013 09:39:10 -0600 Subject: [PATCH 4/5] Fixlet to gadget writer and use std::string instead of char * --- src/loadGadget.cpp | 10 +++++----- src/loadGadget.hpp | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index a824d28..7dab5ab 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -274,10 +274,10 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, int loadflags, i -void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat) +void CosmoTool::writeGadget(const std::string& fname, SimuData *data, int GadgetFormat) { UnformattedWrite *f; - int npart[6]; + int npart[6], npartTotal[6]; float mass[6]; if (data->Pos[0] == 0 || data->Vel[0] == 0 || data->Id == 0) @@ -289,12 +289,12 @@ void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat) for (int i = 0; i < 6; i++) { - npart[i] = 0; + npart[i] = npartTotal[i] = 0; mass[i] = 0; } mass[1] = 1.0; - npart[1] = data->NumPart; + npartTotal[1] = data->TotalNumPart; f->beginCheckpoint(); for (int i = 0; i < 6; i++) @@ -308,7 +308,7 @@ void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat) f->writeInt32(0); for (int i = 0; i < 6; i++) - f->writeInt32(npart[i]); + f->writeInt32(npartTotal[i]); f->writeInt32(0); f->writeInt32(1); f->writeReal64(data->BoxSize); diff --git a/src/loadGadget.hpp b/src/loadGadget.hpp index 69f0ea6..eec0fc9 100644 --- a/src/loadGadget.hpp +++ b/src/loadGadget.hpp @@ -1,6 +1,8 @@ #ifndef __COSMO_LOAD_GADGET_HPP #define __COSMO_LOAD_GADGET_HPP +#include + #include "load_data.hpp" #include "loadSimu.hpp" @@ -11,7 +13,7 @@ namespace CosmoTool { SimuData *loadGadgetMulti(const char *fname, int id, int flags, int GadgetFormat = 1); // Only single snapshot supported - void writeGadget(const char *fname, SimuData *data, int GadgetFormat = 1); + void writeGadget(const std::string& fname, SimuData *data, int GadgetFormat = 1); }; From 01f952865c39a3d7b01598176ed4e6b9e0b43037 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 7 Mar 2013 09:45:52 -0600 Subject: [PATCH 5/5] Allow replication to be different along different dimensions --- src/mykdtree.hpp | 10 ++++++++-- src/replicateGenerator.hpp | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index 27d66ae..bf1eaa0 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -136,7 +136,13 @@ namespace CosmoTool { void setPeriodic(bool on, CoordType replicate) { periodic = on; - this->replicate = replicate; + std::fill(this->replicate, this->replicate+N, replicate); + } + + void setPeriodic(bool on, const coords& replicate) + { + periodic = on; + std::copy(replicate, replicate+N, this->replicate); } uint32_t getIntersection(const coords& x, CoordType r, @@ -193,7 +199,7 @@ namespace CosmoTool { Cell *base_cell; bool periodic; - CoordType replicate; + coords replicate; Node *buildTree(Cell **cell0, uint32_t NumCells, diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index fd7035f..4d89050 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -46,18 +46,29 @@ namespace CosmoTool { public: typedef Coord Coords[N]; - Coord replicate; + Coords replicate; ReplicateGenerator(const Coords& x, Coord shift) { face = 0; - replicate = shift; + std::fill(replicate, replicate+N, shift); numFaces = spower(3); std::copy(x, x+N, x_base); if (!next()) abort(); } + ReplicateGenerator(const Coords& x, Coords& shift) + { + face = 0; + std::copy(shift, shift+N, replicate); + numFaces = spower(3); + std::copy(x, x+N, x_base); + if (!next()) + abort(); + } + + bool next() { if (face == numFaces) @@ -72,7 +83,7 @@ namespace CosmoTool int c_face; c_face = q_face % 3; q_face /= 3; - x_shifted[i] = x_base[i] + (c_face-1)*replicate; + x_shifted[i] = x_base[i] + (c_face-1)*replicate[i]; no_move = no_move && (c_face == 1); } if (no_move)