Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
d61fc059
Commit
d61fc059
authored
Mar 28, 2017
by
Dave Moxey
Browse files
Merge branch 'fix/gmsh_writer' into 'master'
fix/gmsh-writer See merge request !747
parents
b1bf964a
4cf3f60c
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
d61fc059
...
...
@@ -11,6 +11,11 @@ v4.5.0
**Documentation**
:
-
Added the developer-guide repository as a submodule (!751)
v4.4.1
------
**NekMesh**
:
-
Fix memory consumption issue with Gmsh output (!747)
v4.4.0
------
**Library**
:
...
...
library/NekMeshUtils/MeshElements/Mesh.cpp
View file @
d61fc059
...
...
@@ -33,9 +33,9 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <NekMeshUtils/MeshElements/Mesh.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <NekMeshUtils/MeshElements/Mesh.h>
using
namespace
std
;
...
...
@@ -96,17 +96,22 @@ unsigned int Mesh::GetNumEntities()
* - Finally, any boundary elements are updated so that they have the same
* interior degrees of freedom as their corresponding edge or face links.
*/
void
Mesh
::
MakeOrder
(
int
order
,
LibUtilities
::
PointsType
distType
)
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
int
id
=
m_vertexSet
.
size
();
EdgeSet
::
iterator
eit
;
FaceSet
::
iterator
fit
;
boost
::
unordered_map
<
int
,
SpatialDomains
::
Geometry1DSharedPtr
>
edgeGeoms
;
boost
::
unordered_map
<
int
,
SpatialDomains
::
Geometry2DSharedPtr
>
faceGeoms
;
boost
::
unordered_map
<
int
,
SpatialDomains
::
GeometrySharedPtr
>
volGeoms
;
boost
::
unordered_map
<
int
,
EdgeSharedPtr
>
edgeCopies
;
boost
::
unordered_map
<
int
,
FaceSharedPtr
>
faceCopies
;
// Decide on distribution of points to use for each shape type based on the
// input we've been supplied.
...
...
@@ -127,7 +132,7 @@ void Mesh::MakeOrder(int order,
pTypes
[
LibUtilities
::
eTriangle
]
=
LibUtilities
::
eNodalTriElec
;
pTypes
[
LibUtilities
::
eQuadrilateral
]
=
LibUtilities
::
eGaussLobattoLegendre
;
pTypes
[
LibUtilities
::
ePrism
]
=
LibUtilities
::
eNodalPrismElec
;
pTypes
[
LibUtilities
::
ePrism
]
=
LibUtilities
::
eNodalPrismElec
;
pTypes
[
LibUtilities
::
eTetrahedron
]
=
LibUtilities
::
eNodalTetElec
;
pTypes
[
LibUtilities
::
eHexahedron
]
=
LibUtilities
::
eGaussLobattoLegendre
;
}
...
...
@@ -136,32 +141,20 @@ void Mesh::MakeOrder(int order,
ASSERTL1
(
false
,
"Mesh::MakeOrder does not support this points type."
);
}
// Begin by
generating Nektar++ geometry
objects for edges, faces
and
//
elements
so that we don't affect any neighbouring elements in the mesh as
// 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.
for
(
eit
=
m_edgeSet
.
begin
();
eit
!=
m_edgeSet
.
end
();
eit
++
)
{
SpatialDomains
::
Geometry1DSharedPtr
geom
=
(
*
eit
)
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
edgeGeoms
[(
*
eit
)
->
m_id
]
=
geom
;
}
for
(
fit
=
m_faceSet
.
begin
();
fit
!=
m_faceSet
.
end
();
fit
++
)
// at the same time we delete the curvature from the original edge
for
(
eit
=
m_edgeSet
.
begin
();
eit
!=
m_edgeSet
.
end
();
eit
++
)
{
SpatialDomains
::
Geometry2DSharedPtr
geom
=
(
*
fit
)
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
faceGeoms
[(
*
fit
)
->
m_id
]
=
geom
;
edgeCopies
[(
*
eit
)
->
m_id
]
=
EdgeSharedPtr
(
new
Edge
(
*
(
*
eit
)));
(
*
eit
)
->
m_edgeNodes
.
clear
();
}
for
(
int
i
=
0
;
i
<
m_element
[
m_expDim
].
size
();
i
++
)
for
(
fit
=
m_faceSet
.
begin
();
fit
!=
m_faceSet
.
end
();
fit
++
)
{
ElementSharedPtr
el
=
m_element
[
m_expDim
][
i
];
SpatialDomains
::
GeometrySharedPtr
geom
=
el
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
volGeoms
[
el
->
GetId
()]
=
geom
;
faceCopies
[(
*
fit
)
->
m_id
]
=
FaceSharedPtr
(
new
Face
(
*
(
*
fit
)));
(
*
fit
)
->
m_faceNodes
.
clear
();
}
boost
::
unordered_set
<
int
>
processedEdges
,
processedFaces
,
processedVolumes
;
...
...
@@ -176,8 +169,8 @@ void Mesh::MakeOrder(int order,
{
if
(
m_verbose
)
{
LibUtilities
::
PrintProgressbar
(
ct
,
m_edgeSet
.
size
(),
"MakeOrder: Edges: "
);
LibUtilities
::
PrintProgressbar
(
ct
,
m_edgeSet
.
size
(),
"MakeOrder: Edges: "
);
}
int
edgeId
=
(
*
eit
)
->
m_id
;
...
...
@@ -186,8 +179,12 @@ void Mesh::MakeOrder(int order,
continue
;
}
(
*
eit
)
->
MakeOrder
(
order
,
edgeGeoms
[
edgeId
],
pTypes
[
LibUtilities
::
eSegment
],
m_spaceDim
,
id
);
EdgeSharedPtr
cpEdge
=
edgeCopies
[
edgeId
];
SpatialDomains
::
GeometrySharedPtr
geom
=
cpEdge
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
(
*
eit
)
->
MakeOrder
(
order
,
geom
,
pTypes
[
LibUtilities
::
eSegment
],
m_spaceDim
,
id
);
processedEdges
.
insert
(
edgeId
);
}
...
...
@@ -198,8 +195,8 @@ void Mesh::MakeOrder(int order,
{
if
(
m_verbose
)
{
LibUtilities
::
PrintProgressbar
(
ct
,
m_faceSet
.
size
(),
"MakeOrder: Faces: "
);
LibUtilities
::
PrintProgressbar
(
ct
,
m_faceSet
.
size
(),
"MakeOrder: Faces: "
);
}
int
faceId
=
(
*
fit
)
->
m_id
;
...
...
@@ -208,10 +205,14 @@ void Mesh::MakeOrder(int order,
continue
;
}
LibUtilities
::
ShapeType
type
=
(
*
fit
)
->
m_vertexList
.
size
()
==
3
?
LibUtilities
::
eTriangle
:
LibUtilities
::
eQuadrilateral
;
(
*
fit
)
->
MakeOrder
(
order
,
faceGeoms
[
faceId
],
pTypes
[
type
],
m_spaceDim
,
id
);
FaceSharedPtr
cpFace
=
faceCopies
[
faceId
];
SpatialDomains
::
GeometrySharedPtr
geom
=
cpFace
->
GetGeom
(
m_spaceDim
);
geom
->
FillGeom
();
LibUtilities
::
ShapeType
type
=
(
*
fit
)
->
m_vertexList
.
size
()
==
3
?
LibUtilities
::
eTriangle
:
LibUtilities
::
eQuadrilateral
;
(
*
fit
)
->
MakeOrder
(
order
,
geom
,
pTypes
[
type
],
m_spaceDim
,
id
);
processedFaces
.
insert
(
faceId
);
}
...
...
@@ -219,7 +220,7 @@ void Mesh::MakeOrder(int order,
for
(
int
i
=
0
;
i
<
m_element
[
1
].
size
();
++
i
)
{
ElementSharedPtr
el
=
m_element
[
1
][
i
];
EdgeSharedPtr
edge
=
el
->
GetEdgeLink
();
EdgeSharedPtr
edge
=
el
->
GetEdgeLink
();
if
(
!
edge
)
{
...
...
@@ -235,7 +236,7 @@ void Mesh::MakeOrder(int order,
for
(
int
i
=
0
;
i
<
m_element
[
2
].
size
();
++
i
)
{
ElementSharedPtr
el
=
m_element
[
2
][
i
];
FaceSharedPtr
face
=
el
->
GetFaceLink
();
FaceSharedPtr
face
=
el
->
GetFaceLink
();
if
(
!
face
)
{
...
...
@@ -256,9 +257,10 @@ void Mesh::MakeOrder(int order,
{
LibUtilities
::
PrintProgressbar
(
i
,
nElmt
,
"MakeOrder: Elements: "
);
}
ElementSharedPtr
el
=
m_element
[
m_expDim
][
i
];
el
->
MakeOrder
(
order
,
volGeoms
[
el
->
GetId
()],
pTypes
[
el
->
GetConf
().
m_e
],
m_spaceDim
,
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
)
...
...
@@ -266,6 +268,5 @@ void Mesh::MakeOrder(int order,
cout
<<
endl
;
}
}
}
}
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