Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tomáš Jakubec
GTMesh
Commits
c4df8b3f
Commit
c4df8b3f
authored
Apr 18, 2021
by
Tomáš Jakubec
Browse files
fix order in computeCellsCenterDifference
parent
1827d267
Pipeline
#2862
failed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/GTMesh/UnstructuredMesh/MeshFunctions/ComputeCellsCenterDifference.h
View file @
c4df8b3f
...
...
@@ -16,35 +16,28 @@ MeshDataContainer<Vector<Dimension, Real>, Dimension - 1> computeCellsCenterDiff
if
(
mesh
.
getBoundaryCells
().
empty
())
{
for
(
auto
&
face
:
mesh
.
getFaces
())
{
if
(
!
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
!
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
connectingLines
.
at
(
face
)
=
mesh
.
getCells
().
at
(
face
.
getCellLeftIndex
()).
getCenter
()
-
mesh
.
getCells
().
at
(
face
.
getCellRightIndex
()).
getCenter
();
}
else
if
(
!
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
connectingLines
.
at
(
face
)
=
mesh
.
getCells
().
at
(
face
.
getCellLeftIndex
()).
getCenter
()
-
face
.
getCenter
();
}
else
if
(
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
!
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
if
(
!
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
!
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
connectingLines
.
at
(
face
)
=
mesh
.
getCells
().
at
(
face
.
getCellRightIndex
()).
getCenter
()
-
face
.
getCenter
();
-
mesh
.
getCells
().
at
(
face
.
getCellLeftIndex
()).
getCenter
();
}
else
if
(
!
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
connectingLines
.
at
(
face
)
=
face
.
getCenter
()
-
mesh
.
getCells
().
at
(
face
.
getCellLeftIndex
()).
getCenter
();
}
else
if
(
isInvalidIndex
(
face
.
getCellLeftIndex
())
&&
!
isInvalidIndex
(
face
.
getCellRightIndex
()))
{
connectingLines
.
at
(
face
)
=
face
.
getCenter
()
-
mesh
.
getCells
().
at
(
face
.
getCellRightIndex
()).
getCenter
();
}
}
}
else
{
for
(
auto
&
face
:
mesh
.
getFaces
())
{
auto
&
cellLeft
=
isBoundaryIndex
(
face
.
getCellLeftIndex
())
?
mesh
.
getBoundaryCells
().
at
(
extractBoundaryIndex
(
face
.
getCellLeftIndex
()))
?
mesh
.
getBoundaryCells
().
at
(
extractBoundaryIndex
(
face
.
getCellLeftIndex
()))
:
mesh
.
getCells
().
at
(
face
.
getCellLeftIndex
());
auto
&
cellRight
=
isBoundaryIndex
(
face
.
getCellRightIndex
())
?
mesh
.
getBoundaryCells
().
at
(
extractBoundaryIndex
(
face
.
getCellRightIndex
()))
?
mesh
.
getBoundaryCells
().
at
(
extractBoundaryIndex
(
face
.
getCellRightIndex
()))
:
mesh
.
getCells
().
at
(
face
.
getCellRightIndex
());
connectingLines
.
at
(
face
)
=
cell
Lef
t
.
getCenter
()
-
cell
Righ
t
.
getCenter
();
connectingLines
.
at
(
face
)
=
cell
Righ
t
.
getCenter
()
-
cell
Lef
t
.
getCenter
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment