Commit 3d293f9e authored by Matthias Messner's avatar Matthias Messner
parents 3da06e35 a5d07478
# - Finds OpenMP support
# This module can be used to detect OpenMP support in a compiler.
# If the compiler supports OpenMP, the flags required to compile with
# openmp support are set.
#
# The following variables are set:
# OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
# OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
# OPENMP_FOUND - true if openmp is detected
#
# Supported compilers can be found at http://openmp.org/wp/openmp-compilers/
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Modified in RSTM from original source to provide CXX-tm flags
set(OpenMP_C_FLAG_CANDIDATES
#Gnu
"-fopenmp"
#Microsoft Visual Studio
"/openmp"
#Intel windows
"-Qopenmp"
#Intel
"-openmp"
#Empty, if compiler automatically accepts openmp
" "
#Sun
"-xopenmp"
#HP
"+Oopenmp"
#IBM XL C/c++
"-qsmp"
#Portland Group
"-mp"
)
set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES})
set(OpenMP_CXX-tm_FLAG_CANDIDATES ${OpenMP_CXX_FLAG_CANDIDATES})
# sample openmp source code to test
set(OpenMP_C_TEST_SOURCE
"
#include <omp.h>
int main() {
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}
")
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
set(OpenMP_CXX-tm_TEST_SOURCE ${OpenMP_CXX_TEST_SOURCE})
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS AND DEFINED OpenMP_CXX-tm_FLAGS)
set(OpenMP_C_FLAG_CANDIDATES)
set(OpenMP_CXX_FLAG_CANDIDATES)
set(OpenMP_CXX-tm_FLAG_CANDIDATES)
endif()
# check c compiler
IF (CMAKE_C_COMPILER)
include (CheckCSourceCompiles)
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP C flag = [${FLAG}]")
check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
ENDIF (CMAKE_C_COMPILER)
# check cxx compiler
IF (CMAKE_CXX_COMPILER)
include (CheckCXXSourceCompiles)
foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
ENDIF (CMAKE_CXX_COMPILER)
# check cxxtm compiler
IF (CMAKE_CXX-tm_COMPILER)
include (CheckCXX-tmSourceCompiles)
foreach(FLAG ${OpenMP_CXX-tm_FLAG_CANDIDATES})
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP CXX-tm flag = [${FLAG}]")
check_cxxtm_source_compiles("${OpenMP_CXX-tm_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX-tm_FLAGS_INTERNAL "${FLAG}")
break()
endif()
endforeach()
ENDIF ()
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
macro (OpenMP_complete_lang_flags lang langstring)
IF (CMAKE_${lang}_COMPILER)
set(OpenMP_${lang}_FLAGS "${OpenMP_${lang}_FLAGS_INTERNAL}"
CACHE STRING "${langstring} compiler flags for OpenMP parallization")
find_package_handle_standard_args(OpenMP DEFAULT_MSG
OpenMP_${lang}_FLAGS )
mark_as_advanced(OpenMP_${lang}_FLAGS)
ENDIF ()
endmacro ()
OpenMP_complete_lang_flags (C "C")
OpenMP_complete_lang_flags (CXX "C++")
OpenMP_complete_lang_flags (CXX-tm "C++ TM")
......@@ -6,11 +6,14 @@ if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource)
# MPI option has to be set before project
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" OFF )
# MPI option has to be set before project, cannot be changed in the cache!
if( SCALFMM_USE_MPI )
SET(CMAKE_CXX_COMPILER mpicxx)
endif()
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
else()
MESSAGE(STATUS "Remove CMake cache and run cmake .. -DSCALFMM_USE_MPI=ON to enable MPI" )
endif(SCALFMM_USE_MPI)
# Project Infos
project(scalfmm)
......@@ -32,9 +35,12 @@ OPTION( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF )
# Test if openmp is here
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
find_package(OpenMP)
# include(FindOpenMP)
find_package (OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# Debug
MESSAGE( STATUS "SCALFMM_BUILD_DEBUG = ${SCALFMM_BUILD_DEBUG}" )
......@@ -87,15 +93,6 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
# Use Mem stats
MESSAGE( STATUS "SCALFMM_USE_MEM_STATS = ${SCALFMM_USE_MEM_STATS}" )
# Test if openmp is here
find_package (OpenMP)
# include(FindOpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# Add CBLAS
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CBLAS_LIBRARIES}")
......
......@@ -19,6 +19,11 @@
/** This class is an arranger, it move the particles that need
* to be hosted in a different leaf
* \n
* For example, if a simulation has been executed and the position
* of the particles have been changed, then it may be better
* to move the particles in the tree instead of building a new
* tree.
*/
template <class OctreeClass, class ContainerClass, class ParticleClass>
class FOctreeArranger : FAssertable {
......
......@@ -18,7 +18,12 @@
/** This class is an arranger, it move the particles that need
* to be hosted in a different leaf
* This is the parallel version.
* This is the parallel version that use MPI.
* \n
* For example, if a simulation has been executed and the position
* of the particles have been changed, then it may be better
* to move the particles in the tree instead of building a new
* tree.
*/
template <class OctreeClass, class ContainerClass, class ParticleClass>
class FOctreeArrangerProc : FAssertable {
......
......@@ -18,12 +18,11 @@
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractCell
* @brief
* Please read the license
*
* This class define the method that every cell class
* has to implement.
*
* In fact FOctree & FFmmAlgorithm need this function to be implemented.
* This class define the methods that every cell class
* has to implement to be insertable in the tree.
* \n
* In fact FOctree & FFmmAlgorithm need this functions to be implemented.
* But you cannot use this interface with the extension (as an example :
* because the compiler will faill to know if getMortonIndex is coming
* from this interface or from the extension)
......@@ -37,9 +36,9 @@ public:
}
/**
* Must be implemented by each user Cell class
* @return the position of the current cell
*/
* Must be implemented by each user Cell class
* @return the position of the current cell
*/
virtual MortonIndex getMortonIndex() const = 0;
......
......@@ -71,10 +71,11 @@ public:
/**
* L2L
* Local to local
* @param the father to take value from
* @param the child to downward values (child may have already been impacted by M2L)
* @param level the current level of computation
* @param local the father to take value from
* @param child the child to downward values (child may have already been impacted by M2L)
* @param inLevel the current level of computation
* the child array has a size of 8 elements (address if exists or 0 otherwise).
* Children are ordering in the morton index way.
* You must test if a pointer is 0 to know if an element exists inside this array
*/
virtual void L2L(const CellClass* const FRestrict local, CellClass* FRestrict * const FRestrict child, const int inLevel) = 0;
......
......@@ -6,7 +6,7 @@ class FBufferWriter;
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractSendable
* @class FAbstractSerializable
* Please read the license
*
* This propose an interface to save and restore a class
......
......@@ -33,10 +33,12 @@ public:
virtual ~FBasicCell(){
}
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
FExtendMortonIndex::save(buffer);
FExtendCoordinate::save(buffer);
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
FExtendMortonIndex::restore(buffer);
FExtendCoordinate::restore(buffer);
......
......@@ -14,8 +14,6 @@
#include "FAbstractKernels.hpp"
#include "../Utils/FGlobal.hpp"
#include "../Utils/FTrace.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -23,8 +21,7 @@
* @brief
* Please read the license
*
* This kernels simply shows the details of the information
* it receives (in debug)
* This kernels is empty and does nothing.
*/
template< class ParticleClass, class CellClass, class ContainerClass>
class FBasicKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> {
......
......@@ -27,9 +27,11 @@
*/
class FBasicParticle : public FExtendPosition{
public:
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
FExtendPosition::save(buffer);
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
FExtendPosition::restore(buffer);
}
......
......@@ -12,7 +12,7 @@
#define FFmaPARTICLE_HPP
#include "FBasicParticle.hpp"
#include "../Extensions/FExtendPosition.hpp"
#include "../Extensions/FExtendPhysicalValue.hpp"
/**
......@@ -23,14 +23,16 @@
* This class defines a particle for FMA loader.
* As defined in FFmaLoader it needs {FBasicParticle,FExtendPhysicalValue}
*/
class FFmaParticle : public FBasicParticle, public FExtendPhysicalValue {
class FFmaParticle : public FExtendPosition, public FExtendPhysicalValue {
public:
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
FBasicParticle::save(buffer);
FExtendPosition::save(buffer);
FExtendPhysicalValue::save(buffer);
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
FBasicParticle::restore(buffer);
FExtendPosition::restore(buffer);
FExtendPhysicalValue::restore(buffer);
}
};
......
......@@ -33,7 +33,7 @@ public:
/**
* To add a new particle in the leaf
* @param particle the new particle
* @param particle the new particle to store in the current leaf
*/
void push(const ParticleClass& particle){
this->particles.push(particle);
......
......@@ -20,7 +20,7 @@
* Please read the license
*
* This class is used in the FTestKernels, please
* look at this class to know what it is.
* look at this class to know how to customize a cell.
*
* This cell simply store the data when up/down
*/
......@@ -51,25 +51,36 @@ public:
this->dataDown = inData;
}
/////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
FBasicCell::save(buffer);
buffer << dataDown << dataUp;
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
FBasicCell::restore(buffer);
buffer >> dataDown >> dataUp;
}
/////////////////////////////////////////////////
/** Serialize only up data in a buffer */
void serializeUp(FBufferWriter& buffer) const {
buffer << this->dataUp;
}
/** Deserialize only up data in a buffer */
void deserializeUp(FBufferReader& buffer){
buffer >> this->dataUp;
}
/** Serialize only down data in a buffer */
void serializeDown(FBufferWriter& buffer) const {
buffer << this->dataDown;
}
/** Deserialize only up data in a buffer */
void deserializeDown(FBufferReader& buffer){
buffer >> this->dataDown;
}
......
......@@ -27,7 +27,9 @@
*
* This kernels is a virtual kernels to validate that the fmm algorithm is
* correctly done on particles.
* It used FTestCell and FTestParticle
* It should use FTestCell and FTestParticle.
* A the end of a computation, the particles should host then number of particles
* in the simulation (-1).
*/
template< class ParticleClass, class CellClass, class ContainerClass>
class FTestKernels : public FAbstractKernels<ParticleClass,CellClass,ContainerClass> {
......@@ -38,14 +40,12 @@ public:
/** Before upward */
void P2M(CellClass* const pole, const ContainerClass* const particles) {
// the pole represents all particles under
pole->setDataUp(pole->getDataUp() + particles->getSize());
}
/** During upward */
void M2M(CellClass* const FRestrict pole, const CellClass *const FRestrict *const FRestrict child, const int /*level*/) {
// A parent represents the sum of the child
for(int idx = 0 ; idx < 8 ; ++idx){
if(child[idx]){
......@@ -56,7 +56,6 @@ public:
/** Before Downward */
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[343], const int /*size*/, const int /*level*/) {
// The pole is impacted by what represent other poles
for(int idx = 0 ; idx < 343 ; ++idx){
if(distantNeighbors[idx]){
......@@ -67,7 +66,6 @@ public:
/** During Downward */
void L2L(const CellClass*const FRestrict local, CellClass* FRestrict *const FRestrict child, const int /*level*/) {
// Each child is impacted by the father
for(int idx = 0 ; idx < 8 ; ++idx){
if(child[idx]){
......@@ -79,7 +77,6 @@ public:
/** After Downward */
void L2P(const CellClass* const local, ContainerClass*const particles){
// The particles is impacted by the parent cell
typename ContainerClass::BasicIterator iter(*particles);
while( iter.hasNotFinished() ){
......@@ -94,7 +91,6 @@ public:
void P2P(const FTreeCoordinate& ,
ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
ContainerClass* const directNeighborsParticles[27], const int ){
// Each particles targeted is impacted by the particles sources
long long int inc = sources->getSize();
if(targets == sources){
......@@ -118,7 +114,6 @@ public:
void P2PRemote(const FTreeCoordinate& ,
ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
ContainerClass* const directNeighborsParticles[27], const int ){
// Each particles targeted is impacted by the particles sources
long long int inc = 0;
for(int idx = 0 ; idx < 27 ; ++idx){
......
......@@ -22,7 +22,8 @@
* This class is used in the FTestKernels, please
* look at this class to know whit it is.
*
* Particles just need the data down.
* Particles just need the data down (after and run with FTestKernel the
* value shoud be NB PARTICLES (-1)).
*/
class FTestParticle : public FBasicParticle {
protected:
......@@ -46,10 +47,15 @@ public:
this->dataDown = inData;
}
//////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
FBasicParticle::save(buffer);
buffer << dataDown;
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
FBasicParticle::restore(buffer);
buffer >> dataDown;
......
......@@ -21,12 +21,14 @@
* @brief
* Please read the license
* This class is used to enable the use of typed particles
* (source XOR target) or simple system (source AND target)
* (source XOR target) or simple system (source AND target).
*
* Particles should be typed to enable targets/sources difference.
*/
template< class ParticleClass , class ContainerClass>
class FTypedLeaf : public FAbstractLeaf<ParticleClass,ContainerClass>, public FAssertable {
ContainerClass sources;
ContainerClass targets;
ContainerClass sources; //< The sources containers
ContainerClass targets; //< The targets containers
public:
/** Default destructor */
......@@ -38,6 +40,7 @@ public:
* @param particle the new particle
*/
void push(const ParticleClass& particle){
// Test if is source or target particle
if(particle.isTarget()) this->targets.push(particle);
else if(particle.isSource()) this->sources.push(particle);
else fassert(false, "Error particle has undefined type.", __LINE__, __FILE__);
......
......@@ -21,22 +21,24 @@
* Please read the license
*
* A bool array is a dynamique allocated array that used 1 bit per value.
* Under the wood, it use bit operations to acess/set value in an array of
* native type.
*/
class FBoolArray{
/** Size of a unsigned long */
const static int SizeOfLong = sizeof(unsigned long);
const static int BytesInBlock = sizeof(unsigned long);
const static int SizeOfBlock = BytesInBlock * 8;
/** Size of the array => number of real elements */
const int size;
/** The array to store bits */
unsigned long* const array;
/** Size of the memory allocated */
const int memSize;
/** Size of the array => number of real elements */
const int size;
/** get size to number of long */
int LongFromSize(const int inSize){
const int nbLong = (inSize / (SizeOfLong * 8) );
return nbLong + 1;
return ((inSize + SizeOfBlock - 1) / SizeOfBlock);
}
/** Alloc an array */
......@@ -46,12 +48,12 @@ class FBoolArray{
public :
/** Constructor with size */
FBoolArray(const int inSize) : size(inSize), array(AllocArray(inSize)), memSize(LongFromSize(inSize)*SizeOfLong) {
FBoolArray(const int inSize) : array(AllocArray(inSize)), memSize(LongFromSize(inSize)*BytesInBlock), size(inSize) {
setToZeros();
}
/** Constructor form another array */
FBoolArray(const FBoolArray& other): size(other.size), array(AllocArray(other.size)), memSize(other.memSize){
FBoolArray(const FBoolArray& other): array(AllocArray(other.size)), memSize(other.memSize), size(other.size){
*this = other;
}
......@@ -87,14 +89,14 @@ public :
/** To get a value */
bool get(const int inPos) const {
const int posInArray = inPos / (SizeOfLong*8);
const int posInArray = inPos / SizeOfBlock;
const int bytePosition = inPos - (posInArray * 8);
return (array[posInArray] >> bytePosition) & 1;
}
/** To set a value */
void set(const int inPos, const bool inVal){
const int posInArray = inPos / (SizeOfLong*8);
const int posInArray = inPos / SizeOfBlock;
const int bytePosition = inPos - (posInArray * 8);
if(inVal) array[posInArray] |= (1UL << bytePosition);
else array[posInArray] &= ~(1UL << bytePosition);
......
......@@ -18,8 +18,7 @@
* This class provide a fast way to manage a memory and convert
* the content to basic type.
*
* Specifie the needed space with reserve,
* then fill it with data
* Specifie the needed space with reserve, then fill it with data
* finaly read and convert.
*/
class FBufferReader {
......
......@@ -15,6 +15,8 @@
* @author Berenger Bramas (berenger.bramas@inria.fr)This class is a light octree
* It is just a linked list with 8 pointers per node
* it is used to store small data in an octree way.
* @warning It can only store one level of data!
* As it is linked, the acess is always made fro the top.
*/
template <class CellClass>
class FLightOctree {
......
......@@ -23,7 +23,7 @@
* This class is a linked list container.
* It is a very basic list to enable strong performance.
*
* Please refere to unit test flistUTest.cpp to know more.
* Please refere to unit test utestList.cpp to know more.
*/
template< class Object >
class FList {
......
......@@ -31,29 +31,33 @@
* This class is an octree container.
*
* Please refere to testOctree.cpp to see an example.
* <code>
* @code
* // can be used as : <br>
* FOctree<TestParticle, TestCell> tree(1.0,FPoint(0.5,0.5,0.5));
* </code>
* @endcode
*
* Particles and cells has to respect the Abstract class definition.
* Particle must extend {FExtendPosition}
* Cell must extend extend {FTreeCoordinate,FExtendMortonIndex}
*
* If the octree as an height H, then it goes from 0 to H-1
* at level 0 the space is not split
*/
template< class ParticleClass, class CellClass, class ContainerClass, class LeafClass>
class FOctree : protected FAssertable, public FNoCopyable {
FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels
FAbstractSubOctree< ParticleClass, CellClass , ContainerClass, LeafClass>* root; //< root suboctree
FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels
const int height; //< tree height
const int subHeight; //< tree height
const int leafIndex; //< index of leaf int array
FAbstractSubOctree< ParticleClass, CellClass , ContainerClass, LeafClass>* root; //< root suboctree
const FPoint boxCenter; //< the space system center
const FPoint boxCorner; //< the space system corner (used to compute morton index)
const FReal boxWidth; //< the space system width
const FReal boxWidth; //< the space system width
/**
......@@ -89,15 +93,17 @@ class FOctree : protected FAssertable, public FNoCopyable {
public:
/**
* Constructor