Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
dd8edc44
Commit
dd8edc44
authored
May 07, 2014
by
COULAUD Olivier
Browse files
all
parent
61aa139a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Data/prolate100.fma
0 → 100644
View file @
dd8edc44
100 20 0 0 0
0.998298 0.0088693 0.576438 0.396465
0.107422 -0.2487 -9.62605 0.840485
-0.784533 0.0389288 6.18863 0.353336
-0.239929 0.958705 1.52707 0.446583
0.403898 0.780385 -4.77353 0.318693
0.0229265 0.413024 -9.10432 0.886428
0.161035 0.900809 4.03249 0.0155828
-0.391436 0.31133 -8.6594 0.58409
0.336155 0.892897 -2.99556 0.159369
0.909534 0.318221 2.67363 0.383716
-0.323809 0.118659 -9.38652 0.691004
0.423993 -0.27039 8.6436 0.0588589
-0.800443 0.592642 -0.898189 0.899854
0.487848 -0.782409 3.87093 0.163546
-0.4158 -0.85766 3.02539 0.159072
0.818692 -0.351912 -4.53763 0.533065
-0.510301 0.495726 -7.02744 0.604144
0.171849 -0.265669 -9.48624 0.582699
-0.410242 0.878534 -2.44705 0.269971
-0.00788981 0.954825 2.97065 0.390478
0.812492 -0.302815 -4.98156 0.293401
-0.846722 -0.267532 -4.59878 0.742377
-0.197639 0.654068 7.3016 0.298526
0.531595 -0.522932 6.66295 0.0755381
0.418405 -0.309864 -8.53769 0.404983
0.532116 -0.816875 2.22637 0.857378
0.0428093 -0.966039 -2.54826 0.941968
-0.339692 -0.886642 -3.13806 0.662831
0.596096 -0.158221 7.87169 0.846476
-0.835556 -0.334092 -4.36152 0.00275508
-0.730973 0.25523 6.32879 0.462379
-0.217175 0.974508 -0.56292 0.532596
0.782485 0.605231 1.46331 0.787877
0.380726 -0.791496 4.78103 0.265612
-0.0353821 0.866432 -4.9804 0.982752
-0.960368 -0.166482 -2.23557 0.306785
0.675061 -0.710818 -1.97559 0.600855
-0.717732 0.562193 -4.10852 0.608716
0.407635 -0.831071 -3.78358 0.212439
-0.59752 0.611465 -5.1873 0.885895
0.808438 -0.582506 -0.843452 0.304657
0.974247 -0.182917 1.31847 0.15186
0.426876 0.893875 -1.36987 0.337662
-0.906895 0.267389 -3.25646 0.387477
0.859915 0.35397 3.67765 0.64361
-0.106217 0.923875 -3.67658 0.753553
0.456599 0.645136 6.12631 0.603616
0.487819 -0.741964 4.59915 0.531628
-0.263461 -0.211377 -9.41227 0.45936
-0.804465 0.564279 1.85539 0.652488
-0.350825 0.87264 -3.39738 0.327181
0.719278 0.513161 4.68299 0.94637
0.976244 -0.0912485 -1.96521 0.36804
0.381419 -0.336697 8.60903 0.94389
0.612962 -0.771412 -1.70885 0.00742826
-0.971677 0.153174 -1.7995 0.5166
0.975193 0.145973 -1.66402 0.272771
0.0789429 0.896583 4.35783 0.0242992
0.0663075 -0.825902 5.59901 0.591955
0.86939 -0.420831 -2.58964 0.204964
0.902358 -0.0929655 -4.20841 0.877693
-0.310971 -0.220975 -9.24374 0.0593687
0.58475 0.628044 5.13448 0.260843
-0.728461 -0.387442 -5.65008 0.302829
-0.00839011 -0.818783 5.74042 0.891495
0.531829 -0.729876 -4.29463 0.498198
-0.672177 0.315034 6.70024 0.710026
0.00306144 0.432259 9.01744 0.286414
-0.986248 0.0182631 -1.64259 0.864924
-0.391103 -0.911636 1.26331 0.675541
-0.703262 -0.319161 -6.35262 0.45849
0.441326 0.674298 -5.92076 0.959636
0.194108 0.782199 -5.92019 0.774675
0.643091 -0.457905 -6.13805 0.376551
-0.611491 0.522452 5.94241 0.228639
-0.0661106 -0.832189 -5.50537 0.354534
0.281414 0.901252 3.29472 0.300318
0.811012 0.569713 1.32994 0.669766
0.472628 0.194104 -8.5962 0.718967
0.734747 -0.557898 -3.85871 0.565955
-0.402198 0.190946 8.9542 0.824465
-0.772446 0.28541 5.67334 0.390612
0.33774 0.850235 4.03773 0.818766
-0.472288 -0.72322 -5.03881 0.844008
0.411452 -0.839687 -3.54449 0.180468
-0.752738 0.453448 -4.77254 0.943396
0.408807 0.758538 5.07442 0.424887
-0.338412 -0.8306 -4.42246 0.520666
0.740683 0.233553 6.29953 0.0656438
-0.00108433 -0.990426 -1.38042 0.913508
0.787219 0.591184 -1.75465 0.882585
-0.0907875 -0.954644 2.83572 0.761364
-0.0664647 -0.59599 -8.00236 0.398923
-0.227157 0.973079 0.389491 0.688257
-0.988393 0.0354439 -1.47727 0.761548
-0.296175 0.882092 3.66325 0.405009
0.986697 -0.145634 0.722434 0.125251
-0.858933 -0.485494 -1.62882 0.484634
0.650514 -0.466089 -5.9966 0.222463
0.0480048 -0.51252 8.57332 0.873121
Data/prolate100.jpeg
0 → 100644
View file @
dd8edc44
486 KB
Data/prolate50.fma
0 → 100644
View file @
dd8edc44
20 10.002 0.0 0.0 0.0
-0.381596 -0.909478 -1.65028 7.82637e-06
-0.328097 -0.475796 -8.1607 0.131538
0.773946 -0.488975 4.02381 0.755605
0.841093 0.258549 -4.75094 0.45865
-0.631449 -0.695168 -3.43532 0.532767
0.855311 0.420252 3.03037 0.218959
-0.0908349 0.632258 7.69414 0.0470446
-0.837853 0.118 5.3299 0.678865
-0.565994 0.690639 -4.50186 0.679296
0.799983 -0.599417 -0.269652 0.934693
-0.42005 0.906916 0.325839 0.383502
-0.101258 0.994787 -0.120466 0.519416
-0.164731 0.958734 -2.31716 0.830965
-0.973424 0.221148 0.594948 0.0345721
0.532694 0.535145 6.55635 0.0534616
0.626587 -0.682149 3.76911 0.5297
0.0663265 0.625817 7.77144 0.671149
-0.951257 -0.0795204 -2.9797 0.00769819
-0.764777 0.449732 -4.61365 0.383416
-0.23121 0.970786 -0.641653 0.0668422
Src/AdaptativeTree/FAdaptCell.hpp
deleted
100755 → 0
View file @
61aa139a
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FADAPTCELL_HPP
#define FADAPTCELL_HPP
#include
<cstddef>
#include
<vector>
//
#include
"Components/FBasicCell.hpp"
#include
"Containers/FVector.hpp"
/**
* @author Olivier Coulaud (Olivier.Coulaud@inria.fr)
* @class FAdaptCell*
* @brief This class defines adaptative cell.
*
* ToDO
*
*/
//class FAdaptCell;
template
<
class
CellClass
,
class
LeafClass
>
class
FAdaptCell
:
public
FBasicCell
{
public:
struct
FExtACell
{
FAdaptCell
<
CellClass
,
LeafClass
>
*
cell
;
int
level
;
//< Level in the octree of cell
FExtACell
()
{
cell
=
nullptr
;
level
=-
1
;
}
;
};
protected:
// Global Index of the cell in the octree (This id is unique)
long
int
gID
;
//! Number of particles inside the cell
int
nbP
;
//! iAdaptive cell True, false
bool
adaptative
;
bool
sminMCriteria
;
//
// Lists
//
FExtACell
adaptativeParent
;
//< Adaptative Parent of the cell
FVector
<
FExtACell
>
adaptativeChild
;
//< list of adaptative child of the cell
FVector
<
LeafClass
*>
leaves
;
//< list of leaf child of the cell
//
//
CellClass
*
trueFMMCell
;
//<a pointer on the cell that contains Multipole and local values
public:
FAdaptCell
()
:
gID
(
-
1
),
nbP
(
0
),
adaptative
(
false
),
trueFMMCell
(
nullptr
)
{
}
/** Default destructor */
virtual
~
FAdaptCell
(){
}
//! add nbPart in cell
void
addPart
(
const
int
n
){
this
->
nbP
+=
n
;
}
//! Return the number of particles inside the cell
const
int
getnbPart
()
const
{
return
this
->
nbP
;
}
//!return true if the sminM criteria is satisfied
bool
isSminMCriteria
(){
return
this
->
sminMCriteria
;
}
//!return true if the sminM criteria is satisfied
bool
isSminMCriteria
()
const
{
return
this
->
sminMCriteria
;
}
//! Set if the cell is adaptative or not
void
setSminMCriteria
(
const
bool
bb
=
true
){
this
->
sminMCriteria
=
bb
;
}
//! Return the global Id of the cell in the octree
const
long
int
getGlobalId
(){
return
this
->
gID
;
}
const
long
int
getGlobalId
(
)
const
{
return
this
->
gID
;
}
//! Set he global Id of the cell in the octree to id
void
setGlobalId
(
const
long
int
&
id
){
this
->
gID
=
id
;
;
}
//! Set if the cell is adaptative or not
void
setCellAdaptative
(
const
bool
bb
=
true
){
this
->
adaptative
=
bb
;
}
//!return true if the cell is adaptative
const
bool
isAdaptative
()
const
{
return
this
->
adaptative
;
}
//
//! Add the adaptive parent of the cell
void
addAdaptativeParent
(
const
FExtACell
&
ac
)
{
this
->
adaptativeParent
.
cell
=
ac
.
cell
;
this
->
adaptativeParent
.
level
=
ac
.
level
;
std
::
cout
<<
" addAdaptativeParent "
<<
*
(
this
)
<<
std
::
endl
;
}
//
//! Add the adaptive child of the cell
void
addAdaptativeParent
(
FAdaptCell
<
CellClass
,
LeafClass
>
*
cell
,
const
int
idxLevel
)
{
this
->
adaptativeParent
.
cell
=
cell
;
this
->
adaptativeParent
.
level
=
idxLevel
;
}
FExtACell
getAdaptativeFather
()
{
return
this
->
adaptativeParent
;
}
FExtACell
getAdaptativeFather
()
const
{
return
this
->
adaptativeParent
;
}
//
//! Add the adaptive child of the cell
void
addAdaptativeChild
(
FAdaptCell
<
CellClass
,
LeafClass
>
*
cell
,
const
int
idxLevel
)
{
FExtACell
AC
;
AC
.
cell
=
cell
;
AC
.
level
=
idxLevel
;
this
->
adaptativeChild
.
push
(
AC
);
}
//
//! Add the adaptive child of the cell
void
addAdaptativeChild
(
const
FExtACell
&
AC
){
this
->
adaptativeChild
.
push
(
AC
)
;
}
int
sizeofAdaptativeChild
()
const
{
return
this
->
adaptativeChild
.
getSize
();
}
FVector
<
FExtACell
>*
getAdaptativeChild
(){
return
&
this
->
adaptativeChild
;
}
const
FVector
<
FExtACell
>*
getAdaptativeChild
()
const
{
return
&
this
->
adaptativeChild
;
}
//
//! Add the adaptive child of the cell
void
addLeafptr
(
LeafClass
*
leaf
)
{
this
->
leaves
.
push
(
leaf
)
;
}
//! Return the number of leaves
int
getLeavesSize
()
const
{
return
this
->
leaves
.
getSize
();
}
//! Return the number of leaves
LeafClass
*
getLeaf
(
const
int
i
)
{
return
this
->
leaves
[
i
];
}
//! Return the number of leaves
LeafClass
*
getLeaf
(
const
int
i
)
const
{
return
this
->
leaves
[
i
];
}
/** Make it like the beginning */
void
resetToInitialState
(){
//this->dataDown = 0;
//this->dataUp = 0;
this
->
nbP
=
0
;
}
/////////////////////////////////////////////////
/** Save the current cell in a buffer */
template
<
class
BufferWriterClass
>
void
save
(
BufferWriterClass
&
buffer
)
const
{
FBasicCell
::
save
(
buffer
);
//buffer << dataDown << dataUp << nbP;
}
/** Restore the current cell from a buffer */
template
<
class
BufferReaderClass
>
void
restore
(
BufferReaderClass
&
buffer
){
FBasicCell
::
restore
(
buffer
);
// buffer >> dataDown >> dataUp >> nbP;
}
/////////////////////////////////////////////////
/** Serialize only up data in a buffer */
template
<
class
BufferWriterClass
>
void
serializeUp
(
BufferWriterClass
&
buffer
)
const
{
//buffer << this->dataUp;
}
/** Deserialize only up data in a buffer */
template
<
class
BufferReaderClass
>
void
deserializeUp
(
BufferReaderClass
&
buffer
){
//buffer >> this->dataUp;
}
/** Serialize only down data in a buffer */
template
<
class
BufferWriterClass
>
void
serializeDown
(
BufferWriterClass
&
buffer
)
const
{
//buffer << this->dataDown;
}
/** Deserialize only up data in a buffer */
template
<
class
BufferReaderClass
>
void
deserializeDown
(
BufferReaderClass
&
buffer
){
//buffer >> this->dataDown;
}
/**
* Operator stream FAdaptCell to std::ostream
*
* @param[in,out] output where to write the adaptative cell
* @param[in] inPosition the cell to write out
* @return the output for multiple << operators
*/
template
<
class
StreamClass
>
friend
StreamClass
&
operator
<<
(
StreamClass
&
output
,
const
FAdaptCell
<
CellClass
,
LeafClass
>&
cell
){
output
<<
"( Cell Id "
<<
cell
.
getGlobalId
()
<<
" Adpatative "
<<
std
::
boolalpha
<<
cell
.
isAdaptative
()
<<
" sminM "
<<
cell
.
isSminMCriteria
()
<<
" "
<<
cell
.
getnbPart
()
;
if
(
cell
.
getLeavesSize
()
>
0
){
output
<<
" LF={"
;
for
(
int
i
=
0
;
i
<
cell
.
getLeavesSize
()
;
++
i
){
output
<<
cell
.
getLeaf
(
i
)
<<
" "
;
}
output
<<
"}"
;
}
output
<<
" CA={ "
;
const
FVector
<
FExtACell
>
*
v
=
cell
.
getAdaptativeChild
()
;
if
(
cell
.
sizeofAdaptativeChild
()
>
0
){
for
(
int
i
=
0
;
i
<
v
->
getSize
()
;
++
i
){
output
<<
v
->
operator
[](
i
).
cell
->
getGlobalId
()
<<
" "
;
}
}
output
<<
"} "
;
if
(
cell
.
getAdaptativeFather
().
cell
){
output
<<
" FA={"
<<
(
cell
.
getAdaptativeFather
()).
cell
->
getGlobalId
()
<<
"} "
;
}
else
{
output
<<
" FA={} "
;
}
output
<<
" )"
<<
std
::
endl
;
return
output
;
// for multiple << operators.
}
};
#endif //FADAPTCELL_HPP
Src/AdaptativeTree/FAdaptSeqAlgorithm.hpp
deleted
100755 → 0
View file @
61aa139a
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, B��renger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FADAPTSEQALGORITHM_HPP
#define FADAPTSEQALGORITHM_HPP
#include
"../Utils/FGlobal.hpp"
#include
"../Utils/FAssert.hpp"
#include
"../Utils/FLog.hpp"
#include
"../Utils/FTrace.hpp"
#include
"../Utils/FTic.hpp"
#include
"../Containers/FOctree.hpp"
#include
"../Containers/FVector.hpp"
#include
"FCoreCommon.hpp"
/**
* @author Olivier Coulaud (olivier.coulaud@inria.fr)
* @class FAdaptSeqAlgorithm
* @brief
* Please read the license
*
* This class is a basic FMM algorithm
* It just iterates on a tree and call the kernels with good arguments.
*
* Of course this class does not deallocate pointer given in arguments.
*/
template
<
class
OctreeClass
,
class
CellClass
,
class
ContainerClass
,
class
KernelClass
,
class
LeafClass
>
class
FAdaptSeqAlgorithm
:
public
FAbstractAlgorithm
{
OctreeClass
*
const
tree
;
//< The octree to work on
KernelClass
*
const
kernels
;
//< The kernels
const
int
OctreeHeight
;
public:
/** The constructor need the octree and the kernels used for computation
* @param inTree the octree to work on
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FAdaptSeqAlgorithm
(
OctreeClass
*
const
inTree
,
KernelClass
*
const
inKernels
)
:
tree
(
inTree
)
,
kernels
(
inKernels
),
OctreeHeight
(
tree
->
getHeight
())
{
FAssertLF
(
tree
,
"tree cannot be null"
);
FAssertLF
(
kernels
,
"kernels cannot be null"
);
FLOG
(
FLog
::
Controller
<<
"FFmmAlgorithm
\n
"
);
}
/** Default destructor */
virtual
~
FAdaptSeqAlgorithm
(){
}
/**
* To execute the fmm algorithm
* Call this function to run the complete algorithm
*/
void
execute
(
const
unsigned
operationsToProceed
=
FFmmNearAndFarFields
){
FTRACE
(
FTrace
::
FFunction
functionTrace
(
__FUNCTION__
,
"Fmm"
,
__FILE__
,
__LINE__
)
);
if
(
operationsToProceed
&
FFmmP2M
)
bottomPass
();
if
(
operationsToProceed
&
FFmmM2M
)
upwardPass
();
if
(
operationsToProceed
&
FFmmM2L
)
transferPass
();
if
(
operationsToProceed
&
FFmmL2L
)
downardPass
();
if
(
(
operationsToProceed
&
FFmmP2P
)
||
(
operationsToProceed
&
FFmmL2P
)
)
directPass
();
}
private:
/////////////////////////////////////////////////////////////////////////////
// P2M
/////////////////////////////////////////////////////////////////////////////
/** P2M */
void
bottomPass
(){
FTRACE
(
FTrace
::
FFunction
functionTrace
(
__FUNCTION__
,
"Fmm"
,
__FILE__
,
__LINE__
)
);
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Bottom Pass
\n
"
).
write
(
FLog
::
Flush
)
);
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
computationCounter
);
typename
OctreeClass
::
Iterator
octreeIterator
(
tree
);
// Iterate on leafs
octreeIterator
.
gotoBottomLeft
();
do
{
// We need the current cell that represent the leaf
// and the list of particles
FLOG
(
computationCounter
.
tic
());
if
(
!
octreeIterator
.
getCurrentCell
()
->
iisSminMCriteria
()){
kernels
->
P2M
(
octreeIterator
.
getCurrentCell
()
,
octreeIterator
.
getCurrentListSrc
());
}
FLOG
(
computationCounter
.
tac
());
}
while
(
octreeIterator
.
moveRight
());
FLOG
(
FLog
::
Controller
<<
"
\t
Finished (@Bottom Pass (P2M) = "
<<
counterTime
.
tacAndElapsed
()
<<
"s)
\n
"
);
FLOG
(
FLog
::
Controller
<<
"
\t\t
Computation : "
<<
computationCounter
.
cumulated
()
<<
" s
\n
"
);
}
/////////////////////////////////////////////////////////////////////////////
// Upward
/////////////////////////////////////////////////////////////////////////////
/** M2M */
void
upwardPass
(){
FTRACE
(
FTrace
::
FFunction
functionTrace
(
__FUNCTION__
,
"Fmm"
,
__FILE__
,
__LINE__
)
);
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Upward Pass
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
computationCounter
);
// Start from leal level - 1
typename
OctreeClass
::
Iterator
octreeIterator
(
tree
);
octreeIterator
.
gotoBottomLeft
();
octreeIterator
.
moveUp
();
typename
OctreeClass
::
Iterator
avoidGotoLeftIterator
(
octreeIterator
);
// for each levels
for
(
int
idxLevel
=
OctreeHeight
-
2
;
idxLevel
>
1
;
--
idxLevel
){
FLOG
(
FTic
counterTimeLevel
);
// for each cells
do
{
// We need the current cell and the child
// child is an array (of 8 child) that may be null
FLOG
(
computationCounter
.
tic
());
//
if
(
octreeIterator
.
getCurrentCell
()
->
isAdaptative
()
&&
!
octreeIterator
.
getCurrentCell
()
->
isSminMCriteria
()
){
// if( !octreeIterator.isSminMCriteria()){};
// Need only adaptative child !!!!!
const
auto
*
v
=
octreeIterator
.
getCurrentCell
().
getAdaptativeChild
()
;
// if (cell.sizeofAdaptativeChild()> 0 ){
// for (int i=0; i < v->getSize() ; ++i){
// output << v->operator [](i).cell->getGlobalId() << " ";
// }
// }
// kernels->M2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel);
}
FLOG
(
computationCounter
.
tac
());
}
while
(
octreeIterator
.
moveRight
());
avoidGotoLeftIterator
.
moveUp
();
octreeIterator
=
avoidGotoLeftIterator
;
FLOG
(
FLog
::
Controller
<<
"
\t\t
>> Level "
<<
idxLevel
<<
" = "
<<
counterTimeLevel
.
tacAndElapsed
()
<<
"s
\n
"
);
}
FLOG
(
FLog
::
Controller
<<
"
\t
Finished (@Upward Pass (M2M) = "
<<
counterTime
.
tacAndElapsed
()
<<
"s)
\n
"
);
FLOG
(
FLog
::
Controller
<<
"
\t\t
Computation : "
<<
computationCounter
.
cumulated
()
<<
" s
\n
"
);
}
/////////////////////////////////////////////////////////////////////////////
// Transfer
/////////////////////////////////////////////////////////////////////////////
/** M2L */
void
transferPass
(){
FTRACE
(
FTrace
::
FFunction
functionTrace
(
__FUNCTION__
,
"Fmm"
,
__FILE__
,
__LINE__
)
);
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (M2L)
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
computationCounter
);
typename
OctreeClass
::
Iterator
octreeIterator
(
tree
);
octreeIterator
.
moveDown
();
typename
OctreeClass
::
Iterator
avoidGotoLeftIterator
(
octreeIterator
);
const
CellClass
*
neighbors
[
343
];
// for each levels
for
(
int
idxLevel
=
2
;
idxLevel
<
OctreeHeight
;
++
idxLevel
){
FLOG
(
FTic
counterTimeLevel
);
// for each cells
do
{
const
int
counter
=
tree
->
getInteractionNeighbors
(
neighbors
,
octreeIterator
.
getCurrentGlobalCoordinate
(),
idxLevel
);
FLOG
(
computationCounter
.
tic
());
if
(
counter
)
kernels
->
M2L
(
octreeIterator
.
getCurrentCell
()
,
neighbors
,
counter
,
idxLevel
);
FLOG
(
computationCounter
.
tac
());
}
while
(
octreeIterator
.
moveRight
());
FLOG
(
computationCounter
.
tic
());
kernels
->
finishedLevelM2L
(
idxLevel
);
FLOG
(
computationCounter
.
tac
());
avoidGotoLeftIterator
.
moveDown
();
octreeIterator
=
avoidGotoLeftIterator
;
FLOG
(
FLog
::
Controller
<<
"
\t\t
>> Level "
<<
idxLevel
<<
" = "
<<
counterTimeLevel
.
tacAndElapsed
()
<<
"s
\n
"
);
}
FLOG
(
FLog
::
Controller
<<
"
\t
Finished (@Downward Pass (M2L) = "
<<
counterTime
.
tacAndElapsed
()
<<
"s)
\n
"
);
FLOG
(
FLog
::
Controller
<<
"
\t\t
Computation : "
<<
computationCounter
.
cumulated
()
<<
" s
\n
"
);
}
/////////////////////////////////////////////////////////////////////////////
// Downward
/////////////////////////////////////////////////////////////////////////////
/** L2L */
void
downardPass
(){
FTRACE
(
FTrace
::
FFunction
functionTrace
(
__FUNCTION__
,
"Fmm"
,
__FILE__
,
__LINE__
)
);
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (L2L)
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
computationCounter
);
typename
OctreeClass
::
Iterator
octreeIterator
(
tree
);
octreeIterator
.
moveDown
();
typename
OctreeClass
::
Iterator
avoidGotoLeftIterator
(
octreeIterator
);
const
int
heightMinusOne
=
OctreeHeight
-
1
;
// for each levels exepted leaf level
for
(
int
idxLevel
=
2
;
idxLevel
<
heightMinusOne
;
++
idxLevel
){
FLOG
(
FTic
counterTimeLevel
);
// for each cells
do
{
FLOG
(
computationCounter
.
tic
());