From 561e12e4f51c8abd9e528d01f8c51446f2cce3b9 Mon Sep 17 00:00:00 2001 From: rkulakov Date: Mon, 15 Jan 2024 04:50:31 -0500 Subject: [PATCH] Fix transmutation syntax error --- MDLIB/ParticleRoutines.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/MDLIB/ParticleRoutines.c b/MDLIB/ParticleRoutines.c index 25017189..bea0425e 100755 --- a/MDLIB/ParticleRoutines.c +++ b/MDLIB/ParticleRoutines.c @@ -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; kNb_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; kNb_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 -----------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------*/ \ No newline at end of file