Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
b5c6bfac
Commit
b5c6bfac
authored
Apr 03, 2017
by
Dave Moxey
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some issues with revised Mesh::MakeOrder routine to address failing tests
parent
5c9235f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
25 deletions
+52
-25
library/NekMeshUtils/MeshElements/Edge.h
library/NekMeshUtils/MeshElements/Edge.h
+3
-2
library/NekMeshUtils/MeshElements/Face.h
library/NekMeshUtils/MeshElements/Face.h
+9
-4
library/NekMeshUtils/MeshElements/Mesh.cpp
library/NekMeshUtils/MeshElements/Mesh.cpp
+40
-19
No files found.
library/NekMeshUtils/MeshElements/Edge.h
View file @
b5c6bfac
...
...
@@ -73,8 +73,9 @@ public:
/// Copies an existing edge.
NEKMESHUTILS_EXPORT
Edge
(
const
Edge
&
pSrc
)
:
m_n1
(
pSrc
.
m_n1
),
m_n2
(
pSrc
.
m_n2
),
m_edgeNodes
(
pSrc
.
m_edgeNodes
),
m_curveType
(
pSrc
.
m_curveType
),
m_geom
(
pSrc
.
m_geom
)
:
m_id
(
pSrc
.
m_id
),
m_n1
(
pSrc
.
m_n1
),
m_n2
(
pSrc
.
m_n2
),
m_edgeNodes
(
pSrc
.
m_edgeNodes
),
m_curveType
(
pSrc
.
m_curveType
),
m_elLink
(
pSrc
.
m_elLink
),
m_parentCAD
(
pSrc
.
m_parentCAD
)
{
}
...
...
library/NekMeshUtils/MeshElements/Face.h
View file @
b5c6bfac
...
...
@@ -67,13 +67,18 @@ public:
std
::
vector
<
EdgeSharedPtr
>
pEdgeList
,
LibUtilities
::
PointsType
pCurveType
)
:
m_vertexList
(
pVertexList
),
m_edgeList
(
pEdgeList
),
m_faceNodes
(
pFaceNodes
),
m_curveType
(
pCurveType
),
m_geom
(){}
m_faceNodes
(
pFaceNodes
),
m_curveType
(
pCurveType
),
m_geom
()
{
}
/// Copy an existing face.
NEKMESHUTILS_EXPORT
Face
(
const
Face
&
pSrc
)
:
m_vertexList
(
pSrc
.
m_vertexList
),
m_edgeList
(
pSrc
.
m_edgeList
),
m_faceNodes
(
pSrc
.
m_faceNodes
),
m_curveType
(
pSrc
.
m_curveType
),
m_geom
(
pSrc
.
m_geom
){}
:
m_id
(
pSrc
.
m_id
),
m_vertexList
(
pSrc
.
m_vertexList
),
m_edgeList
(
pSrc
.
m_edgeList
),
m_faceNodes
(
pSrc
.
m_faceNodes
),
m_curveType
(
pSrc
.
m_curveType
),
m_geom
(
pSrc
.
m_geom
),
m_parentCAD
(
pSrc
.
m_parentCAD
)
{
}
NEKMESHUTILS_EXPORT
~
Face
()
{
...
...
library/NekMeshUtils/MeshElements/Mesh.cpp
View file @
b5c6bfac
...
...
@@ -98,12 +98,10 @@ unsigned int Mesh::GetNumEntities()
*/
void
Mesh
::
MakeOrder
(
int
order
,
LibUtilities
::
PointsType
distType
)
{
// going to make a copy of the curavture information
// cheaper that geom objects
// currently the geometry objects which make up a 3D element
// dont use the volume nodes, they are just stored,
// so we can get away without copying them
// Going to make a copy of the curavture information, since this is cheaper
// than using Nektar's Geometry objects. Currently, the geometry objects
// which make up a 3D element dont use the volume nodes, they are just
// stored, so we can get away without copying them.
int
id
=
m_vertexSet
.
size
();
...
...
@@ -141,19 +139,47 @@ void Mesh::MakeOrder(int order, LibUtilities::PointsType distType)
ASSERTL1
(
false
,
"Mesh::MakeOrder does not support this points type."
);
}
// Begin by coping mesh objects for edges, faces
// so that we don't affect any neighbouring elements in the mesh as
// we process each element.
// at the same time we delete the curvature from the original edge
// Begin by copying mesh objects for edges and faces so that we don't affect
// any neighbouring elements in the mesh as we process each element. At the
// same time we delete the curvature from the original edge and face, which
// will be re-added with the MakeOrder routine.
// First, we fill in the volume-interior nodes. This preserves the original
// curvature of the mesh.
const
int
nElmt
=
m_element
[
m_expDim
].
size
();
int
tmpId
=
0
;
for
(
int
i
=
0
;
i
<
nElmt
;
++
i
)
{
if
(
m_verbose
)
{
LibUtilities
::
PrintProgressbar
(
i
,
nElmt
,
"MakeOrder: Elements: "
);
}
ElementSharedPtr
el
=
m_element
[
m_expDim
][
i
];
SpatialDomains
::
GeometrySharedPtr
geom
=
el
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
el
->
MakeOrder
(
order
,
geom
,
pTypes
[
el
->
GetConf
().
m_e
],
m_spaceDim
,
tmpId
);
}
// Now make copies of each of the edges.
for
(
eit
=
m_edgeSet
.
begin
();
eit
!=
m_edgeSet
.
end
();
eit
++
)
{
edgeCopies
[(
*
eit
)
->
m_id
]
=
EdgeSharedPtr
(
new
Edge
(
*
(
*
eit
)));
(
*
eit
)
->
m_edgeNodes
.
clear
();
}
// Now copy faces. Make sure that this is a "deep copy", so that the face's
// edge list corresponds to the copied edges, otherwise we end up in a
// non-consistent state.
for
(
fit
=
m_faceSet
.
begin
();
fit
!=
m_faceSet
.
end
();
fit
++
)
{
faceCopies
[(
*
fit
)
->
m_id
]
=
FaceSharedPtr
(
new
Face
(
*
(
*
fit
)));
FaceSharedPtr
tmpFace
=
FaceSharedPtr
(
new
Face
(
*
(
*
fit
)));
for
(
int
i
=
0
;
i
<
tmpFace
->
m_edgeList
.
size
();
++
i
)
{
tmpFace
->
m_edgeList
[
i
]
=
edgeCopies
[
tmpFace
->
m_edgeList
[
i
]
->
m_id
];
}
faceCopies
[(
*
fit
)
->
m_id
]
=
tmpFace
;
(
*
fit
)
->
m_faceNodes
.
clear
();
}
...
...
@@ -249,18 +275,13 @@ void Mesh::MakeOrder(int order, LibUtilities::PointsType distType)
el
->
SetVolumeNodes
(
face
->
m_faceNodes
);
}
// Finally, fill in volumes.
const
int
nElmt
=
m_element
[
m_expDim
].
size
();
for
(
int
i
=
0
;
i
<
nElmt
;
++
i
)
{
if
(
m_verbose
)
vector
<
NodeSharedPtr
>
tmp
=
m_element
[
m_expDim
][
i
]
->
GetVolumeNodes
();
for
(
int
j
=
0
;
j
<
tmp
.
size
();
++
j
)
{
LibUtilities
::
PrintProgressbar
(
i
,
nElmt
,
"MakeOrder: Elements: "
)
;
tmp
[
j
]
->
m_id
=
id
++
;
}
ElementSharedPtr
el
=
m_element
[
m_expDim
][
i
];
SpatialDomains
::
GeometrySharedPtr
geom
=
el
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
el
->
MakeOrder
(
order
,
geom
,
pTypes
[
el
->
GetConf
().
m_e
],
m_spaceDim
,
id
);
}
if
(
m_verbose
)
...
...
Dave Moxey
@dmoxey
mentioned in commit
33307895
·
Apr 04, 2017
mentioned in commit
33307895
mentioned in commit 33307895c0bd523b384116dd36587d84b06bcad0
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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