Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
01944e67
Commit
01944e67
authored
Jul 17, 2020
by
frey_m
Browse files
ArbitraryDomain: remove unused Quaternion variables + functions
parent
397773a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
88 deletions
+0
-88
src/Solvers/ArbitraryDomain.cpp
src/Solvers/ArbitraryDomain.cpp
+0
-66
src/Solvers/ArbitraryDomain.h
src/Solvers/ArbitraryDomain.h
+0
-14
src/Solvers/IrregularDomain.h
src/Solvers/IrregularDomain.h
+0
-7
src/Solvers/MGPoissonSolver.cpp
src/Solvers/MGPoissonSolver.cpp
+0
-1
No files found.
src/Solvers/ArbitraryDomain.cpp
View file @
01944e67
...
...
@@ -68,11 +68,6 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
setHr
(
hr
);
globalToLocalQuaternion_m
=
getGlobalToLocalQuaternion
();
localToGlobalQuaternion_m
[
0
]
=
globalToLocalQuaternion_m
[
0
];
for
(
int
i
=
1
;
i
<
4
;
i
++
)
localToGlobalQuaternion_m
[
i
]
=
-
globalToLocalQuaternion_m
[
i
];
int
zGhostOffsetLeft
=
(
localId
[
2
].
first
()
==
0
)
?
0
:
1
;
int
zGhostOffsetRight
=
(
localId
[
2
].
last
()
==
nr_m
[
2
]
-
1
)
?
0
:
1
;
int
yGhostOffsetLeft
=
(
localId
[
1
].
first
()
==
0
)
?
0
:
1
;
...
...
@@ -116,8 +111,6 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
//P = saveP;
//rotateWithQuaternion(P, localToGlobalQuaternion_m);
if
(
bgeom_m
->
fastIsInside
(
P0
,
P
)
%
2
==
0
)
{
// Fill the map with true or false values for very fast isInside tests
...
...
@@ -133,11 +126,9 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
std
::
tuple
<
int
,
int
,
int
>
pos
(
idx
,
idy
,
idz
);
//rotateZAxisWithQuaternion(dir, localToGlobalQuaternion_m);
dir
=
Vector_t
(
0
,
0
,
1
);
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
dir
,
I
))
{
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiZ
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
2
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -147,7 +138,6 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
}
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
-
dir
,
I
))
{
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoZ
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
2
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -156,11 +146,9 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
#endif
}
//rotateYAxisWithQuaternion(dir, localToGlobalQuaternion_m);
dir
=
Vector_t
(
0
,
1
,
0
);
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
dir
,
I
))
{
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiY
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
1
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -170,7 +158,6 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
}
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
-
dir
,
I
))
{
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoY
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
1
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -179,11 +166,9 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
#endif
}
//rotateXAxisWithQuaternion(dir, localToGlobalQuaternion_m);
dir
=
Vector_t
(
1
,
0
,
0
);
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
dir
,
I
))
{
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiX
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
0
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -193,7 +178,6 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
}
if
(
bgeom_m
->
intersectRayBoundary
(
P
,
-
dir
,
I
)){
//rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoX
.
insert
(
std
::
pair
<
std
::
tuple
<
int
,
int
,
int
>
,
double
>
(
pos
,
I
[
0
]));
}
else
{
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
...
...
@@ -482,56 +466,6 @@ inline void ArbitraryDomain::crossProduct(double A[], double B[], double C[]) {
C
[
2
]
=
A
[
0
]
*
B
[
1
]
-
A
[
1
]
*
B
[
0
];
}
inline
void
ArbitraryDomain
::
rotateWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
)
{
// rotates a Vector_t (3 elements) using a quaternion.
// Flip direction of rotation by quaternionVectorcomponent *= -1
Vector_t
const
quaternionVectorComponent
=
Vector_t
(
quaternion
(
1
),
quaternion
(
2
),
quaternion
(
3
));
double
const
quaternionScalarComponent
=
quaternion
(
0
);
v
=
2.0
*
dot
(
quaternionVectorComponent
,
v
)
*
quaternionVectorComponent
+
(
quaternionScalarComponent
*
quaternionScalarComponent
-
dot
(
quaternionVectorComponent
,
quaternionVectorComponent
))
*
v
+
2.0
*
quaternionScalarComponent
*
cross
(
quaternionVectorComponent
,
v
);
}
inline
void
ArbitraryDomain
::
rotateXAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
)
{
// rotates the positive xaxis using a quaternion.
v
(
0
)
=
(
quaternion
(
0
)
*
quaternion
(
0
)
+
quaternion
(
1
)
*
quaternion
(
1
)
-
quaternion
(
2
)
*
quaternion
(
2
)
-
quaternion
(
3
)
*
quaternion
(
3
));
v
(
1
)
=
2.0
*
(
quaternion
(
1
)
*
quaternion
(
2
)
+
quaternion
(
0
)
*
quaternion
(
3
));
v
(
2
)
=
2.0
*
(
quaternion
(
1
)
*
quaternion
(
3
)
-
quaternion
(
0
)
*
quaternion
(
2
));
}
inline
void
ArbitraryDomain
::
rotateYAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
)
{
// rotates the positive yaxis using a quaternion.
v
(
0
)
=
2.0
*
(
quaternion
(
1
)
*
quaternion
(
2
)
-
quaternion
(
0
)
*
quaternion
(
3
));
v
(
1
)
=
(
quaternion
(
0
)
*
quaternion
(
0
)
-
quaternion
(
1
)
*
quaternion
(
1
)
+
quaternion
(
2
)
*
quaternion
(
2
)
-
quaternion
(
3
)
*
quaternion
(
3
));
v
(
2
)
=
2.0
*
(
quaternion
(
2
)
*
quaternion
(
3
)
+
quaternion
(
0
)
*
quaternion
(
1
));
}
inline
void
ArbitraryDomain
::
rotateZAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
)
{
// rotates the positive zaxis using a quaternion.
v
(
0
)
=
2.0
*
(
quaternion
(
1
)
*
quaternion
(
3
)
+
quaternion
(
0
)
*
quaternion
(
2
));
v
(
1
)
=
2.0
*
(
quaternion
(
2
)
*
quaternion
(
3
)
-
quaternion
(
0
)
*
quaternion
(
1
));
v
(
2
)
=
(
quaternion
(
0
)
*
quaternion
(
0
)
-
quaternion
(
1
)
*
quaternion
(
1
)
-
quaternion
(
2
)
*
quaternion
(
2
)
+
quaternion
(
3
)
*
quaternion
(
3
));
}
// vi: set et ts=4 sw=4 sts=4:
// Local Variables:
// mode:c
...
...
src/Solvers/ArbitraryDomain.h
View file @
01944e67
...
...
@@ -49,10 +49,6 @@ public:
ArbitraryDomain
(
BoundaryGeometry
*
bgeom
,
Vector_t
nr
,
Vector_t
hr
,
std
::
string
interpl
);
ArbitraryDomain
(
BoundaryGeometry
*
bgeom
,
Vector_t
nr
,
Vector_t
hr
,
Vector_t
globalMeanR
,
Quaternion_t
globalToLocalQuaternion
,
std
::
string
interpl
);
~
ArbitraryDomain
();
/// queries if a given (x,y,z) coordinate lies inside the domain
...
...
@@ -81,9 +77,6 @@ private:
/// all intersection points with gridlines in Z direction
PointList
IntersectHiZ
,
IntersectLoZ
;
// Quaternion_t globalToLocalQuaternion_m; because defined in parent class
Quaternion_t
localToGlobalQuaternion_m
;
int
startId
;
// Here we store the number of nodes in a xy layer for a given z coordinate
...
...
@@ -113,13 +106,6 @@ private:
void
linearInterpolation
(
int
idx
,
int
idy
,
int
idz
,
StencilValue_t
&
value
,
double
&
scaleFactor
)
override
;
// Rotate positive axes with quaternion -DW
inline
void
rotateWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
);
inline
void
rotateXAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
);
inline
void
rotateYAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
);
inline
void
rotateZAxisWithQuaternion
(
Vector_t
&
v
,
Quaternion_t
const
quaternion
);
};
#endif
...
...
src/Solvers/IrregularDomain.h
View file @
01944e67
...
...
@@ -29,7 +29,6 @@
#include <vector>
#include <string>
#include "Algorithms/PBunchDefs.h"
#include "Algorithms/Quaternion.h"
/// enumeration corresponding to different interpolation methods at the boundary
enum
{
...
...
@@ -118,11 +117,6 @@ public:
double
getMinZ
()
{
return
zMin_m
;
}
double
getMaxZ
()
{
return
zMax_m
;
}
void
setGlobalToLocalQuaternion
(
Quaternion_t
globalToLocalQuaternion
){
globalToLocalQuaternion_m
=
globalToLocalQuaternion
;}
Quaternion_t
getGlobalToLocalQuaternion
()
{
return
globalToLocalQuaternion_m
;}
double
getXRangeMin
();
double
getXRangeMax
();
double
getYRangeMin
();
...
...
@@ -171,7 +165,6 @@ protected:
/// mean position of bunch (m)
Vector_t
rMean_m
;
Quaternion_t
globalToLocalQuaternion_m
;
/// flag indicating if geometry has changed for the current time-step
bool
hasGeometryChanged_m
;
...
...
src/Solvers/MGPoissonSolver.cpp
View file @
01944e67
...
...
@@ -300,7 +300,6 @@ void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
nr_m
[
1
]
=
orig_nr_m
[
1
];
nr_m
[
2
]
=
orig_nr_m
[
2
];
bp_m
->
setGlobalToLocalQuaternion
(
itsBunch_m
->
getGlobalToLocalQuaternion
());
bp_m
->
setNr
(
nr_m
);
NDIndex
<
3
>
localId
=
layout_m
->
getLocalNDIndex
();
...
...
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