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

comment zeroRoughness

parent 850c09b2
No related branches found
No related tags found
1 merge request!2729Move roughness from LayerInterface to Layer (#20)
Pipeline #163536 passed
......@@ -38,6 +38,9 @@ Layer::Layer(const Material& material, double thickness, const LayerRoughness* r
, m_thickness(thickness)
, m_roughness(roughness ? roughness->clone() : zeroRoughness())
{
// If the roughness is not defined by user, it is equivalent to the situation when roughness is
// defined, but has zero rms. To avoid constant nullptr checks in the code and to ease
// resampling it was accepted that "Layer" should always have non-null roughness descriptor.
ASSERT(m_roughness);
if (thickness < 0.)
throw std::runtime_error("Layer contructor called with negative thickness");
......
......@@ -75,7 +75,7 @@ private:
R3 m_B_field; //!< cached value of magnetic induction
double m_thickness; //!< layer thickness in nanometers
OwningVector<ParticleLayout> m_layouts; //!< independent layouts in this layer
std::unique_ptr<const LayerRoughness> m_roughness; //!< roughness of the top interface
std::unique_ptr<const LayerRoughness> m_roughness; //!< roughness of the top surface. Never null
unsigned int m_n_slices = 1; //!< number of slices to create for graded layer approach
#endif // SWIG
};
......
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