BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
swigAPI Namespace Reference

Functions

std::pair< double, double > defaultMaterialProfileLimits (const MultiLayer &multilayer)
 Get default z limits for generating a material profile. More...
 
std::vector< double > generateZValues (int n_points, double z_min, double z_max)
 
std::vector< complex_tmaterialProfileSLD (const MultiLayer &multilayer, int n_points, double z_min, double z_max)
 Calculate average material profile for given multilayer. More...
 

Detailed Description

Functions that are only used in the swig *.i files

Function Documentation

◆ defaultMaterialProfileLimits()

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

Get default z limits for generating a material profile.

Definition at line 43 of file MultiLayerFuncs.cpp.

44 {
45  SimulationOptions options;
46  options.setUseAvgMaterials(true);
47  ProcessedSample sample(multilayer, options);
48  ProfileHelper helper(sample);
49  return helper.defaultLimits();
50 }
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:36
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 > swigAPI::generateZValues ( int  n_points,
double  z_min,
double  z_max 
)

Definition at line 20 of file MultiLayerFuncs.cpp.

21 {
22  std::vector<double> result;
23  if (n_points < 1)
24  return result;
25  double step = n_points > 1 ? (z_max - z_min) / (n_points - 1) : 0.0;
26  for (int i = 0; i < n_points; ++i) {
27  result.push_back(z_min + i * step);
28  }
29  return result;
30 }

Referenced by materialProfileSLD().

◆ materialProfileSLD()

std::vector< complex_t > swigAPI::materialProfileSLD ( const MultiLayer multilayer,
int  n_points,
double  z_min,
double  z_max 
)

Calculate average material profile for given multilayer.

Definition at line 32 of file MultiLayerFuncs.cpp.

34 {
35  SimulationOptions options;
36  options.setUseAvgMaterials(true);
37  ProcessedSample sample(multilayer, options);
38  ProfileHelper helper(sample);
39  std::vector<double> z_values = generateZValues(n_points, z_min, z_max);
40  return helper.calculateProfile(z_values);
41 }
std::vector< double > generateZValues(int n_points, double z_min, double z_max)

References ProfileHelper::calculateProfile(), generateZValues(), and SimulationOptions::setUseAvgMaterials().

Here is the call graph for this function: