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
af1bbdef
Commit
af1bbdef
authored
7 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
DepthProbeComputation
Redmine: #2006
parent
f47bee21
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/DepthProbeComputation.cpp
+67
-0
67 additions, 0 deletions
Core/Computation/DepthProbeComputation.cpp
Core/Computation/DepthProbeComputation.h
+51
-0
51 additions, 0 deletions
Core/Computation/DepthProbeComputation.h
with
118 additions
and
0 deletions
Core/Computation/DepthProbeComputation.cpp
0 → 100644
+
67
−
0
View file @
af1bbdef
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Computation/SpecularComputation.cpp
//! @brief Implements class SpecularComputation.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#include
"DepthProbeComputation.h"
#include
"Layer.h"
#include
"IFresnelMap.h"
#include
"MatrixFresnelMap.h"
#include
"MultiLayer.h"
#include
"ScalarFresnelMap.h"
#include
"ProgressHandler.h"
static_assert
(
std
::
is_copy_constructible
<
DepthProbeComputation
>::
value
==
false
,
"DepthProbeComputation should not be copy constructible"
);
static_assert
(
std
::
is_copy_assignable
<
DepthProbeComputation
>::
value
==
false
,
"DepthProbeComputation should not be copy assignable"
);
DepthProbeComputation
::
DepthProbeComputation
(
const
MultiLayer
&
multilayer
,
const
SimulationOptions
&
options
,
ProgressHandler
&
progress
,
DepthProbeElementIter
begin_it
,
DepthProbeElementIter
end_it
)
:
IComputation
(
options
,
progress
,
multilayer
)
,
m_begin_it
(
begin_it
),
m_end_it
(
end_it
)
,
mP_fresnel_map
(
createFresnelMap
())
,
m_computation_term
(
mP_multi_layer
.
get
(),
mP_fresnel_map
.
get
())
{
}
DepthProbeComputation
::~
DepthProbeComputation
()
=
default
;
void
DepthProbeComputation
::
runProtected
()
{
if
(
!
m_progress
->
alive
())
return
;
m_computation_term
.
eval
(
m_progress
,
m_begin_it
,
m_end_it
);
}
std
::
unique_ptr
<
IFresnelMap
>
DepthProbeComputation
::
createFresnelMap
()
{
std
::
unique_ptr
<
IFresnelMap
>
P_result
;
if
(
!
mP_multi_layer
->
requiresMatrixRTCoefficients
())
P_result
.
reset
(
new
ScalarFresnelMap
());
else
P_result
.
reset
(
new
MatrixFresnelMap
());
if
(
m_sim_options
.
isIntegrate
())
P_result
->
disableCaching
();
if
(
m_sim_options
.
useAvgMaterials
())
throw
std
::
runtime_error
(
"Error in SpecularComputation::createFresnelMap: using averaged "
"materials is not implemented"
);
P_result
->
setMultilayer
(
*
mP_multi_layer
);
return
P_result
;
}
This diff is collapsed.
Click to expand it.
Core/Computation/DepthProbeComputation.h
0 → 100644
+
51
−
0
View file @
af1bbdef
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Computation/DepthProbeComputation.h
//! @brief Declares class DepthProbeComputation.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef DEPTHPROBECOMPUTATION_H
#define DEPTHPROBECOMPUTATION_H
#include
"IComputation.h"
#include
"Complex.h"
#include
"SimulationOptions.h"
#include
"DepthProbeComputationTerm.h"
class
IFresnelMap
;
class
MultiLayer
;
struct
HomogeneousRegion
;
//! Performs a single-threaded depth probe computation with given sample.
//!
//! Controlled by the multi-threading machinery in Simulation::runSingleSimulation().
//!
//! @ingroup algorithms_internal
class
DepthProbeComputation
:
public
IComputation
{
using
DepthProbeElementIter
=
std
::
vector
<
DepthProbeElement
>::
iterator
;
public:
DepthProbeComputation
(
const
MultiLayer
&
multilayer
,
const
SimulationOptions
&
options
,
ProgressHandler
&
progress
,
DepthProbeElementIter
begin_it
,
DepthProbeElementIter
end_it
);
virtual
~
DepthProbeComputation
();
private:
void
runProtected
()
override
;
std
::
unique_ptr
<
IFresnelMap
>
createFresnelMap
();
DepthProbeElementIter
m_begin_it
,
m_end_it
;
std
::
unique_ptr
<
IFresnelMap
>
mP_fresnel_map
;
DepthProbeComputationTerm
m_computation_term
;
};
#endif // DEPTHPROBECOMPUTATION_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