Skip to content
Snippets Groups Projects
Commit 5750a30b authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

rm SliceInterface

parent f61c80f1
No related branches found
No related tags found
1 merge request!2723Implement model of growing roughness (#969)
......@@ -100,18 +100,6 @@ complex_t get_sum8terms(const ReSample& re_sample, size_t i_layer, const Diffuse
return term1 + term2 + term3 + term4 + term5 + term6 + term7 + term8;
}
class SliceInterface {
public:
SliceInterface(const Slice& slice)
: hig(slice.hig())
, topRoughness(slice.topRoughness())
{
ASSERT(topRoughness);
}
double hig = 0;
const LayerRoughness* topRoughness = nullptr;
};
} // namespace
double Compute::roughMultiLayerContribution(const ReSample& re_sample, const DiffuseElement& ele)
......@@ -125,7 +113,7 @@ double Compute::roughMultiLayerContribution(const ReSample& re_sample, const Dif
double autocorr_sum = 0;
double crosscorr_sum = 0;
std::vector<SliceInterface> roughStack; // only slices with rough top interfaces
std::vector<Slice> roughStack; // only slices with rough top interfaces
std::vector<complex_t> rterm;
std::vector<complex_t> sterm;
......@@ -146,12 +134,12 @@ double Compute::roughMultiLayerContribution(const ReSample& re_sample, const Dif
// precompute autocorrelation terms
for (int i = n_interfaces - 1; i >= 0; i--) {
auto* autocorr_model = roughStack[i].topRoughness->autocorrelationModel();
auto* autocorr_model = roughStack[i].topRoughness()->autocorrelationModel();
if (auto* k_corr = dynamic_cast<const K_CorrelationModel*>(autocorr_model)) {
spectrum[i] = k_corr->spectralFunction(q);
} else if (auto* lin_growth = dynamic_cast<const LinearGrowthModel*>(autocorr_model)) {
ASSERT(i < int(n_interfaces - 1));
const double thickness = roughStack[i].hig - roughStack[i + 1].hig;
const double thickness = roughStack[i].hig() - roughStack[i + 1].hig();
spectrum[i] = lin_growth->spectralFunction(spectrum[i + 1], thickness, q);
}
}
......@@ -162,15 +150,15 @@ double Compute::roughMultiLayerContribution(const ReSample& re_sample, const Dif
// precompute crosscorrelation terms
for (int j = n_interfaces - 2; j >= 0; j--) {
const double thickness = roughStack[j].hig - roughStack[j + 1].hig;
const double thickness = roughStack[j].hig() - roughStack[j + 1].hig();
if (auto* spat_freq_cc = dynamic_cast<const SpatialFrequencyCrosscorrelation*>(
roughStack[j].topRoughness->crosscorrelationModel())) {
const double sigma_up = roughStack[j].topRoughness->sigma();
const double sigma_low = roughStack[j + 1].topRoughness->sigma();
roughStack[j].topRoughness()->crosscorrelationModel())) {
const double sigma_up = roughStack[j].topRoughness()->sigma();
const double sigma_low = roughStack[j + 1].topRoughness()->sigma();
crosscorr_with_interface_below[j] = spat_freq_cc->crosscorrSpectrum(
sigma_up, sigma_low, spectrum[j], spectrum[j + 1], thickness, q);
} else if (auto* lin_growth_autocorr = dynamic_cast<const LinearGrowthModel*>(
roughStack[j].topRoughness->autocorrelationModel())) {
roughStack[j].topRoughness()->autocorrelationModel())) {
crosscorr_with_interface_below[j] =
lin_growth_autocorr->crosscorrSpectrum(spectrum[j + 1], thickness, q);
}
......
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