Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mlz
BornAgain
Commits
c5664a4e
Commit
c5664a4e
authored
Dec 06, 2022
by
Wuttke, Joachim
Browse files
IFormFactor: sort fcts, rm virtual keywords
parent
693c9163
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Sample/Particle/IFormFactor.cpp
View file @
c5664a4e
...
...
@@ -30,16 +30,6 @@ IFormFactor::IFormFactor(const std::vector<double>& PValues)
IFormFactor
::~
IFormFactor
()
=
default
;
complex_t
IFormFactor
::
theFF
(
const
WavevectorInfo
&
wavevectors
)
const
{
return
formfactor_at_bottom
(
wavevectors
.
getQ
());
}
SpinMatrix
IFormFactor
::
thePolFF
(
const
WavevectorInfo
&
wavevectors
)
const
{
return
formfactor_pol
(
wavevectors
.
getQ
());
}
double
IFormFactor
::
bottomZ
(
const
IRotation
*
rotation
)
const
{
if
(
!
m_shape3D
)
...
...
@@ -54,6 +44,11 @@ double IFormFactor::topZ(const IRotation* rotation) const
return
PolyhedralUtil
::
TopZ
(
m_shape3D
->
vertices
(),
rotation
);
}
double
IFormFactor
::
volume
()
const
{
return
std
::
abs
(
formfactor_at_bottom
(
C3
()));
}
bool
IFormFactor
::
canSliceAnalytically
(
const
IRotation
*
rotation
)
const
{
return
!
rotation
||
rotation
->
zInvariant
();
...
...
@@ -68,12 +63,17 @@ std::string IFormFactor::pythonConstructor() const
return
Py
::
Fmt
::
printFunction
(
className
(),
arguments
);
}
SpinMatrix
IFormFactor
::
formfactor_pol
(
C3
q
)
const
complex_t
IFormFactor
::
theFF
(
const
WavevectorInfo
&
wavevectors
)
const
{
return
formfactor_at_bottom
(
q
)
*
SpinMatrix
::
One
(
);
return
formfactor_at_bottom
(
wavevectors
.
getQ
()
);
}
double
IFormFactor
::
volume
(
)
const
SpinMatrix
IFormFactor
::
thePolFF
(
const
WavevectorInfo
&
wavevectors
)
const
{
return
std
::
abs
(
formfactor_at_bottom
(
C3
()));
return
formfactor_pol
(
wavevectors
.
getQ
());
}
SpinMatrix
IFormFactor
::
formfactor_pol
(
C3
q
)
const
{
return
formfactor_at_bottom
(
q
)
*
SpinMatrix
::
One
();
}
Sample/Particle/IFormFactor.h
View file @
c5664a4e
...
...
@@ -41,9 +41,6 @@ public:
IFormFactor
*
clone
()
const
override
=
0
;
complex_t
theFF
(
const
WavevectorInfo
&
wavevectors
)
const
;
SpinMatrix
thePolFF
(
const
WavevectorInfo
&
wavevectors
)
const
;
virtual
double
bottomZ
(
const
IRotation
*
rotation
)
const
;
virtual
double
topZ
(
const
IRotation
*
rotation
)
const
;
...
...
@@ -53,18 +50,21 @@ public:
//! form factor's shape. This is used for SSCA calculations
virtual
double
radialExtension
()
const
=
0
;
virtual
complex_t
formfactor_at_bottom
(
C3
q
)
const
=
0
;
//! Creates the Python constructor of this class (or derived classes)
virtual
std
::
string
pythonConstructor
()
const
;
std
::
string
pythonConstructor
()
const
;
//! Default implementation only allows rotations along z-axis
virtual
bool
canSliceAnalytically
(
const
IRotation
*
rot
)
const
;
complex_t
theFF
(
const
WavevectorInfo
&
wavevectors
)
const
;
SpinMatrix
thePolFF
(
const
WavevectorInfo
&
wavevectors
)
const
;
//! Returns scattering amplitude for complex scattering wavevector q=k_i-k_f in case
//! of matrix interactions. Default implementation calls formfactor_at_bottom(q) and
//! multiplies with the unit matrix.
virtual
SpinMatrix
formfactor_pol
(
C3
q
)
const
;
SpinMatrix
formfactor_pol
(
C3
q
)
const
;
virtual
complex_t
formfactor_at_bottom
(
C3
q
)
const
=
0
;
protected:
//! IShape3D object, used to retrieve vertices (which may be approximate in the case
...
...
auto/Wrap/libBornAgainSample.py
View file @
c5664a4e
...
...
@@ -2655,14 +2655,6 @@ class IFormFactor(ISampleNode):
r
"""clone(IFormFactor self) -> IFormFactor"""
return
_libBornAgainSample
.
IFormFactor_clone
(
self
)
def
theFF
(
self
,
wavevectors
):
r
"""theFF(IFormFactor self, WavevectorInfo const & wavevectors) -> complex_t"""
return
_libBornAgainSample
.
IFormFactor_theFF
(
self
,
wavevectors
)
def
thePolFF
(
self
,
wavevectors
):
r
"""thePolFF(IFormFactor self, WavevectorInfo const & wavevectors) -> SpinMatrix"""
return
_libBornAgainSample
.
IFormFactor_thePolFF
(
self
,
wavevectors
)
def
bottomZ
(
self
,
rotation
):
r
"""bottomZ(IFormFactor self, IRotation rotation) -> double"""
return
_libBornAgainSample
.
IFormFactor_bottomZ
(
self
,
rotation
)
...
...
@@ -2679,10 +2671,6 @@ class IFormFactor(ISampleNode):
r
"""radialExtension(IFormFactor self) -> double"""
return
_libBornAgainSample
.
IFormFactor_radialExtension
(
self
)
def
formfactor_at_bottom
(
self
,
q
):
r
"""formfactor_at_bottom(IFormFactor self, C3 q) -> complex_t"""
return
_libBornAgainSample
.
IFormFactor_formfactor_at_bottom
(
self
,
q
)
def
pythonConstructor
(
self
):
r
"""pythonConstructor(IFormFactor self) -> std::string"""
return
_libBornAgainSample
.
IFormFactor_pythonConstructor
(
self
)
...
...
@@ -2691,9 +2679,21 @@ class IFormFactor(ISampleNode):
r
"""canSliceAnalytically(IFormFactor self, IRotation rot) -> bool"""
return
_libBornAgainSample
.
IFormFactor_canSliceAnalytically
(
self
,
rot
)
def
theFF
(
self
,
wavevectors
):
r
"""theFF(IFormFactor self, WavevectorInfo const & wavevectors) -> complex_t"""
return
_libBornAgainSample
.
IFormFactor_theFF
(
self
,
wavevectors
)
def
thePolFF
(
self
,
wavevectors
):
r
"""thePolFF(IFormFactor self, WavevectorInfo const & wavevectors) -> SpinMatrix"""
return
_libBornAgainSample
.
IFormFactor_thePolFF
(
self
,
wavevectors
)
def
formfactor_pol
(
self
,
q
):
r
"""formfactor_pol(IFormFactor self, C3 q) -> SpinMatrix"""
return
_libBornAgainSample
.
IFormFactor_formfactor_pol
(
self
,
q
)
def
formfactor_at_bottom
(
self
,
q
):
r
"""formfactor_at_bottom(IFormFactor self, C3 q) -> complex_t"""
return
_libBornAgainSample
.
IFormFactor_formfactor_at_bottom
(
self
,
q
)
def
__disown__
(
self
):
self
.
this
.
disown
()
_libBornAgainSample
.
disown_IFormFactor
(
self
)
...
...
auto/Wrap/libBornAgainSample_wrap.cpp
View file @
c5664a4e
This diff is collapsed.
Click to expand it.
auto/Wrap/libBornAgainSample_wrap.h
View file @
c5664a4e
...
...
@@ -79,10 +79,8 @@ public:
virtual
double
topZ
(
IRotation
const
*
rotation
)
const
;
virtual
double
volume
()
const
;
virtual
double
radialExtension
()
const
;
virtual
complex_t
formfactor_at_bottom
(
C3
q
)
const
;
virtual
std
::
string
pythonConstructor
()
const
;
virtual
bool
canSliceAnalytically
(
IRotation
const
*
rot
)
const
;
virtual
SpinMatrix
formfactor_
pol
(
C3
q
)
const
;
virtual
complex_t
formfactor_
at_bottom
(
C3
q
)
const
;
/* Internal director utilities */
public:
...
...
@@ -113,7 +111,7 @@ private:
return
method
;
}
private:
mutable
swig
::
SwigVar_PyObject
vtable
[
1
5
];
mutable
swig
::
SwigVar_PyObject
vtable
[
1
3
];
#endif
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment