Skip to content
Snippets Groups Projects
Commit a5c199af authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

analysis ctd

parent 228cfe14
No related branches found
No related tags found
No related merge requests found
...@@ -26,29 +26,25 @@ void FormFactorCoherentSum::addCoherentPart(const FormFactorCoherentPart& part) ...@@ -26,29 +26,25 @@ void FormFactorCoherentSum::addCoherentPart(const FormFactorCoherentPart& part)
complex_t FormFactorCoherentSum::evaluate(const SimulationElement& sim_element) const complex_t FormFactorCoherentSum::evaluate(const SimulationElement& sim_element) const
{ {
complex_t result{}; complex_t result{};
for (auto& part : m_parts) { for (auto& part : m_parts)
result += part.evaluate(sim_element); result += part.evaluate(sim_element);
}
return result; return result;
} }
Eigen::Matrix2cd FormFactorCoherentSum::evaluatePol(const SimulationElement& sim_element) const Eigen::Matrix2cd FormFactorCoherentSum::evaluatePol(const SimulationElement& sim_element) const
{ {
Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero(); Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero();
for (auto& part : m_parts) { for (auto& part : m_parts)
result += part.evaluatePol(sim_element); result += part.evaluatePol(sim_element);
}
return result; return result;
} }
void FormFactorCoherentSum::scaleRelativeAbundance(double total_abundance) void FormFactorCoherentSum::scaleRelativeAbundance(double total_abundance)
{ {
if (total_abundance > 0.0) { if (total_abundance <= 0.0)
m_abundance /= total_abundance; throw Exceptions::LogicErrorException("FormFactorCoherentSum::scaleRelativeAbundance: "
return; "Trying to scale with non strictly positive factor.");
} m_abundance /= total_abundance;
throw Exceptions::LogicErrorException("FormFactorCoherentSum::scaleRelativeAbundance: "
"Trying to scale with non strictly positive factor.");
} }
double FormFactorCoherentSum::radialExtension() const double FormFactorCoherentSum::radialExtension() const
......
...@@ -40,7 +40,7 @@ The `ParticleLayoutComputation` constructor points the member `m_interference_fu ...@@ -40,7 +40,7 @@ The `ParticleLayoutComputation` constructor points the member `m_interference_fu
`ParticleLayoutComputation::compute` increments `SimulationElement::m_intensity` by a scattering intensity times the `ProcessedLayout::surfaceDensity()`. The intensity is computed by `m_interference_function_strategy->evaluate`, which is implemented as `IInterferenceFunctionStrategy::evaluate`. Except for Monte-Carlo integration, this wraps just one call to `IInterferenceFunctionStrategy::evaluateSinglePoint`. For unpolarized scattering, and except for radial paracrystals, the next call goes to `DecouplingApproximationStrategy::scalarCalculation`. `ParticleLayoutComputation::compute` increments `SimulationElement::m_intensity` by a scattering intensity times the `ProcessedLayout::surfaceDensity()`. The intensity is computed by `m_interference_function_strategy->evaluate`, which is implemented as `IInterferenceFunctionStrategy::evaluate`. Except for Monte-Carlo integration, this wraps just one call to `IInterferenceFunctionStrategy::evaluateSinglePoint`. For unpolarized scattering, and except for radial paracrystals, the next call goes to `DecouplingApproximationStrategy::scalarCalculation`.
`DecouplingApproximationStrategy::scalarCalculation` performs a coherent and an incoherent summation over scattering amplitudes `ff` obtained from `ProcessedLayout::formFactorList()`, which is of type `FormFactorCoherentSum`. The mixed sum is sum `DecouplingApproximationStrategy::scalarCalculation` performs a coherent and an incoherent summation over scattering amplitudes `ff` obtained by calling `FormFactorCoherentSum::evaluate` on members of `ProcessedLayout::formFactorList()`. The mixed sum is sum
> |ff|^2 + |sum ff|^2 * (coherence_factor - 1) > |ff|^2 + |sum ff|^2 * (coherence_factor - 1)
...@@ -57,3 +57,11 @@ By default, outer_iff = 1, so that ...@@ -57,3 +57,11 @@ By default, outer_iff = 1, so that
For the simplest of all interference functions, `InterferenceFunctionNone::iff_without_dw` just returns 1, so that For the simplest of all interference functions, `InterferenceFunctionNone::iff_without_dw` just returns 1, so that
> coherence_factor = 1. > coherence_factor = 1.
### Computing the particle formfactor
`FormFactorCoherentSum::evaluate` returns the sum over `FormFactorCoherentPart::evaluate`.
`FormFactorCoherentPart` wraps an `IFormFactor` and additionally holds members `m_fresnel_map` and ``m_layer_index` that are set by `FormFactorCoherentPart::setSpecularInfo`. This information is forwarded by calling `IFormFactor::setSpecularInfo`, which does nothing, unless overridden in `FormFactorDWBA::setSpecularInfo`.
After this preparation, `FormFactorDWBA::evaluate` calls `IFormFactor::evaluate`, which is pure virtual, overridden by `FormFactorDWBA::evaluate`, which computes the sum over the four DWBA terms. This involves four calls to `m_form_factor->evaluate`. The member `m_form_factor` is probably of type `IFormFactorBorn`. `IFormFactorBorn::evaluate` calls `IFormFactorBorn::evaluate_for_q`, which is pure virtual, overriden by shape-specific classes like `FormFactorFullSphere`.
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