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
88eef2dd
Commit
88eef2dd
authored
6 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
Move functions to unnamed namespace
parent
37a099e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/Aggregate/InterferenceFunctionHardDisk.cpp
+15
-10
15 additions, 10 deletions
Core/Aggregate/InterferenceFunctionHardDisk.cpp
Core/Aggregate/InterferenceFunctionHardDisk.h
+0
-3
0 additions, 3 deletions
Core/Aggregate/InterferenceFunctionHardDisk.h
with
15 additions
and
13 deletions
Core/Aggregate/InterferenceFunctionHardDisk.cpp
+
15
−
10
View file @
88eef2dd
...
...
@@ -22,6 +22,9 @@
namespace
{
static
const
double
p
=
7.0
/
3.0
-
4.0
*
std
::
sqrt
(
3.0
)
/
M_PI
;
double
Czero
(
double
packing
);
double
S2
(
double
packing
);
double
W2
(
double
x
);
}
InterferenceFunctionHardDisk
::
InterferenceFunctionHardDisk
(
double
radius
,
double
density
)
...
...
@@ -60,8 +63,8 @@ double InterferenceFunctionHardDisk::iff_without_dw(const kvector_t q) const
double
qy
=
q
.
y
();
m_q
=
2.0
*
std
::
sqrt
(
qx
*
qx
+
qy
*
qy
)
*
m_radius
;
m_packing
=
packingRatio
();
m_c_zero
=
c_
zero
(
m_packing
);
m_s2
=
s
2
(
m_packing
);
m_c_zero
=
C
zero
(
m_packing
);
m_s2
=
S
2
(
m_packing
);
double
c_q
=
2.0
*
M_PI
*
mP_integrator
->
integrate
(
0.0
,
1.0
);
double
rho
=
4.0
*
m_packing
/
M_PI
;
return
1.0
/
(
1.0
-
rho
*
c_q
);
...
...
@@ -89,14 +92,21 @@ double InterferenceFunctionHardDisk::packingRatio() const
return
M_PI
*
m_radius
*
m_radius
*
m_density
;
}
double
InterferenceFunctionHardDisk
::
c_zero
(
double
packing
)
const
double
InterferenceFunctionHardDisk
::
integrand
(
double
x
)
const
{
double
cx
=
m_c_zero
*
(
1.0
+
4.0
*
m_packing
*
(
W2
(
x
/
2.0
)
-
1.0
)
+
m_s2
*
x
);
return
x
*
cx
*
MathFunctions
::
Bessel_J0
(
m_q
*
x
);
}
namespace
{
double
Czero
(
double
packing
)
{
double
numerator
=
1.0
+
packing
+
3.0
*
p
*
packing
*
packing
-
p
*
std
::
pow
(
packing
,
3
);
double
denominator
=
std
::
pow
(
1.0
-
packing
,
3
);
return
-
numerator
/
denominator
;
}
double
InterferenceFunctionHardDisk
::
s
2
(
double
packing
)
const
double
S
2
(
double
packing
)
{
double
factor
=
3.0
*
packing
*
packing
/
8.0
;
double
numerator
=
8.0
*
(
1.0
-
2.0
*
p
)
+
(
25.0
-
9.0
*
p
)
*
p
*
packing
-
(
7.0
-
3.0
*
p
)
*
p
*
packing
*
packing
;
...
...
@@ -104,13 +114,8 @@ double InterferenceFunctionHardDisk::s2(double packing) const
return
factor
*
numerator
/
denominator
;
}
double
InterferenceFunctionHardDisk
::
w
2
(
double
x
)
const
double
W
2
(
double
x
)
{
return
2.0
*
(
std
::
acos
(
x
)
-
x
*
std
::
sqrt
(
1.0
-
x
*
x
))
/
M_PI
;
}
double
InterferenceFunctionHardDisk
::
integrand
(
double
x
)
const
{
double
cx
=
m_c_zero
*
(
1.0
+
4.0
*
m_packing
*
(
w2
(
x
/
2.0
)
-
1.0
)
+
m_s2
*
x
);
return
x
*
cx
*
MathFunctions
::
Bessel_J0
(
m_q
*
x
);
}
This diff is collapsed.
Click to expand it.
Core/Aggregate/InterferenceFunctionHardDisk.h
+
0
−
3
View file @
88eef2dd
...
...
@@ -46,9 +46,6 @@ private:
void
init_parameters
();
void
validateParameters
()
const
;
double
packingRatio
()
const
;
double
c_zero
(
double
packing
)
const
;
double
s2
(
double
packing
)
const
;
double
w2
(
double
x
)
const
;
double
integrand
(
double
x
)
const
;
double
m_radius
;
double
m_density
;
...
...
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