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
224c8c0e
Commit
224c8c0e
authored
11 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
Refactor: removed runMagnetic()
parent
f01d03d5
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/DecoratedLayerDWBASimulation.h
+0
-2
0 additions, 2 deletions
Core/Algorithms/inc/DecoratedLayerDWBASimulation.h
Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp
+48
-54
48 additions, 54 deletions
Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp
with
48 additions
and
56 deletions
Core/Algorithms/inc/DecoratedLayerDWBASimulation.h
+
0
−
2
View file @
224c8c0e
...
@@ -40,8 +40,6 @@ public:
...
@@ -40,8 +40,6 @@ public:
virtual
void
run
();
virtual
void
run
();
protected
:
protected
:
void
runMagnetic
(
const
IInterferenceFunctionStrategy
*
p_strategy
);
Layer
*
mp_layer
;
Layer
*
mp_layer
;
DiffuseDWBASimulation
*
mp_diffuseDWBA
;
DiffuseDWBASimulation
*
mp_diffuseDWBA
;
...
...
This diff is collapsed.
Click to expand it.
Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp
+
48
−
54
View file @
224c8c0e
...
@@ -48,43 +48,10 @@ void DecoratedLayerDWBASimulation::run()
...
@@ -48,43 +48,10 @@ void DecoratedLayerDWBASimulation::run()
boost
::
scoped_ptr
<
const
IInterferenceFunctionStrategy
>
P_strategy
(
boost
::
scoped_ptr
<
const
IInterferenceFunctionStrategy
>
P_strategy
(
createAndInitStrategy
());
createAndInitStrategy
());
if
(
checkPolarizationPresent
())
{
runMagnetic
(
P_strategy
.
get
());
return
;
}
calculateCoherentIntensity
(
P_strategy
.
get
());
calculateCoherentIntensity
(
P_strategy
.
get
());
calculateInCoherentIntensity
();
calculateInCoherentIntensity
();
}
}
void
DecoratedLayerDWBASimulation
::
runMagnetic
(
const
IInterferenceFunctionStrategy
*
p_strategy
)
{
msglog
(
MSG
::
DEBUG
)
<<
"LayerDecoratorDWBASimulation::calculateCoh...()"
;
double
wavelength
=
getWaveLength
();
double
total_surface_density
=
mp_layer
->
getTotalParticleSurfaceDensity
();
OutputData
<
Eigen
::
Matrix2d
>::
iterator
it
=
mp_polarization_output
->
begin
(
m_thread_info
);
while
(
it
!=
mp_polarization_output
->
end
(
m_thread_info
)
)
{
Bin1D
phi_bin
=
mp_polarization_output
->
getBinOfAxis
(
"phi_f"
,
it
.
getIndex
());
Bin1D
alpha_bin
=
mp_polarization_output
->
getBinOfAxis
(
"alpha_f"
,
it
.
getIndex
());
double
alpha_f
=
alpha_bin
.
getMidPoint
();
if
(
m_sim_params
.
me_framework
==
SimulationParameters
::
DWBA
&&
alpha_f
<
0
)
{
++
it
;
continue
;
}
Bin1DCVector
k_f_bin
=
getKfBin1_matrix
(
wavelength
,
alpha_bin
,
phi_bin
);
*
it
=
p_strategy
->
evaluatePol
(
m_ki
,
k_f_bin
,
alpha_bin
,
phi_bin
)
*
total_surface_density
;
++
it
;
}
}
IInterferenceFunctionStrategy
IInterferenceFunctionStrategy
*
DecoratedLayerDWBASimulation
::
createAndInitStrategy
()
const
*
DecoratedLayerDWBASimulation
::
createAndInitStrategy
()
const
{
{
...
@@ -104,31 +71,61 @@ void DecoratedLayerDWBASimulation::calculateCoherentIntensity(
...
@@ -104,31 +71,61 @@ void DecoratedLayerDWBASimulation::calculateCoherentIntensity(
double
total_surface_density
=
double
total_surface_density
=
mp_layer
->
getTotalParticleSurfaceDensity
();
mp_layer
->
getTotalParticleSurfaceDensity
();
cvector_t
k_ij
=
m_ki
;
if
(
checkPolarizationPresent
())
{
k_ij
.
setZ
(
-
(
complex_t
)
mp_specular_info
->
getInCoefficients
()
->
getScalarKz
());
// polarized dwba calculation:
OutputData
<
Eigen
::
Matrix2d
>::
iterator
it
=
DWBASimulation
::
iterator
it_intensity
=
begin
();
mp_polarization_output
->
begin
(
m_thread_info
);
while
(
it_intensity
!=
end
()
)
while
(
it
!=
mp_polarization_output
->
end
(
m_thread_info
)
)
{
{
Bin1D
phi_bin
=
getDWBAIntensity
().
getBinOfAxis
(
Bin1D
phi_bin
=
mp_polarization_output
->
getBinOfAxis
(
"phi_f"
,
it_intensity
.
getIndex
());
"phi_f"
,
it
.
getIndex
());
Bin1D
alpha_bin
=
getDWBAIntensity
().
getBinOfAxis
(
Bin1D
alpha_bin
=
mp_polarization_output
->
getBinOfAxis
(
"alpha_f"
,
it_intensity
.
getIndex
());
"alpha_f"
,
it
.
getIndex
());
double
alpha_f
=
alpha_bin
.
getMidPoint
();
double
alpha_f
=
alpha_bin
.
getMidPoint
();
if
(
std
::
abs
(
mp_specular_info
->
getOutCoefficients
(
alpha_f
,
0.0
)
if
(
m_sim_params
.
me_framework
==
SimulationParameters
::
DWBA
&&
->
getScalarR
())
!=
0.0
&&
alpha_f
<
0
)
{
alpha_f
<
0
)
{
++
it
;
continue
;
}
Bin1DCVector
k_f_bin
=
getKfBin1_matrix
(
wavelength
,
alpha_bin
,
phi_bin
);
*
it
=
p_strategy
->
evaluatePol
(
m_ki
,
k_f_bin
,
alpha_bin
,
phi_bin
)
*
total_surface_density
;
++
it
;
}
}
else
{
// scalar dwba calculation:
cvector_t
k_ij
=
m_ki
;
k_ij
.
setZ
(
-
(
complex_t
)
mp_specular_info
->
getInCoefficients
()
->
getScalarKz
());
DWBASimulation
::
iterator
it_intensity
=
begin
();
while
(
it_intensity
!=
end
()
)
{
Bin1D
phi_bin
=
getDWBAIntensity
().
getBinOfAxis
(
"phi_f"
,
it_intensity
.
getIndex
());
Bin1D
alpha_bin
=
getDWBAIntensity
().
getBinOfAxis
(
"alpha_f"
,
it_intensity
.
getIndex
());
double
alpha_f
=
alpha_bin
.
getMidPoint
();
if
(
std
::
abs
(
mp_specular_info
->
getOutCoefficients
(
alpha_f
,
0.0
)
->
getScalarR
())
!=
0.0
&&
alpha_f
<
0
)
{
++
it_intensity
;
continue
;
}
Bin1DCVector
k_f_bin
=
getKfBin
(
wavelength
,
alpha_bin
,
phi_bin
);
*
it_intensity
=
p_strategy
->
evaluate
(
k_ij
,
k_f_bin
,
alpha_bin
)
*
total_surface_density
;
++
it_intensity
;
++
it_intensity
;
continue
;
}
}
Bin1DCVector
k_f_bin
=
getKfBin
(
wavelength
,
alpha_bin
,
phi_bin
);
*
it_intensity
=
p_strategy
->
evaluate
(
k_ij
,
k_f_bin
,
alpha_bin
)
*
total_surface_density
;
++
it_intensity
;
}
}
}
}
void
DecoratedLayerDWBASimulation
::
calculateInCoherentIntensity
()
void
DecoratedLayerDWBASimulation
::
calculateInCoherentIntensity
()
{
{
if
(
checkPolarizationPresent
())
{
return
;
}
msglog
(
MSG
::
DEBUG
)
<<
"Calculating incoherent scattering..."
;
msglog
(
MSG
::
DEBUG
)
<<
"Calculating incoherent scattering..."
;
if
(
mp_diffuseDWBA
)
{
if
(
mp_diffuseDWBA
)
{
mp_diffuseDWBA
->
setSpecularInfo
(
*
mp_specular_info
);
mp_diffuseDWBA
->
setSpecularInfo
(
*
mp_specular_info
);
...
@@ -137,6 +134,3 @@ void DecoratedLayerDWBASimulation::calculateInCoherentIntensity()
...
@@ -137,6 +134,3 @@ void DecoratedLayerDWBASimulation::calculateInCoherentIntensity()
addDWBAIntensity
(
mp_diffuseDWBA
->
getDWBAIntensity
()
);
addDWBAIntensity
(
mp_diffuseDWBA
->
getDWBAIntensity
()
);
}
}
}
}
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