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
fb0e01c4
Commit
fb0e01c4
authored
11 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
AddAdded Fourier transformed 2d Voigt and Gate
parent
92900d50
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/Algorithms/inc/FTDistributions.h
+36
-1
36 additions, 1 deletion
Core/Algorithms/inc/FTDistributions.h
Core/Algorithms/src/FTDistributions.cpp
+56
-1
56 additions, 1 deletion
Core/Algorithms/src/FTDistributions.cpp
with
92 additions
and
2 deletions
Core/Algorithms/inc/FTDistributions.h
+
36
−
1
View file @
fb0e01c4
...
...
@@ -33,7 +33,7 @@ protected:
double
m_omega
;
};
//! Interface for 2 dimensional distributions in Fourier space
class
BA_CORE_API_
IFTDistribution2D
:
public
IParameterized
{
public:
...
...
@@ -72,6 +72,8 @@ protected:
double
m_delta
;
};
//! 2 dimensional Cauchy distribution in Fourier space
//! corresponds to exp(-r) in real space
class
BA_CORE_API_
FTDistribution2DCauchy
:
public
IFTDistribution2D
{
public:
...
...
@@ -83,6 +85,8 @@ public:
virtual
double
evaluate
(
double
qx
,
double
qy
)
const
;
};
//! 2 dimensional Gauss distribution in Fourier space
//! corresponds to exp(-r^2) in real space
class
BA_CORE_API_
FTDistribution2DGauss
:
public
IFTDistribution2D
{
public:
...
...
@@ -94,6 +98,37 @@ public:
virtual
double
evaluate
(
double
qx
,
double
qy
)
const
;
};
//! 2 dimensional gate distribution in Fourier space
//! corresponds to 1 if r<1 (and 0 otherwise) in real space
class
BA_CORE_API_
FTDistribution2DGate
:
public
IFTDistribution2D
{
public:
FTDistribution2DGate
(
double
coherence_length_x
,
double
coherence_length_y
);
virtual
~
FTDistribution2DGate
()
{}
virtual
FTDistribution2DGate
*
clone
()
const
;
virtual
double
evaluate
(
double
qx
,
double
qy
)
const
;
};
//! 2 dimensional Voigt distribution in Fourier space
//! Corresponds to eta*Gauss + (1-eta)*Cauchy
class
BA_CORE_API_
FTDistribution2DVoigt
:
public
IFTDistribution2D
{
public:
FTDistribution2DVoigt
(
double
coherence_length_x
,
double
coherence_length_y
,
double
eta
);
virtual
~
FTDistribution2DVoigt
()
{}
virtual
FTDistribution2DVoigt
*
clone
()
const
;
virtual
double
evaluate
(
double
qx
,
double
qy
)
const
;
protected
:
virtual
void
init_parameters
();
double
m_eta
;
};
#endif
/* FTDISTRIBUTIONS_H_ */
This diff is collapsed.
Click to expand it.
Core/Algorithms/src/FTDistributions.cpp
+
56
−
1
View file @
fb0e01c4
...
...
@@ -14,6 +14,7 @@
// ************************************************************************** //
#include
"FTDistributions.h"
#include
"MathFunctions.h"
void
IFTDistribution2D
::
transformToStarBasis
(
double
qX
,
double
qY
,
double
alpha
,
double
a
,
double
b
,
double
&
qa
,
double
&
qb
)
const
...
...
@@ -68,8 +69,8 @@ FTDistribution2DGauss* FTDistribution2DGauss::clone() const
m_coherence_length_x
,
m_coherence_length_y
);
p_clone
->
setGamma
(
m_gamma
);
return
p_clone
;
}
double
FTDistribution2DGauss
::
evaluate
(
double
qx
,
double
qy
)
const
{
double
sum_sq
=
qx
*
qx
*
m_coherence_length_x
*
m_coherence_length_x
...
...
@@ -77,3 +78,57 @@ double FTDistribution2DGauss::evaluate(double qx, double qy) const
return
std
::
exp
(
-
sum_sq
/
4.0
)
/
2.0
;
}
FTDistribution2DGate
::
FTDistribution2DGate
(
double
coherence_length_x
,
double
coherence_length_y
)
:
IFTDistribution2D
(
coherence_length_x
,
coherence_length_y
)
{
setName
(
"2DDistributionGate"
);
init_parameters
();
}
FTDistribution2DGate
*
FTDistribution2DGate
::
clone
()
const
{
FTDistribution2DGate
*
p_clone
=
new
FTDistribution2DGate
(
m_coherence_length_x
,
m_coherence_length_y
);
p_clone
->
setGamma
(
m_gamma
);
return
p_clone
;
}
double
FTDistribution2DGate
::
evaluate
(
double
qx
,
double
qy
)
const
{
double
scaled_q
=
std
::
sqrt
(
qx
*
qx
*
m_coherence_length_x
*
m_coherence_length_x
+
qy
*
qy
*
m_coherence_length_y
*
m_coherence_length_y
);
return
MathFunctions
::
Bessel_C1
(
scaled_q
);
}
FTDistribution2DVoigt
::
FTDistribution2DVoigt
(
double
coherence_length_x
,
double
coherence_length_y
,
double
eta
)
:
IFTDistribution2D
(
coherence_length_x
,
coherence_length_y
)
,
m_eta
(
eta
)
{
setName
(
"2DDistributionVoigt"
);
init_parameters
();
}
FTDistribution2DVoigt
*
FTDistribution2DVoigt
::
clone
()
const
{
FTDistribution2DVoigt
*
p_clone
=
new
FTDistribution2DVoigt
(
m_coherence_length_x
,
m_coherence_length_y
,
m_eta
);
p_clone
->
setGamma
(
m_gamma
);
return
p_clone
;
}
double
FTDistribution2DVoigt
::
evaluate
(
double
qx
,
double
qy
)
const
{
double
sum_sq
=
qx
*
qx
*
m_coherence_length_x
*
m_coherence_length_x
+
qy
*
qy
*
m_coherence_length_y
*
m_coherence_length_y
;
return
m_eta
*
std
::
exp
(
-
sum_sq
/
4.0
)
/
2.0
+
(
1.0
-
m_eta
)
*
std
::
pow
(
1.0
+
sum_sq
,
-
1.5
);
}
void
FTDistribution2DVoigt
::
init_parameters
()
{
IFTDistribution2D
::
init_parameters
();
registerParameter
(
"eta"
,
&
m_eta
);
}
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