Skip to content

Commit

Permalink
for #7074 added default data and updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep committed May 30, 2024
1 parent 43454bd commit a76d2c6
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 124 deletions.
9 changes: 6 additions & 3 deletions sirepo/package_data/static/html/impactt-visualization.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="container-fluid">
<div data-simple-panel="simulationStatus">
<div data-sim-status-panel="visualization.simState"></div>
</div>
<div class="row">
<div class="col-md-6 col-xl-4">
<div data-simple-panel="simulationStatus">
<div data-sim-status-panel="visualization.simState"></div>
</div>
</div>
</div>
7 changes: 3 additions & 4 deletions sirepo/package_data/static/js/impactt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var srdbg = SIREPO.srdbg;
SIREPO.app.config(function() {
SIREPO.appFieldEditors += ``;
SIREPO.lattice = {
canReverseBeamline: true,
elementColor: {
MULTIPOLE: 'yellow',
QUADRUPOLE: 'red',
Expand Down Expand Up @@ -89,9 +88,9 @@ SIREPO.app.directive('appHeader', function(appState, panelState) {
<div data-app-header-right="nav">
<app-header-right-sim-loaded>
<div data-sim-sections="">
<li class="sim-section" data-ng-class="{active: nav.isActive(\'visualization\')}"><a href data-ng-click="nav.openSection(\'visualization\')"><span class="glyphicon glyphicon-flash"></span> Visualization</a></li>
<li class="sim-section" data-ng-class="{active: nav.isActive(\'lattice\')}"><a href data-ng-click="nav.openSection(\'lattice\')"><span class="glyphicon glyphicon-flash"></span> Lattice</a></li>
<li class="sim-section" data-ng-class="{active: nav.isActive(\'source\')}"><a href data-ng-click="nav.openSection(\'source\')"><span class="glyphicon glyphicon-flash"></span> Source</a></li>
<li class="sim-section" data-ng-class="{active: nav.isActive('lattice')}"><a href data-ng-click="nav.openSection('lattice')"><span class="glyphicon glyphicon-flash"></span> Lattice</a></li>
<li class="sim-section" data-ng-class="{active: nav.isActive('source')}"><a href data-ng-click="nav.openSection('source')"><span class="glyphicon glyphicon-flash"></span> Source</a></li>
<li class="sim-section" data-ng-class="{active: nav.isActive('visualization')}"><a href data-ng-click="nav.openSection('visualization')"><span class="glyphicon glyphicon-flash"></span> Visualization</a></li>
</div>
</app-header-right-sim-loaded>
<app-settings>
Expand Down
3 changes: 2 additions & 1 deletion sirepo/package_data/static/js/sirepo-lattice.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ SIREPO.app.factory('latticeService', function(appState, panelState, rpnService,
if (name == 'beamline') {
fixModelName(name);
var id = appState.models.beamline.id;
updateModels('beamline', 'id', 'beamlines', sortBeamlines);
self.editBeamline({ id: id });
}
if (self.isElementModelName(name)) {
Expand Down Expand Up @@ -1701,7 +1702,7 @@ SIREPO.app.directive('lattice', function(appState, latticeService, panelState, p
groupItem.width = 0.3;
groupItem.x -= 0.15;
}
groupItem.height = Math.min(0.5, groupItem.width);
groupItem.height = 0.5;
groupItem.y = pos.y - groupItem.height / 2;
groupItem.color = getPicColor(item, 'lightblue');
}
Expand Down
120 changes: 50 additions & 70 deletions sirepo/package_data/static/json/impactt-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,7 @@
},
"model": {
"beamline": {
"name": ["Name", "ValidatedString"],
"x": ["X [m]", "RPNValue", 0, "The x-coordinate of the location of the particle source"],
"y": ["Y [m]", "RPNValue", 0, "The y-coordinate of the location of the particle source"],
"z": ["Z [m]", "RPNValue", 0, "The z-coordinate of the location of the particle source"],
"theta": ["THETA", "RPNValue", 0, "The rotation about the y-axis of the particle source"],
"phi": ["PHI", "RPNValue", 0, "The rotation about the x-axis of the particle source"],
"psi": ["PSI", "RPNValue", 0, "The rotation about the z-axis of the particle source"]
"name": ["Name", "ValidatedString"]
},
"beamlineReport": {},
"command_beam": {
Expand Down Expand Up @@ -151,16 +145,19 @@
"zmu1": ["zmu1 [m]", "RPNValue", 0.0],
"zmu2": ["zmu2", "RPNValue", 0.0]
},
"impacttReport": {},
"simulationStatus": {},
"rpnVariable": {
"name": ["Name", "String"],
"value": ["Value", "RPNValue"]
},
"simulation": {
"elementPosition": ["Element Positioning", "ElementPosition", "absolute", "Beamline elements may be positioned relative to each other using Drifts for spacing, or positioned absolute using Elemedge."],
"elementPosition": ["Element Positioning", "ElementPosition", "absolute"],
"visualizationBeamlineId": ["Beamline", "LatticeBeamlineList", ""]
},
"_ELEMENT": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"radius": ["Radius [m]", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"radius": ["Radius [m]", "RPNValue", 0],
"x_offset": ["Misalignment X [m]", "RPNValue", 0],
"y_offset": ["Misalignment Y [m]", "RPNValue", 0],
"x_rotation": ["Rotation Error X [rad]", "RPNValue", 0],
Expand All @@ -169,92 +166,86 @@
},
"OFFSET_BEAM": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"x_offset": ["X offset [m]", "Float", 0, "X offset V3(m)"],
"y_offset": ["Y offset [m]", "Float", 0, "Y offset V5(m)"],
"z_offset": ["Z offset [m]", "Float", 0, "Z offset V7(m)"],
"px_offset": ["Px offset", "Float", 0, "(γβx) offset V4"],
"py_offset": ["Py offset", "Float", 0, "(γβy) offset V6"],
"pz_offset": ["Pz offset", "Float", 0, "(γβz) offset V8"]
"l": ["L [m]", "RPNValue", 0, "The element length"],
"x_offset": ["X offset [m]", "RPNValue", 0, "X offset V3(m)"],
"y_offset": ["Y offset [m]", "RPNValue", 0, "Y offset V5(m)"],
"z_offset": ["Z offset [m]", "RPNValue", 0, "Z offset V7(m)"],
"px_offset": ["Px offset", "RPNValue", 0, "(γβx) offset V4"],
"py_offset": ["Py offset", "RPNValue", 0, "(γβy) offset V6"],
"pz_offset": ["Pz offset", "RPNValue", 0, "(γβz) offset V8"]
},
"WRITE_BEAM": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"filename": ["Filename", "InputFile", ""],
"sample_frequency": ["Bnseg", "Integer", 0, "particle sample frequency"]
},
"WRITE_BEAM_FOR_RESTART": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"filename": ["Filename", "InputFile", ""]
},
"ROTATIONALLY_SYMMETRIC_TO_3D": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"s": ["S", "Float", 0]
"l": ["L [m]", "RPNValue", 0, "The element length"]
},
"CHANGE_TIMESTEP": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"dt": ["Dt", "Float", 0, "Time step size (secs)."],
"s": ["S", "Float", 0]
"l": ["L [m]", "RPNValue", 0, "The element length"],
"dt": ["Dt", "RPNValue", 0, "Time step size (secs)."]
},
"WAKEFIELD": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"method": ["Method", "String", ""],
"gap": ["Gap", "Float", 0],
"period": ["Period", "Float", 0],
"s": ["S", "Float", 0],
"s_begin": ["S Begin", "Float", 0],
"iris_radius": ["Iris Radius", "Float", 0],
"gap": ["Gap", "RPNValue", 0],
"period": ["Period", "RPNValue", 0],
"s": ["S [m]", "RPNValue", 0, "Wakefield end position]"],
"iris_radius": ["Iris Radius", "RPNValue", 0],
"filename": ["Filename", "InputFile", ""]
},
"SPACECHARGE": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"s": ["S", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"is_on": ["Is On", "Boolean", "0", "switch on/off the space-charge calculation"]
},
"STOP": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"s": ["S", "Float", 0]
"l": ["L [m]", "RPNValue", 0, "The element length"]
},
"WRITE_SLICE_INFO": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"n_slices": ["Number of Slices", "Integer", 0],
"s": ["S", "Float", 0],
"filename": ["Filename", "InputFile", ""]
},
"CONSTFOC": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"radius": ["Radius [m]", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"radius": ["Radius [m]", "RPNValue", 0],
"x_focusing_gradient": ["X Focusing Gradient [kx0^2]", "RPNValue", 0],
"y_focusing_gradient": ["Y Focusing Gradient [ky0^2]", "RPNValue", 0],
"z_focusing_gradient": ["Z Focusing Gradient [kz0^2]", "RPNValue", 0]
},
"DIPOLE": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"b_field_x": ["X Field Strength [T]", "RPNValue", 0],
"b_field": ["Y Field Strength [T]", "RPNValue", 0],
"half_gap": ["Half of Gap Width (m)", "RPNValue", 0],
"filename": ["Filename", "InputFile", "", "file ID to contain the geometry information of bend."]
},
"DRIFT": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"]
"l": ["L [m]", "RPNValue", 0, "The element length"]
},
"DTL": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"rf_frequency": ["RF Frequency [Hz]", "Float", 0, "Frequency of the RF field in Hz."],
"theta0_deg": ["Theta 0 [deg]", "Float", 0, "Initial phase in degrees"],
"radius": ["Radius [m]", "Float", 0],
"field_amplitude_scale": ["Scale", "Float", 1, "This can be used to scale the field amplitude. Normally set to 1."],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"rf_frequency": ["RF Frequency [Hz]", "RPNValue", 0, "Frequency of the RF field in Hz."],
"theta0_deg": ["Theta 0 [deg]", "RPNValue", 0, "Initial phase in degrees"],
"radius": ["Radius [m]", "RPNValue", 0],
"field_amplitude_scale": ["Scale", "RPNValue", 1, "This can be used to scale the field amplitude. Normally set to 1."],
"filename": ["Filename", "InputFile", "", "Drift Tube Linac filename"],
"quad_1_length": ["Quad 1 Length [m]", "RPNValue", 0],
"quad_1_gradient": ["Quad 1 Gradient [T/m]", "RPNValue", 0],
Expand All @@ -280,33 +271,33 @@
},
"EMFLDCART": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"radius": ["Radius [m]", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"radius": ["Radius [m]", "RPNValue", 0],
"rf_frequency": ["RF Frequency [Hz]", "RPNValue", 0, "Frequency of the RF field in Hz."],
"rf_field_scale": ["RF field scale", "RPNValue", 1, "This can be used to scale the field amplitude. Normally set to 1."],
"theta0_deg": ["Theta 0 [deg]", "RPNValue", 0, "Initial phase in degrees"],
"filename": ["Filename", "InputFile", "", "EMfldCart filename"]
},
"EMFLDCYL": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"radius": ["Radius [m]", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"radius": ["Radius [m]", "RPNValue", 0],
"rf_frequency": ["RF Frequency [Hz]", "RPNValue", 0, "Frequency of the RF field in Hz."],
"rf_field_scale": ["RF field scale", "RPNValue", 1, "This can be used to scale the field amplitude. Normally set to 1."],
"theta0_deg": ["Theta 0 [deg]", "RPNValue", 0, "Initial phase in degrees"],
"filename": ["Filename", "InputFile", "", "EMfldCyl filename"]
},
"EMFLDANA": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"rf_frequency": ["RF Frequency [Hz]", "Float", 0, "Frequency of the RF field in Hz."],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"rf_frequency": ["RF Frequency [Hz]", "RPNValue", 0, "Frequency of the RF field in Hz."],
"e_scale": ["E Scale", "RPNValue", 0],
"theta0_deg": ["Theta 0 [deg]", "RPNValue", 0, "Initial phase in degrees"],
"filename": ["Filename", "InputFile", "", "EMfldAna filename"]
},
"MULTIPOLE": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"pole_type": ["Pole Type", "PoleType", "sextupole"],
"b_field_x": ["Field Strength [T/m^n]", "RPNValue", 0],
"filename": ["Filename", "InputFile", "", "Multipole filename"]
Expand Down Expand Up @@ -336,22 +327,16 @@
},
"SOLENOID": {
"name": ["NAME", "ValidatedString", "", ""],
"l": ["L [m]", "Float", 0, "The element length"],
"radius": ["Radius [m]", "Float", 0],
"l": ["L [m]", "RPNValue", 0, "The element length"],
"radius": ["Radius [m]", "RPNValue", 0],
"filename": ["Filename", "InputFile", "", "Solenoid field map filename"]
}
},
"view": {
"beamline": {
"title": "Beamline",
"advanced": [
"name",
"x",
"y",
"z",
"theta",
"phi",
"psi"
"name"
]
},
"beamlineReport": {
Expand Down Expand Up @@ -407,8 +392,7 @@
"advanced": [
"name",
"l",
"dt",
"s"
"dt"
]
},
"DIPOLE": {
Expand Down Expand Up @@ -467,8 +451,7 @@
"fieldsPerTab": 8,
"advanced": [
"name",
"l",
"s"
"l"
]
},
"SOLENOID": {
Expand Down Expand Up @@ -506,7 +489,6 @@
"advanced": [
"name",
"l",
"s",
"is_on"
]
},
Expand All @@ -515,8 +497,7 @@
"fieldsPerTab": 8,
"advanced": [
"name",
"l",
"s"
"l"
]
},
"WAKEFIELD": {
Expand All @@ -529,7 +510,6 @@
"method",
"gap",
"period",
"s_begin",
"iris_radius",
"filename"
]
Expand Down
12 changes: 12 additions & 0 deletions sirepo/package_data/template/impactt/default-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"models": {
"beamlines": [],
"commands": [],
"elements": [],
"simulation": {
"elementPosition": "absolute",
"visualizationBeamlineId": ""
}
},
"simulationType": "impactt"
}
Loading

0 comments on commit a76d2c6

Please sign in to comment.