Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
40559ab6
Commit
40559ab6
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
repair known_slicing test: rm non-scattering simulation; print infos
parent
c2a67a84
No related branches found
No related tags found
1 merge request
!1223
meanRelativeDifference now detects empty data fields
Pipeline
#84272
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Py/Functional/known_slicing.py
+14
-30
14 additions, 30 deletions
Tests/Py/Functional/known_slicing.py
with
14 additions
and
30 deletions
Tests/Py/Functional/known_slicing.py
+
14
−
30
View file @
40559ab6
...
...
@@ -42,12 +42,12 @@ def get_sample(particle_to_air=None, particle_to_substrate=None):
class
SlicedSpheresTest
(
unittest
.
TestCase
):
def
testSphericalCupOnTopOfSubstrate
(
self
):
"""
print
(
"""
Simulation #1: truncated sphere on top of substrate.
Simulation #2: sphere crossing the interface.
Both particles are made of same material as substrate.
Same scattering expected from both sample models.
"""
"""
,
flush
=
True
)
# truncated sphere (dz removed from bottom) on top of substrate
truncatedSphere
=
ba
.
Particle
(
matSubstrate
,
...
...
@@ -62,10 +62,10 @@ class SlicedSpheresTest(unittest.TestCase):
self
.
assertLess
(
diff
,
1e-15
)
def
testSphericalLacuneInSubstrate
(
self
):
"""
print
(
"""
Similar to previous. Truncated sphere and sphere are made of vacuum material.
From scattering point of view, both cases should look like an vacuum lacune in substrate.
"""
"""
,
flush
=
True
)
# Sphere truncated from top. Intended to go below interface.
truncatedSphere
=
ba
.
Particle
(
matVacuum
,
...
...
@@ -81,10 +81,10 @@ class SlicedSpheresTest(unittest.TestCase):
self
.
assertLess
(
diff
,
1e-15
)
def
testSpheresCrossingInterface
(
self
):
"""
print
(
"""
Same particle in same position, but attached to two different layers.
Of course, results shall be identical.
"""
"""
,
flush
=
True
)
# Sphere intended for vacuum layer and crossing interface
sphere1
=
ba
.
Particle
(
matParticle
,
ba
.
Sphere
(
R
))
...
...
@@ -139,12 +139,12 @@ class SlicedSpheresTest(unittest.TestCase):
return
result
def
testCompound
(
self
):
"""
print
(
"""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle on top of substrate
Simulation #2: spherical compound on top of substrate, where
top and bottom are made of same material.
"""
"""
,
flush
=
True
)
sphere
=
ba
.
Particle
(
matParticle
,
ba
.
Sphere
(
R
))
compound
=
self
.
get_compound
(
matParticle
,
matParticle
)
...
...
@@ -154,11 +154,11 @@ class SlicedSpheresTest(unittest.TestCase):
self
.
assertLess
(
diff
,
2e-14
)
def
testCompoundBuilds
(
self
):
"""
print
(
"""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle compound on top of substrate
Simulation #2: same, but made using rotation
"""
"""
,
flush
=
True
)
compound1
=
self
.
get_compound
(
matParticle
,
matSubstrate
)
compound2
=
self
.
get_compound_v2
(
matParticle
,
matSubstrate
)
...
...
@@ -167,30 +167,14 @@ class SlicedSpheresTest(unittest.TestCase):
get_sample
(
compound2
))
self
.
assertLess
(
diff
,
1e-14
)
def
testInvisibleCompound
(
self
):
"""
Compares two simulation intended to provide identical results.
Simulation #1: no particles at all
Simulation #2: spherical compound on top of substrate crossing the interface
Bottom part of compound is made of substrate material, top part from
vacuum layer material.
"""
compound
=
self
.
get_compound
(
matVacuum
,
matSubstrate
)
compound
.
translate
(
0
,
0
,
-
dz
)
diff
=
infrastruct
.
diff_MiniGISAS
(
get_sample
(),
get_sample
(
compound
))
self
.
assertLess
(
diff
,
1e-14
)
def
testSlicedCompound
(
self
):
"""
print
(
"""
Compares two simulation intended to provide identical results.
Simulation #1: spherical particle on top of substrate.
Simulation #2: spherical compound on top of substrate,
where top and bottom are made of same material.
Both particles are inserted in vacuum layer with shift to go below interface
"""
"""
,
flush
=
True
)
shift
=
3.0
...
...
@@ -205,13 +189,13 @@ class SlicedSpheresTest(unittest.TestCase):
self
.
assertLess
(
diff
,
1e-14
)
def
testSphericalCupOnTopOfSubstrate
(
self
):
"""
print
(
"""
Compares two simulation intended to provide identical results.
Simulation #1: truncated sphere on top of substrate.
Simulation #2: spherical particle compound crossing the interface.
Bottom part of compound is made from substrate material.
both cases should look like a truncated sphere on top of substrate.
"""
"""
,
flush
=
True
)
# truncated sphere on top of substrate with height 16nm
truncatedSphere
=
ba
.
Particle
(
matParticle
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment