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
Merge requests
!1145
Optimize integrands in form factor quadrature
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Optimize integrands in form factor quadrature
hemi
into
main
Overview
0
Commits
13
Pipelines
4
Changes
1
Merged
Wuttke, Joachim
requested to merge
hemi
into
main
2 years ago
Overview
0
Commits
13
Pipelines
4
Changes
1
Expand
0
0
Merge request reports
Viewing commit
1109ff9e
Prev
Next
Show latest version
1 file
+
9
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1109ff9e
little optimization for Cone
· 1109ff9e
Wuttke, Joachim
authored
2 years ago
Sample/HardParticle/Cone.cpp
+
9
−
7
Options
@@ -38,23 +38,25 @@ Cone::Cone(double radius, double height, double alpha)
complex_t
Cone
::
formfactor_at_bottom
(
C3
q
)
const
{
ASSERT
(
m_validated
);
const
double
R
=
m_radius
;
const
double
H
=
m_height
;
if
(
std
::
abs
(
q
.
mag
())
<
std
::
numeric_limits
<
double
>::
epsilon
())
{
double
R
=
m_radius
;
double
H
=
m_height
;
if
(
m_cot_alpha
==
0.0
)
return
M_PI
*
R
*
R
*
H
;
// cylinder case
double
R2
=
R
-
H
*
m_cot_alpha
;
double
apex_height
=
R
/
m_cot_alpha
;
return
M_PI
/
3.
*
(
R
*
R
*
H
+
(
R
*
R
-
R2
*
R2
)
*
(
apex_height
-
H
));
}
complex_t
integral
=
ComplexIntegrator
().
integrate
(
const
complex_t
q_p
=
std
::
sqrt
(
q
.
x
()
*
q
.
x
()
+
q
.
y
()
*
q
.
y
());
return
M_TWOPI
*
ComplexIntegrator
().
integrate
(
[
=
](
double
Z
)
{
double
Rz
=
m_radius
-
Z
*
m_cot_alpha
;
complex_t
q_p
=
std
::
sqrt
(
q
.
x
()
*
q
.
x
()
+
q
.
y
()
*
q
.
y
());
// sqrt(x*x + y*y)
const
double
Rz
=
R
-
Z
*
m_cot_alpha
;
return
Rz
*
Rz
*
Math
::
Bessel
::
J1c
(
q_p
*
Rz
)
*
exp_I
(
q
.
z
()
*
Z
);
},
0.
,
m_height
);
return
M_TWOPI
*
integral
;
0.
,
H
);
}
std
::
string
Cone
::
validate
()
const
Loading