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
aeed23d3
Commit
aeed23d3
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
copy edit ..
parent
7d37ace6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/Computation/ProcessedLayout.cpp
+20
-24
20 additions, 24 deletions
Core/Computation/ProcessedLayout.cpp
Sample/Aggregate/ParticleLayout.cpp
+1
-2
1 addition, 2 deletions
Sample/Aggregate/ParticleLayout.cpp
with
21 additions
and
26 deletions
Core/Computation/ProcessedLayout.cpp
+
20
−
24
View file @
aeed23d3
...
@@ -23,10 +23,18 @@
...
@@ -23,10 +23,18 @@
#include
"Sample/Slice/Slice.h"
#include
"Sample/Slice/Slice.h"
#include
"Sample/Slice/SlicedFormFactorList.h"
#include
"Sample/Slice/SlicedFormFactorList.h"
namespace
namespace
{
{
void
ScaleRegionMap
(
std
::
map
<
size_t
,
std
::
vector
<
HomogeneousRegion
>>&
region_map
,
double
factor
);
void
ScaleRegionMap
(
std
::
map
<
size_t
,
std
::
vector
<
HomogeneousRegion
>>&
region_map
,
double
factor
)
{
for
(
auto
&
entry
:
region_map
)
{
for
(
auto
&
region
:
entry
.
second
)
{
region
.
m_volume
*=
factor
;
}
}
}
}
}
// namespace
ProcessedLayout
::
ProcessedLayout
(
const
ParticleLayout
&
layout
,
const
std
::
vector
<
Slice
>&
slices
,
ProcessedLayout
::
ProcessedLayout
(
const
ParticleLayout
&
layout
,
const
std
::
vector
<
Slice
>&
slices
,
double
z_ref
,
const
IFresnelMap
*
p_fresnel_map
,
bool
polarized
)
double
z_ref
,
const
IFresnelMap
*
p_fresnel_map
,
bool
polarized
)
...
@@ -80,10 +88,10 @@ void ProcessedLayout::collectFormFactors(const ParticleLayout& layout,
...
@@ -80,10 +88,10 @@ void ProcessedLayout::collectFormFactors(const ParticleLayout& layout,
const
std
::
vector
<
Slice
>&
slices
,
double
z_ref
)
const
std
::
vector
<
Slice
>&
slices
,
double
z_ref
)
{
{
double
layout_abundance
=
layout
.
getTotalAbundance
();
double
layout_abundance
=
layout
.
getTotalAbundance
();
for
(
auto
p_
particle
:
layout
.
particles
())
{
for
(
const
auto
*
particle
:
layout
.
particles
())
{
auto
ff_coh
=
processParticle
(
*
p_
particle
,
slices
,
z_ref
);
FormFactorCoherentSum
ff_coh
=
processParticle
(
*
particle
,
slices
,
z_ref
);
ff_coh
.
scaleRelativeAbundance
(
layout_abundance
);
ff_coh
.
scaleRelativeAbundance
(
layout_abundance
);
m_formfactors
.
push_back
(
std
::
move
(
ff_coh
)
)
;
m_formfactors
.
emplace_back
(
ff_coh
);
}
}
double
weight
=
layout
.
weight
();
double
weight
=
layout
.
weight
();
m_surface_density
=
weight
*
layout
.
totalParticleSurfaceDensity
();
m_surface_density
=
weight
*
layout
.
totalParticleSurfaceDensity
();
...
@@ -102,25 +110,25 @@ FormFactorCoherentSum ProcessedLayout::processParticle(const IParticle& particle
...
@@ -102,25 +110,25 @@ FormFactorCoherentSum ProcessedLayout::processParticle(const IParticle& particle
mergeRegionMap
(
region_map
);
mergeRegionMap
(
region_map
);
auto
result
=
FormFactorCoherentSum
(
abundance
);
auto
result
=
FormFactorCoherentSum
(
abundance
);
for
(
size_t
i
=
0
;
i
<
sliced_ffs
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
sliced_ffs
.
size
();
++
i
)
{
auto
ff_pair
=
sliced_ffs
[
i
];
const
auto
ff_pair
=
sliced_ffs
[
i
];
std
::
unique_ptr
<
IFormFactor
>
P_
ff_framework
;
std
::
unique_ptr
<
IFormFactor
>
ff_framework
;
if
(
slices
.
size
()
>
1
)
{
if
(
slices
.
size
()
>
1
)
{
if
(
m_polarized
)
if
(
m_polarized
)
P_
ff_framework
=
std
::
make_unique
<
FormFactorDWBAPol
>
(
*
ff_pair
.
first
);
ff_framework
=
std
::
make_unique
<
FormFactorDWBAPol
>
(
*
ff_pair
.
first
);
else
else
P_
ff_framework
=
std
::
make_unique
<
FormFactorDWBA
>
(
*
ff_pair
.
first
);
ff_framework
=
std
::
make_unique
<
FormFactorDWBA
>
(
*
ff_pair
.
first
);
}
else
{
}
else
{
if
(
m_polarized
)
if
(
m_polarized
)
P_
ff_framework
=
std
::
make_unique
<
FormFactorBAPol
>
(
*
ff_pair
.
first
);
ff_framework
=
std
::
make_unique
<
FormFactorBAPol
>
(
*
ff_pair
.
first
);
else
else
P_
ff_framework
.
reset
(
ff_pair
.
first
->
clone
());
ff_framework
.
reset
(
ff_pair
.
first
->
clone
());
}
}
size_t
slice_index
=
ff_pair
.
second
;
size_t
slice_index
=
ff_pair
.
second
;
const
Material
slice_material
=
slices
[
slice_index
].
material
();
const
Material
slice_material
=
slices
[
slice_index
].
material
();
P_
ff_framework
->
setAmbientMaterial
(
slice_material
);
ff_framework
->
setAmbientMaterial
(
slice_material
);
auto
part
=
FormFactorCoherentPart
(
P_
ff_framework
.
release
());
auto
part
=
FormFactorCoherentPart
(
ff_framework
.
release
());
part
.
setSpecularInfo
(
m_fresnel_map
,
slice_index
);
part
.
setSpecularInfo
(
m_fresnel_map
,
slice_index
);
result
.
addCoherentPart
(
part
);
result
.
addCoherentPart
(
part
);
...
@@ -138,15 +146,3 @@ void ProcessedLayout::mergeRegionMap(
...
@@ -138,15 +146,3 @@ void ProcessedLayout::mergeRegionMap(
regions
.
end
());
regions
.
end
());
}
}
}
}
namespace
{
void
ScaleRegionMap
(
std
::
map
<
size_t
,
std
::
vector
<
HomogeneousRegion
>>&
region_map
,
double
factor
)
{
for
(
auto
&
entry
:
region_map
)
{
for
(
auto
&
region
:
entry
.
second
)
{
region
.
m_volume
*=
factor
;
}
}
}
}
// namespace
This diff is collapsed.
Click to expand it.
Sample/Aggregate/ParticleLayout.cpp
+
1
−
2
View file @
aeed23d3
...
@@ -112,9 +112,8 @@ const IInterferenceFunction* ParticleLayout::interferenceFunction() const
...
@@ -112,9 +112,8 @@ const IInterferenceFunction* ParticleLayout::interferenceFunction() const
double
ParticleLayout
::
getTotalAbundance
()
const
double
ParticleLayout
::
getTotalAbundance
()
const
{
{
double
result
=
0.0
;
double
result
=
0.0
;
for
(
auto
p_particle
:
m_particles
)
{
for
(
auto
p_particle
:
m_particles
)
result
+=
p_particle
->
abundance
();
result
+=
p_particle
->
abundance
();
}
return
result
;
return
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