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
3d9a1eab
Commit
3d9a1eab
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
local namespace -> top of source file
parent
577ae2a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sample/Scattering/IFormFactor.cpp
+29
-36
29 additions, 36 deletions
Sample/Scattering/IFormFactor.cpp
with
29 additions
and
36 deletions
Sample/Scattering/IFormFactor.cpp
+
29
−
36
View file @
3d9a1eab
...
@@ -22,12 +22,35 @@
...
@@ -22,12 +22,35 @@
namespace
namespace
{
{
bool
ShapeIsContainedInLimits
(
const
IFormFactor
&
formfactor
,
ZLimits
limits
,
const
IRotation
&
rot
,
bool
shapeIsContainedInLimits
(
const
IFormFactor
&
formfactor
,
ZLimits
limits
,
const
IRotation
&
rot
,
kvector_t
translation
);
kvector_t
translation
)
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
.
lowerLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperLimit
();
if
(
!
upper_limit
.
m_limitless
&&
ztop
>
upper_limit
.
m_value
)
return
false
;
if
(
!
lower_limit
.
m_limitless
&&
zbottom
<
lower_limit
.
m_value
)
return
false
;
return
true
;
}
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
.
lowerLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperLimit
();
if
(
!
upper_limit
.
m_limitless
&&
zbottom
>=
upper_limit
.
m_value
)
return
true
;
if
(
!
lower_limit
.
m_limitless
&&
ztop
<=
lower_limit
.
m_value
)
return
true
;
return
false
;
}
}
// namespace
}
// namespace
IFormFactor
::
IFormFactor
(
const
NodeMeta
&
meta
,
const
std
::
vector
<
double
>&
PValues
)
IFormFactor
::
IFormFactor
(
const
NodeMeta
&
meta
,
const
std
::
vector
<
double
>&
PValues
)
:
ISample
(
meta
,
PValues
)
:
ISample
(
meta
,
PValues
)
{
{
...
@@ -36,9 +59,9 @@ IFormFactor::IFormFactor(const NodeMeta& meta, const std::vector<double>& PValue
...
@@ -36,9 +59,9 @@ IFormFactor::IFormFactor(const NodeMeta& meta, const std::vector<double>& PValue
IFormFactor
*
IFormFactor
::
createSlicedFormFactor
(
ZLimits
limits
,
const
IRotation
&
rot
,
IFormFactor
*
IFormFactor
::
createSlicedFormFactor
(
ZLimits
limits
,
const
IRotation
&
rot
,
kvector_t
translation
)
const
kvector_t
translation
)
const
{
{
if
(
S
hapeIsContainedInLimits
(
*
this
,
limits
,
rot
,
translation
))
if
(
s
hapeIsContainedInLimits
(
*
this
,
limits
,
rot
,
translation
))
return
createTransformedFormFactor
(
*
this
,
rot
,
translation
);
return
createTransformedFormFactor
(
*
this
,
rot
,
translation
);
if
(
S
hapeOutsideLimits
(
*
this
,
limits
,
rot
,
translation
))
if
(
s
hapeOutsideLimits
(
*
this
,
limits
,
rot
,
translation
))
return
nullptr
;
return
nullptr
;
if
(
canSliceAnalytically
(
rot
))
if
(
canSliceAnalytically
(
rot
))
return
sliceFormFactor
(
limits
,
rot
,
translation
);
return
sliceFormFactor
(
limits
,
rot
,
translation
);
...
@@ -89,33 +112,3 @@ IFormFactor* createTransformedFormFactor(const IFormFactor& formfactor, const IR
...
@@ -89,33 +112,3 @@ IFormFactor* createTransformedFormFactor(const IFormFactor& formfactor, const IR
std
::
swap
(
P_fftemp
,
P_result
);
std
::
swap
(
P_fftemp
,
P_result
);
return
P_result
.
release
();
return
P_result
.
release
();
}
}
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
.
lowerLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperLimit
();
if
(
!
upper_limit
.
m_limitless
&&
ztop
>
upper_limit
.
m_value
)
return
false
;
if
(
!
lower_limit
.
m_limitless
&&
zbottom
<
lower_limit
.
m_value
)
return
false
;
return
true
;
}
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
.
lowerLimit
();
OneSidedLimit
upper_limit
=
limits
.
upperLimit
();
if
(
!
upper_limit
.
m_limitless
&&
zbottom
>=
upper_limit
.
m_value
)
return
true
;
if
(
!
lower_limit
.
m_limitless
&&
ztop
<=
lower_limit
.
m_value
)
return
true
;
return
false
;
}
}
// namespace
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