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
4b99ea7d
Commit
4b99ea7d
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
merge local fct into SpecularSimulation::runComputation
parent
4a1777a6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sim/Simulation/SpecularSimulation.cpp
+20
-28
20 additions, 28 deletions
Sim/Simulation/SpecularSimulation.cpp
with
20 additions
and
28 deletions
Sim/Simulation/SpecularSimulation.cpp
+
20
−
28
View file @
4b99ea7d
...
@@ -29,33 +29,6 @@
...
@@ -29,33 +29,6 @@
#include
"Sim/Computation/SpecularComputation.h"
#include
"Sim/Computation/SpecularComputation.h"
#include
"Sim/Scan/AlphaScan.h"
#include
"Sim/Scan/AlphaScan.h"
namespace
{
//! Performs the actual simulation, and sets intensity, for given range of SpecularElement%s.
double
reflectedIntensity
(
const
ReSample
&
re_sample
,
SpecularElement
&
ele
)
{
if
(
!
ele
.
isCalculated
())
return
0
;
const
SliceStack
&
slices
=
re_sample
.
averageSlices
();
std
::
vector
<
complex_t
>
kz_stack
=
ele
.
produceKz
(
slices
);
if
(
re_sample
.
polarizing
())
{
const
SpinMatrix
R
=
Compute
::
polarizedReflectivity
(
slices
,
kz_stack
,
true
);
const
SpinMatrix
&
polMatrix
=
ele
.
polarizer
();
const
SpinMatrix
&
anaMatrix
=
ele
.
analyzer
();
return
Compute
::
magneticR
(
R
,
polMatrix
,
anaMatrix
);
}
else
{
const
complex_t
R
=
Compute
::
scalarReflectivity
(
slices
,
kz_stack
);
return
Compute
::
scalarR
(
R
);
}
}
}
// namespace
SpecularSimulation
::
SpecularSimulation
(
const
IBeamScan
&
scan
,
const
MultiLayer
&
sample
)
SpecularSimulation
::
SpecularSimulation
(
const
IBeamScan
&
scan
,
const
MultiLayer
&
sample
)
:
ISimulation
(
sample
)
:
ISimulation
(
sample
)
,
m_scan
(
scan
.
clone
())
,
m_scan
(
scan
.
clone
())
...
@@ -82,7 +55,26 @@ void SpecularSimulation::initElementVector()
...
@@ -82,7 +55,26 @@ void SpecularSimulation::initElementVector()
void
SpecularSimulation
::
runComputation
(
const
ReSample
&
re_sample
,
size_t
iElement
,
double
weight
)
void
SpecularSimulation
::
runComputation
(
const
ReSample
&
re_sample
,
size_t
iElement
,
double
weight
)
{
{
SpecularElement
&
ele
=
*
(
m_eles
.
begin
()
+
static_cast
<
long
>
(
iElement
));
SpecularElement
&
ele
=
*
(
m_eles
.
begin
()
+
static_cast
<
long
>
(
iElement
));
double
refl
=
reflectedIntensity
(
re_sample
,
ele
);
double
refl
=
0
;
if
(
ele
.
isCalculated
())
{
const
SliceStack
&
slices
=
re_sample
.
averageSlices
();
std
::
vector
<
complex_t
>
kz_stack
=
ele
.
produceKz
(
slices
);
if
(
re_sample
.
polarizing
())
{
const
SpinMatrix
R
=
Compute
::
polarizedReflectivity
(
slices
,
kz_stack
,
true
);
const
SpinMatrix
&
polMatrix
=
ele
.
polarizer
();
const
SpinMatrix
&
anaMatrix
=
ele
.
analyzer
();
refl
=
Compute
::
magneticR
(
R
,
polMatrix
,
anaMatrix
);
}
else
{
const
complex_t
R
=
Compute
::
scalarReflectivity
(
slices
,
kz_stack
);
refl
=
Compute
::
scalarR
(
R
);
}
}
double
intensity
=
refl
*
ele
.
footprint
();
double
intensity
=
refl
*
ele
.
footprint
();
if
(
background
())
if
(
background
())
...
...
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