Skip to content

Commit

Permalink
Merge pull request #122
Browse files Browse the repository at this point in the history
* Fix transmutation syntax error
  • Loading branch information
kulakovri authored Jan 17, 2024
1 parent e18c654 commit ac8b269
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions MDLIB/ParticleRoutines.c
Original file line number Diff line number Diff line change
Expand Up @@ -3206,23 +3206,25 @@ void CountPartCell ( markers* particles, grid *mesh, params model, surface topo,
/*--------------------------------------------------------------------------------------------------------------------*/

void TransmutateMarkers(markers *particles, mat_prop *materials, double scaling_T) {
#pragma omp parallel for shared ( particles )
int transmutated_particles = 0;
for (int k=0; k<particles->Nb_part-1; k++) {
const int phase = particles->phase[k];
const double temperature = (particles->T[k] * scaling_T) - zeroC;
const double transmutation = materials->transmutation[phase];

if ((transmutation == -1 && materials->transmutation_temperature[phase] >= temperature)
|| (transmutation == 1 && materials->transmutation_temperature[phase] <= temperature)) {
particles->phase[k] = materials->transmutation_phase[phase];
particles->dual[k] = materials->transmutation_phase[phase];
transmutated_particles++;
}
int transmutated_particles = 0;
#pragma omp parallel for reduction(+:transmutated_particles) shared(particles)
for (int k=0; k<particles->Nb_part-1; k++) {
const int phase = particles->phase[k];
const double temperature = (particles->T[k] * scaling_T) - zeroC;
const double transmutation = materials->transmutation[phase];

if ((transmutation == -1 && materials->transmutation_temperature[phase] >= temperature)
|| (transmutation == 1 && materials->transmutation_temperature[phase] <= temperature)) {
particles->phase[k] = materials->transmutation_phase[phase];
particles->dual[k] = materials->transmutation_phase[phase];
transmutated_particles++;
}
printf("Transmutated particles = %03d\n", transmutated_particles);
}

printf("Transmutated particles = %03d\n", transmutated_particles);
}


/*--------------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------ M-Doodz -----------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------*/

0 comments on commit ac8b269

Please sign in to comment.