Standard Layers Domains#
Note
See the /examples/domains/standardLayers/ folder for an example of standard layers with domains.
In order to use domains, we create a project of the correct type….
problem = createProject(calcType='domains');
problem = RAT.Project(calculation='domains')
The principle of setting up these calculations relies on firstly grouping the layers into domains, then grouping the defined domains intro contrasts, according to a domain ratio parameter:

The example (in the examples folder), we define the layers as for conventional Standard Layers projects:
Layer1 = {'Layer 1',... % Name of the Layer
'L1 thick',... % Layer thickness
'L1 SLD',... % Layer SLD
'L1 Rough',... % Layer roughness
'L1 Hydr',... % hydration (percent)
'bulk out' };
Layer2 = {'Layer 2',... % Name of the layer
'L2 thick',... % Layer thickness
'L2 SLD',... % Layer SLD
'L2 Rough',... % Layer roughness
'L2 Hydr',... % hydration (percent)
'bulk out' };
Layer3 = {'Layer 3',... % Name of the layer
'L3 thick',... % Layer thickness
'L3 SLD',... % Layer SLD
'L3 Rough',... % Layer roughness
'L3 Hydr',... % hydration (percent)
'bulk out' };
problem.addLayerGroup({Layer1, Layer2, Layer3});
# Now group these parameters into layers
problem.layers.append(name='Layer 1',
thickness='L1 Thickness',
SLD='L1 SLD',
roughness='L1 Roughness',
hydration='L1 Hydration',
hydrate_with='bulk out')
problem.layers.append(name='Layer 2',
thickness='L2 Thickness',
SLD='L2 SLD',
roughness='L2 Roughness',
hydration='L2 Hydration',
hydrate_with='bulk out')
problem.layers.append(name='Layer 3',
thickness='L3 Thickness',
SLD='L3 SLD',
roughness='L3 Roughness',
hydration='L3 Hydration',
hydrate_with='bulk out')
p Name Thickness SLD Roughness Hydration Hydrate with
_ _________ ______________ ________ ______________ ______________ ____________
1 "Layer 1" "L1 Thickness" "L1 SLD" "L1 Roughness" "L1 Hydration" "bulk out"
2 "Layer 2" "L2 Thickness" "L2 SLD" "L2 Roughness" "L2 Hydration" "bulk out"
3 "Layer 3" "L3 Thickness" "L3 SLD" "L3 Roughness" "L3 Hydration" "bulk out"
+-------+--------------------+-----------------+------------------------+-----------------+-----------------+--------------+
| index | name | thickness | SLD | roughness | hydration | hydrate with |
+-------+--------------------+-----------------+------------------------+-----------------+-----------------+--------------+
| 0 | Hydrogenated Heads | Heads Thickness | Hydrogenated Heads SLD | Heads Roughness | Heads Hydration | bulk out |
| 1 | Deuterated Heads | Heads Thickness | Deuterated Heads SLD | Heads Roughness | Heads Hydration | bulk out |
| 2 | Hydrogenated Tails | Tails Thickness | Hydrogenated Tails SLD | Tails Roughness | | bulk out |
| 3 | Deuterated Tails | Tails Thickness | Deuterated Tails SLD | Tails Roughness | | bulk out |
+-------+--------------------+-----------------+------------------------+-----------------+-----------------+--------------+
From this point, the model diverges from the usual Standard Layers case, in that the layers are grouped into domain contrasts, which appear in an additional table in the
printout of the project class. Domains contrasts consist of only a model
containing layers, with no bulk phases etc.
p 1
___________________ ________________
"Name" "Domain Test"
"Data" "Simulation"
"Background" "Background 1"
"Background Action" "add"
"Bulk in" "SLD Air"
"Bulk out" "SLD D2O"
"Scalefactor" "Scalefactor 1"
"Resolution" "Resolution 1"
"Resample" "false"
"Repeat Layers" "1"
"Domain Ratio" "Domain Ratio 1"
"Model" "Domain1"
"" "Domain2"
+-------+--------------------+-----------------------+-----------------+-------------------+---------+----------+---------------+--------------+----------+--------------------+
| index | name | data | background | background action | bulk in | bulk out | scalefactor | resolution | resample | model |
+-------+--------------------+-----------------------+-----------------+-------------------+---------+----------+---------------+--------------+----------+--------------------+
| 0 | D-tail/H-Head/D2O | D-tail / H-head / D2O | Background D2O | add | SLD Air | SLD D2O | Scalefactor 1 | Resolution 1 | False | Deuterated Tails |
| | | | | | | | | | | Hydrogenated Heads |
| 1 | H-tail/D-Head/ACMW | D-tail / H-head / D2O | Background ACMW | add | SLD Air | SLD ACMW | Scalefactor 1 | Resolution 1 | False | Hydrogenated Tails |
| | | | | | | | | | | Deuterated Heads |
+-------+--------------------+-----------------------+-----------------+-------------------+---------+----------+---------------+--------------+----------+--------------------+
It is then these that are grouped into the final contrasts model. For each contrast, there must be exactly two (and only two) domain contrasts in the model. In addition, each contrast requires a domain ratio parameter. This is a fittable parameter between 0 and 1, that appears in the domain ratio table:
p Name Min Value Max Fit?
_ ________________ ___ _____ ___ _____
1 "Domain Ratio 1" 0.4 0.5 0.6 false
[]
leading to the final contrast structure of two domains, and one domain ratio:
p 1 2
_______ _________ _________
"Name" "Domain1" "Domain2"
"Model" "Layer 1" "Layer 2"
"" "" "Layer 3"
[]
Note
For the domain ratio, a value of 0 means 100% Domain 1, whilst conversely a value of 1 means 100% Domain 2.