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
0df4c01b
Commit
0df4c01b
authored
1 year ago
by
Anna Wellmann
Browse files
Options
Downloads
Patches
Plain Diff
Extract some functions in DebugDistributionWriter
parent
5394a9f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!307
[GPU] Add a cylinder geometry
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gpu/VirtualFluids_GPU/Output/DistributionDebugWriter.cpp
+22
-15
22 additions, 15 deletions
src/gpu/VirtualFluids_GPU/Output/DistributionDebugWriter.cpp
with
22 additions
and
15 deletions
src/gpu/VirtualFluids_GPU/Output/DistributionDebugWriter.cpp
+
22
−
15
View file @
0df4c01b
...
...
@@ -13,17 +13,17 @@ void DistributionDebugWriter::writeDistributions(const Parameter* para, uint tim
}
}
void
DistributionDebugWriter
::
writeDistributionsForLevel
(
const
Parameter
*
para
,
uint
level
,
uint
timestep
)
void
createFileNames
(
std
::
vector
<
std
::
string
>&
fileNames
,
uint
numberOfParts
,
uint
level
,
uint
timestep
,
const
Parameter
*
para
)
{
const
uint
numberOfParts
=
WriterUtilities
::
calculateNumberOfParts
(
para
,
level
);
std
::
vector
<
std
::
string
>
fileNames
;
for
(
uint
i
=
1
;
i
<=
numberOfParts
;
i
++
)
{
fileNames
.
push_back
(
para
->
getFName
()
+
"_bin_distributions"
+
WriterUtilities
::
makePartFileNameEnding
(
level
,
para
->
getMyProcessID
(),
i
,
timestep
));
}
}
std
::
vector
<
std
::
string
>
nodeDataNames
(
NUMBER_Of_DIRECTIONS
);
void
createNodeDataNames
(
std
::
vector
<
std
::
string
>&
nodeDataNames
)
{
nodeDataNames
.
resize
(
NUMBER_Of_DIRECTIONS
);
for
(
uint
dir
=
STARTDIR
;
dir
<=
ENDDIR
;
dir
++
)
{
const
size_t
minLenghtOfNumberString
=
2
;
// the number is padded with zeros to this length
...
...
@@ -32,18 +32,29 @@ void DistributionDebugWriter::writeDistributionsForLevel(const Parameter* para,
"f_"
+
std
::
string
(
minLenghtOfNumberString
-
std
::
min
(
minLenghtOfNumberString
,
numberString
.
length
()),
'0'
)
+
numberString
;
}
}
void
DistributionDebugWriter
::
writeDistributionsForLevel
(
const
Parameter
*
para
,
uint
level
,
uint
timestep
)
{
const
uint
numberOfParts
=
WriterUtilities
::
calculateNumberOfParts
(
para
,
level
);
std
::
vector
<
std
::
string
>
fileNames
;
createFileNames
(
fileNames
,
numberOfParts
,
level
,
timestep
,
para
);
std
::
vector
<
std
::
string
>
nodeDataNames
;
createNodeDataNames
(
nodeDataNames
);
uint
sizeOfNodes
;
uint
startPosition
;
uint
endPosition
;
std
::
array
<
uint
,
8
>
indicesOfOct
;
std
::
array
<
uint
,
8
>
relativePosInPart
;
uint
rel
Pos
InPart
;
uint
rel
ativePosition
InPart
;
const
LBMSimulationParameter
*
parH
=
para
->
getParHConst
(
level
).
get
();
Distributions27
distributions
=
parH
->
distributions
;
for
(
unsigned
int
part
=
0
;
part
<
(
uint
)
fileNames
.
size
()
;
part
++
)
{
for
(
unsigned
int
part
=
0
;
part
<
numberOfParts
;
part
++
)
{
sizeOfNodes
=
WriterUtilities
::
calculateNumberOfNodesInPart
(
para
,
level
,
part
);
startPosition
=
part
*
para
->
getLimitOfNodesForVTK
();
endPosition
=
startPosition
+
sizeOfNodes
;
...
...
@@ -59,17 +70,13 @@ void DistributionDebugWriter::writeDistributionsForLevel(const Parameter* para,
if
(
parH
->
typeOfGridNode
[
pos
]
!=
GEO_FLUID
)
continue
;
rel
Pos
InPart
=
pos
-
startPosition
;
rel
ativePosition
InPart
=
pos
-
startPosition
;
// node
double
x1
=
parH
->
coordinateX
[
pos
];
double
x2
=
parH
->
coordinateY
[
pos
];
double
x3
=
parH
->
coordinateZ
[
pos
];
nodes
[
relPosInPart
]
=
(
makeUbTuple
((
float
)(
x1
),
(
float
)(
x2
),
(
float
)(
x3
)));
nodes
[
relativePositionInPart
]
=
makeUbTuple
((
float
)
parH
->
coordinateX
[
pos
],
(
float
)
parH
->
coordinateY
[
pos
],
(
float
)
parH
->
coordinateZ
[
pos
]);
// node data
for
(
uint
dir
=
STARTDIR
;
dir
<=
ENDDIR
;
dir
++
)
{
nodeData
[
dir
][
rel
Pos
InPart
]
=
distributions
.
f
[
0
][
dir
*
parH
->
numberOfNodes
+
pos
];
nodeData
[
dir
][
rel
ativePosition
InPart
]
=
distributions
.
f
[
0
][
dir
*
parH
->
numberOfNodes
+
pos
];
}
WriterUtilities
::
getIndicesOfAllNodesInOct
(
indicesOfOct
,
pos
,
parH
);
...
...
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