Class MultiLayer (toplevel sample model)

In BornAgain, for the time being, a sample is always represented by an instance of class MultiLayer, even if it is a single-layer SAS sample.

Create an instance and add layers

The sample is created by the constructor call

sample = ba.MultiLayer()

Layers are then added using either of

sample.addLayer(layer)
sample.addLayerWithTopRoughness(layer, roughness)

For the arguments, see sections Layer and Roughness.

The layer added first is the top layer (typically vacuum). The layer added last is the bottom layer (typically substrate).

Set properties

Global properties of the sample are set through the following functions:

sample.setRoughnessModel(roughnessModel)

which takes an argument of type RoughnessModel;

sample.setCrossCorrLength(crossCorrLength)

where the argument is the vertical roughness correlation length in nm;

sample.setExternalField(ext_field);

where the argument is the external magnetic field in A/m.