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
159bdea4
Commit
159bdea4
authored
4 years ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Core: prepend missing "m_"
parent
aa447ebf
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/Simulation/Simulation2D.cpp
+9
-8
9 additions, 8 deletions
Core/Simulation/Simulation2D.cpp
Core/Simulation/Simulation2D.h
+1
-1
1 addition, 1 deletion
Core/Simulation/Simulation2D.h
with
10 additions
and
9 deletions
Core/Simulation/Simulation2D.cpp
+
9
−
8
View file @
159bdea4
...
...
@@ -34,7 +34,7 @@ Simulation2D::~Simulation2D() = default;
void
Simulation2D
::
prepareSimulation
()
{
Simulation
::
prepareSimulation
();
detector_context
=
m_instrument
.
detector2D
().
createContext
();
m_
detector_context
=
m_instrument
.
detector2D
().
createContext
();
}
void
Simulation2D
::
removeMasks
()
...
...
@@ -64,9 +64,9 @@ Simulation2D::Simulation2D(const Simulation2D& other)
size_t
Simulation2D
::
numberOfSimulationElements
()
const
{
if
(
!
detector_context
)
if
(
!
m_
detector_context
)
throw
std
::
runtime_error
(
"Error in numberOfSimulationElements(): no detector context"
);
return
detector_context
->
numberOfSimulationElements
();
return
m_
detector_context
->
numberOfSimulationElements
();
}
void
Simulation2D
::
setDetectorParameters
(
size_t
n_x
,
double
x_min
,
double
x_max
,
size_t
n_y
,
...
...
@@ -102,15 +102,16 @@ std::vector<SimulationElement> Simulation2D::generateSimulationElements(const Be
const
Eigen
::
Matrix2cd
analyzer_operator
=
detector
.
detectionProperties
().
analyzerOperator
();
const
size_t
spec_index
=
detector
.
getIndexOfSpecular
(
beam
);
const
size_t
N
=
m_detector_context
->
numberOfSimulationElements
();
std
::
vector
<
SimulationElement
>
result
;
result
.
reserve
(
detector_context
->
numberOfSimulationElements
());
for
(
size_t
element_index
=
0
;
element_index
<
detector_context
->
numberOfSimulationElements
();
++
element_index
)
{
result
.
reserve
(
N
);
for
(
size_t
element_index
=
0
;
element_index
<
N
;
++
element_index
)
{
SimulationElement
element
(
wavelength
,
alpha_i
,
phi_i
,
detector_context
->
createPixel
(
element_index
));
m_
detector_context
->
createPixel
(
element_index
));
element
.
setPolarization
(
beam_polarization
);
element
.
setAnalyzerOperator
(
analyzer_operator
);
if
(
detector_context
->
detectorIndex
(
element_index
)
==
spec_index
)
if
(
m_
detector_context
->
detectorIndex
(
element_index
)
==
spec_index
)
element
.
setSpecular
(
true
);
result
.
emplace_back
(
std
::
move
(
element
));
}
...
...
This diff is collapsed.
Click to expand it.
Core/Simulation/Simulation2D.h
+
1
−
1
View file @
159bdea4
...
...
@@ -96,11 +96,11 @@ protected:
std
::
vector
<
SimulationElement
>
m_sim_elements
;
std
::
vector
<
double
>
m_cache
;
std
::
unique_ptr
<
DetectorContext
>
detector_context
;
private
:
std
::
vector
<
double
>
rawResults
()
const
override
;
void
setRawResults
(
const
std
::
vector
<
double
>&
raw_data
)
override
;
std
::
unique_ptr
<
DetectorContext
>
m_detector_context
;
};
#endif // BORNAGAIN_CORE_SIMULATION_SIMULATION2D_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