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
091f2c3d
Commit
091f2c3d
authored
5 years ago
by
Beerwerth, Randolf
Browse files
Options
Downloads
Patches
Plain Diff
Enable SpecularStrategyBuilder
parent
03969dd0
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/ProcessedSample.cpp
+8
-7
8 additions, 7 deletions
Core/Computation/ProcessedSample.cpp
Core/Computation/SpecularComputation.cpp
+3
-4
3 additions, 4 deletions
Core/Computation/SpecularComputation.cpp
with
11 additions
and
11 deletions
Core/Computation/ProcessedSample.cpp
+
8
−
7
View file @
091f2c3d
...
@@ -24,12 +24,12 @@
...
@@ -24,12 +24,12 @@
#include
"ScalarFresnelMap.h"
#include
"ScalarFresnelMap.h"
#include
"SimulationOptions.h"
#include
"SimulationOptions.h"
#include
"Slice.h"
#include
"Slice.h"
#include
"SpecularScalarStrategy.h"
#include
"SpecularStrategyBuilder.h"
#include
"SpecularMagneticStrategy.h"
namespace
namespace
{
{
std
::
unique_ptr
<
IFresnelMap
>
CreateFresnelMap
(
const
std
::
vector
<
Slice
>&
slices
,
std
::
unique_ptr
<
IFresnelMap
>
CreateFresnelMap
(
const
MultiLayer
&
sample
,
const
std
::
vector
<
Slice
>&
slices
,
const
SimulationOptions
&
options
);
const
SimulationOptions
&
options
);
bool
ContainsMagneticMaterial
(
const
MultiLayer
&
sample
);
bool
ContainsMagneticMaterial
(
const
MultiLayer
&
sample
);
bool
ContainsMagneticSlice
(
const
std
::
vector
<
Slice
>&
slices
);
bool
ContainsMagneticSlice
(
const
std
::
vector
<
Slice
>&
slices
);
...
@@ -44,7 +44,7 @@ ProcessedSample::ProcessedSample(const MultiLayer& sample, const SimulationOptio
...
@@ -44,7 +44,7 @@ ProcessedSample::ProcessedSample(const MultiLayer& sample, const SimulationOptio
m_ext_field
{
sample
.
externalField
()}
m_ext_field
{
sample
.
externalField
()}
{
{
initSlices
(
sample
,
options
);
initSlices
(
sample
,
options
);
mP_fresnel_map
=
CreateFresnelMap
(
m_slices
,
options
);
mP_fresnel_map
=
CreateFresnelMap
(
sample
,
m_slices
,
options
);
initBFields
();
initBFields
();
initLayouts
(
sample
);
initLayouts
(
sample
);
initFresnelMap
(
options
);
initFresnelMap
(
options
);
...
@@ -279,14 +279,15 @@ void ProcessedSample::initFresnelMap(const SimulationOptions& sim_options)
...
@@ -279,14 +279,15 @@ void ProcessedSample::initFresnelMap(const SimulationOptions& sim_options)
namespace
namespace
{
{
std
::
unique_ptr
<
IFresnelMap
>
CreateFresnelMap
(
const
std
::
vector
<
Slice
>&
slices
,
std
::
unique_ptr
<
IFresnelMap
>
CreateFresnelMap
(
const
MultiLayer
&
sample
,
const
std
::
vector
<
Slice
>&
slices
,
const
SimulationOptions
&
options
)
const
SimulationOptions
&
options
)
{
{
std
::
unique_ptr
<
IFresnelMap
>
P_result
;
std
::
unique_ptr
<
IFresnelMap
>
P_result
;
if
(
ContainsMagneticSlice
(
slices
))
if
(
ContainsMagneticSlice
(
slices
))
P_result
.
reset
(
new
MatrixFresnelMap
(
std
::
make_unique
<
SpecularMagneticStrategy
>
(
)));
P_result
.
reset
(
new
MatrixFresnelMap
(
SpecularStrategyBuilder
::
build
(
sample
,
true
)));
else
else
P_result
.
reset
(
new
ScalarFresnelMap
(
std
::
make_unique
<
SpecularS
calarS
trategy
>
(
)));
P_result
.
reset
(
new
ScalarFresnelMap
(
SpecularStrategy
Builder
::
build
(
sample
,
false
)));
if
(
options
.
isIntegrate
())
if
(
options
.
isIntegrate
())
P_result
->
disableCaching
();
P_result
->
disableCaching
();
return
P_result
;
return
P_result
;
...
...
This diff is collapsed.
Click to expand it.
Core/Computation/SpecularComputation.cpp
+
3
−
4
View file @
091f2c3d
...
@@ -16,9 +16,8 @@
...
@@ -16,9 +16,8 @@
#include
"MultiLayer.h"
#include
"MultiLayer.h"
#include
"ProcessedSample.h"
#include
"ProcessedSample.h"
#include
"ProgressHandler.h"
#include
"ProgressHandler.h"
#include
"SpecularScalarStrategy.h"
#include
"SpecularMagneticStrategy.h"
#include
"SpecularSimulationElement.h"
#include
"SpecularSimulationElement.h"
#include
"SpecularStrategyBuilder.h"
static_assert
(
std
::
is_copy_constructible
<
SpecularComputation
>::
value
==
false
,
static_assert
(
std
::
is_copy_constructible
<
SpecularComputation
>::
value
==
false
,
"SpecularComputation should not be copy constructible"
);
"SpecularComputation should not be copy constructible"
);
...
@@ -35,9 +34,9 @@ SpecularComputation::SpecularComputation(const MultiLayer& multilayer,
...
@@ -35,9 +34,9 @@ SpecularComputation::SpecularComputation(const MultiLayer& multilayer,
{
{
if
(
mP_processed_sample
->
containsMagneticMaterial
()
if
(
mP_processed_sample
->
containsMagneticMaterial
()
||
mP_processed_sample
->
externalField
()
!=
kvector_t
{})
||
mP_processed_sample
->
externalField
()
!=
kvector_t
{})
m_computation_term
.
reset
(
new
SpecularMatrixTerm
(
std
::
make_unique
<
SpecularMagneticStrategy
>
(
)));
m_computation_term
.
reset
(
new
SpecularMatrixTerm
(
SpecularStrategyBuilder
::
build
(
multilayer
,
true
)));
else
else
m_computation_term
.
reset
(
new
SpecularScalarTerm
(
std
::
make_unique
<
SpecularS
calarS
trategy
>
(
)));
m_computation_term
.
reset
(
new
SpecularScalarTerm
(
SpecularStrategy
Builder
::
build
(
multilayer
,
false
)));
}
}
SpecularComputation
::~
SpecularComputation
()
=
default
;
SpecularComputation
::~
SpecularComputation
()
=
default
;
...
...
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