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
ea8639f5
Commit
ea8639f5
authored
1 year ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
add comments
parent
1516b417
No related branches found
No related tags found
1 merge request
!2443
Few comments to explain some points in the slicing algorithm
Pipeline
#134000
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Resample/Processed/ReSample.cpp
+3
-2
3 additions, 2 deletions
Resample/Processed/ReSample.cpp
Resample/Slice/SliceStack.h
+2
-0
2 additions, 0 deletions
Resample/Slice/SliceStack.h
with
5 additions
and
2 deletions
Resample/Processed/ReSample.cpp
+
3
−
2
View file @
ea8639f5
...
@@ -143,7 +143,7 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
...
@@ -143,7 +143,7 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
const
ZLimits
&
particle_span
=
particle_spans
[
i
];
const
ZLimits
&
particle_span
=
particle_spans
[
i
];
// if no slicing is needed, create single slice for the layer
// if no slicing is needed, create single slice for the layer
if
(
!
particle_span
.
isFinite
())
{
if
(
!
particle_span
.
isFinite
())
{
// also if layer contains no particles
if
(
i
==
nLayers
-
1
)
if
(
i
==
nLayers
-
1
)
tl
=
0.0
;
tl
=
0.0
;
if
(
i
==
0
)
if
(
i
==
0
)
...
@@ -168,10 +168,11 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
...
@@ -168,10 +168,11 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
}
}
// middle or bottom layer
// middle or bottom layer
else
{
else
{
ASSERT
(
top
<=
0
);
if
(
top
<
0
)
{
if
(
top
<
0
)
{
result
.
addSlice
(
-
top
,
*
material
,
roughness
);
result
.
addSlice
(
-
top
,
*
material
,
roughness
);
result
.
addNSlices
(
nSlices
,
top
-
bottom
,
*
material
);
result
.
addNSlices
(
nSlices
,
top
-
bottom
,
*
material
);
}
else
{
}
else
{
// top == 0
result
.
addNSlices
(
nSlices
,
top
-
bottom
,
*
material
,
roughness
);
result
.
addNSlices
(
nSlices
,
top
-
bottom
,
*
material
,
roughness
);
}
}
// middle layer
// middle layer
...
...
This diff is collapsed.
Click to expand it.
Resample/Slice/SliceStack.h
+
2
−
0
View file @
ea8639f5
...
@@ -48,6 +48,8 @@ public:
...
@@ -48,6 +48,8 @@ public:
SliceStack
setBField
(
const
R3
&
externalField
);
SliceStack
setBField
(
const
R3
&
externalField
);
// the name "bottom roughness" refers to the normal top roughness of a slice, but from the point
// of view of the inverted stack used in the recurrence relation computation algorithm.
const
LayerRoughness
*
bottomRoughness
(
size_t
i_slice
)
const
;
const
LayerRoughness
*
bottomRoughness
(
size_t
i_slice
)
const
;
RoughnessModel
roughnessModel
()
const
{
return
m_roughness_model
;
}
RoughnessModel
roughnessModel
()
const
{
return
m_roughness_model
;
}
...
...
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