BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MultiLayerFuncs.cpp File Reference
Include dependency graph for MultiLayerFuncs.cpp:

Go to the source code of this file.

Functions

std::vector< complex_tMaterialProfile (const MultiLayer &multilayer, int n_points, double z_min, double z_max)
 
std::pair< double, double > DefaultMaterialProfileLimits (const MultiLayer &multilayer)
 
std::vector< double > GenerateZValues (int n_points, double z_min, double z_max)
 

Detailed Description

Global functions related to MultiLayers.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file MultiLayerFuncs.cpp.

Function Documentation

◆ DefaultMaterialProfileLimits()

std::pair<double, double> DefaultMaterialProfileLimits ( const MultiLayer multilayer)

Get default z limits for generating a material profile.

Definition at line 31 of file MultiLayerFuncs.cpp.

32 {
33  SimulationOptions options;
34  options.setUseAvgMaterials(true);
35  ProcessedSample sample(multilayer, options);
36  ProfileHelper helper(sample);
37  return helper.defaultLimits();
38 }
Data structure that contains all the necessary data for scattering calculations.
Object that can generate the material profile of a sample as a function of depth.
Definition: ProfileHelper.h:32
Collect the different options for simulation.
void setUseAvgMaterials(bool use_avg_materials)

References ProfileHelper::defaultLimits(), and SimulationOptions::setUseAvgMaterials().

Here is the call graph for this function:

◆ GenerateZValues()

std::vector<double> GenerateZValues ( int  n_points,
double  z_min,
double  z_max 
)

Generate z values (equidistant) for use in MaterialProfile.

Definition at line 40 of file MultiLayerFuncs.cpp.

41 {
42  std::vector<double> result;
43  if (n_points < 1)
44  return result;
45  double step = n_points > 1 ? (z_max - z_min) / (n_points - 1) : 0.0;
46  for (int i = 0; i < n_points; ++i) {
47  result.push_back(z_min + i * step);
48  }
49  return result;
50 }

Referenced by MaterialProfile().