Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
3bd7cd3e
Commit
3bd7cd3e
authored
Sep 04, 2012
by
BRAMAS Berenger
Browse files
Update ewal test file
parent
46e30723
Changes
2
Hide whitespace changes
Inline
Side-by-side
Src/Files/FEwalLoader.hpp
View file @
3bd7cd3e
...
...
@@ -52,29 +52,29 @@ public:
char
buffer
[
bufferSize
];
file
.
getline
(
buffer
,
bufferSize
);
int
imcon
;
int
imcon
;
int
tempi
(
0
);
FReal
tempf
(
0
);
file
>>
tempi
>>
imcon
>>
this
->
nbParticles
>>
tempf
;
if
(
imcon
>
0
)
{
FReal
widthx
,
widthy
,
widthz
;
file
>>
widthx
>>
tempf
>>
tempf
;
file
>>
tempf
>>
widthy
>>
tempf
;
file
>>
tempf
>>
tempf
>>
widthz
;
// this->centerOfBox.setPosition(0.0,0.0,0.0);
this
->
boxWidth
=
widthx
;
}
else
{
// Non periodic case.
this
->
boxWidth
=
tempf
;
}
this
->
centerOfBox
.
setPosition
(
0.0
,
0.0
,
0.0
);
file
>>
tempi
>>
imcon
>>
this
->
nbParticles
;
// Periodic case
if
(
imcon
>
0
)
{
FReal
widthx
,
widthy
,
widthz
;
file
>>
widthx
>>
tempf
>>
tempf
;
file
>>
tempf
>>
widthy
>>
tempf
;
file
>>
tempf
>>
tempf
>>
widthz
;
this
->
boxWidth
=
widthx
;
}
// Non periodic case
else
{
file
>>
this
->
boxWidth
;
}
this
->
centerOfBox
.
setPosition
(
0.0
,
0.0
,
0.0
);
}
else
{
this
->
boxWidth
=
0
;
this
->
nbParticles
=
0
;
this
->
boxWidth
=
0
;
this
->
nbParticles
=
0
;
}
std
::
cout
<<
"boxWidth: "
<<
this
->
boxWidth
<<
std
::
endl
;
}
/**
* Default destructor, simply close the file
...
...
@@ -130,15 +130,15 @@ public:
char
type
[
2
];
std
::
string
line
;
file
.
ignore
(
std
::
numeric_limits
<
std
::
streamsize
>::
max
(),
'\n'
);
file
.
read
(
type
,
2
);
file
>>
index
;
std
::
getline
(
file
,
line
);
// needed to skip the end of the line in non periodic case
file
>>
x
>>
y
>>
z
;
file
>>
vx
>>
vy
>>
vz
;
file
>>
fx
>>
fy
>>
fz
;
// std::cout << " x >> y >> z: " << x<< " " <<y<< " " <<z <<std::endl;
// std::cout << " x >> y >> z: " << x<< " " <<y<< " " <<z <<std::endl;
inParticle
.
setPosition
(
x
,
y
,
z
);
inParticle
.
setForces
(
fx
,
fy
,
fz
);
//inParticle.setForces(vx,vy,vz);
...
...
Tests/Kernels/testSphericalEwalAlgorithm.cpp
View file @
3bd7cd3e
...
...
@@ -85,15 +85,15 @@ int main(int argc, char ** argv){
///////////////////////What we do/////////////////////////////
std
::
cout
<<
">> This executable has to be used to test Spherical algorithm.
\n
"
;
std
::
cout
<<
">> options are -h H -sh SH -P p -per PER -f FILE -noper -verbose
\n
"
;
std
::
cout
<<
">> Recommanded files : ../Data/Ewal
ForcesPositionOut.txt ../Data/EwalNon
Periodic.
txt
../Data/EwalPeriodic.
txt
\n
"
;
std
::
cout
<<
">> options are -h H -sh SH -P p -per PER -f FILE -noper -verbose
-gen
\n
"
;
std
::
cout
<<
">> Recommanded files : ../Data/Ewal
Test_
Periodic.
run
../Data/Ewal
Test_No
Periodic.
run
\n
"
;
//////////////////////////////////////////////////////////////
const
int
NbLevels
=
FParameters
::
getValue
(
argc
,
argv
,
"-h"
,
4
);
const
int
SizeSubLevels
=
FParameters
::
getValue
(
argc
,
argv
,
"-sh"
,
2
);
const
int
DevP
=
FParameters
::
getValue
(
argc
,
argv
,
"-P"
,
9
);
const
int
PeriodicDeep
=
FParameters
::
getValue
(
argc
,
argv
,
"-per"
,
2
);
const
char
*
const
filename
=
FParameters
::
getStr
(
argc
,
argv
,
"-f"
,
"../Data/EwalPeriodic.
txt
"
);
const
char
*
const
filename
=
FParameters
::
getStr
(
argc
,
argv
,
"-f"
,
"../Data/Ewal
Test_
Periodic.
run
"
);
// recommenda
FTic
counter
;
...
...
@@ -253,6 +253,40 @@ int main(int argc, char ** argv){
}
// -----------------------------------------------------
// ReGenerate file
if
(
FParameters
::
existParameter
(
argc
,
argv
,
"-gen"
)
){
std
::
cout
<<
"Generate ewal.out from input file"
<<
std
::
endl
;
std
::
ofstream
fileout
(
"ewal.out"
,
std
::
ifstream
::
out
);
std
::
ifstream
file
(
filename
,
std
::
ifstream
::
in
);
if
(
file
.
is_open
()){
const
int
bufferSize
=
512
;
char
buffer
[
bufferSize
];
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
if
(
!
FParameters
::
existParameter
(
argc
,
argv
,
"-noper"
)
){
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
}
for
(
int
idxPart
=
0
;
idxPart
<
loader
.
getNumberOfParticles
()
;
++
idxPart
){
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
file
.
getline
(
buffer
,
bufferSize
);
fileout
<<
buffer
<<
'\n'
;
file
.
getline
(
buffer
,
bufferSize
);
file
.
getline
(
buffer
,
bufferSize
);
}
}
}
// end generate
// -----------------------------------------------------
delete
[]
particles
;
return
0
;
...
...
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