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
6d614dd3
Commit
6d614dd3
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
various little simplifications
parent
046373d6
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/Computation/ParticleLayoutComputation.cpp
+6
-9
6 additions, 9 deletions
Core/Computation/ParticleLayoutComputation.cpp
Core/Computation/ParticleLayoutComputation.h
+1
-2
1 addition, 2 deletions
Core/Computation/ParticleLayoutComputation.h
with
7 additions
and
11 deletions
Core/Computation/ParticleLayoutComputation.cpp
+
6
−
9
View file @
6d614dd3
...
@@ -22,24 +22,21 @@ ParticleLayoutComputation::ParticleLayoutComputation(const ProcessedLayout* p_la
...
@@ -22,24 +22,21 @@ ParticleLayoutComputation::ParticleLayoutComputation(const ProcessedLayout* p_la
const
SimulationOptions
&
options
,
const
SimulationOptions
&
options
,
bool
polarized
)
bool
polarized
)
:
m_layout
(
p_layout
)
:
m_layout
(
p_layout
)
,
m_region_map
(
p_layout
->
regionMap
())
{
{
LayoutStrategyBuilder
builder
(
p_layout
,
options
,
polarized
);
LayoutStrategyBuilder
builder
(
p_layout
,
options
,
polarized
);
m_strategy
.
reset
(
builder
.
releaseStrategy
());
m_strategy
.
reset
(
builder
.
releaseStrategy
());
m_region_map
=
p_layout
->
regionMap
();
m_surface_density
=
p_layout
->
surfaceDensity
();
}
}
ParticleLayoutComputation
::~
ParticleLayoutComputation
()
=
default
;
ParticleLayoutComputation
::~
ParticleLayoutComputation
()
=
default
;
void
ParticleLayoutComputation
::
compute
(
SimulationElement
&
elem
)
const
void
ParticleLayoutComputation
::
compute
(
SimulationElement
&
elem
)
const
{
{
double
alpha_f
=
elem
.
getAlphaMean
();
const
double
alpha_f
=
elem
.
getAlphaMean
();
size_t
n_layers
=
m_layout
->
numberOfSlices
();
const
size_t
n_layers
=
m_layout
->
numberOfSlices
();
if
(
n_layers
>
1
&&
alpha_f
<
0
)
{
if
(
n_layers
>
1
&&
alpha_f
<
0
)
return
;
// zero for transmission with multilayers (n>1)
return
;
// zero for transmission with multilayers (n>1) # TODO: support transmission GISAS
}
else
{
elem
.
addIntensity
(
m_strategy
->
evaluate
(
elem
)
*
m_layout
->
surfaceDensity
());
elem
.
addIntensity
(
m_strategy
->
evaluate
(
elem
)
*
m_surface_density
);
}
}
}
void
ParticleLayoutComputation
::
mergeRegionMap
(
void
ParticleLayoutComputation
::
mergeRegionMap
(
...
...
This diff is collapsed.
Click to expand it.
Core/Computation/ParticleLayoutComputation.h
+
1
−
2
View file @
6d614dd3
...
@@ -44,8 +44,7 @@ public:
...
@@ -44,8 +44,7 @@ public:
private:
private:
const
ProcessedLayout
*
m_layout
;
const
ProcessedLayout
*
m_layout
;
std
::
unique_ptr
<
const
IInterferenceFunctionStrategy
>
m_strategy
;
std
::
unique_ptr
<
const
IInterferenceFunctionStrategy
>
m_strategy
;
double
m_surface_density
;
const
std
::
map
<
size_t
,
std
::
vector
<
HomogeneousRegion
>>
m_region_map
;
std
::
map
<
size_t
,
std
::
vector
<
HomogeneousRegion
>>
m_region_map
;
};
};
#endif // BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
#endif // BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
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