Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
solverstack
ScalFMM
Commits
fc133b46
Commit
fc133b46
authored
May 17, 2018
by
COULAUD Olivier
Browse files
Options
Browse Files
Download
Plain Diff
Resolved merge conflict by incorporating both suggestions.
parents
54a989b4
cc9a9b37
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1949 additions
and
1794 deletions
+1949
-1794
Src/Containers/FBufferReader.hpp
Src/Containers/FBufferReader.hpp
+19
-1
Src/Containers/FBufferWriter.hpp
Src/Containers/FBufferWriter.hpp
+3
-0
Src/Containers/FNeighborIndexes.hpp
Src/Containers/FNeighborIndexes.hpp
+1
-1
Src/Containers/FOctree.hpp
Src/Containers/FOctree.hpp
+24
-16
Src/Containers/FVector.hpp
Src/Containers/FVector.hpp
+25
-4
Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp
Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp
+1876
-1771
Src/Core/FP2PExclusion.hpp
Src/Core/FP2PExclusion.hpp
+1
-1
No files found.
Src/Containers/FBufferReader.hpp
View file @
fc133b46
...
...
@@ -4,7 +4,8 @@
#include <memory>
#include "FAbstractBuffer.hpp"
#include "../Utils/FAssert.hpp"
#include "FBufferWriter.hpp"
#include "Utils/FAssert.hpp"
/**
* \brief Provides memory management and conversion to basic type
...
...
@@ -38,6 +39,23 @@ public :
{
FAssertLF
(
array
,
"Cannot allocate array"
);
}
/**
* \brief Construct the reader
*
* \param capacity Buffer capacity in bytes
*/
explicit
FBufferReader
(
FBufferWriter
&
buf
)
:
arrayCapacity
(
buf
.
getCapacity
()
)
{
this
->
cleanAndResize
(
arrayCapacity
)
;
std
::
unique_ptr
<
char
[]
>
arraytmp
(
new
char
[
arrayCapacity
]);
std
::
copy
(
buf
.
data
(),
buf
.
data
()
+
arrayCapacity
,
arraytmp
.
get
());
array
=
std
::
move
(
arraytmp
);
currentIndex
=
buf
.
getSize
()
;
FAssertLF
(
array
,
"Cannot allocate array"
);
}
virtual
~
FBufferReader
()
=
default
;
...
...
Src/Containers/FBufferWriter.hpp
View file @
fc133b46
...
...
@@ -98,6 +98,9 @@ public:
return
array
.
get
();
}
std
::
unique_ptr
<
char
[]
>*
ptrData
(){
return
&
array
;
}
/**
* \brief Return the written memory size
*/
...
...
Src/Containers/FNeighborIndexes.hpp
View file @
fc133b46
#ifndef FNEIGHBORINDEXES_HPP
#define FNEIGHBORINDEXES_HPP
#include "
../
Utils/FGlobal.hpp"
#include "Utils/FGlobal.hpp"
/**
* @brief The FAbstractNeighborIndex class is an abstraction of
...
...
Src/Containers/FOctree.hpp
View file @
fc133b46
...
...
@@ -184,8 +184,9 @@ public:
}
}
/** Remove a leaf from its morton index
* @param indexToRemove the index of the leaf to remove
/** Create a leaf from its morton index
* @param indexToCreate the Morton index of the leaf to create
* @return a pointer on the leaf
*/
LeafClass
*
createLeaf
(
const
MortonIndex
indexToCreate
){
const
FTreeCoordinate
host
(
indexToCreate
);
...
...
@@ -1398,7 +1399,7 @@ public:
return
idxNeighbors
;
}
#ifdef TOTO
/** This function fill an array with the neighbors of a cell
* @param inNeighbors the array to store the elements
* @param inIndex the index of the element we want the neighbors
...
...
@@ -1440,7 +1441,7 @@ public:
return
idxNeighbors
;
}
#endif
/** This function fill an array with the neighbors of a cell
* @param inNeighbors the array to store the elements
* @param inIndex the index of the element we want the neighbors
...
...
@@ -1483,7 +1484,7 @@ public:
return
idxNeighbors
;
}
#ifdef TOTO
/** This function fill an array with the neighbors of a cell. The cell is set by its FTreeCordinate center
*
* @param[out] outNeighbors the array to store the elements
...
...
@@ -1496,7 +1497,7 @@ public:
int
getPeriodicLeafsNeighbors
(
ContainerClass
*
outNeighbors
[
27
],
FTreeCoordinate
outOffsets
[
27
],
bool
*
const
isPeriodic
,
const
FTreeCoordinate
&
center
,
const
int
inLevel
,
const
int
inDirection
){
std
::
cout
<<
" FOCTREE::getPeriodicLeafsNeighbors "
<<
std
::
endl
;
std
::
cout
<<
" FOCTREE::getPeriodicLeafsNeighbors
??????
"
<<
std
::
endl
;
const
int
boxLimite
=
FMath
::
pow2
(
inLevel
);
if
(
center
.
getX
()
!=
0
&&
center
.
getY
()
!=
0
&&
center
.
getZ
()
!=
0
&&
...
...
@@ -1580,8 +1581,8 @@ public:
return
idxNeighbors
;
}
/** This function fill an array with the n
eighbor
s of a cell in the tree.
#endif
/** This function fill an array with the n
on empty adjacents cell
s of a cell in the tree.
* In the parallel case, we return only cells of the local octree.
*
* This method is used in the P2P operator in sequential or parallel periodic algorithm
...
...
@@ -1600,18 +1601,22 @@ public:
* @param[in] inLevel the level of the element
* @return the number of neighbors */
//template< class ARRAY1, class ARRAY2, class ARRAY3 >
// int getPeriodicLeafsNeighbors(ARRAY1
outNeighbors, ARRAY2 outNeighborPositions,
// ARRAY3 outOffsets, bool*const isPeriodic,
int
getPeriodicLeafsNeighbors
(
ContainerClass
*
outNeighbors
[
26
],
int
outNeighborPositions
[
26
],
FTreeCoordinate
outOffsets
[
26
],
bool
&
isPeriodic
,
// int getPeriodicLeafsNeighbors(ARRAY1
&
outNeighbors, ARRAY2
&
outNeighborPositions,
// ARRAY3
&
outOffsets, bool*const isPeriodic,
int
getPeriodicLeafsNeighbors
(
ContainerClass
*
outNeighbors
[
26
],
int
outNeighborPositions
[
26
],
FTreeCoordinate
outOffsets
[
26
],
bool
&
isPeriodic
,
const
FTreeCoordinate
&
center
,
const
int
inLevel
,
const
int
inDirection
){
std
::
cout
<<
" FOCTREE::getPeriodicLeafsNeighbors "
<<
center
.
getMortonIndex
()
<<
std
::
endl
;
#ifdef SCALFMM_DEBUG_P2P_PERIODIQUE
std
::
cout
<<
" FOCTREE::getPeriodicLeafsNeighbors ARRAY "
<<
center
.
getMortonIndex
()
<<
std
::
endl
;
#endif
const
int
boxLimite
=
FMath
::
pow2
(
inLevel
);
if
(
center
.
getX
()
!=
0
&&
center
.
getY
()
!=
0
&&
center
.
getZ
()
!=
0
&&
center
.
getX
()
!=
boxLimite
-
1
&&
center
.
getY
()
!=
boxLimite
-
1
&&
center
.
getZ
()
!=
boxLimite
-
1
){
#ifdef SCALFMM_DEBUG_P2P_PERIODIQUE
std
::
cout
<<
" No periodic conditions the cell is not near the boundary "
<<
std
::
endl
;
#endif
isPeriodic
=
false
;
return
getLeafsNeighbors
(
outNeighbors
,
outNeighborPositions
,
center
,
inLevel
);
}
...
...
@@ -1673,15 +1678,18 @@ public:
// get the particle structure of the leaf
ContainerClass
*
const
leaf
=
getLeafSrc
(
mortonOther
);
// add to list if the cell exists i.e. the pointer is not null
if
(
leaf
){
#ifdef SCALFMM_DEBUG_P2P_PERIODIQUE
std
::
cout
<<
"mortonOther "
<<
mortonOther
<<
" idx "
<<
idxX
<<
" idyY "
<<
idxY
<<
" idxZ "
<<
idxZ
<<
" "
<<
(((
idxX
+
1
)
*
3
)
+
(
idxY
+
1
))
*
3
+
idxZ
+
1
<<
std
::
endl
;
#endif
outNeighbors
[
idxNeighbors
]
=
leaf
;
outOffsets
[
idxNeighbors
].
setPosition
(
xoffset
,
yoffset
,
zoffset
);
outNeighborPositions
[
idxNeighbors
]
=
(((
idxX
+
1
)
*
3
)
+
(
idxY
+
1
))
*
3
+
idxZ
+
1
;
++
idxNeighbors
;
}
// if(leaf)
}
}
// if( idxX || idxY || idxZ )
}
}
...
...
Src/Containers/FVector.hpp
View file @
fc133b46
...
...
@@ -6,6 +6,7 @@
#include "../Utils/FGlobal.hpp"
#include <cstring>
#include <vector>
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
...
...
@@ -89,9 +90,9 @@ public:
// clear current element
clear
();
// alloc bigger if needed
if
(
capacity
<
other
.
getS
ize
()){
if
(
capacity
<
other
.
s
ize
()){
delete
[]
reinterpret_cast
<
char
*
>
(
array
);
capacity
=
FSize
(
double
(
other
.
getS
ize
())
*
1.5
);
capacity
=
FSize
(
double
(
other
.
s
ize
())
*
1.5
);
array
=
reinterpret_cast
<
ObjectType
*
>
(
new
char
[
sizeof
(
ObjectType
)
*
capacity
]);
}
...
...
@@ -119,7 +120,20 @@ public:
}
return
(
*
this
);
}
/**
*@brief Copy operator
*/
FVector
&
operator
=
(
std
::
vector
<
ObjectType
>
&&
other
){
if
(
&
other
!=
this
){
clear
();
delete
[]
reinterpret_cast
<
char
*
>
(
array
);
array
=
other
.
data
();
capacity
=
other
.
capacity
();
index
=
other
.
size
();
other
.
clear
();
}
return
(
*
this
);
}
/**
*@brief destructor
*/
...
...
@@ -136,7 +150,6 @@ public:
FSize
getCapacity
()
const
{
return
capacity
;
}
/**
*@brief Set the buffer capacity
*@param inCapacity to change the capacity
...
...
@@ -209,9 +222,17 @@ public:
* @return The number of element added into the vector
* This is not the capcity
*/
// [[gnu::deprecated]]
FSize
getSize
()
const
{
return
index
;
}
/**
* @return The number of element added into the vector
* This is not the capcity
*/
FSize
size
()
const
{
return
index
;
}
/**
* @brief pop the first value
...
...
Src/Core/FFmmAlgorithmThreadProcPeriodic.hpp
View file @
fc133b46
This diff is collapsed.
Click to expand it.
Src/Core/FP2PExclusion.hpp
View file @
fc133b46
#ifndef FP2PEXCLUSION_HPP
#define FP2PEXCLUSION_HPP
#include "
../
Containers/FTreeCoordinate.hpp"
#include "Containers/FTreeCoordinate.hpp"
/**
* This class gives is responsible of the separation of the leaves
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment