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
f962fec9
Commit
f962fec9
authored
Apr 11, 2018
by
COULAUD Olivier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now we can load files with and without potential and forces
parent
b1f3080b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
Utils/src/sharedMemoryInterpolatiomCmpAlgos.hpp
Utils/src/sharedMemoryInterpolatiomCmpAlgos.hpp
+21
-5
No files found.
Utils/src/sharedMemoryInterpolatiomCmpAlgos.hpp
View file @
f962fec9
...
...
@@ -46,6 +46,7 @@
#include "Core/FFmmAlgorithmTask.hpp"
#include "Core/FFmmAlgorithmNewTask.hpp"
#include "Core/FFmmAlgorithmSectionTask.hpp"
#include "Core/FFmmAlgorithmOmp4.hpp"
#else
#include "Core/FFmmAlgorithm.hpp"
#endif
...
...
@@ -73,6 +74,7 @@ using KernelType = FInterpolationKernel<FReal,CellType,ContainerType,MatrixKe
using
TaskFmmAlgo
=
FFmmAlgorithmTask
<
OctreeType
,
CellType
,
ContainerType
,
KernelType
,
LeafType
>
;
using
TaskNewFmmAlgo
=
FFmmAlgorithmNewTask
<
OctreeType
,
CellType
,
ContainerType
,
KernelType
,
LeafType
>
;
using
SectionTaskFmmAlgo
=
FFmmAlgorithmSectionTask
<
OctreeType
,
CellType
,
ContainerType
,
KernelType
,
LeafType
>
;
using
Omp4FmmAlgo
=
FFmmAlgorithmOmp4
<
OctreeType
,
CellType
,
ContainerType
,
KernelType
,
LeafType
>
;
#else
using
FmmType
=
FFmmAlgorithm
<
OctreeType
,
CellType
,
ContainerType
,
KernelType
,
LeafType
>
;
#endif
...
...
@@ -128,18 +130,29 @@ int main(int argc, char* argv[]) {
////////////////////////////////////////////////////////////////////
//
FFmaGenericLoader
<
FReal
>
loader
(
filename
);
if
(
loader
.
getNbRecordPerline
()
!=
8
){
if
(
loader
.
getNbRecordPerline
()
!=
8
&&
FParameters
::
existParameter
(
argc
,
argv
,
"-cmp"
)
){
std
::
cerr
<<
"File should contain 8 data to read (x,y,z,q,p,fx,fy,fz)
\n
"
;
std
::
exit
(
EXIT_FAILURE
);
}
FSize
nbParticles
=
loader
.
getNumberOfParticles
()
;
FmaRWParticle
<
FReal
,
8
,
8
>
*
const
particles
=
new
FmaRWParticle
<
FReal
,
8
,
8
>
[
nbParticles
];
//
//
//
// open particle file
////////////////////////////////////////////////////////////////////
//
loader
.
fillParticle
(
particles
,
nbParticles
);
if
(
loader
.
getNbRecordPerline
()
==
8
){
loader
.
fillParticle
(
particles
,
nbParticles
);
}
else
{
FmaRWParticle
<
FReal
,
4
,
4
>
*
const
part
=
new
FmaRWParticle
<
FReal
,
4
,
4
>
[
nbParticles
];
loader
.
fillParticle
(
part
,
nbParticles
);
for
(
int
idx
=
0
;
idx
<
nbParticles
;
++
idx
){
auto
p
=
part
[
idx
].
getPosition
()
;
particles
[
idx
].
setPosition
(
p
)
;
particles
[
idx
].
setPhysicalValue
(
part
[
idx
].
getPhysicalValue
()
);
}
}
time
.
tac
();
//
// init oct-tree
...
...
@@ -186,7 +199,7 @@ int main(int argc, char* argv[]) {
TaskFmmAlgo
algo1
(
&
tree
,
kernels
.
get
()
);
TaskNewFmmAlgo
algo2
(
&
tree
,
kernels
.
get
()
);
SectionTaskFmmAlgo
algo3
(
&
tree
,
kernels
.
get
()
);
Omp4FmmAlgo
algo4
(
&
tree
,
kernels
.
get
()
);
FAbstractAlgorithm
*
algo
=
nullptr
;
FAlgorithmTimers
*
timer
=
nullptr
;
...
...
@@ -198,7 +211,10 @@ int main(int argc, char* argv[]) {
timer
=
&
algo2
;
}
else
if
(
"sectiontask"
==
algoStr
)
{
algo
=
&
algo3
;
timer
=
&
algo3
;
timer
=
&
algo3
;
}
else
if
(
"omp4"
==
algoStr
)
{
algo
=
&
algo4
;
timer
=
&
algo4
;
}
else
{
std
::
cout
<<
"Unknown algorithm: "
<<
algoStr
<<
std
::
endl
;
std
::
exit
(
EXIT_FAILURE
);
...
...
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