25 const std::vector<Slice>& slices,
double z_ref);
28 double SliceTopZ(
size_t i,
const std::vector<Slice>& slices);
30 void ScaleRegions(std::vector<HomogeneousRegion>& regions,
double factor);
34 const std::vector<Slice>& slices,
39 for (
auto p_particle : particles) {
49 bool single_layer = (slice_indices.first == slice_indices.second);
50 for (
size_t i = slice_indices.first; i < slice_indices.second + 1; ++i) {
52 kvector_t translation(0.0, 0.0, z_ref - z_top_i);
57 m_ff_list.emplace_back(std::move(sliced_particle.mP_slicedff), i);
58 double thickness = slices[i].thickness();
62 sliced_particle.m_regions.end());
75 throw std::out_of_range(
"SlicedFormFactorList::operator[] error: "
76 "index out of range");
88 const std::vector<Slice>& slices,
double z_ref)
91 double zbottom = bottomTopZ.
m_bottom;
92 double ztop = bottomTopZ.m_top;
93 double eps = (ztop - zbottom) * 1e-6;
95 double zmax = ztop + z_ref -
eps;
96 double zmin = zbottom + z_ref +
eps;
99 if (top_index > bottom_index)
100 top_index = bottom_index;
101 return {top_index, bottom_index};
106 auto n_layers = slices.size();
107 if (n_layers < 2 || z > 0.0)
109 double z_layer_bottom = 0.0;
111 while (i_slice + 1 < n_layers) {
113 z_layer_bottom -= slices[i_slice].thickness();
114 if (z > z_layer_bottom)
122 auto n_layers = slices.size();
123 if (n_layers < 2 || z >= 0.0)
125 double z_layer_bottom = 0.0;
127 while (i_slice + 1 < n_layers) {
129 z_layer_bottom -= slices[i_slice].thickness();
130 if (z >= z_layer_bottom)
136 double SliceTopZ(
size_t i,
const std::vector<Slice>& slices)
141 for (
size_t j = 1; j < i; ++j)
142 top_z -= slices[j].thickness();
148 size_t N = slices.size();
151 if (slice_index == 0)
152 return ZLimits({
false, 0}, {
true, 0});
153 if (slice_index == N - 1)
154 return ZLimits({
true, 0}, {
false, 0});
155 double thickness = slices[slice_index].thickness();
156 return ZLimits(-thickness, 0.0);
159 void ScaleRegions(std::vector<HomogeneousRegion>& regions,
double factor)
161 for (
auto& region : regions)
162 region.m_volume *= factor;
Defines interface IParticle.
Defines IRotation classes.
Defines class SlicedParticle.
Pure virtual base class for Particle, ParticleComposition, ParticleCoreShell, MesoCrystal.
void translate(kvector_t translation) override final
Translates the particle.
virtual SafePointerVector< IParticle > decompose() const
Decompose in constituent IParticle objects.
virtual SlicedParticle createSlicedParticle(ZLimits limits) const
Creates a sliced form factor for this particle.
virtual ParticleLimits bottomTopZ() const
Top and bottom z-coordinate.
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.