Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
Sudesh Rathnayake
waLBerla
Commits
b0c7f35c
Commit
b0c7f35c
authored
2 years ago
by
Philipp Suffa
Committed by
Jonas Plewinski
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Fix] Initialise FlagField with one flag exclusively
parent
cfdf0480
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h
+13
-5
13 additions, 5 deletions
...metry/initializer/BoundarySetterFlagFieldSpecialization.h
with
13 additions
and
5 deletions
src/geometry/initializer/BoundarySetterFlagFieldSpecialization.h
+
13
−
5
View file @
b0c7f35c
...
@@ -136,22 +136,30 @@ namespace initializer {
...
@@ -136,22 +136,30 @@ namespace initializer {
template
<
typename
Flag_T
>
template
<
typename
Flag_T
>
void
BoundarySetter
<
FlagField
<
Flag_T
>>::
set
(
cell_idx_t
x
,
cell_idx_t
y
,
cell_idx_t
z
)
void
BoundarySetter
<
FlagField
<
Flag_T
>>::
set
(
cell_idx_t
x
,
cell_idx_t
y
,
cell_idx_t
z
)
{
{
flagField_
->
addFlag
(
x
,
y
,
z
,
flag_
);
//Check if no flag is set yet to avoid multiple flags per cell on initialization
if
(
flagField_
->
get
(
x
,
y
,
z
)
==
Flag_T
(
0
))
flagField_
->
addFlag
(
x
,
y
,
z
,
flag_
);
}
}
template
<
typename
Flag_T
>
template
<
typename
Flag_T
>
void
BoundarySetter
<
FlagField
<
Flag_T
>>::
set
(
const
CellInterval
&
ci
)
void
BoundarySetter
<
FlagField
<
Flag_T
>>::
set
(
const
CellInterval
&
ci
)
{
{
for
(
auto
it
=
flagField_
->
beginSliceXYZ
(
ci
);
it
!=
flagField_
->
end
();
++
it
)
for
(
auto
it
=
flagField_
->
beginSliceXYZ
(
ci
);
it
!=
flagField_
->
end
();
++
it
)
{
field
::
addFlag
(
it
,
flag_
);
//Check if no flag is set yet to avoid multiple flags per cell on initialization
if
(
*
it
==
Flag_T
(
0
))
field
::
addFlag
(
it
,
flag_
);
}
}
}
template
<
typename
Flag_T
>
template
<
typename
Flag_T
>
template
<
typename
CellIterator
>
template
<
typename
CellIterator
>
void
BoundarySetter
<
FlagField
<
Flag_T
>
>::
set
(
const
CellIterator
&
begin
,
const
CellIterator
&
end
)
void
BoundarySetter
<
FlagField
<
Flag_T
>
>::
set
(
const
CellIterator
&
begin
,
const
CellIterator
&
end
)
{
{
for
(
auto
it
=
begin
;
it
!=
end
;
++
it
)
for
(
auto
it
=
begin
;
it
!=
end
;
++
it
)
{
flagField_
->
addFlag
(
it
->
x
(),
it
->
y
(),
it
->
z
(),
flag_
);
//Check if no flag is set yet to avoid multiple flags per cell on initialization
if
(
flagField_
->
get
(
it
->
x
(),
it
->
y
(),
it
->
z
())
==
Flag_T
(
0
))
flagField_
->
addFlag
(
it
->
x
(),
it
->
y
(),
it
->
z
(),
flag_
);
}
}
}
}
// namespace initializer
}
// namespace initializer
...
...
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