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
03bd1613
Commit
03bd1613
authored
Oct 21, 2015
by
Michael Turner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more changes to meshing system
parent
083816a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
33 deletions
+44
-33
library/MeshUtils/CMakeLists.txt
library/MeshUtils/CMakeLists.txt
+11
-11
library/MeshUtils/MeshElements/Edge.h
library/MeshUtils/MeshElements/Edge.h
+5
-3
library/MeshUtils/MeshElements/Node.h
library/MeshUtils/MeshElements/Node.h
+7
-0
library/MeshUtils/SurfaceMeshing/CurveMesh.cpp
library/MeshUtils/SurfaceMeshing/CurveMesh.cpp
+11
-10
library/MeshUtils/SurfaceMeshing/CurveMesh.h
library/MeshUtils/SurfaceMeshing/CurveMesh.h
+4
-3
library/MeshUtils/SurfaceMeshing/SurfaceMeshMesh.cpp
library/MeshUtils/SurfaceMeshing/SurfaceMeshMesh.cpp
+6
-6
No files found.
library/MeshUtils/CMakeLists.txt
View file @
03bd1613
...
...
@@ -3,10 +3,10 @@ SET(MESHUTILS_SOURCES
)
IF
(
NEKTAR_USE_MESH
)
SET
(
MESHUTILS_SOURCES
${
MESHUTILS_SOURCES
}
#
SurfaceMeshing/CurveMesh.cpp
#
Octree/Octant.cpp
#
Octree/Octree.cpp
#
SurfaceMeshing/SurfaceMeshMesh.cpp
SurfaceMeshing/CurveMesh.cpp
Octree/Octant.cpp
Octree/Octree.cpp
SurfaceMeshing/SurfaceMeshMesh.cpp
# SurfaceMeshing/SurfaceMeshHOMesh.cpp
# SurfaceMeshing/FaceMesh.cpp
# SurfaceMeshing/OptimiseFunctions.cpp
...
...
@@ -36,13 +36,13 @@ SET(MESHUTILS_HEADERS
)
IF
(
NEKTAR_USE_MESH
)
SET
(
MESHUTILS_HEADERS
${
MESHUTILS_HEADERS
}
#
Octree/CurvaturePoint.hpp
#
MeshElem.hpp
#
SurfaceMeshing/CurveMesh.h
#
Octree/Octant.h
#
Octree/Octree.h
#
SurfaceMeshing/SurfaceMesh.h
#
SurfaceMeshing/FaceMesh.h
Octree/CurvaturePoint.hpp
MeshElem.hpp
SurfaceMeshing/CurveMesh.h
Octree/Octant.h
Octree/Octree.h
SurfaceMeshing/SurfaceMesh.h
SurfaceMeshing/FaceMesh.h
# ExtLibInterface/TriangleInterface.h
# ExtLibInterface/TetGenInterface.h
# TetMeshing/TetMesh.h
...
...
library/MeshUtils/MeshElements/Edge.h
View file @
03bd1613
...
...
@@ -53,15 +53,15 @@ namespace MeshUtils
std
::
vector
<
NodeSharedPtr
>
pEdgeNodes
,
LibUtilities
::
PointsType
pCurveType
)
:
m_n1
(
pVertex1
),
m_n2
(
pVertex2
),
m_edgeNodes
(
pEdgeNodes
),
m_curveType
(
pCurveType
),
m_geom
()
{}
m_curveType
(
pCurveType
),
CADCurveID
(
-
1
),
m_geom
()
{}
/// Creates a new linear edge.
Edge
(
NodeSharedPtr
pVertex1
,
NodeSharedPtr
pVertex2
)
:
m_n1
(
pVertex1
),
m_n2
(
pVertex2
),
m_edgeNodes
(),
m_curveType
(),
m_geom
()
{}
m_curveType
(),
CADCurveID
(
-
1
),
m_geom
()
{}
/// Copies an existing edge.
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_curveType
(
pSrc
.
m_curveType
),
CADCurveID
(
pSrc
.
CADCurveID
),
m_geom
(
pSrc
.
m_geom
)
{}
~
Edge
()
{}
/// Returns the total number of nodes defining the edge.
...
...
@@ -136,6 +136,8 @@ namespace MeshUtils
LibUtilities
::
PointsType
m_curveType
;
/// Element(s) which are linked to this edge.
vector
<
pair
<
ElementSharedPtr
,
int
>
>
m_elLink
;
/// id of cad curve which edge lies on
unsigned
int
CADCurveID
;
private:
SpatialDomains
::
SegGeomSharedPtr
m_geom
;
...
...
library/MeshUtils/MeshElements/Node.h
View file @
03bd1613
...
...
@@ -169,6 +169,13 @@ namespace MeshUtils
return
search
->
second
;
}
Array
<
OneD
,
NekDouble
>
GetLoc
()
{
Array
<
OneD
,
NekDouble
>
out
(
3
);
out
[
0
]
=
m_x
;
out
[
1
]
=
m_y
;
out
[
2
]
=
m_z
;
return
out
;
}
Array
<
OneD
,
NekDouble
>
GetCADSurf
(
int
i
)
{
//I dont know why I ahev to do this to get it to work
...
...
library/MeshUtils/SurfaceMeshing/CurveMesh.cpp
View file @
03bd1613
...
...
@@ -125,18 +125,15 @@ void CurveMesh::Mesh()
id
=
verts
[
1
]
->
GetId
()
-
1
;
t
=
m_bounds
[
1
];
m_mesh
->
m_meshnode
[
id
]
->
SetCurve
(
m_id
,
t
);
m_mesh
->
m_meshnode
[
id
]
->
SetC
ADC
urve
(
m_id
,
t
);
m_meshpoints
.
push_back
(
m_mesh
->
m_meshnode
[
id
]);
for
(
int
i
=
0
;
i
<
Ne
;
i
++
)
{
EdgeSharedPtr
e
=
MemoryManager
<
Edge
>::
AllocateSharedPtr
(
m_mesh
->
m_edge
.
size
(),
m_meshpoints
[
i
],
m_meshpoints
[
i
+
1
]);
Nodes
[
m_meshpoints
[
i
]]
->
SetEdge
(
Edges
.
size
()
-
1
);
Nodes
[
m_meshpoints
[
i
+
1
]]
->
SetEdge
(
Edges
.
size
()
-
1
);
Edges
[
Edges
.
size
()
-
1
]
->
SetCurve
(
m_id
);
EdgeSharedPtr
e
=
boost
::
shared_ptr
<
Edge
>
(
new
Edge
(
m_meshpoints
[
i
],
m_meshpoints
[
i
+
1
]));
e
->
CADCurveID
=
m_id
;
m_mesh
->
m_meshedge
.
push_back
(
e
);
}
ASSERTL0
(
Ne
+
1
==
m_meshpoints
.
size
(),
"incorrect number of points in curve mesh"
);
...
...
@@ -148,8 +145,12 @@ int CurveMesh::SplitEdge(int a, int b,
std
::
map
<
int
,
MeshNodeSharedPtr
>
&
Nodes
,
std
::
map
<
int
,
MeshEdgeSharedPtr
>
&
Edges
)
{
// this needs to be re written when format is decided.
//find position of a and b in the meshpoints vector
int
posa
,
posb
;
/*
int posa, posb;
for(int i = 0; i < m_meshpoints.size(); i++)
{
if(m_meshpoints[i] == a)
...
...
@@ -190,7 +191,7 @@ int CurveMesh::SplitEdge(int a, int b,
m_meshpoints.insert(m_meshpoints.begin() + posa + 1, 1, Nodes.size()-1);
Ne
++
;
Ne++;
*/
return
Nodes
.
size
()
-
1
;
}
...
...
library/MeshUtils/SurfaceMeshing/CurveMesh.h
View file @
03bd1613
...
...
@@ -39,6 +39,7 @@
#include <boost/shared_ptr.hpp>
#include <MeshUtils/MeshElements/MeshElements.h>
#include <MeshUtils/MeshElem.hpp>
#include <MeshUtils/CADSystem/CADVert.h>
#include <MeshUtils/CADSystem/CADCurve.h>
...
...
@@ -78,17 +79,17 @@ class CurveMesh
/**
* @brief get id of first node
*/
int
GetFirstPoint
(){
return
m_meshpoints
[
0
];}
NodeSharedPtr
GetFirstPoint
(){
return
m_meshpoints
[
0
];}
/**
* @brief get id of last node
*/
int
GetLastPoint
(){
return
m_meshpoints
.
back
();}
NodeSharedPtr
GetLastPoint
(){
return
m_meshpoints
.
back
();}
/**
* @brief get list of mesh nodes
*/
std
::
vector
<
int
>
GetMeshPoints
(){
return
m_meshpoints
;}
std
::
vector
<
NodeSharedPtr
>
GetMeshPoints
(){
return
m_meshpoints
;}
/**
* @brief get the number of points in the curve
...
...
library/MeshUtils/SurfaceMeshing/SurfaceMeshMesh.cpp
View file @
03bd1613
...
...
@@ -57,7 +57,7 @@ void SurfaceMesh::Mesh()
{
Array
<
OneD
,
NekDouble
>
loc
=
itv
->
second
->
GetLoc
();
NodeSharedPtr
n
=
boost
::
shared_ptr
<
Node
>
(
new
Node
(
itv
->
first
-
1
,
loc
[
0
],
loc
[
1
],
loc
[
2
]);
new
Node
(
itv
->
first
-
1
,
loc
[
0
],
loc
[
1
],
loc
[
2
])
)
;
m_mesh
->
m_meshnode
.
push_back
(
n
);
}
...
...
@@ -77,14 +77,13 @@ void SurfaceMesh::Mesh()
m_curvemeshes
[
i
]
->
Mesh
();
}
/*
//all nodes thus far exist on curves on sufaces but do not know about the surface
map<int, MeshNodeSharedPtr>::iterator it;
for(it = Nodes.begin(); it != Nodes.end(); it++)
for
(
int
i
=
0
;
i
<
m_mesh
->
m_meshnode
.
size
();
i
++
)
{
Array<OneD, NekDouble> loc =
it->second
->GetLoc();
Array
<
OneD
,
NekDouble
>
loc
=
m_mesh
->
m_meshnode
[
i
]
->
GetLoc
();
list
<
int
>
l
;
map<int, NekDouble> curves =
it->second
->GetCurveMap();
map
<
int
,
NekDouble
>
curves
=
m_mesh
->
m_meshnode
[
i
]
->
GetCurveMap
();
map
<
int
,
NekDouble
>::
iterator
cit
;
for
(
cit
=
curves
.
begin
();
cit
!=
curves
.
end
();
cit
++
)
{
...
...
@@ -102,6 +101,7 @@ void SurfaceMesh::Mesh()
}
}
/*
//analyse for two node surfaces (not possible)
for(int i = 1; i <= m_cad->GetNumSurf(); i++)
{
...
...
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