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
0fcdffa4
Commit
0fcdffa4
authored
8 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Move Rotations.* to Vector; minimize dependences of Layer.cpp
parent
df202056
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/Samples/Layer.cpp
+13
-19
13 additions, 19 deletions
Core/Samples/Layer.cpp
Core/Vectors/Rotations.cpp
+0
-0
0 additions, 0 deletions
Core/Vectors/Rotations.cpp
Core/Vectors/Rotations.h
+0
-0
0 additions, 0 deletions
Core/Vectors/Rotations.h
with
13 additions
and
19 deletions
Core/Samples/Layer.cpp
+
13
−
19
View file @
0fcdffa4
...
...
@@ -13,9 +13,8 @@
//
// ************************************************************************** //
#include
"Layer.h"
#include
"DecoratedLayerDWBASimulation.h"
#include
"MultiLayer.h"
using
namespace
BornAgain
;
...
...
@@ -34,10 +33,10 @@ Layer::Layer(const Layer& other) : ICompositeSample()
{
m_thickness
=
other
.
m_thickness
;
mp_material
=
0
;
if
(
other
.
mp_material
)
mp_material
=
other
.
mp_material
->
clone
();
for
(
size_t
i
=
0
;
i
<
other
.
getNumberOfLayouts
();
++
i
)
{
if
(
other
.
mp_material
)
mp_material
=
other
.
mp_material
->
clone
();
for
(
size_t
i
=
0
;
i
<
other
.
getNumberOfLayouts
();
++
i
)
addLayoutPtr
(
other
.
getLayout
(
i
)
->
clone
());
}
setNumberOfLayers
(
other
.
getNumberOfLayers
());
initialize
();
}
...
...
@@ -56,9 +55,8 @@ Layer* Layer::cloneInvertB() const
{
Layer
*
p_clone
=
new
Layer
();
p_clone
->
mp_material
=
Materials
::
createInvertedMaterial
(
this
->
mp_material
);
for
(
size_t
i
=
0
;
i
<
getNumberOfLayouts
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
getNumberOfLayouts
();
++
i
)
p_clone
->
addLayoutPtr
(
getLayout
(
i
)
->
cloneInvertB
());
}
p_clone
->
m_thickness
=
this
->
m_thickness
;
p_clone
->
setNumberOfLayers
(
getNumberOfLayers
());
p_clone
->
init_parameters
();
...
...
@@ -118,9 +116,8 @@ void Layer::addLayout(const ILayout &decoration)
const
ILayout
*
Layer
::
getLayout
(
size_t
i
)
const
{
if
(
i
>=
m_layouts
.
size
())
{
return
0
;
}
if
(
i
>=
m_layouts
.
size
())
return
nullptr
;
return
m_layouts
[
i
];
}
...
...
@@ -131,26 +128,23 @@ bool Layer::hasDWBASimulation() const
LayerDWBASimulation
*
Layer
::
createLayoutSimulation
(
size_t
layout_index
)
const
{
if
(
getNumberOfLayouts
()
==
0
||
layout_index
>=
getNumberOfLayouts
())
{
return
0
;
}
if
(
getNumberOfLayouts
()
==
0
||
layout_index
>=
getNumberOfLayouts
())
return
nullptr
;
return
new
DecoratedLayerDWBASimulation
(
this
,
layout_index
);
}
double
Layer
::
getTotalParticleSurfaceDensity
(
size_t
layout_index
)
const
{
if
(
getNumberOfLayouts
()
==
0
||
layout_index
>=
getNumberOfLayouts
())
{
if
(
getNumberOfLayouts
()
==
0
||
layout_index
>=
getNumberOfLayouts
())
return
0.0
;
}
return
getLayout
(
layout_index
)
->
getTotalParticleSurfaceDensity
();
}
double
Layer
::
getTotalAbundance
()
const
{
double
total_abundance
=
0.0
;
for
(
size_t
i
=
0
;
i
<
getNumberOfLayouts
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
getNumberOfLayouts
();
++
i
)
total_abundance
+=
getLayout
(
i
)
->
getTotalAbundance
();
}
return
total_abundance
;
}
...
...
@@ -179,8 +173,8 @@ void Layer::print(std::ostream& ostr) const
void
Layer
::
addLayoutPtr
(
ILayout
*
layout
)
{
if
(
!
layout
)
return
;
if
(
!
layout
)
return
;
m_layouts
.
push_back
(
layout
);
registerChild
(
layout
);
}
...
...
This diff is collapsed.
Click to expand it.
Core/
Sample
s/Rotations.cpp
→
Core/
Vector
s/Rotations.cpp
+
0
−
0
View file @
0fcdffa4
File moved
This diff is collapsed.
Click to expand it.
Core/
Sample
s/Rotations.h
→
Core/
Vector
s/Rotations.h
+
0
−
0
View file @
0fcdffa4
File moved
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