Skip to content

Commit

Permalink
Merge branch 'main' into add-topo-height-to-instance
Browse files Browse the repository at this point in the history
# Conflicts:
#	MDLIB/ParticleRoutines.c
  • Loading branch information
kulakovri committed Feb 13, 2024
2 parents 44121b8 + ac8b269 commit cc60f31
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions MDLIB/ParticleRoutines.c
Original file line number Diff line number Diff line change
Expand Up @@ -3207,23 +3207,24 @@ void CountPartCell ( markers* particles, grid *mesh, params model, surface topo,

void TransmutateMarkers(markers *particles, mat_prop *materials, double scaling_T) {
int transmutated_particles = 0;

#pragma omp parallel for 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++;
}
#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 cc60f31

Please sign in to comment.