BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
LayerFillLimits.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file Sample/Scattering/LayerFillLimits.h
6
//! @brief Defines class LayerFillLimits.
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************************************
14
15
#ifdef SWIG
16
#error no need to expose this header to Swig
17
#endif
18
19
#ifndef USER_API
20
#ifndef BORNAGAIN_SAMPLE_SCATTERING_LAYERFILLLIMITS_H
21
#define BORNAGAIN_SAMPLE_SCATTERING_LAYERFILLLIMITS_H
22
23
#include "
Sample/Scattering/ZLimits.h
"
24
#include <cstddef>
25
#include <utility>
26
#include <vector>
27
28
//! Helper class for the graded layer approximation. Generates limits for each layer, indicating
29
//! the region of the layer (along z) that contains particle(s)
30
//!
31
//! The constructor takes the bottom layer z-coordinates as parameter. This means that for N
32
//! layers, only N-1 coordinates need to be passed (the last layer is assumed to be semi-infinite).
33
//! @ingroup algorithms_internal
34
35
class
LayerFillLimits
{
36
public
:
37
LayerFillLimits
(std::vector<double> layers_bottomz);
38
39
//! Particle limits are given in global coordinates
40
void
update
(
ParticleLimits
particle_limits,
double
offset = 0.0);
41
42
//! Returns the filled region limits for each layer (in local layer coordinates)
43
std::vector<ZLimits>
layerZLimits
()
const
;
44
45
private
:
46
size_t
layerIndexTop
(
double
top_z)
const
;
47
size_t
layerIndexBottom
(
double
bottom_z)
const
;
48
void
updateLayerLimits
(
size_t
i_layer,
ZLimits
limits);
49
std::vector<double>
m_layers_bottomz
;
50
std::vector<ZLimits>
m_layer_fill_limits
;
51
};
52
53
#endif
// BORNAGAIN_SAMPLE_SCATTERING_LAYERFILLLIMITS_H
54
#endif
// USER_API
ZLimits.h
Defines class ZLimits.
LayerFillLimits
Helper class for the graded layer approximation.
Definition:
LayerFillLimits.h:35
LayerFillLimits::LayerFillLimits
LayerFillLimits(std::vector< double > layers_bottomz)
Definition:
LayerFillLimits.cpp:23
LayerFillLimits::m_layer_fill_limits
std::vector< ZLimits > m_layer_fill_limits
Definition:
LayerFillLimits.h:50
LayerFillLimits::layerZLimits
std::vector< ZLimits > layerZLimits() const
Returns the filled region limits for each layer (in local layer coordinates)
Definition:
LayerFillLimits.cpp:47
LayerFillLimits::m_layers_bottomz
std::vector< double > m_layers_bottomz
Definition:
LayerFillLimits.h:49
LayerFillLimits::updateLayerLimits
void updateLayerLimits(size_t i_layer, ZLimits limits)
Definition:
LayerFillLimits.cpp:73
LayerFillLimits::update
void update(ParticleLimits particle_limits, double offset=0.0)
Particle limits are given in global coordinates.
Definition:
LayerFillLimits.cpp:29
LayerFillLimits::layerIndexTop
size_t layerIndexTop(double top_z) const
Definition:
LayerFillLimits.cpp:52
LayerFillLimits::layerIndexBottom
size_t layerIndexBottom(double bottom_z) const
Definition:
LayerFillLimits.cpp:62
ZLimits
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition:
ZLimits.h:45
ParticleLimits
Vertical extension of a particle, specified by bottom and top z coordinate.
Definition:
ZLimits.h:26
Sample
Scattering
LayerFillLimits.h
Generated by
1.9.1