Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
ScalFMM
Commits
fca208c7
Commit
fca208c7
authored
11 years ago
by
BRAMAS Berenger
Browse files
Options
Downloads
Patches
Plain Diff
update bench periodic
parent
4b013adf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Kernels/testRotationPeriodicBench.cpp
+13
-8
13 additions, 8 deletions
Tests/Kernels/testRotationPeriodicBench.cpp
with
13 additions
and
8 deletions
Tests/Kernels/testRotationPeriodicBench.cpp
+
13
−
8
View file @
fca208c7
...
...
@@ -56,8 +56,11 @@ int main(int argc, char** argv){
const
int
MinLevelAbove
=
FParameters
::
getValue
(
argc
,
argv
,
"-min"
,
-
1
);
const
int
MaxLevelAbove
=
FParameters
::
getValue
(
argc
,
argv
,
"-max"
,
3
);
const
int
IncLevelAbove
=
1
;
const
int
NbParticles
=
FParameters
::
getValue
(
argc
,
argv
,
"-nb"
,
6
);;
const
int
NbParticles
=
FParameters
::
getValue
(
argc
,
argv
,
"-nb"
,
6
);
const
int
NbParticlesPrint
=
FParameters
::
getValue
(
argc
,
argv
,
"-nbprint"
,
FMath
::
Min
(
6
,
NbParticles
));
FAssertLF
(
NbParticlesPrint
<=
NbParticles
,
"The number of printer particles cannot be higer than the number of particles."
);
std
::
cout
<<
"The application will use "
<<
NbParticles
<<
" but studies only "
<<
NbParticlesPrint
<<
" of them."
<<
std
::
endl
;
/////////////////////////////////////////////////
// Insert particlePositions in tree and copy into array
...
...
@@ -70,7 +73,7 @@ int main(int argc, char** argv){
loader
.
fillParticle
(
&
particlePositions
[
idxPart
]);
}
FReal
*
allPotential
=
new
FReal
[(
MaxLevelAbove
-
MinLevelAbove
)
*
NbParticles
];
FReal
*
allPotential
=
new
FReal
[(
MaxLevelAbove
-
MinLevelAbove
)
*
NbParticles
Print
];
/////////////////////////////////////////////////
// Test for different periodicity for FMM!!
...
...
@@ -106,7 +109,9 @@ int main(int argc, char** argv){
const
FReal
*
const
potentials
=
leaf
->
getTargets
()
->
getPotentials
();
const
FVector
<
int
>&
indexes
=
leaf
->
getTargets
()
->
getIndexes
();
for
(
int
idxPart
=
0
;
idxPart
<
leaf
->
getTargets
()
->
getNbParticles
()
;
++
idxPart
){
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticles
+
indexes
[
idxPart
]]
=
potentials
[
idxPart
];
if
(
indexes
[
idxPart
]
<
NbParticlesPrint
){
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticlesPrint
+
indexes
[
idxPart
]]
=
potentials
[
idxPart
];
}
}
});
}
...
...
@@ -121,10 +126,10 @@ int main(int argc, char** argv){
std
::
cout
<<
idxLevelAbove
<<
"
\t
"
;
}
std
::
cout
<<
"
\n
"
;
for
(
int
idxPart
=
0
;
idxPart
<
NbParticles
;
++
idxPart
){
for
(
int
idxPart
=
0
;
idxPart
<
NbParticles
Print
;
++
idxPart
){
std
::
cout
<<
idxPart
<<
"
\t
"
;
for
(
int
idxLevelAbove
=
MinLevelAbove
;
idxLevelAbove
<
MaxLevelAbove
;
idxLevelAbove
+=
IncLevelAbove
){
std
::
cout
<<
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticles
+
idxPart
]
<<
"
\t
"
;
std
::
cout
<<
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticles
Print
+
idxPart
]
<<
"
\t
"
;
}
std
::
cout
<<
"
\n
"
;
}
...
...
@@ -135,11 +140,11 @@ int main(int argc, char** argv){
std
::
cout
<<
idxLevelAbove
<<
"/"
<<
idxLevelAbove
-
1
<<
"
\t
"
;
}
std
::
cout
<<
"
\n
"
;
for
(
int
idxPart
=
0
;
idxPart
<
NbParticles
;
++
idxPart
){
for
(
int
idxPart
=
0
;
idxPart
<
NbParticles
Print
;
++
idxPart
){
std
::
cout
<<
idxPart
<<
"
\t
"
;
for
(
int
idxLevelAbove
=
MinLevelAbove
+
1
;
idxLevelAbove
<
MaxLevelAbove
;
idxLevelAbove
+=
IncLevelAbove
){
std
::
cout
<<
FMath
::
Abs
((
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticles
+
idxPart
]
/
allPotential
[(
idxLevelAbove
-
MinLevelAbove
-
1
)
*
NbParticles
+
idxPart
])
-
1.0
)
<<
"
\t
"
;
std
::
cout
<<
FMath
::
Abs
((
allPotential
[(
idxLevelAbove
-
MinLevelAbove
)
*
NbParticles
Print
+
idxPart
]
/
allPotential
[(
idxLevelAbove
-
MinLevelAbove
-
1
)
*
NbParticles
Print
+
idxPart
])
-
1.0
)
<<
"
\t
"
;
}
std
::
cout
<<
"
\n
"
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment