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
c4c83b07
Commit
c4c83b07
authored
2 years ago
by
Anna Wellmann
Browse files
Options
Downloads
Patches
Plain Diff
Change name of local variable 'idx' to avoid confusion with the outer variable
parent
b1e44982
No related branches found
No related tags found
1 merge request
!173
Fix some Sonarqube code smells
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp
+23
-19
23 additions, 19 deletions
...gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp
with
23 additions
and
19 deletions
src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp
+
23
−
19
View file @
c4c83b07
...
@@ -156,7 +156,8 @@ void VTKFile::unloadFile()
...
@@ -156,7 +156,8 @@ void VTKFile::unloadFile()
this
->
loaded
=
false
;
this
->
loaded
=
false
;
}
}
void
VTKFile
::
getData
(
real
*
data
,
uint
numberOfNodes
,
const
std
::
vector
<
uint
>&
readIndices
,
const
std
::
vector
<
uint
>&
writeIndices
,
uint
offsetRead
,
uint
offsetWrite
)
void
VTKFile
::
getData
(
real
*
data
,
uint
numberOfNodes
,
const
std
::
vector
<
uint
>
&
readIndices
,
const
std
::
vector
<
uint
>
&
writeIndices
,
uint
offsetRead
,
uint
offsetWrite
)
{
{
if
(
!
this
->
loaded
)
loadFile
();
if
(
!
this
->
loaded
)
loadFile
();
...
@@ -305,7 +306,10 @@ void VTKReader::fillArrays(std::vector<real>& coordsY, std::vector<real>& coords
...
@@ -305,7 +306,10 @@ void VTKReader::fillArrays(std::vector<real>& coordsY, std::vector<real>& coords
this
->
planeNeighbor0PM
.
push_back
(
writeIdx
);
this
->
planeNeighbor0PM
.
push_back
(
writeIdx
);
this
->
planeNeighbor0MP
.
push_back
(
writeIdx
);
this
->
planeNeighbor0MP
.
push_back
(
writeIdx
);
this
->
planeNeighbor0MM
.
push_back
(
writeIdx
);
this
->
planeNeighbor0MM
.
push_back
(
writeIdx
);
found0PP
=
true
;
found0PM
=
true
;
found0MM
=
true
;
found0MP
=
true
;
found0PP
=
true
;
found0PM
=
true
;
found0MM
=
true
;
found0MP
=
true
;
}
}
else
else
{
{
...
@@ -325,40 +329,40 @@ void VTKReader::fillArrays(std::vector<real>& coordsY, std::vector<real>& coords
...
@@ -325,40 +329,40 @@ void VTKReader::fillArrays(std::vector<real>& coordsY, std::vector<real>& coords
if
(
!
found0PP
)
//NT in simulation is EN in precursor
if
(
!
found0PP
)
//NT in simulation is EN in precursor
{
{
int
i
d
x
=
file
.
findNeighborPPM
(
posY
,
posZ
,
0.
f
);
int
i
nde
x
=
file
.
findNeighborPPM
(
posY
,
posZ
,
0.
f
);
if
(
i
d
x
!=-
1
)
if
(
i
nde
x
!=-
1
)
{
{
found0PP
=
true
;
found0PP
=
true
;
real
dy
=
file
.
getX
(
i
d
x
)
-
posY
;
real
dy
=
file
.
getX
(
i
nde
x
)
-
posY
;
real
dz
=
file
.
getY
(
i
d
x
)
-
posZ
;
real
dz
=
file
.
getY
(
i
nde
x
)
-
posZ
;
this
->
weights0PP
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
weights0PP
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
planeNeighbor0PP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
d
x
));
this
->
planeNeighbor0PP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
nde
x
));
}
}
}
}
if
(
!
found0PM
)
//NB in simulation is ES in precursor
if
(
!
found0PM
)
//NB in simulation is ES in precursor
{
{
int
i
d
x
=
file
.
findNeighborPMM
(
posY
,
posZ
,
0.
f
);
int
i
nde
x
=
file
.
findNeighborPMM
(
posY
,
posZ
,
0.
f
);
if
(
i
d
x
!=-
1
)
if
(
i
nde
x
!=-
1
)
{
{
found0PM
=
true
;
found0PM
=
true
;
real
dy
=
file
.
getX
(
i
d
x
)
-
posY
;
real
dy
=
file
.
getX
(
i
nde
x
)
-
posY
;
real
dz
=
file
.
getY
(
i
d
x
)
-
posZ
;
real
dz
=
file
.
getY
(
i
nde
x
)
-
posZ
;
this
->
weights0PM
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
weights0PM
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
planeNeighbor0PP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
d
x
));
this
->
planeNeighbor0PP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
nde
x
));
}
}
}
}
if
(
!
found0MP
)
//ST in simulation is WN in precursor
if
(
!
found0MP
)
//ST in simulation is WN in precursor
{
{
int
i
d
x
=
file
.
findNeighborMPM
(
posY
,
posZ
,
0.
f
);
int
i
nde
x
=
file
.
findNeighborMPM
(
posY
,
posZ
,
0.
f
);
if
(
i
d
x
!=-
1
)
if
(
i
nde
x
!=-
1
)
{
{
found0MP
=
true
;
found0MP
=
true
;
real
dy
=
file
.
getX
(
i
d
x
)
-
posY
;
real
dy
=
file
.
getX
(
i
nde
x
)
-
posY
;
real
dz
=
file
.
getY
(
i
d
x
)
-
posZ
;
real
dz
=
file
.
getY
(
i
nde
x
)
-
posZ
;
this
->
weights0MP
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
weights0MP
.
emplace_back
(
1.
f
/
(
dy
*
dy
+
dz
*
dz
+
eps
));
this
->
planeNeighbor0MP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
d
x
));
this
->
planeNeighbor0MP
.
emplace_back
(
getWriteIndex
(
level
,
fileId
,
i
nde
x
));
}
}
}
}
...
@@ -413,7 +417,7 @@ void VTKReader::getNextData(real* data, uint numberOfNodes, real time)
...
@@ -413,7 +417,7 @@ void VTKReader::getNextData(real* data, uint numberOfNodes, real time)
{
{
numberOfFiles
++
;
numberOfFiles
++
;
printf
(
"switching to precursor file no. %z
d
\n
"
,
numberOfFiles
);
printf
(
"switching to precursor file no. %z
u
\n
"
,
numberOfFiles
);
if
(
numberOfFiles
==
this
->
fileCollection
->
files
[
level
][
id
].
size
())
if
(
numberOfFiles
==
this
->
fileCollection
->
files
[
level
][
id
].
size
())
throw
std
::
runtime_error
(
"Not enough Precursor Files to read"
);
throw
std
::
runtime_error
(
"Not enough Precursor Files to read"
);
...
@@ -437,4 +441,4 @@ void VTKReader::getNextData(real* data, uint numberOfNodes, real time)
...
@@ -437,4 +441,4 @@ void VTKReader::getNextData(real* data, uint numberOfNodes, real time)
this
->
nFile
[
level
][
id
]
=
numberOfFiles
;
this
->
nFile
[
level
][
id
]
=
numberOfFiles
;
}
}
// }
// }
}
}
\ No newline at end of file
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