Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
dbd631ba
Commit
dbd631ba
authored
Jan 05, 2018
by
David Moxey
Browse files
Apply patches to NekMesh
parent
68226f7a
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
library/NekMeshUtils/MeshElements/Composite.h
View file @
dbd631ba
...
...
@@ -55,56 +55,6 @@ public:
{
}
/**
* @brief Generate a Nektar++ string describing the composite.
*
* The list of composites may include individual element IDs or ranges of
* element IDs.
*/
NEKMESHUTILS_EXPORT
std
::
string
GetXmlString
(
bool
doSort
=
true
)
{
std
::
stringstream
st
;
std
::
vector
<
ElementSharedPtr
>::
iterator
it
;
bool
range
=
false
;
int
vId
=
m_items
[
0
]
->
GetId
();
int
prevId
=
vId
;
st
<<
" "
<<
m_tag
<<
"["
<<
vId
;
for
(
it
=
m_items
.
begin
()
+
1
;
it
!=
m_items
.
end
();
++
it
)
{
// store previous element ID and get current one
prevId
=
vId
;
vId
=
(
*
it
)
->
GetId
();
// continue an already started range
if
(
prevId
>
-
1
&&
vId
==
prevId
+
1
)
{
range
=
true
;
// if this is the last element, it's the end of a range, so
// write
if
(
*
it
==
m_items
.
back
())
{
st
<<
"-"
<<
vId
;
}
continue
;
}
// terminate a range, if present
if
(
range
)
{
st
<<
"-"
<<
prevId
;
range
=
false
;
}
// write what will be either a single entry or start of new range
st
<<
","
<<
vId
;
}
// terminate
st
<<
"] "
;
return
st
.
str
();
}
/// ID of composite.
unsigned
int
m_id
;
/// Element type tag.
...
...
library/NekMeshUtils/MeshElements/Edge.cpp
View file @
dbd631ba
...
...
@@ -102,6 +102,8 @@ SpatialDomains::SegGeomSharedPtr Edge::GetGeom(int coordDim)
m_id
,
coordDim
,
p
);
}
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Face.cpp
View file @
dbd631ba
...
...
@@ -334,7 +334,7 @@ SpatialDomains::Geometry2DSharedPtr Face::GetGeom(int coordDim)
}
ret
=
MemoryManager
<
SpatialDomains
::
TriGeom
>::
AllocateSharedPtr
(
m_id
,
edges
,
edgeo
,
c
);
m_id
,
edges
,
c
);
}
else
{
...
...
@@ -399,7 +399,7 @@ SpatialDomains::Geometry2DSharedPtr Face::GetGeom(int coordDim)
ret
=
MemoryManager
<
SpatialDomains
::
QuadGeom
>::
AllocateSharedPtr
(
m_id
,
edges
,
edgeo
,
c
);
m_id
,
edges
,
c
);
}
}
else
...
...
@@ -407,16 +407,17 @@ SpatialDomains::Geometry2DSharedPtr Face::GetGeom(int coordDim)
if
(
nEdge
==
3
)
{
ret
=
MemoryManager
<
SpatialDomains
::
TriGeom
>::
AllocateSharedPtr
(
m_id
,
edges
,
edgeo
);
m_id
,
edges
);
}
else
{
ret
=
MemoryManager
<
SpatialDomains
::
QuadGeom
>::
AllocateSharedPtr
(
m_id
,
edges
,
edgeo
);
m_id
,
edges
);
}
}
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Hexahedron.cpp
View file @
dbd631ba
...
...
@@ -170,8 +170,10 @@ SpatialDomains::GeometrySharedPtr Hexahedron::GetGeom(int coordDim)
m_face
[
i
]
->
GetGeom
(
coordDim
));
}
ret
=
MemoryManager
<
SpatialDomains
::
HexGeom
>::
AllocateSharedPtr
(
faces
);
ret
=
MemoryManager
<
SpatialDomains
::
HexGeom
>::
AllocateSharedPtr
(
m_id
,
faces
);
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Line.cpp
View file @
dbd631ba
...
...
@@ -107,6 +107,7 @@ SpatialDomains::GeometrySharedPtr Line::GetGeom(int coordDim)
m_id
,
2
,
p
);
}
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Mesh.h
View file @
dbd631ba
...
...
@@ -36,6 +36,8 @@
#ifndef NEKMESHUTILS_MESHELEMENTS_MESH
#define NEKMESHUTILS_MESHELEMENTS_MESH
#include <set>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
#include <NekMeshUtils/MeshElements/Element.h>
#include <NekMeshUtils/MeshElements/Composite.h>
...
...
library/NekMeshUtils/MeshElements/Prism.cpp
View file @
dbd631ba
...
...
@@ -253,8 +253,10 @@ SpatialDomains::GeometrySharedPtr Prism::GetGeom(int coordDim)
faces
[
i
]
=
m_face
[
i
]
->
GetGeom
(
coordDim
);
}
ret
=
MemoryManager
<
SpatialDomains
::
PrismGeom
>::
AllocateSharedPtr
(
faces
);
ret
=
MemoryManager
<
SpatialDomains
::
PrismGeom
>::
AllocateSharedPtr
(
m_id
,
faces
);
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Pyramid.cpp
View file @
dbd631ba
...
...
@@ -164,7 +164,9 @@ SpatialDomains::GeometrySharedPtr Pyramid::GetGeom(int coordDim)
faces
[
i
]
=
m_face
[
i
]
->
GetGeom
(
coordDim
);
}
m_geom
=
MemoryManager
<
SpatialDomains
::
PyrGeom
>::
AllocateSharedPtr
(
faces
);
m_geom
=
MemoryManager
<
SpatialDomains
::
PyrGeom
>::
AllocateSharedPtr
(
m_id
,
faces
);
m_geom
->
Setup
();
return
m_geom
;
}
...
...
library/NekMeshUtils/MeshElements/Quadrilateral.cpp
View file @
dbd631ba
...
...
@@ -205,24 +205,17 @@ void Quadrilateral::MakeOrder(int order,
SpatialDomains
::
GeometrySharedPtr
Quadrilateral
::
GetGeom
(
int
coordDim
)
{
SpatialDomains
::
SegGeomSharedPtr
edges
[
4
];
SpatialDomains
::
PointGeomSharedPtr
verts
[
4
];
SpatialDomains
::
QuadGeomSharedPtr
ret
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
edges
[
i
]
=
m_edge
[
i
]
->
GetGeom
(
coordDim
);
verts
[
i
]
=
m_vertex
[
i
]
->
GetGeom
(
coordDim
);
}
StdRegions
::
Orientation
edgeorient
[
4
]
=
{
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
0
],
*
edges
[
1
]),
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
1
],
*
edges
[
2
]),
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
2
],
*
edges
[
3
]),
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
3
],
*
edges
[
0
])};
ret
=
MemoryManager
<
SpatialDomains
::
QuadGeom
>::
AllocateSharedPtr
(
m_id
,
verts
,
edges
,
edgeorient
);
m_id
,
edges
);
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Tetrahedron.cpp
View file @
dbd631ba
...
...
@@ -239,7 +239,9 @@ SpatialDomains::GeometrySharedPtr Tetrahedron::GetGeom(int coordDim)
m_face
[
i
]
->
GetGeom
(
coordDim
));
}
ret
=
MemoryManager
<
SpatialDomains
::
TetGeom
>::
AllocateSharedPtr
(
tfaces
);
ret
=
MemoryManager
<
SpatialDomains
::
TetGeom
>::
AllocateSharedPtr
(
m_id
,
tfaces
);
ret
->
Setup
();
return
ret
;
}
...
...
library/NekMeshUtils/MeshElements/Triangle.cpp
View file @
dbd631ba
...
...
@@ -121,22 +121,16 @@ Triangle::Triangle(ElmtConfig pConf,
SpatialDomains
::
GeometrySharedPtr
Triangle
::
GetGeom
(
int
coordDim
)
{
SpatialDomains
::
SegGeomSharedPtr
edges
[
3
];
SpatialDomains
::
PointGeomSharedPtr
verts
[
3
];
SpatialDomains
::
TriGeomSharedPtr
ret
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
edges
[
i
]
=
m_edge
[
i
]
->
GetGeom
(
coordDim
);
verts
[
i
]
=
m_vertex
[
i
]
->
GetGeom
(
coordDim
);
}
StdRegions
::
Orientation
edgeorient
[
3
]
=
{
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
0
],
*
edges
[
1
]),
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
1
],
*
edges
[
2
]),
SpatialDomains
::
SegGeom
::
GetEdgeOrientation
(
*
edges
[
2
],
*
edges
[
0
])};
ret
=
MemoryManager
<
SpatialDomains
::
TriGeom
>::
AllocateSharedPtr
(
m_id
,
verts
,
edges
,
edgeorient
);
m_id
,
edges
);
ret
->
Setup
();
return
ret
;
}
...
...
utilities/NekMesh/InputModules/InputMCF.cpp
View file @
dbd631ba
...
...
@@ -71,6 +71,7 @@ void InputMCF::ParseFile(string nm)
filename
.
push_back
(
nm
);
LibUtilities
::
SessionReaderSharedPtr
pSession
=
LibUtilities
::
SessionReader
::
CreateInstance
(
0
,
NULL
,
filename
);
pSession
->
InitSession
();
ASSERTL0
(
pSession
->
DefinesElement
(
"NEKTAR/MESHING"
),
"no meshing tag"
);
ASSERTL0
(
pSession
->
DefinesElement
(
"NEKTAR/MESHING/INFORMATION"
),
...
...
utilities/NekMesh/InputModules/InputNekpp.cpp
View file @
dbd631ba
...
...
@@ -81,11 +81,11 @@ void InputNekpp::Process()
// Copy vertices.
map
<
int
,
NodeSharedPtr
>
vIdMap
;
for
(
auto
&
vit
:
graph
->
Get
VertSet
())
for
(
auto
&
vit
:
graph
->
Get
AllPointGeoms
())
{
SpatialDomains
::
PointGeomSharedPtr
vert
=
vit
.
second
;
NodeSharedPtr
n
(
new
Node
(
vert
->
Get
Vid
(),
(
*
vert
)(
0
),
(
*
vert
)(
1
),
(
*
vert
)(
2
)));
new
Node
(
vert
->
Get
GlobalID
(),
(
*
vert
)(
0
),
(
*
vert
)(
1
),
(
*
vert
)(
2
)));
m_mesh
->
m_vertexSet
.
insert
(
n
);
vIdMap
[
vert
->
GetVid
()]
=
n
;
}
...
...
@@ -107,13 +107,13 @@ void InputNekpp::Process()
int
id0
=
it
.
second
->
GetVid
(
0
);
int
id1
=
it
.
second
->
GetVid
(
1
);
LibUtilities
::
PointsType
ptype
=
it
.
second
->
GetPointsKeys
()[
0
].
GetPointsType
();
it
.
second
->
GetXmap
()
->
GetPointsKeys
()[
0
].
GetPointsType
();
EdgeSharedPtr
ed
=
EdgeSharedPtr
(
new
Edge
(
vIdMap
[
id0
],
vIdMap
[
id1
],
curve
,
ptype
));
auto
testIns
=
m_mesh
->
m_edgeSet
.
insert
(
ed
);
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
Eid
();
eIdMap
[
it
.
second
->
Get
Eid
()]
=
ed
;
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
GlobalID
();
eIdMap
[
it
.
second
->
Get
GlobalID
()]
=
ed
;
}
}
...
...
@@ -142,8 +142,8 @@ void InputNekpp::Process()
faceEdges
,
LibUtilities
::
ePolyEvenlySpaced
));
auto
testIns
=
m_mesh
->
m_faceSet
.
insert
(
fac
);
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
Fid
();
fIdMap
[
it
.
second
->
Get
Fid
()]
=
fac
;
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
GlobalID
();
fIdMap
[
it
.
second
->
Get
GlobalID
()]
=
fac
;
}
for
(
auto
&
it
:
graph
->
GetAllQuadGeoms
())
...
...
@@ -169,8 +169,8 @@ void InputNekpp::Process()
faceEdges
,
LibUtilities
::
ePolyEvenlySpaced
));
auto
testIns
=
m_mesh
->
m_faceSet
.
insert
(
fac
);
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
Fid
();
fIdMap
[
it
.
second
->
Get
Fid
()]
=
fac
;
(
*
(
testIns
.
first
))
->
m_id
=
it
.
second
->
Get
GlobalID
();
fIdMap
[
it
.
second
->
Get
GlobalID
()]
=
fac
;
}
}
...
...
@@ -241,10 +241,10 @@ void InputNekpp::Process()
for
(
auto
&
compIt
:
graph
->
GetComposites
())
{
// Get hold of dimension
int
dim
=
(
*
compIt
.
second
)
[
0
]
->
GetShapeDim
();
int
dim
=
compIt
.
second
->
m_geomVec
[
0
]
->
GetShapeDim
();
// compIt->second is a GeometryVector
for
(
auto
&
geomIt
:
*
compIt
.
second
)
for
(
auto
&
geomIt
:
compIt
.
second
->
m_geomVec
)
{
ElmtConfig
conf
(
geomIt
->
GetShapeType
(),
1
,
true
,
true
,
false
);
...
...
utilities/NekMesh/OutputModules/OutputNekpp.cpp
View file @
dbd631ba
This diff is collapsed.
Click to expand it.
utilities/NekMesh/OutputModules/OutputNekpp.h
View file @
dbd631ba
...
...
@@ -36,8 +36,6 @@
#ifndef UTILITIES_NEKMESH_OUTPUTNEKPP
#define UTILITIES_NEKMESH_OUTPUTNEKPP
#include <tinyxml.h>
#include <NekMeshUtils/Module/Module.h>
namespace
Nektar
...
...
@@ -54,7 +52,7 @@ public:
{
return
MemoryManager
<
OutputNekpp
>::
AllocateSharedPtr
(
m
);
}
static
NekMeshUtils
::
ModuleKey
className
;
static
NekMeshUtils
::
ModuleKey
className
1
,
className2
;
OutputNekpp
(
NekMeshUtils
::
MeshSharedPtr
m
);
virtual
~
OutputNekpp
();
...
...
@@ -63,24 +61,13 @@ public:
virtual
void
Process
();
private:
/// Writes the <NODES> section of the XML file.
void
WriteXmlNodes
(
TiXmlElement
*
pRoot
);
/// Writes the <EDGES> section of the XML file.
void
WriteXmlEdges
(
TiXmlElement
*
pRoot
);
/// Writes the <FACES> section of the XML file if needed.
void
WriteXmlFaces
(
TiXmlElement
*
pRoot
);
/// Writes the <ELEMENTS> section of the XML file.
void
WriteXmlElements
(
TiXmlElement
*
pRoot
);
/// Writes the <CURVES> section of the XML file if needed.
void
WriteXmlCurves
(
TiXmlElement
*
pRoot
);
/// Writes the <COMPOSITES> section of the XML file.
void
WriteXmlComposites
(
TiXmlElement
*
pRoot
);
/// Writes the <DOMAIN> section of the XML file.
void
WriteXmlDomain
(
TiXmlElement
*
pRoot
);
/// Writes the <EXPANSIONS> section of the XML file.
void
WriteXmlExpansions
(
TiXmlElement
*
pRoot
);
/// Writes the <CONDITIONS> section of the XML file.
void
WriteXmlConditions
(
TiXmlElement
*
pRoot
);
void
TransferVertices
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferEdges
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferFaces
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferElements
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferCurves
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferComposites
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
void
TransferDomain
(
SpatialDomains
::
MeshGraphSharedPtr
graph
);
};
}
}
...
...
utilities/NekMesh/ProcessModules/ProcessBL.cpp
View file @
dbd631ba
...
...
@@ -197,7 +197,7 @@ void ProcessBL::BoundaryLayer2D()
if
(
surf
.
size
()
>
0
)
{
vector
<
unsigned
int
>
surfs
;
ParseUtils
::
Generate
Seq
Vector
(
surf
,
surfs
);
ParseUtils
::
GenerateVector
(
surf
,
surfs
);
sort
(
surfs
.
begin
(),
surfs
.
end
());
// If surface is defined, process list of elements to find those
...
...
@@ -729,7 +729,7 @@ void ProcessBL::BoundaryLayer3D()
if
(
surf
.
size
()
>
0
)
{
vector
<
unsigned
int
>
surfs
;
ParseUtils
::
Generate
Seq
Vector
(
surf
,
surfs
);
ParseUtils
::
GenerateVector
(
surf
,
surfs
);
sort
(
surfs
.
begin
(),
surfs
.
end
());
// If surface is defined, process list of elements to find those
...
...
utilities/NekMesh/ProcessModules/ProcessJac.cpp
View file @
dbd631ba
...
...
@@ -98,7 +98,7 @@ void ProcessJac::Process()
// Generate geometric factors.
SpatialDomains
::
GeomFactorsSharedPtr
gfac
=
geom
->
GetGeomFactors
();
LibUtilities
::
PointsKeyVector
p
=
geom
->
GetPointsKeys
();
LibUtilities
::
PointsKeyVector
p
=
geom
->
GetXmap
()
->
GetPointsKeys
();
SpatialDomains
::
DerivStorage
deriv
=
gfac
->
GetDeriv
(
p
);
const
int
pts
=
deriv
[
0
][
0
].
num_elements
();
Array
<
OneD
,
NekDouble
>
jc
(
pts
);
...
...
utilities/NekMesh/ProcessModules/ProcessLinear.cpp
View file @
dbd631ba
...
...
@@ -264,7 +264,7 @@ bool ProcessLinear::Invalid(ElementSharedPtr el, NekDouble thr)
SpatialDomains
::
GeometrySharedPtr
geomL
=
elL
->
GetGeom
(
m_mesh
->
m_spaceDim
);
SpatialDomains
::
GeomFactorsSharedPtr
gfacL
=
geomL
->
GetGeomFactors
();
LibUtilities
::
PointsKeyVector
p
=
geom
->
GetPointsKeys
();
LibUtilities
::
PointsKeyVector
p
=
geom
->
GetXmap
()
->
GetPointsKeys
();
SpatialDomains
::
DerivStorage
deriv
=
gfac
->
GetDeriv
(
p
);
SpatialDomains
::
DerivStorage
derivL
=
gfacL
->
GetDeriv
(
p
);
const
int
pts
=
deriv
[
0
][
0
].
num_elements
();
...
...
Julian Marcon
@jmarcon
mentioned in issue
#97 (closed)
·
Feb 15, 2018
mentioned in issue
#97 (closed)
mentioned in issue #97
Toggle commit list
Write
Preview
Supports
Markdown
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