Skip to content

Commit

Permalink
Fixed the sinkMap to include helium clusters (ORNL-Fusion#112).
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Blondel committed Nov 29, 2023
1 parent cb1df73 commit 4beab57
Showing 1 changed file with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ PSIReactionNetwork<TSpeciesEnum>::updateExtraClusterData(
using SinkReactionType = typename Superclass::Traits::SinkReactionType;
auto sinkReactions =
this->_reactions.template getView<SinkReactionType>();
this->_clusterData.h_view().extraData.initialize(sinkReactions.size());
using GBSinkReactionType =
typename Superclass::Traits::GBSinkReactionType;
auto gbSinkReactions =
this->_reactions.template getView<GBSinkReactionType>();
this->_clusterData.h_view().extraData.initialize(
sinkReactions.size() + gbSinkReactions.size());

this->copyClusterDataView();

Expand All @@ -143,6 +148,12 @@ PSIReactionNetwork<TSpeciesEnum>::updateExtraClusterData(
clusterData().extraData.sinkMap(i) =
sinkReactions(i).getReactantId();
});
Kokkos::parallel_for(
"PSIReactionNetwork::updateExtraClusterData",
gbSinkReactions.size(), KOKKOS_LAMBDA(IndexType i) {
clusterData().extraData.sinkMap(i + sinkReactions.size()) =
gbSinkReactions(i).getReactantId();
});

this->invalidateDataMirror();
}
Expand Down Expand Up @@ -428,6 +439,15 @@ PSIReactionNetwork<TSpeciesEnum>::computeFluxesPreProcess(
Kokkos::parallel_for(
"PSIReactionNetwork::computeFluxesPreProcess", sinkReactions.size(),
KOKKOS_LAMBDA(IndexType i) { sinkReactions[i].updateRates(); });

using GBSinkReactionType =
typename Superclass::Traits::GBSinkReactionType;
auto gbSinkReactions =
this->_reactions.template getView<GBSinkReactionType>();
Kokkos::parallel_for(
"PSIReactionNetwork::computeFluxesPreProcess",
gbSinkReactions.size(),
KOKKOS_LAMBDA(IndexType i) { gbSinkReactions[i].updateRates(); });
}
}

Expand Down Expand Up @@ -513,6 +533,15 @@ PSIReactionNetwork<TSpeciesEnum>::computePartialsPreProcess(
"PSIReactionNetwork::computePartialsPreProcess",
sinkReactions.size(),
KOKKOS_LAMBDA(IndexType i) { sinkReactions[i].updateRates(); });

using GBSinkReactionType =
typename Superclass::Traits::GBSinkReactionType;
auto gbSinkReactions =
this->_reactions.template getView<GBSinkReactionType>();
Kokkos::parallel_for(
"PSIReactionNetwork::computePartialsPreProcess",
gbSinkReactions.size(),
KOKKOS_LAMBDA(IndexType i) { gbSinkReactions[i].updateRates(); });
}
}

Expand Down

0 comments on commit 4beab57

Please sign in to comment.