29 , m_begin_it(begin_it)
44 const size_t n_z = z_positions.
size();
46 size_t start_z_ind = n_z;
47 std::valarray<double> intensities(0.0, n_z);
51 double z_layer_bottom(0.0);
52 double z_layer_top(0.0);
53 for (
size_t i_layer = 0; i_layer < n_layers && start_z_ind != 0; ++i_layer) {
60 const complex_t
R = flux->getScalarR();
61 const complex_t T = flux->getScalarT();
62 const complex_t kz_out = flux->getScalarKz();
63 const complex_t kz_in = -kz_out;
66 size_t ip1_z = start_z_ind;
67 for (; ip1_z > 0; --ip1_z) {
68 const size_t i_z = ip1_z - 1;
69 if (i_layer + 1 != n_layers && z_positions[i_z] <= z_layer_bottom)
71 const double z = z_positions[i_z] - z_layer_top;
72 intensities[i_z] = std::norm(
R * exp_I(kz_out * z) + T * exp_I(kz_in * z));
Defines the macro ASSERT.
#define ASSERT(condition)
Declares class DepthProbeComputation.
Defines class DepthProbeElement.
std::vector< std::unique_ptr< const IFlux > > Fluxes
Defines class ProgressHandler.
Defines class ScalarFlux.
std::vector< DepthProbeElement >::iterator DepthProbeElementIter
DepthProbeComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, DepthProbeElementIter begin_it, DepthProbeElementIter end_it)
DepthProbeElementIter m_begin_it
~DepthProbeComputation() override
void runProtected() override
Runs computation. May throw. To be called from run(), which catches exceptions.
DepthProbeElementIter m_end_it
void setIntensities(T &&intensities)
const IAxis * getZPositions() const
bool isCalculated() const
Abstract base class for one-dimensional axes.
virtual size_t size() const =0
Returns the number of bins.
Interface for a single-threaded computation with given range of DiffuseElements and ProgressHandler.
const reSample & m_re_sample
void stepProgress() const
Maintains information about progress of a computation.
Specular reflection and transmission coefficients in a layer in case of scalar interactions between t...
Collect the different options for simulation.SimulationOptions.
Data structure that contains all the necessary data for scattering calculations.
size_t numberOfSlices() const
double sliceTopZ(size_t i) const
Fluxes fluxesIn(const R3 &k) const
double sliceBottomZ(size_t i) const
Fluxes fluxes(const SliceStack &slices, const R3 &k, bool forward)
Computes refraction angle reflection/transmission coefficients for given sliced sample and wavevector...