Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
71
Issues
71
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OPAL
src
Commits
8ebeebf4
Commit
8ebeebf4
authored
Jun 03, 2015
by
kraus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up and beautify output
parent
1c087b04
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
297 additions
and
270 deletions
+297
-270
classic/5.0/src/Algorithms/PartBunch.cpp
classic/5.0/src/Algorithms/PartBunch.cpp
+3
-2
ippl/src/Utility/IpplTimings.cpp
ippl/src/Utility/IpplTimings.cpp
+150
-124
src/Solvers/FFTBoxPoissonSolver.cpp
src/Solvers/FFTBoxPoissonSolver.cpp
+59
-57
src/Solvers/FFTBoxPoissonSolver.h
src/Solvers/FFTBoxPoissonSolver.h
+1
-3
src/Solvers/FFTPoissonSolver.cpp
src/Solvers/FFTPoissonSolver.cpp
+83
-81
src/Solvers/FFTPoissonSolver.h
src/Solvers/FFTPoissonSolver.h
+1
-3
No files found.
classic/5.0/src/Algorithms/PartBunch.cpp
View file @
8ebeebf4
...
...
@@ -134,10 +134,10 @@ PartBunch::PartBunch(const PartData *ref):
addAttribute
(
PType
);
addAttribute
(
TriID
);
selfFieldTimer_m
=
IpplTimings
::
getTimer
(
"SelfField"
);
boundpTimer_m
=
IpplTimings
::
getTimer
(
"Boundingbox"
);
statParamTimer_m
=
IpplTimings
::
getTimer
(
"Statistics"
);
compPotenTimer_m
=
IpplTimings
::
getTimer
(
"Potential"
);
selfFieldTimer_m
=
IpplTimings
::
getTimer
(
"SelfField total"
);
compPotenTimer_m
=
IpplTimings
::
getTimer
(
"SF: Potential"
);
histoTimer_m
=
IpplTimings
::
getTimer
(
"Histogram"
);
...
...
@@ -2075,6 +2075,7 @@ void PartBunch::calcBeamParameters() {
void
PartBunch
::
calcBeamParametersLight
()
{
// for Autophase, avoids communication
IpplTimings
::
startTimer
(
statParamTimer_m
);
const
double
m0
=
getM
()
*
1.E-6
;
...
...
ippl/src/Utility/IpplTimings.cpp
View file @
8ebeebf4
This diff is collapsed.
Click to expand it.
src/Solvers/FFTBoxPoissonSolver.cpp
View file @
8ebeebf4
...
...
@@ -39,7 +39,8 @@ FFTBoxPoissonSolver::FFTBoxPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::s
mesh2_m
(
0
),
layout2_m
(
0
),
greensFunction_m
(
greensFunction
),
a_m
(
boxSize
)
{
a_m
(
boxSize
)
{
int
i
;
domain_m
=
layout_m
->
getDomain
();
...
...
@@ -87,22 +88,22 @@ FFTBoxPoissonSolver::FFTBoxPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::s
(
nr_m
[
i
]
-
domain_m
[
i
]));
}
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"GreenFTotal"
);
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"IntGreenF1"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"IntGreenF3
"
);
IntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"IntGreenF4
"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF1"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF4
"
);
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"GreenF1"
);
GreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"GreenF2
"
);
GreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"GreenF3
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"GreenF4"
);
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"
SF:
GreenFTotal"
);
if
(
greensFunction_m
==
std
::
string
(
"INTEGRATED"
))
{
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF1
"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF3
"
);
IntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF4"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF1
"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF4"
);
}
else
{
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: GreenF1
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: GreenF4
"
);
}
}
FFTBoxPoissonSolver
::
FFTBoxPoissonSolver
(
PartBunch
&
beam
,
std
::
string
greensFunction
)
:
...
...
@@ -110,7 +111,8 @@ FFTBoxPoissonSolver::FFTBoxPoissonSolver(PartBunch &beam, std::string greensFunc
layout_m
(
&
beam
.
getFieldLayout
()),
mesh2_m
(
0
),
layout2_m
(
0
),
greensFunction_m
(
greensFunction
)
{
greensFunction_m
(
greensFunction
)
{
int
i
;
domain_m
=
layout_m
->
getDomain
();
...
...
@@ -152,22 +154,22 @@ FFTBoxPoissonSolver::FFTBoxPoissonSolver(PartBunch &beam, std::string greensFunc
(
nr_m
[
i
]
-
domain_m
[
i
])
*
(
nr_m
[
i
]
-
domain_m
[
i
]));
}
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"GreenFTotal"
);
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"IntGreenF1"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"IntGreenF3
"
);
IntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"IntGreenF4
"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF1"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF4
"
);
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"GreenF1"
);
GreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"GreenF2
"
);
GreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"GreenF3
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"GreenF4"
);
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"
SF:
GreenFTotal"
);
if
(
greensFunction_m
==
std
::
string
(
"INTEGRATED"
))
{
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF1
"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF3
"
);
IntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF4"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF1
"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF4"
);
}
else
{
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: GreenF1
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: GreenF4
"
);
}
}
////////////////////////////////////////////////////////////////////////////
...
...
@@ -282,23 +284,23 @@ void FFTBoxPoissonSolver::greensFunction() {
}
/** If the beam has a longitudinal size >> transverse size the
* direct Green function at each mesh point is not efficient
* (needs a lot of mesh points along the transverse size to
* get a good resolution)
*
* If the charge density function is uniform within each cell
* the following Green's function can be defined:
*
* \f[ \overline{G}(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'} cout << I << endl;
cout << J << endl;
cout << K << endl;
cout << IE << endl;
cout << JE << endl;
cout << KE << endl;
) = \int_{x_{i'} - h_x/2}^{x_{i'} + h_x/2} dx' \int_{y_{j'} - h_y/2}^{y_{j'} + h_y/2} dy' \int_{z_{k'} - h_z/2}^{z_{k'} + h_z/2} dz' G(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'}).
* \f]
*/
* direct Green function at each mesh point is not efficient
* (needs a lot of mesh points along the transverse size to
* get a good resolution)
*
* If the charge density function is uniform within each cell
* the following Green's function can be defined:
*
* \f[ \overline{G}(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'} cout << I << endl;
cout << J << endl;
cout << K << endl;
cout << IE << endl;
cout << JE << endl;
cout << KE << endl;
) = \int_{x_{i'} - h_x/2}^{x_{i'} + h_x/2} dx' \int_{y_{j'} - h_y/2}^{y_{j'} + h_y/2} dy' \int_{z_{k'} - h_z/2}^{z_{k'} + h_z/2} dz' G(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'}).
* \f]
*/
void
FFTBoxPoissonSolver
::
integratedGreensFunction
()
{
tmpgreen
=
0.0
;
...
...
@@ -308,8 +310,8 @@ void FFTBoxPoissonSolver::integratedGreensFunction() {
IpplTimings
::
startTimer
(
IntGreensFunctionTimer1_m
);
/**
* This integral can be calculated analytically in a closed from:
*/
* This integral can be calculated analytically in a closed from:
*/
for
(
int
k
=
idx
[
2
].
first
();
k
<
std
::
min
(
nr_m
[
2
]
+
2
,
idx
[
2
].
last
()
+
3
);
k
++
)
{
for
(
int
j
=
idx
[
1
].
first
();
j
<
std
::
min
(
nr_m
[
1
]
+
2
,
idx
[
1
].
last
()
+
3
);
j
++
)
{
for
(
int
i
=
idx
[
0
].
first
();
i
<
std
::
min
(
nr_m
[
0
]
+
2
,
idx
[
0
].
last
()
+
3
);
i
++
)
{
...
...
@@ -357,8 +359,8 @@ void FFTBoxPoissonSolver::integratedGreensFunction() {
//assign seems to have problems when we need values that are on another CPU, i.e. [I+1]
/*assign(rho2_m[I][J][K] ,
tmpgreen[I+1][J+1][K+1] - tmpgreen[I][J+1][K+1] - tmpgreen[I+1][J][K+1] + tmpgreen[I][J][K+1] - tmpgreen[I+1][J+1][K] +
tmpgreen[I][J+1][K] + tmpgreen[I+1][J][K] - tmpgreen[I][J][K]);*/
tmpgreen[I+1][J+1][K+1] - tmpgreen[I][J+1][K+1] - tmpgreen[I+1][J][K+1] + tmpgreen[I][J][K+1] - tmpgreen[I+1][J+1][K] +
tmpgreen[I][J+1][K] + tmpgreen[I+1][J][K] - tmpgreen[I][J][K]);*/
grntr_m
[
0
][
0
][
0
]
=
grntr_m
[
0
][
0
][
1
];
...
...
@@ -487,7 +489,7 @@ void FFTBoxPoissonSolver::shiftedIntGreensFunction(double zshift) {
** (x[nr_m[0]:1]^2 + y[0:nr_m[1]-1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5}
** (x[0:nr_m[0]-1]^2 + y[nr_m[1]:1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5}
** (x[nr_m[0]:1]^2 + y[nr_m[1]:1]^2 + (z_c - z[nr_m[2]:1])^2)^{-0.5}
*/
*/
grntr_m
[
IE
][
J
][
K
]
=
grntr_m
[
2
*
nr_m
[
0
]
-
IE
][
J
][
K
];
grntr_m
[
I
][
JE
][
K
]
=
grntr_m
[
I
][
2
*
nr_m
[
1
]
-
JE
][
K
];
...
...
@@ -516,4 +518,4 @@ Inform &FFTBoxPoissonSolver::print(Inform &os) const {
/***************************************************************************
* $RCSfile: FFTBoxPoissonSolver.cc,v $ $Author: adelmann $
* $Revision: 1.6 $ $Date: 2001/08/16 09:36:08 $
***************************************************************************/
***************************************************************************/
\ No newline at end of file
src/Solvers/FFTBoxPoissonSolver.h
View file @
8ebeebf4
...
...
@@ -117,8 +117,6 @@ private:
IpplTimings
::
TimerRef
ShIntGreensFunctionTimer4_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer1_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer2_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer3_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer4_m
;
};
...
...
@@ -133,4 +131,4 @@ inline Inform &operator<<(Inform &os, const FFTBoxPoissonSolver &fs) {
/***************************************************************************
* $RCSfile: FFTBoxPoissonSolver.hh,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2001/08/08 11:21:48 $
***************************************************************************/
***************************************************************************/
\ No newline at end of file
src/Solvers/FFTPoissonSolver.cpp
View file @
8ebeebf4
...
...
@@ -55,7 +55,8 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
layout3_m
(
nullptr
),
mesh4_m
(
nullptr
),
layout4_m
(
nullptr
),
greensFunction_m
(
greensFunction
)
{
greensFunction_m
(
greensFunction
)
{
int
i
;
bcz_m
=
(
bcz
==
std
::
string
(
"PERIODIC"
));
// for DC beams, the z direction has periodic boundary conditions
...
...
@@ -72,47 +73,47 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
}
if
(
bcz_m
)
{
// The FFT's require double-sized field sizes in order to
// simulate an isolated system. The FFT of the charge density field, rho,
// would otherwise mimic periodic boundary conditions, i.e. as if there were
// several beams set a periodic distance apart. The double-sized fields in x and
// alleviate this problem, in z we have periodic BC's
for
(
i
=
0
;
i
<
2
;
i
++
)
{
hr_m
[
i
]
=
mesh_m
->
get_meshSpacing
(
i
);
nr_m
[
i
]
=
domain_m
[
i
].
length
();
domain2_m
[
i
]
=
Index
(
2
*
nr_m
[
i
]
+
1
);
}
hr_m
[
2
]
=
mesh_m
->
get_meshSpacing
(
2
);
nr_m
[
2
]
=
domain_m
[
2
].
length
();
domain2_m
[
2
]
=
Index
(
2
*
nr_m
[
2
]
+
1
);
for
(
i
=
0
;
i
<
2
*
3
;
++
i
)
{
bc_m
[
i
]
=
new
ZeroFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
i
);
vbc_m
[
i
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
i
);
}
// z-direction
bc_m
[
4
]
=
new
ParallelPeriodicFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
4
);
bc_m
[
5
]
=
new
ParallelPeriodicFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
5
);
vbc_m
[
4
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
4
);
vbc_m
[
5
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
5
);
// The FFT's require double-sized field sizes in order to
// simulate an isolated system. The FFT of the charge density field, rho,
// would otherwise mimic periodic boundary conditions, i.e. as if there were
// several beams set a periodic distance apart. The double-sized fields in x and
// alleviate this problem, in z we have periodic BC's
for
(
i
=
0
;
i
<
2
;
i
++
)
{
hr_m
[
i
]
=
mesh_m
->
get_meshSpacing
(
i
);
nr_m
[
i
]
=
domain_m
[
i
].
length
();
domain2_m
[
i
]
=
Index
(
2
*
nr_m
[
i
]
+
1
);
}
hr_m
[
2
]
=
mesh_m
->
get_meshSpacing
(
2
);
nr_m
[
2
]
=
domain_m
[
2
].
length
();
domain2_m
[
2
]
=
Index
(
2
*
nr_m
[
2
]
+
1
);
for
(
i
=
0
;
i
<
2
*
3
;
++
i
)
{
bc_m
[
i
]
=
new
ZeroFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
i
);
vbc_m
[
i
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
i
);
}
// z-direction
bc_m
[
4
]
=
new
ParallelPeriodicFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
4
);
bc_m
[
5
]
=
new
ParallelPeriodicFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
5
);
vbc_m
[
4
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
4
);
vbc_m
[
5
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
5
);
}
else
{
// The FFT's require double-sized field sizes in order to
// simulate an isolated system. The FFT of the charge density field, rho,
// would otherwise mimic periodic boundary conditions, i.e. as if there were
// several beams set a periodic distance apart. The double-sized fields
// alleviate this problem.
for
(
i
=
0
;
i
<
3
;
i
++
)
{
hr_m
[
i
]
=
mesh_m
->
get_meshSpacing
(
i
);
nr_m
[
i
]
=
domain_m
[
i
].
length
();
domain2_m
[
i
]
=
Index
(
2
*
nr_m
[
i
]
+
1
);
}
// The FFT's require double-sized field sizes in order to
// simulate an isolated system. The FFT of the charge density field, rho,
// would otherwise mimic periodic boundary conditions, i.e. as if there were
// several beams set a periodic distance apart. The double-sized fields
// alleviate this problem.
for
(
i
=
0
;
i
<
3
;
i
++
)
{
hr_m
[
i
]
=
mesh_m
->
get_meshSpacing
(
i
);
nr_m
[
i
]
=
domain_m
[
i
].
length
();
domain2_m
[
i
]
=
Index
(
2
*
nr_m
[
i
]
+
1
);
}
for
(
i
=
0
;
i
<
2
*
3
;
++
i
)
{
bc_m
[
i
]
=
new
ZeroFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
i
);
vbc_m
[
i
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
i
);
}
for
(
i
=
0
;
i
<
2
*
3
;
++
i
)
{
bc_m
[
i
]
=
new
ZeroFace
<
double
,
3
,
Mesh_t
,
Center_t
>
(
i
);
vbc_m
[
i
]
=
new
ZeroFace
<
Vector_t
,
3
,
Mesh_t
,
Center_t
>
(
i
);
}
}
// create double sized mesh and layout objects for the use in the FFT's
...
...
@@ -171,23 +172,23 @@ FFTPoissonSolver::FFTPoissonSolver(Mesh_t *mesh, FieldLayout_t *fl, std::string
(
2
*
nr_m
[
i
]
-
domain2_m
[
i
]));
}
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"GreensFTotal"
);
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"IntGreenF1"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"IntGreenF3
"
);
IntGreensMirrorTimer1_m
=
IpplTimings
::
getTimer
(
"MirrorRho1
"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF1"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"ShIntGreenF4
"
);
IntGreensMirrorTimer2_m
=
IpplTimings
::
getTimer
(
"MirrorRho2
"
);
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"GreenF1"
);
GreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"GreenF2
"
);
GreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"GreenF3
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"GreenF4"
);
GreensFunctionTimer_m
=
IpplTimings
::
getTimer
(
"
SF:
GreensFTotal"
);
if
(
greensFunction_m
==
std
::
string
(
"INTEGRATED"
))
{
IntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF1
"
);
IntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF2
"
);
IntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: IntGreenF3
"
);
IntGreensMirrorTimer1_m
=
IpplTimings
::
getTimer
(
"SF: MirrorRho1"
);
ShIntGreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF1
"
);
ShIntGreensFunctionTimer2_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF2
"
);
ShIntGreensFunctionTimer3_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF3
"
);
ShIntGreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: ShIntGreenF4
"
);
IntGreensMirrorTimer2_m
=
IpplTimings
::
getTimer
(
"SF: MirrorRho2"
);
}
else
{
GreensFunctionTimer1_m
=
IpplTimings
::
getTimer
(
"SF: GreenF1
"
);
GreensFunctionTimer4_m
=
IpplTimings
::
getTimer
(
"SF: GreenF4
"
);
}
}
...
...
@@ -200,7 +201,8 @@ FFTPoissonSolver::FFTPoissonSolver(PartBunch &beam, std::string greensFunction):
layout3_m
(
nullptr
),
mesh4_m
(
nullptr
),
layout4_m
(
nullptr
),
greensFunction_m
(
greensFunction
)
{
greensFunction_m
(
greensFunction
)
{
int
i
;
domain_m
=
layout_m
->
getDomain
();
...
...
@@ -422,23 +424,23 @@ void FFTPoissonSolver::greensFunction() {
}
/** If the beam has a longitudinal size >> transverse size the
* direct Green function at each mesh point is not efficient
* (needs a lot of mesh points along the transverse size to
* get a good resolution)
*
* If the charge density function is uniform within each cell
* the following Green's function can be defined:
*
* \f[ \overline{G}(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'} cout << I << endl;
cout << J << endl;
cout << K << endl;
cout << IE << endl;
cout << JE << endl;
cout << KE << endl;
) = \int_{x_{i'} - h_x/2}^{x_{i'} + h_x/2} dx' \int_{y_{j'} - h_y/2}^{y_{j'} + h_y/2} dy' \int_{z_{k'} - h_z/2}^{z_{k'} + h_z/2} dz' G(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'}).
* \f]
*/
* direct Green function at each mesh point is not efficient
* (needs a lot of mesh points along the transverse size to
* get a good resolution)
*
* If the charge density function is uniform within each cell
* the following Green's function can be defined:
*
* \f[ \overline{G}(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'} cout << I << endl;
cout << J << endl;
cout << K << endl;
cout << IE << endl;
cout << JE << endl;
cout << KE << endl;
) = \int_{x_{i'} - h_x/2}^{x_{i'} + h_x/2} dx' \int_{y_{j'} - h_y/2}^{y_{j'} + h_y/2} dy' \int_{z_{k'} - h_z/2}^{z_{k'} + h_z/2} dz' G(x_i - x_{i'}, y_j - y_{j'}, z_k - z_{k'}).
* \f]
*/
void
FFTPoissonSolver
::
integratedGreensFunction
()
{
NDIndex
<
3
>
idx
=
layout4_m
->
getLocalNDIndex
();
...
...
@@ -448,8 +450,8 @@ void FFTPoissonSolver::integratedGreensFunction() {
IpplTimings
::
startTimer
(
IntGreensFunctionTimer1_m
);
/**
* This integral can be calculated analytically in a closed from:
*/
* This integral can be calculated analytically in a closed from:
*/
for
(
int
k
=
idx
[
2
].
first
();
k
<=
idx
[
2
].
last
()
+
1
;
k
++
)
{
for
(
int
j
=
idx
[
1
].
first
();
j
<=
idx
[
1
].
last
()
+
1
;
j
++
)
{
for
(
int
i
=
idx
[
0
].
first
();
i
<=
idx
[
0
].
last
()
+
1
;
i
++
)
{
...
...
@@ -478,10 +480,10 @@ void FFTPoissonSolver::integratedGreensFunction() {
//assign seems to have problems when we need values that are on another CPU, i.e. [I+1]
/*assign(rho2_m[I][J][K] ,
tmpgreen[I+1][J+1][K+1] - tmpgreen[I][J+1][K+1] -
tmpgreen[I+1][J][K+1] + tmpgreen[I][J][K+1] -
tmpgreen[I+1][J+1][K] + tmpgreen[I][J+1][K] +
tmpgreen[I+1][J][K] - tmpgreen[I][J][K]);*/
tmpgreen[I+1][J+1][K+1] - tmpgreen[I][J+1][K+1] -
tmpgreen[I+1][J][K+1] + tmpgreen[I][J][K+1] -
tmpgreen[I+1][J+1][K] + tmpgreen[I][J+1][K] +
tmpgreen[I+1][J][K] - tmpgreen[I][J][K]);*/
Index
I
=
nr_m
[
0
]
+
1
;
Index
J
=
nr_m
[
1
]
+
1
;
...
...
@@ -672,4 +674,4 @@ Inform &FFTPoissonSolver::print(Inform &os) const {
/***************************************************************************
* $RCSfile: FFTPoissonSolver.cc,v $ $Author: adelmann $
* $Revision: 1.6 $ $Date: 2001/08/16 09:36:08 $
***************************************************************************/
***************************************************************************/
\ No newline at end of file
src/Solvers/FFTPoissonSolver.h
View file @
8ebeebf4
...
...
@@ -154,8 +154,6 @@ private:
IpplTimings
::
TimerRef
IntGreensMirrorTimer2_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer1_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer2_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer3_m
;
IpplTimings
::
TimerRef
GreensFunctionTimer4_m
;
};
...
...
@@ -170,4 +168,4 @@ inline Inform &operator<<(Inform &os, const FFTPoissonSolver &fs) {
/***************************************************************************
* $RCSfile: FFTPoissonSolver.hh,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2001/08/08 11:21:48 $
***************************************************************************/
***************************************************************************/
\ No newline at end of file
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