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
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
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
b7325d0d
Commit
b7325d0d
authored
May 12, 2015
by
kraus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
throw exception if some field overlaps with dipole field; does not work yet
parent
236d53a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
src/Elements/OpalBeamline.cpp
src/Elements/OpalBeamline.cpp
+11
-0
src/Utilities/OpalSection.cpp
src/Utilities/OpalSection.cpp
+21
-2
src/Utilities/OpalSection.h
src/Utilities/OpalSection.h
+1
-0
No files found.
src/Elements/OpalBeamline.cpp
View file @
b7325d0d
...
...
@@ -440,6 +440,17 @@ void OpalBeamline::prepareSections() {
}
}
}
if
(
sections_m
[
i
].
doDipoleFieldsOverlap
())
{
const
CompVec
&
elements
=
sections_m
[
i
].
getElements
();
auto
it
=
elements
.
begin
();
std
::
string
elementNames
=
(
*
it
)
->
getName
();
for
(
++
it
;
it
!=
elements
.
end
();
++
it
)
{
elementNames
+=
", "
+
(
*
it
)
->
getName
();
}
throw
OpalException
(
"OpalBeamline::prepareSections"
,
"Fields overlap with dipole fields; not supported yet;
\n
*** affected elements: "
+
elementNames
);
}
}
...
...
src/Utilities/OpalSection.cpp
View file @
b7325d0d
...
...
@@ -62,8 +62,6 @@ OpalSection::OpalSection(const CompVec &elements, const double &start, const dou
boundarygeometry_m
=
(
*
clit
)
->
getBoundaryGeometry
();
has_boundarygeometry_m
=
true
;
}
}
if
(
has_wake_m
&&
!
wakefunction_m
)
{
// we then dismissed them all or there is
...
...
@@ -165,4 +163,25 @@ void OpalSection::updateEndCache() {
EndCache_m
.
u_factor
=
tanb
*
sinc
/
cosa
-
tana
*
cosc
;
EndCache_m
.
v_factor
=
-
tanb
*
cosc
/
cosa
-
tana
*
sinc
;
}
}
bool
OpalSection
::
doDipoleFieldsOverlap
()
const
{
if
(
!
bends_m
)
return
false
;
unsigned
int
numFieldContributions
=
0
;
for
(
auto
it
=
elements_m
.
begin
();
it
!=
elements_m
.
end
();
++
it
)
{
switch
((
*
it
)
->
getType
())
{
case
ElementBase
::
CORRECTOR
:
case
ElementBase
::
MULTIPOLE
:
case
ElementBase
::
RBEND
:
case
ElementBase
::
RFCAVITY
:
case
ElementBase
::
RFQUADRUPOLE
:
case
ElementBase
::
SBEND
:
case
ElementBase
::
SOLENOID
:
case
ElementBase
::
TRAVELINGWAVE
:
++
numFieldContributions
;
default:
}
}
return
(
numFieldContributions
>
1
);
}
\ No newline at end of file
src/Utilities/OpalSection.h
View file @
b7325d0d
...
...
@@ -69,6 +69,7 @@ public:
return
EndCache_m
;
}
bool
doDipoleFieldsOverlap
()
const
;
private:
CompVec
elements_m
;
double
start_m
;
...
...
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