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

clang-format

parent 5ecac1fd
No related branches found
No related tags found
1 merge request!153Replace Slice::m_thickness by Slice::m_zRange; simplify computations in ProfileHelper and ProcessedSample
Pipeline #40386 passed
......@@ -64,7 +64,7 @@ void RoughMultiLayerComputation::compute(SimulationElement& elem) const
sterm[i] = get_sum8terms(i, elem);
}
for (size_t i = 0; i + 1 < n_slices; i++) {
const LayerRoughness* rough = m_sample->avgeSlice(i+1).topRoughness();
const LayerRoughness* rough = m_sample->avgeSlice(i + 1).topRoughness();
if (rough)
autocorr += std::norm(rterm[i]) * std::norm(sterm[i]) * rough->getSpectralFun(q);
}
......@@ -121,7 +121,7 @@ complex_t RoughMultiLayerComputation::get_sum8terms(size_t ilayer,
const complex_t qz4_minus = -qz1_minus;
double sigma(0.0);
if (const LayerRoughness* roughness = m_sample->avgeSlice(ilayer+1).topRoughness())
if (const LayerRoughness* roughness = m_sample->avgeSlice(ilayer + 1).topRoughness())
sigma = roughness->getSigma();
const complex_t term1 = T_in_plus * T_out_plus * h_plus(qz1_plus * sigma);
const complex_t term2 = T_in_plus * R_out_plus * h_plus(qz2_plus * sigma);
......
......@@ -169,7 +169,7 @@ void ProcessedSample::initSlices(const MultiLayer& sample, const SimulationOptio
if (!slice_limits.isFinite() || N == 0) {
if (i == sample.numberOfLayers() - 1)
tl = 0.0;
if (i==0)
if (i == 0)
m_slices.addTopSlice(tl, *material);
else
m_slices.addSlice(tl, *material, roughness);
......
......@@ -23,8 +23,7 @@ Slice::Slice(const ZLimits& zRange, const Material& material, const kvector_t& B
{
}
Slice::Slice(const ZLimits& zRange, const Material& material)
: Slice(zRange, material, {}, nullptr)
Slice::Slice(const ZLimits& zRange, const Material& material) : Slice(zRange, material, {}, nullptr)
{
}
......
......@@ -24,14 +24,14 @@ void SliceStack::addTopSlice(double zbottom, const Material& material)
void SliceStack::addSlice(double thickness, const Material& material,
const LayerRoughness* roughness)
{
ASSERT(this->size()>0);
ASSERT(this->size() > 0);
double top = this->back().zBottom();
ASSERT(thickness>=0);
ASSERT(thickness >= 0);
std::unique_ptr<ZLimits> zRange;
if (thickness==0)
if (thickness == 0)
zRange = std::make_unique<ZLimits>(-ZLimits::inf, top);
else
zRange = std::make_unique<ZLimits>(top-thickness, top);
zRange = std::make_unique<ZLimits>(top - thickness, top);
if (roughness)
this->emplace_back(Slice(*zRange, material, *roughness));
else
......@@ -43,7 +43,7 @@ void SliceStack::addSlice(double thickness, const Material& material,
void SliceStack::addNSlices(size_t n, double thickness, const Material& material,
const LayerRoughness* roughness)
{
ASSERT(thickness>0);
ASSERT(thickness > 0);
ASSERT(n > 0);
const double slice_thickness = thickness / n;
addSlice(slice_thickness, material, roughness);
......
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