Skip to content
Snippets Groups Projects
Commit 7a0f028c authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Ensure that SimulationElements that are going to be added are always set (to...

Ensure that SimulationElements that are going to be added are always set (to zero if no calculation is done on a specific SimulationElement)
parent 85b2ddc9
No related branches found
No related tags found
No related merge requests found
...@@ -50,9 +50,11 @@ bool ParticleLayoutComputation::eval( ...@@ -50,9 +50,11 @@ bool ParticleLayoutComputation::eval(
return false; return false;
double alpha_f = it->getAlphaMean(); double alpha_f = it->getAlphaMean();
size_t n_layers = mp_multilayer->getNumberOfLayers(); size_t n_layers = mp_multilayer->getNumberOfLayers();
if (n_layers > 1 && alpha_f < 0) // skip transmission for multilayers (n>1) if (n_layers > 1 && alpha_f < 0) {
continue; it->setIntensity(0.0); // zero for transmission with multilayers (n>1)
it->setIntensity(p_strategy->evaluate(*it) * total_surface_density); } else {
it->setIntensity(p_strategy->evaluate(*it) * total_surface_density);
}
counter.stepProgress(progress); counter.stepProgress(progress);
} }
return true; return true;
......
...@@ -42,6 +42,8 @@ bool SpecularComputation::eval( ...@@ -42,6 +42,8 @@ bool SpecularComputation::eval(
continue; continue;
double intensity = std::norm(R)*sin_alpha_i/solid_angle; double intensity = std::norm(R)*sin_alpha_i/solid_angle;
it->setIntensity(intensity); it->setIntensity(intensity);
} else {
it->setIntensity(0.0);
} }
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment