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
b85f78be
Commit
b85f78be
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ZLimits preferred API: zBottom, zTop
parent
73c218b4
No related branches found
No related tags found
1 merge request
!134
simplify ZLimits
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sample/Scattering/IFormFactor.cpp
+8
-14
8 additions, 14 deletions
Sample/Scattering/IFormFactor.cpp
Sample/Scattering/ZLimits.h
+3
-0
3 additions, 0 deletions
Sample/Scattering/ZLimits.h
with
11 additions
and
14 deletions
Sample/Scattering/IFormFactor.cpp
+
8
−
14
View file @
b85f78be
...
...
@@ -24,34 +24,28 @@
#include
<utility>
namespace
{
bool
shapeIsContainedInLimits
(
const
IFormFactor
&
formfactor
,
ZLimits
limits
,
const
IRotation
&
rot
,
kvector_t
translation
)
{
double
zbottom
=
formfactor
.
bottomZ
(
rot
)
+
translation
.
z
();
double
ztop
=
formfactor
.
topZ
(
rot
)
+
translation
.
z
();
OneSidedLimit
lower_limit
=
limits
.
lowerZLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperZLimit
();
if
(
!
upper_limit
.
m_limitless
&&
ztop
>
upper_limit
.
m_limit_z
)
return
false
;
if
(
!
lower_limit
.
m_limitless
&&
zbottom
<
lower_limit
.
m_limit_z
)
return
false
;
return
true
;
return
limits
.
zBottom
()
<=
zbottom
&&
ztop
<=
limits
.
zTop
();
}
bool
shapeOutsideLimits
(
const
IFormFactor
&
formfactor
,
ZLimits
limits
,
const
IRotation
&
rot
,
kvector_t
translation
)
{
double
zbottom
=
formfactor
.
bottomZ
(
rot
)
+
translation
.
z
();
double
ztop
=
formfactor
.
topZ
(
rot
)
+
translation
.
z
();
OneSidedLimit
lower_limit
=
limits
.
lowerZLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperZLimit
();
if
(
!
upper_limit
.
m_limitless
&&
zbottom
>=
upper_limit
.
m_limit_z
)
return
true
;
if
(
!
lower_limit
.
m_limitless
&&
ztop
<=
lower_limit
.
m_limit_z
)
return
true
;
return
false
;
return
ztop
<=
limits
.
zBottom
()
||
zbottom
>=
limits
.
zTop
();
}
}
// namespace
IFormFactor
::
IFormFactor
(
const
NodeMeta
&
meta
,
const
std
::
vector
<
double
>&
PValues
)
:
ISampleNode
(
meta
,
PValues
),
m_nodeMeta
(
meta
)
{
...
...
This diff is collapsed.
Click to expand it.
Sample/Scattering/ZLimits.h
+
3
−
0
View file @
b85f78be
...
...
@@ -51,6 +51,9 @@ public:
bool
isFinite
()
const
;
double
zBottom
()
const
{
return
m_zmin
;
}
double
zTop
()
const
{
return
m_zmax
;
}
OneSidedLimit
lowerZLimit
()
const
;
OneSidedLimit
upperZLimit
()
const
;
...
...
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