Skip to content

Commit

Permalink
for #7279 use ENDFB-8.0-NNDC library for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep committed Jan 21, 2025
1 parent 4443699 commit b006eea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
20 changes: 11 additions & 9 deletions sirepo/package_data/static/js/openmc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3271,22 +3271,16 @@ SIREPO.app.directive('standardMaterial', function(openmcService, panelState, uti
<span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
<input class="${searchClass} form-control" placeholder="Search Material Compendium" />
<span class="input-group-btn">
<button class="btn" data-ng-class="{'btn-primary': wantElement}" type="button" data-ng-click="selectSearchType(true)">Element</button>
<button class="btn" data-ng-class="{'btn-primary': ! wantElement}" type="button" data-ng-click="selectSearchType(false)">Nuclide</button>
<button class="btn" data-ng-class="{'btn-primary': wantElement}" type="button" data-ng-disabled="! hasSelection()" data-ng-click="selectSearchType(true)">Element</button>
<button class="btn" data-ng-class="{'btn-primary': ! wantElement}" type="button" data-ng-disabled="! hasSelection()" data-ng-click="selectSearchType(false)">Nuclide</button>
</span>
</div>
`,
controller: function($scope, $element) {
let lastSelected = '';
$scope.wantElement = true;

$scope.selectSearchType = (wantElement) => {
$scope.wantElement = wantElement;
if (lastSelected) {
$(`.${searchClass}`).val(lastSelected);
$scope.onSelect()(lastSelected);
}
};
$scope.hasSelection = () => lastSelected ? true : false;

$scope.onSelect = () => {
return (value) => {
Expand All @@ -3299,6 +3293,14 @@ SIREPO.app.directive('standardMaterial', function(openmcService, panelState, uti
};
};

$scope.selectSearchType = (wantElement) => {
$scope.wantElement = wantElement;
if (lastSelected) {
$(`.${searchClass}`).val(lastSelected);
$scope.onSelect()(lastSelected);
}
};

openmcService.loadStandardMaterialNames((names) => {
$scope.list = [];
for (const n of names) {
Expand Down
3 changes: 1 addition & 2 deletions sirepo/package_data/template/openmc/examples/aurora.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@
},
"settings": {
"batches": 10,
"dataLibrary": "ENDFB-7.1-NNDC",
"inactive": 0,
"materialLibrary": "ENDFB-7.1-NNDC",
"materialLibrary": "ENDFB-8.0-NNDC",
"particles": 50000,
"photon_transport": "0",
"run_mode": "fixed source",
Expand Down
3 changes: 1 addition & 2 deletions sirepo/package_data/template/openmc/examples/reactor.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@
},
"settings": {
"batches": 5,
"dataLibrary": "ENDFB-7.1-NNDC",
"inactive": 0,
"materialLibrary": "ENDFB-7.1-NNDC",
"materialLibrary": "ENDFB-8.0-NNDC",
"particles": 5000,
"photon_transport": "0",
"run_mode": "fixed source",
Expand Down
2 changes: 1 addition & 1 deletion sirepo/package_data/template/openmc/examples/teapot.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"settings": {
"batches": 10,
"inactive": 0,
"materialLibrary": "ENDFB-7.1-NNDC",
"materialLibrary": "ENDFB-8.0-NNDC",
"particles": 5000,
"photon_transport": "0",
"run_mode": "fixed source",
Expand Down

0 comments on commit b006eea

Please sign in to comment.