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
c2c21297
Commit
c2c21297
authored
7 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
Add instrument reference to MainComputation class
Redmine: #1858
parent
6087ecbc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Core/Computation/MainComputation.cpp
+3
-0
3 additions, 0 deletions
Core/Computation/MainComputation.cpp
Core/Computation/MainComputation.h
+3
-0
3 additions, 0 deletions
Core/Computation/MainComputation.h
Core/Simulation/Simulation.cpp
+2
-2
2 additions, 2 deletions
Core/Simulation/Simulation.cpp
with
8 additions
and
2 deletions
Core/Computation/MainComputation.cpp
+
3
−
0
View file @
c2c21297
...
...
@@ -17,6 +17,7 @@
#include
"ParticleLayoutComputation.h"
#include
"Layer.h"
#include
"IFresnelMap.h"
#include
"Instrument.h"
#include
"MatrixFresnelMap.h"
#include
"MultiLayer.h"
#include
"RoughMultiLayerComputation.h"
...
...
@@ -33,11 +34,13 @@ HomogeneousMaterial CalculateAverageMaterial(const HomogeneousMaterial& layer_ma
MainComputation
::
MainComputation
(
const
MultiLayer
&
multilayer
,
const
Instrument
&
instrument
,
const
SimulationOptions
&
options
,
ProgressHandler
&
progress
,
const
std
::
vector
<
SimulationElement
>::
iterator
&
begin_it
,
const
std
::
vector
<
SimulationElement
>::
iterator
&
end_it
)
:
mP_multi_layer
(
multilayer
.
cloneSliced
(
options
.
useAvgMaterials
()))
,
m_instrument
(
instrument
)
,
m_sim_options
(
options
)
,
m_progress
(
&
progress
)
,
m_begin_it
(
begin_it
)
...
...
This diff is collapsed.
Click to expand it.
Core/Computation/MainComputation.h
+
3
−
0
View file @
c2c21297
...
...
@@ -25,6 +25,7 @@
class
IFresnelMap
;
class
MultiLayer
;
class
Instrument
;
struct
HomogeneousRegion
;
class
IComputationTerm
;
class
ProgressHandler
;
...
...
@@ -42,6 +43,7 @@ class MainComputation final : public INoncopyable
public:
MainComputation
(
const
MultiLayer
&
multilayer
,
const
Instrument
&
instrument
,
const
SimulationOptions
&
options
,
ProgressHandler
&
progress
,
const
std
::
vector
<
SimulationElement
>::
iterator
&
begin_it
,
...
...
@@ -66,6 +68,7 @@ private:
bool
checkRegions
(
const
std
::
vector
<
HomogeneousRegion
>&
regions
)
const
;
std
::
unique_ptr
<
MultiLayer
>
mP_multi_layer
;
const
Instrument
&
m_instrument
;
SimulationOptions
m_sim_options
;
ProgressHandler
*
m_progress
;
//! these iterators define the span of detector bins this simulation will work on
...
...
This diff is collapsed.
Click to expand it.
Core/Simulation/Simulation.cpp
+
2
−
2
View file @
c2c21297
...
...
@@ -215,7 +215,7 @@ void Simulation::runSingleSimulation()
if
(
m_options
.
getNumberOfThreads
()
==
1
)
{
// Single thread.
std
::
unique_ptr
<
MainComputation
>
P_computation
(
new
MainComputation
(
*
sample
(),
m_options
,
m_progress
,
batch_start
,
batch_end
));
new
MainComputation
(
*
sample
(),
m_instrument
,
m_options
,
m_progress
,
batch_start
,
batch_end
));
P_computation
->
run
();
// the work is done here
if
(
!
P_computation
->
isCompleted
())
{
std
::
string
message
=
P_computation
->
errorMessage
();
...
...
@@ -246,7 +246,7 @@ void Simulation::runSingleSimulation()
else
end_it
=
batch_start
+
end_thread_index
;
computations
.
emplace_back
(
new
MainComputation
(
*
sample
(),
m_options
,
m_progress
,
begin_it
,
end_it
));
new
MainComputation
(
*
sample
(),
m_instrument
,
m_options
,
m_progress
,
begin_it
,
end_it
));
}
// Run simulations in n threads.
...
...
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