From 4beab57e224626498d016ed16bf63c684c01e2ef Mon Sep 17 00:00:00 2001 From: Sophie Blondel Date: Wed, 29 Nov 2023 10:55:34 -0500 Subject: [PATCH] Fixed the sinkMap to include helium clusters (#112). --- .../core/network/impl/PSIReactionNetwork.tpp | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/xolotl/core/include/xolotl/core/network/impl/PSIReactionNetwork.tpp b/xolotl/core/include/xolotl/core/network/impl/PSIReactionNetwork.tpp index a281f731e..873188995 100644 --- a/xolotl/core/include/xolotl/core/network/impl/PSIReactionNetwork.tpp +++ b/xolotl/core/include/xolotl/core/network/impl/PSIReactionNetwork.tpp @@ -132,7 +132,12 @@ PSIReactionNetwork::updateExtraClusterData( using SinkReactionType = typename Superclass::Traits::SinkReactionType; auto sinkReactions = this->_reactions.template getView(); - this->_clusterData.h_view().extraData.initialize(sinkReactions.size()); + using GBSinkReactionType = + typename Superclass::Traits::GBSinkReactionType; + auto gbSinkReactions = + this->_reactions.template getView(); + this->_clusterData.h_view().extraData.initialize( + sinkReactions.size() + gbSinkReactions.size()); this->copyClusterDataView(); @@ -143,6 +148,12 @@ PSIReactionNetwork::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(); } @@ -428,6 +439,15 @@ PSIReactionNetwork::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(); + Kokkos::parallel_for( + "PSIReactionNetwork::computeFluxesPreProcess", + gbSinkReactions.size(), + KOKKOS_LAMBDA(IndexType i) { gbSinkReactions[i].updateRates(); }); } } @@ -513,6 +533,15 @@ PSIReactionNetwork::computePartialsPreProcess( "PSIReactionNetwork::computePartialsPreProcess", sinkReactions.size(), KOKKOS_LAMBDA(IndexType i) { sinkReactions[i].updateRates(); }); + + using GBSinkReactionType = + typename Superclass::Traits::GBSinkReactionType; + auto gbSinkReactions = + this->_reactions.template getView(); + Kokkos::parallel_for( + "PSIReactionNetwork::computePartialsPreProcess", + gbSinkReactions.size(), + KOKKOS_LAMBDA(IndexType i) { gbSinkReactions[i].updateRates(); }); } }