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
a48dd44b
Commit
a48dd44b
authored
9 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
precompute two factors
parent
7949d382
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/FormFactors/FormFactorRipple1.cpp
+8
-8
8 additions, 8 deletions
Core/FormFactors/FormFactorRipple1.cpp
Core/FormFactors/FormFactorRipple1.h
+3
-5
3 additions, 5 deletions
Core/FormFactors/FormFactorRipple1.h
with
11 additions
and
13 deletions
Core/FormFactors/FormFactorRipple1.cpp
+
8
−
8
View file @
a48dd44b
...
...
@@ -80,29 +80,29 @@ double FormFactorRipple1::getRadius() const
//! Integrand for complex formfactor.
complex_t
FormFactorRipple1
::
Integrand
(
double
Z
)
const
{
complex_t
iqZ
=
I
*
m_q
.
z
()
*
Z
;
complex_t
aa
=
std
::
acos
(
2.0
*
Z
/
m_height
-
1.0
);
return
std
::
exp
(
iq
Z
)
*
aa
*
MathFunctions
::
sinc
(
aa
*
m_q
.
y
()
*
m_width
/
(
Units
::
PI2
)
);
return
std
::
exp
(
m_az
*
Z
)
*
aa
*
MathFunctions
::
sinc
(
m_ay
*
aa
);
}
//! Complex formfactor.
complex_t
FormFactorRipple1
::
evaluate_for_q
(
const
cvector_t
&
q
)
const
{
m_q
=
q
;
complex_t
factor
=
m_length
*
MathFunctions
::
sinc
(
m_q
.
x
()
*
m_length
*
0.5
)
*
m_width
/
Units
::
PI
;
complex_t
factor
=
m_length
*
MathFunctions
::
sinc
(
q
.
x
()
*
m_length
*
0.5
)
*
m_width
/
Units
::
PI
;
// analytical expressions for some particular cases
if
(
m_
q
.
z
()
==
0.
)
{
if
(
m_
q
.
y
()
==
0.
)
if
(
q
.
z
()
==
0.
)
{
if
(
q
.
y
()
==
0.
)
return
factor
*
Units
::
PID2
*
m_height
;
complex_t
aaa
=
m_
q
.
y
()
*
m_width
/
(
Units
::
PI2
);
complex_t
aaa
=
q
.
y
()
*
m_width
/
(
Units
::
PI2
);
complex_t
aaa2
=
aaa
*
aaa
;
if
(
aaa2
==
1.
)
return
factor
*
Units
::
PID4
*
m_height
;
return
factor
*
Units
::
PID2
*
m_height
*
MathFunctions
::
sinc
(
m_
q
.
y
()
*
m_width
*
0.5
)
/
(
1.0
-
aaa2
);
return
factor
*
Units
::
PID2
*
m_height
*
MathFunctions
::
sinc
(
q
.
y
()
*
m_width
*
0.5
)
/
(
1.0
-
aaa2
);
}
// numerical integration otherwise
m_ay
=
q
.
y
()
*
m_width
/
Units
::
PI2
;
m_az
=
I
*
q
.
z
();
complex_t
integral
=
mP_integrator
->
integrate
(
0
,
m_height
);
return
factor
*
integral
;
}
This diff is collapsed.
Click to expand it.
Core/FormFactors/FormFactorRipple1.h
+
3
−
5
View file @
a48dd44b
...
...
@@ -35,7 +35,6 @@ public:
//! @param width of cosine cross section
//! @param height of cosine cross section
FormFactorRipple1
(
double
length
,
double
width
,
double
height
);
virtual
~
FormFactorRipple1
();
virtual
FormFactorRipple1
*
clone
()
const
;
...
...
@@ -43,11 +42,8 @@ public:
virtual
void
accept
(
ISampleVisitor
*
visitor
)
const
;
virtual
double
getRadius
()
const
;
double
getHeight
()
const
;
double
getWidth
()
const
;
double
getLength
()
const
;
virtual
complex_t
evaluate_for_q
(
const
cvector_t
&
q
)
const
;
...
...
@@ -62,7 +58,9 @@ private:
double
m_width
;
double
m_height
;
double
m_length
;
mutable
cvector_t
m_q
;
mutable
complex_t
m_ay
;
mutable
complex_t
m_az
;
#ifndef GCCXML_SKIP_THIS
std
::
unique_ptr
<
IntegratorComplex
<
FormFactorRipple1
>>
mP_integrator
;
...
...
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