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
338373bf
Commit
338373bf
authored
11 years ago
by
Ganeva, Marina
Browse files
Options
Downloads
Plain Diff
Merge branch 'ripple2analytical' into develop
parents
e721993d
22a85fd0
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/inc/FormFactorRipple2.h
+1
-4
1 addition, 4 deletions
Core/FormFactors/inc/FormFactorRipple2.h
Core/FormFactors/src/FormFactorRipple2.cpp
+21
-16
21 additions, 16 deletions
Core/FormFactors/src/FormFactorRipple2.cpp
with
22 additions
and
20 deletions
Core/FormFactors/inc/FormFactorRipple2.h
+
1
−
4
View file @
338373bf
...
...
@@ -29,7 +29,7 @@ class BA_CORE_API_ FormFactorRipple2 : public IFormFactorBorn
public:
FormFactorRipple2
(
double
width
,
double
height
,
double
length
,
double
asymetry
);
~
FormFactorRipple2
()
{
delete
m_integrator
;
}
~
FormFactorRipple2
()
{
}
virtual
FormFactorRipple2
*
clone
()
const
;
...
...
@@ -45,7 +45,6 @@ public:
virtual
complex_t
evaluate_for_q
(
const
cvector_t
&
q
)
const
;
private
:
complex_t
Integrand
(
double
Z
,
void
*
params
)
const
;
virtual
void
init_parameters
();
...
...
@@ -54,8 +53,6 @@ private:
double
m_length
;
double
m_d
;
mutable
cvector_t
m_q
;
MemberComplexFunctionIntegrator
<
FormFactorRipple2
>
*
m_integrator
;
};
#endif // FORMFACTORSPHERE_H
...
...
This diff is collapsed.
Click to expand it.
Core/FormFactors/src/FormFactorRipple2.cpp
+
21
−
16
View file @
338373bf
...
...
@@ -32,11 +32,6 @@ FormFactorRipple2::FormFactorRipple2(double width, double height, double length,
assert
(
m_width
>=
2.
*
m_d
);
assert
(
m_height
>
0
);
init_parameters
();
MemberComplexFunctionIntegrator
<
FormFactorRipple2
>::
mem_function
p_mf
=
&
FormFactorRipple2
::
Integrand
;
m_integrator
=
new
MemberComplexFunctionIntegrator
<
FormFactorRipple2
>
(
p_mf
,
this
);
}
void
FormFactorRipple2
::
init_parameters
()
...
...
@@ -56,23 +51,33 @@ FormFactorRipple2 *FormFactorRipple2::clone() const
}
//! Integrand for complex formfactor.
complex_t
FormFactorRipple2
::
Integrand
(
double
Z
,
void
*
params
)
const
{
(
void
)
params
;
// to avoid unused-variable warning
complex_t
p1
=
(
1.0
-
Z
/
m_height
)
*
MathFunctions
::
Sinc
(
m_q
.
y
()
*
m_width
*
0.5
*
(
1.0
-
Z
/
m_height
));
return
p1
*
std
::
exp
(
complex_t
(
0.0
,
1.0
)
*
(
-
1.0
*
m_q
.
y
()
*
m_d
*
(
1
-
Z
/
m_height
)
+
m_q
.
z
()
*
Z
));
}
//! Complex formfactor.
complex_t
FormFactorRipple2
::
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
;
complex_t
integral
=
m_integrator
->
integrate
(
0
,
m_height
);
return
factor
*
integral
;
complex_t
result
=
0
;
complex_t
iqzH
=
complex_t
(
0.0
,
1.0
)
*
m_q
.
z
()
*
m_height
;
complex_t
iqyW
=
complex_t
(
0.0
,
1.0
)
*
m_q
.
y
()
*
m_width
;
complex_t
aaa
=
2.0
*
(
m_d
*
m_q
.
y
()
+
m_height
*
m_q
.
z
());
if
(
0.0
==
m_q
.
y
()
and
0.0
==
m_q
.
z
())
result
=
m_height
*
0.5
;
else
if
(
0.0
==
m_q
.
y
())
result
=
(
1.0
-
std
::
exp
(
iqzH
)
+
iqzH
)
/
(
m_height
*
m_q
.
z
()
*
m_q
.
z
());
else
if
(
1.0
==
aaa
/
(
m_q
.
y
()
*
m_width
))
result
=
m_height
*
std
::
exp
(
iqzH
)
*
(
1.0
-
std
::
exp
(
-
1.0
*
iqyW
)
-
iqyW
)
/
(
m_q
.
y
()
*
m_q
.
y
()
*
m_width
*
m_width
);
else
if
(
-
1.0
==
aaa
/
(
m_q
.
y
()
*
m_width
))
result
=
m_height
*
std
::
exp
(
iqzH
)
*
(
1.0
-
std
::
exp
(
-
1.0
*
iqyW
)
+
iqyW
)
/
(
m_q
.
y
()
*
m_q
.
y
()
*
m_width
*
m_width
);
else
{
complex_t
iHqzdqy
=
complex_t
(
0.0
,
1.0
)
*
(
m_q
.
z
()
*
m_height
+
m_q
.
y
()
*
m_d
);
complex_t
Hqzdqy
=
m_q
.
z
()
*
m_height
+
m_q
.
y
()
*
m_d
;
result
=
std
::
cos
(
m_q
.
y
()
*
m_width
*
0.5
)
+
2.0
*
iHqzdqy
*
std
::
sin
(
m_q
.
y
()
*
m_width
*
0.5
)
/
(
m_width
*
m_q
.
y
());
result
=
result
*
std
::
exp
(
-
1.0
*
iHqzdqy
)
-
1.0
;
result
=
result
*
4.0
*
m_height
*
std
::
exp
(
iqzH
)
/
(
4.0
*
Hqzdqy
*
Hqzdqy
-
m_q
.
y
()
*
m_q
.
y
()
*
m_width
*
m_width
);
}
return
factor
*
result
;
}
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