@@ -88,13 +88,13 @@ inline HOST_DEVICE void updateTrajectory(double energy, double angle, MC_Particl
88
88
}
89
89
HOST_DEVICE_END
90
90
91
- inline HOST_DEVICE bool CollisionEvent (MonteCarlo *monteCarlo, MC_Particle &mc_particle, unsigned int tally_index, int particle_index, int *tallyArray)
91
+ inline HOST_DEVICE bool CollisionEvent (MonteCarlo_d *monteCarlo, MC_Particle &mc_particle, unsigned int tally_index, int particle_index, int *tallyArray)
92
92
{
93
- #ifdef __CUDA_ARCH__
93
+ // #ifdef __CUDA_ARCH__
94
94
const MC_Cell_State &cell = monteCarlo->domain_d [mc_particle.domain ].cell_state [mc_particle.cell ];
95
- #else
96
- const MC_Cell_State &cell = monteCarlo->domain [mc_particle.domain ].cell_state [mc_particle.cell ];
97
- #endif
95
+ // #else
96
+ // const MC_Cell_State &cell = monteCarlo->domain[mc_particle.domain].cell_state[mc_particle.cell];
97
+ // #endif
98
98
99
99
int globalMatIndex = cell._material ;
100
100
@@ -107,21 +107,21 @@ inline HOST_DEVICE bool CollisionEvent(MonteCarlo *monteCarlo, MC_Particle &mc_p
107
107
int selectedIso = -1 ;
108
108
int selectedUniqueNumber = -1 ;
109
109
int selectedReact = -1 ;
110
- #ifdef __CUDA_ARCH__
110
+ // #ifdef __CUDA_ARCH__
111
111
int numIsos = (int )monteCarlo->_material_d [globalMatIndex]._isosize ;
112
- #else
113
- int numIsos = (int )monteCarlo->_materialDatabase ->_mat [globalMatIndex]._iso .size ();
114
- #endif
112
+ // #else
113
+ // int numIsos = (int)monteCarlo->_materialDatabase->_mat[globalMatIndex]._iso.size();
114
+ // #endif
115
115
116
116
for (int isoIndex = 0 ; isoIndex < numIsos && currentCrossSection >= 0 ; isoIndex++)
117
117
{
118
- #ifdef __CUDA_ARCH__
118
+ // #ifdef __CUDA_ARCH__
119
119
int uniqueNumber = monteCarlo->_material_d [globalMatIndex]._iso [isoIndex]._gid ;
120
120
int numReacts = monteCarlo->_nuclearData_d ->getNumberReactions (uniqueNumber);
121
- #else
122
- int uniqueNumber = monteCarlo->_materialDatabase ->_mat [globalMatIndex]._iso [isoIndex]._gid ;
123
- int numReacts = monteCarlo->_nuclearData ->getNumberReactions (uniqueNumber);
124
- #endif
121
+ // #else
122
+ // int uniqueNumber = monteCarlo->_materialDatabase->_mat[globalMatIndex]._iso[isoIndex]._gid;
123
+ // int numReacts = monteCarlo->_nuclearData->getNumberReactions(uniqueNumber);
124
+ // #endif
125
125
for (int reactIndex = 0 ; reactIndex < numReacts; reactIndex++)
126
126
{
127
127
currentCrossSection -= macroscopicCrossSection (monteCarlo, reactIndex, mc_particle.domain , mc_particle.cell ,
@@ -145,58 +145,58 @@ inline HOST_DEVICE bool CollisionEvent(MonteCarlo *monteCarlo, MC_Particle &mc_p
145
145
double energyOut[MAX_PRODUCTION_SIZE];
146
146
double angleOut[MAX_PRODUCTION_SIZE];
147
147
int nOut = 0 ;
148
- #ifdef __CUDA_ARCH__
148
+ // #ifdef __CUDA_ARCH__
149
149
double mat_mass = monteCarlo->_material_d [globalMatIndex]._mass ;
150
150
monteCarlo->_nuclearData_d ->_isotopes [selectedUniqueNumber]._species [0 ]._reactions [selectedReact].sampleCollision (
151
151
mc_particle.kinetic_energy , mat_mass, &energyOut[0 ], &angleOut[0 ], nOut, &(mc_particle.random_number_seed ), MAX_PRODUCTION_SIZE);
152
- #else
153
- double mat_mass = monteCarlo->_materialDatabase ->_mat [globalMatIndex]._mass ;
154
- monteCarlo->_nuclearData ->_isotopes [selectedUniqueNumber]._species [0 ]._reactions [selectedReact].sampleCollision (
155
- mc_particle.kinetic_energy , mat_mass, &energyOut[0 ], &angleOut[0 ], nOut, &(mc_particle.random_number_seed ), MAX_PRODUCTION_SIZE);
156
- #endif
152
+ // #else
153
+ // double mat_mass = monteCarlo->_materialDatabase->_mat[globalMatIndex]._mass;
154
+ // monteCarlo->_nuclearData->_isotopes[selectedUniqueNumber]._species[0]._reactions[selectedReact].sampleCollision(
155
+ // mc_particle.kinetic_energy, mat_mass, &energyOut[0], &angleOut[0], nOut, &(mc_particle.random_number_seed), MAX_PRODUCTION_SIZE);
156
+ // #endif
157
157
158
158
// --------------------------------------------------------------------------------------------------------------
159
159
// Post-Collision Phase 1:
160
160
// Tally the collision
161
161
// --------------------------------------------------------------------------------------------------------------
162
162
163
163
// Set the reaction for this particle.
164
- #ifdef __CUDA_ARCH__
164
+ // #ifdef __CUDA_ARCH__
165
165
ATOMIC_UPDATE (tallyArray[tally_index * NUM_TALLIES + 3 ]);
166
- #else
167
- ATOMIC_UPDATE (monteCarlo->_tallies ->_balanceTask [tally_index]._collision );
168
- #endif
166
+ // #else
167
+ // ATOMIC_UPDATE(monteCarlo->_tallies->_balanceTask[tally_index]._collision);
168
+ // #endif
169
169
170
- #ifdef __CUDA_ARCH__
170
+ // #ifdef __CUDA_ARCH__
171
171
NuclearDataReaction::Enum reactionType = (NuclearDataReaction::Enum)monteCarlo->_nuclearData_d ->_isotopes [selectedUniqueNumber]._species [0 ]._reactions [selectedReact]._reactionType ;
172
- #else
173
- NuclearDataReaction::Enum reactionType = monteCarlo->_nuclearData ->_isotopes [selectedUniqueNumber]._species [0 ]._reactions [selectedReact]._reactionType ;
174
- #endif
172
+ // #else
173
+ // NuclearDataReaction::Enum reactionType = monteCarlo->_nuclearData->_isotopes[selectedUniqueNumber]._species[0]._reactions[selectedReact]._reactionType;
174
+ // #endif
175
175
176
176
switch (reactionType)
177
177
{
178
178
case NuclearDataReaction::Scatter:
179
- #ifdef __CUDA_ARCH__
179
+ // #ifdef __CUDA_ARCH__
180
180
ATOMIC_UPDATE (tallyArray[tally_index * NUM_TALLIES + 4 ]);
181
- #else
182
- ATOMIC_UPDATE (monteCarlo->_tallies ->_balanceTask [tally_index]._scatter );
183
- #endif
181
+ // #else
182
+ // ATOMIC_UPDATE(monteCarlo->_tallies->_balanceTask[tally_index]._scatter);
183
+ // #endif
184
184
break ;
185
185
case NuclearDataReaction::Absorption:
186
- #ifdef __CUDA_ARCH__
186
+ // #ifdef __CUDA_ARCH__
187
187
ATOMIC_UPDATE (tallyArray[tally_index * NUM_TALLIES + 5 ]);
188
- #else
189
- ATOMIC_UPDATE (monteCarlo->_tallies ->_balanceTask [tally_index]._absorb );
190
- #endif
188
+ // #else
189
+ // ATOMIC_UPDATE(monteCarlo->_tallies->_balanceTask[tally_index]._absorb);
190
+ // #endif
191
191
break ;
192
192
case NuclearDataReaction::Fission:
193
- #ifdef __CUDA_ARCH__
193
+ // #ifdef __CUDA_ARCH__
194
194
ATOMIC_UPDATE (tallyArray[tally_index * NUM_TALLIES + 6 ]);
195
195
ATOMIC_ADD (tallyArray[tally_index * NUM_TALLIES + 7 ], nOut);
196
- #else
197
- ATOMIC_UPDATE (monteCarlo->_tallies ->_balanceTask [tally_index]._fission );
198
- ATOMIC_ADD (monteCarlo->_tallies ->_balanceTask [tally_index]._produce , nOut);
199
- #endif
196
+ // #else
197
+ // ATOMIC_UPDATE(monteCarlo->_tallies->_balanceTask[tally_index]._fission);
198
+ // ATOMIC_ADD(monteCarlo->_tallies->_balanceTask[tally_index]._produce, nOut);
199
+ // #endif
200
200
break ;
201
201
case NuclearDataReaction::Undefined:
202
202
#ifdef DEBUG
@@ -219,7 +219,7 @@ inline HOST_DEVICE bool CollisionEvent(MonteCarlo *monteCarlo, MC_Particle &mc_p
219
219
updateTrajectory (energyOut[secondaryIndex], angleOut[secondaryIndex], secondaryParticle);
220
220
221
221
// Atomic capture will be called here
222
- monteCarlo->_particleVaultContainer ->addExtraParticle (secondaryParticle);
222
+ monteCarlo->_particleVaultContainer_d ->addExtraParticle (secondaryParticle);
223
223
}
224
224
225
225
updateTrajectory (energyOut[0 ], angleOut[0 ], mc_particle);
@@ -231,15 +231,15 @@ inline HOST_DEVICE bool CollisionEvent(MonteCarlo *monteCarlo, MC_Particle &mc_p
231
231
if (nOut > 1 )
232
232
{
233
233
// Atomic capture will be called here
234
- monteCarlo->_particleVaultContainer ->addExtraParticle (mc_particle);
234
+ monteCarlo->_particleVaultContainer_d ->addExtraParticle (mc_particle);
235
235
}
236
236
237
237
// If we are still tracking this particle the update its energy group
238
- #ifdef __CUDA_ARCH__
238
+ // #ifdef __CUDA_ARCH__
239
239
mc_particle.energy_group = monteCarlo->_nuclearData_d ->getEnergyGroup (mc_particle.kinetic_energy );
240
- #else
241
- mc_particle.energy_group = monteCarlo->_nuclearData ->getEnergyGroup (mc_particle.kinetic_energy );
242
- #endif
240
+ // #else
241
+ // mc_particle.energy_group = monteCarlo->_nuclearData->getEnergyGroup(mc_particle.kinetic_energy);
242
+ // #endif
243
243
244
244
return nOut == 1 ;
245
245
}
0 commit comments