Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iRMB
VirtualFluids
Commits
9ec7a961
Commit
9ec7a961
authored
2 years ago
by
Anna Wellmann
Browse files
Options
Downloads
Patches
Plain Diff
Use parH instead of para in NeighborDebugWriter
parent
eb0bcb57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!182
Fix bug and add some tests in NeighborDebugWriter
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriter.hpp
+11
-11
11 additions, 11 deletions
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriter.hpp
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriterTest.cpp
+2
-2
2 additions, 2 deletions
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriterTest.cpp
with
13 additions
and
13 deletions
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriter.hpp
+
11
−
11
View file @
9ec7a961
...
...
@@ -16,30 +16,30 @@
namespace
NeighborDebugWriter
{
inline
void
writeNeighborLinkLines
(
Parameter
*
par
a
,
int
level
,
int
direction
,
const
std
::
string
&
name
,
inline
void
writeNeighborLinkLines
(
LBMSimulation
Parameter
*
par
H
,
int
direction
,
const
std
::
string
&
name
,
WbWriter
*
writer
)
{
VF_LOG_INFO
(
"Write node links in direction {}."
,
direction
);
const
unsigned
long
long
numberOfNodes
=
par
a
->
getParH
(
level
)
->
numberOfNodes
;
const
unsigned
long
long
numberOfNodes
=
par
H
->
numberOfNodes
;
std
::
vector
<
UbTupleFloat3
>
nodes
;
nodes
.
reserve
(
numberOfNodes
);
std
::
vector
<
UbTupleInt2
>
cells
;
cells
.
reserve
(
numberOfNodes
/
2
);
for
(
size_t
position
=
0
;
position
<
numberOfNodes
;
position
++
)
{
if
(
par
a
->
getParH
(
level
)
->
typeOfGridNode
[
position
]
!=
GEO_FLUID
)
if
(
par
H
->
typeOfGridNode
[
position
]
!=
GEO_FLUID
)
continue
;
const
double
x1
=
par
a
->
getParH
(
level
)
->
coordinateX
[
position
];
const
double
x2
=
par
a
->
getParH
(
level
)
->
coordinateY
[
position
];
const
double
x3
=
par
a
->
getParH
(
level
)
->
coordinateZ
[
position
];
const
double
x1
=
par
H
->
coordinateX
[
position
];
const
double
x2
=
par
H
->
coordinateY
[
position
];
const
double
x3
=
par
H
->
coordinateZ
[
position
];
const
uint
positionNeighbor
=
getNeighborIndex
(
par
a
->
getParH
(
level
).
get
()
,
(
uint
)
position
,
direction
);
const
uint
positionNeighbor
=
getNeighborIndex
(
par
H
,
(
uint
)
position
,
direction
);
const
double
x1Neighbor
=
par
a
->
getParH
(
level
)
->
coordinateX
[
positionNeighbor
];
const
double
x2Neighbor
=
par
a
->
getParH
(
level
)
->
coordinateY
[
positionNeighbor
];
const
double
x3Neighbor
=
par
a
->
getParH
(
level
)
->
coordinateZ
[
positionNeighbor
];
const
double
x1Neighbor
=
par
H
->
coordinateX
[
positionNeighbor
];
const
double
x2Neighbor
=
par
H
->
coordinateY
[
positionNeighbor
];
const
double
x3Neighbor
=
par
H
->
coordinateZ
[
positionNeighbor
];
nodes
.
emplace_back
(
float
(
x1
),
float
(
x2
),
float
(
x3
));
nodes
.
emplace_back
(
float
(
x1Neighbor
),
float
(
x2Neighbor
),
float
(
x3Neighbor
));
...
...
@@ -55,7 +55,7 @@ inline void writeNeighborLinkLinesDebug(Parameter *para)
for
(
size_t
direction
=
vf
::
lbm
::
dir
::
STARTDIR
;
direction
<=
vf
::
lbm
::
dir
::
ENDDIR
;
direction
++
)
{
const
std
::
string
fileName
=
para
->
getFName
()
+
"_"
+
StringUtil
::
toString
<
int
>
(
level
)
+
"_Link_"
+
std
::
to_string
(
direction
)
+
"_Debug.vtk"
;
writeNeighborLinkLines
(
para
,
level
,
(
int
)
direction
,
fileName
,
WbWriterVtkXmlBinary
::
getInstance
());
writeNeighborLinkLines
(
para
->
getParH
(
level
).
get
()
,
(
int
)
direction
,
fileName
,
WbWriterVtkXmlBinary
::
getInstance
());
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/gpu/VirtualFluids_GPU/Output/NeighborDebugWriterTest.cpp
+
2
−
2
View file @
9ec7a961
...
...
@@ -54,7 +54,7 @@ TEST_F(NeighborDebugWriterTest, writeNeighborLinkLinesOnlyFLuidNodes)
std
::
vector
<
UbTupleFloat3
>
expectedNodes
=
{
oneCoord
,
threeCoord
,
oneCoord
,
threeCoord
,
threeCoord
,
threeCoord
};
std
::
vector
<
UbTupleInt2
>
expectedLines
=
{
UbTupleInt2
(
0
,
1
),
UbTupleInt2
(
2
,
3
),
UbTupleInt2
(
4
,
5
)
};
NeighborDebugWriter
::
writeNeighborLinkLines
(
para
.
get
(),
level
,
direction
,
"name"
,
&
writerSpy
);
NeighborDebugWriter
::
writeNeighborLinkLines
(
para
->
get
ParH
(
level
).
get
()
,
direction
,
"name"
,
&
writerSpy
);
EXPECT_THAT
(
writerSpy
.
nodes
.
size
(),
testing
::
Eq
(
numberOfNodes
*
2
));
EXPECT_THAT
(
writerSpy
.
lines
.
size
(),
testing
::
Eq
(
numberOfNodes
));
...
...
@@ -71,7 +71,7 @@ TEST_F(NeighborDebugWriterTest, writeNeighborLinkLinesOneSolidNode)
std
::
vector
<
UbTupleFloat3
>
expectedNodes
=
{
oneCoord
,
threeCoord
,
oneCoord
,
threeCoord
};
std
::
vector
<
UbTupleInt2
>
expectedLines
=
{
UbTupleInt2
(
0
,
1
),
UbTupleInt2
(
2
,
3
)};
NeighborDebugWriter
::
writeNeighborLinkLines
(
para
.
get
(),
level
,
direction
,
"name"
,
&
writerSpy
);
NeighborDebugWriter
::
writeNeighborLinkLines
(
para
->
get
ParH
(
level
).
get
()
,
direction
,
"name"
,
&
writerSpy
);
EXPECT_THAT
(
writerSpy
.
nodes
.
size
(),
testing
::
Eq
((
numberOfNodes
-
1
)
*
2
));
EXPECT_THAT
(
writerSpy
.
lines
.
size
(),
testing
::
Eq
(
numberOfNodes
-
1
));
...
...
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