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
ab778d25
Commit
ab778d25
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
make iffHardDisk thread safe
parent
e2d3797b
No related branches found
No related tags found
1 merge request
!193
Make all of Sample thread safe
Pipeline
#41267
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sample/Aggregate/InterferenceFunctionHardDisk.cpp
+12
-15
12 additions, 15 deletions
Sample/Aggregate/InterferenceFunctionHardDisk.cpp
Sample/Aggregate/InterferenceFunctionHardDisk.h
+0
-3
0 additions, 3 deletions
Sample/Aggregate/InterferenceFunctionHardDisk.h
with
12 additions
and
18 deletions
Sample/Aggregate/InterferenceFunctionHardDisk.cpp
+
12
−
15
View file @
ab778d25
...
...
@@ -82,16 +82,19 @@ double InterferenceFunctionHardDisk::density() const
double
InterferenceFunctionHardDisk
::
iff_without_dw
(
const
kvector_t
q
)
const
{
double
qx
=
q
.
x
();
double
qy
=
q
.
y
();
m_q
=
2.0
*
std
::
sqrt
(
qx
*
qx
+
qy
*
qy
)
*
m_radius
;
m_
packing
=
packingRatio
();
m_
c_zero
=
Czero
(
m_
packing
);
m_
s2
=
S2
(
m_
packing
);
double
c_q
=
const
double
qx
=
q
.
x
();
const
double
qy
=
q
.
y
();
const
double
q2r
=
2.0
*
std
::
sqrt
(
qx
*
qx
+
qy
*
qy
)
*
m_radius
;
const
double
packing
=
packingRatio
();
const
double
c_zero
=
Czero
(
packing
);
const
double
s2
=
S2
(
packing
);
const
double
c_q
=
2.0
*
M_PI
*
RealIntegrator
().
integrate
([
&
](
double
x
)
->
double
{
return
integrand
(
x
);
},
0.0
,
1.0
);
double
rho
=
4.0
*
m_packing
/
M_PI
;
*
RealIntegrator
().
integrate
([
=
](
double
x
)
->
double
{
double
cx
=
c_zero
*
(
1.0
+
4.0
*
packing
*
(
W2
(
x
/
2.0
)
-
1.0
)
+
s2
*
x
);
return
x
*
cx
*
Math
::
Bessel
::
J0
(
q2r
*
x
);
},
0.0
,
1.0
);
const
double
rho
=
4.0
*
packing
/
M_PI
;
return
1.0
/
(
1.0
-
rho
*
c_q
);
}
...
...
@@ -99,9 +102,3 @@ double InterferenceFunctionHardDisk::packingRatio() const
{
return
M_PI
*
m_radius
*
m_radius
*
m_density
;
}
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
*
Math
::
Bessel
::
J0
(
m_q
*
x
);
}
This diff is collapsed.
Click to expand it.
Sample/Aggregate/InterferenceFunctionHardDisk.h
+
0
−
3
View file @
ab778d25
...
...
@@ -41,12 +41,9 @@ public:
private
:
double
iff_without_dw
(
const
kvector_t
q
)
const
override
;
double
packingRatio
()
const
;
double
integrand
(
double
x
)
const
;
double
m_radius
;
double
m_density
;
mutable
double
m_q
,
m_c_zero
,
m_s2
,
m_packing
;
};
#endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTIONHARDDISK_H
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