Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
d96622e2
Commit
d96622e2
authored
Oct 04, 2016
by
Michael Turner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split off ho alignment code
parent
8fafbe50
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
33 additions
and
305 deletions
+33
-305
library/NekMeshUtils/CMakeLists.txt
library/NekMeshUtils/CMakeLists.txt
+1
-0
library/NekMeshUtils/MeshElements/Composite.h
library/NekMeshUtils/MeshElements/Composite.h
+4
-4
library/NekMeshUtils/MeshElements/Edge.cpp
library/NekMeshUtils/MeshElements/Edge.cpp
+4
-2
library/NekMeshUtils/MeshElements/Edge.h
library/NekMeshUtils/MeshElements/Edge.h
+3
-6
library/NekMeshUtils/MeshElements/Element.h
library/NekMeshUtils/MeshElements/Element.h
+3
-140
library/NekMeshUtils/MeshElements/Face.cpp
library/NekMeshUtils/MeshElements/Face.cpp
+2
-0
library/NekMeshUtils/MeshElements/Hexahedron.cpp
library/NekMeshUtils/MeshElements/Hexahedron.cpp
+2
-0
library/NekMeshUtils/MeshElements/Line.cpp
library/NekMeshUtils/MeshElements/Line.cpp
+3
-0
library/NekMeshUtils/MeshElements/Prism.cpp
library/NekMeshUtils/MeshElements/Prism.cpp
+4
-1
library/NekMeshUtils/MeshElements/Quadrilateral.cpp
library/NekMeshUtils/MeshElements/Quadrilateral.cpp
+2
-0
library/NekMeshUtils/MeshElements/Quadrilateral.h
library/NekMeshUtils/MeshElements/Quadrilateral.h
+0
-152
library/NekMeshUtils/MeshElements/Tetrahedron.cpp
library/NekMeshUtils/MeshElements/Tetrahedron.cpp
+2
-0
library/NekMeshUtils/MeshElements/Triangle.cpp
library/NekMeshUtils/MeshElements/Triangle.cpp
+2
-0
library/NekMeshUtils/MeshElements/Triangle.h
library/NekMeshUtils/MeshElements/Triangle.h
+1
-0
No files found.
library/NekMeshUtils/CMakeLists.txt
View file @
d96622e2
...
...
@@ -51,6 +51,7 @@ SET(NEKMESHUTILS_HEADERS
MeshElements/Pyramid.h
MeshElements/Prism.h
MeshElements/Hexahedron.h
MeshElements/HOAlignment.h
)
IF
(
NEKTAR_USE_MESHGEN
)
...
...
library/NekMeshUtils/MeshElements/Composite.h
View file @
d96622e2
////////////////////////////////////////////////////////////////////////////////
//
// File:
Fac
e.h
// File:
Composit
e.h
//
// For more information, please see: http://www.nektar.info/
//
...
...
@@ -29,12 +29,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Mesh
manipulation o
bject
s
.
// Description: Mesh
Composite O
bject.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef N
ekMeshUtils
_MESHELEMENTS_COMPOSITE
#define N
ekMeshUtils
_MESHELEMENTS_COMPOSITE
#ifndef N
EKMESHUTILS
_MESHELEMENTS_COMPOSITE
#define N
EKMESHUTILS
_MESHELEMENTS_COMPOSITE
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
#include <NekMeshUtils/MeshElements/Element.h>
...
...
library/NekMeshUtils/MeshElements/Edge.cpp
View file @
d96622e2
////////////////////////////////////////////////////////////////////////////////
//
// File: Edge.
h
// File: Edge.
cpp
//
// For more information, please see: http://www.nektar.info/
//
...
...
@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Mesh
manipulation objects
.
// Description: Mesh
Edge
.
//
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -37,6 +37,8 @@
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
namespace
Nektar
{
namespace
NekMeshUtils
...
...
library/NekMeshUtils/MeshElements/Edge.h
View file @
d96622e2
...
...
@@ -29,16 +29,13 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Mesh
manipulation objects
.
// Description: Mesh
Edge
.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef N
ekMeshUtils
_MESHELEMENTS_EDGE
#define N
ekMeshUtils
_MESHELEMENTS_EDGE
#ifndef N
EKMESHUTILS
_MESHELEMENTS_EDGE
#define N
EKMESHUTILS
_MESHELEMENTS_EDGE
#include <iomanip>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <SpatialDomains/SegGeom.h>
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
...
...
library/NekMeshUtils/MeshElements/Element.h
View file @
d96622e2
...
...
@@ -29,14 +29,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Mesh
manipulation objects
.
// Description: Mesh
element
.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef NekMeshUtils_MESHELEMENTS_ELEMENT
#define NekMeshUtils_MESHELEMENTS_ELEMENT
#include <iomanip>
#ifndef NEKMESHUTILS_MESHELEMENTS_ELEMENT
#define NEKMESHUTILS_MESHELEMENTS_ELEMENT
#include <LibUtilities/Foundations/PointsType.h>
#include <LibUtilities/BasicUtils/ShapeType.hpp>
...
...
@@ -49,142 +47,7 @@ namespace Nektar
{
namespace
NekMeshUtils
{
/**
* @brief A lightweight struct for dealing with high-order triangle
* alignment.
*
* The logic underlying these routines is taken from the original Nektar
* code.
*/
template
<
typename
T
>
struct
HOTriangle
{
HOTriangle
(
std
::
vector
<
int
>
pVertId
,
std
::
vector
<
T
>
pSurfVerts
)
:
vertId
(
pVertId
),
surfVerts
(
pSurfVerts
)
{
}
HOTriangle
(
std
::
vector
<
int
>
pVertId
)
:
vertId
(
pVertId
)
{
}
/// The triangle vertex IDs
std
::
vector
<
int
>
vertId
;
/// The triangle surface vertices -- templated so that this can
/// either be nodes or IDs.
std
::
vector
<
T
>
surfVerts
;
/**
* @brief Rotates the triangle of data points inside #surfVerts
* counter-clockwise nrot times.
*
* @param nrot Number of times to rotate triangle.
*/
void
Rotate
(
int
nrot
)
{
int
n
,
i
,
j
,
cnt
;
int
np
=
((
int
)
sqrt
(
8.0
*
surfVerts
.
size
()
+
1.0
)
-
1
)
/
2
;
std
::
vector
<
T
>
tmp
(
np
*
np
);
for
(
n
=
0
;
n
<
nrot
;
++
n
)
{
for
(
cnt
=
i
=
0
;
i
<
np
;
++
i
)
{
for
(
j
=
0
;
j
<
np
-
i
;
++
j
,
cnt
++
)
{
tmp
[
i
*
np
+
j
]
=
surfVerts
[
cnt
];
}
}
for
(
cnt
=
i
=
0
;
i
<
np
;
++
i
)
{
for
(
j
=
0
;
j
<
np
-
i
;
++
j
,
cnt
++
)
{
surfVerts
[
cnt
]
=
tmp
[(
np
-
1
-
i
-
j
)
*
np
+
i
];
}
}
}
}
/**
* @brief Reflect data points inside #surfVerts.
*
* This applies a mapping essentially doing the following
* reordering:
*
* 9 9
* 7 8 -> 8 7
* 4 5 6 6 5 4
* 0 1 2 3 3 2 1 0
*/
void
Reflect
()
{
int
i
,
j
,
cnt
;
int
np
=
((
int
)
sqrt
(
8.0
*
surfVerts
.
size
()
+
1.0
)
-
1
)
/
2
;
std
::
vector
<
T
>
tmp
(
np
*
np
);
for
(
cnt
=
i
=
0
;
i
<
np
;
++
i
)
{
for
(
j
=
0
;
j
<
np
-
i
;
++
j
,
cnt
++
)
{
tmp
[
i
*
np
+
np
-
i
-
1
-
j
]
=
surfVerts
[
cnt
];
}
}
for
(
cnt
=
i
=
0
;
i
<
np
;
++
i
)
{
for
(
j
=
0
;
j
<
np
-
i
;
++
j
,
cnt
++
)
{
surfVerts
[
cnt
]
=
tmp
[
i
*
np
+
j
];
}
}
}
/**
* @brief Align this surface to a given vertex ID.
*/
void
Align
(
std
::
vector
<
int
>
vertId
)
{
if
(
vertId
[
0
]
==
this
->
vertId
[
0
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
1
]
||
vertId
[
1
]
==
this
->
vertId
[
2
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
2
])
{
Rotate
(
1
);
Reflect
();
}
}
}
else
if
(
vertId
[
0
]
==
this
->
vertId
[
1
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
0
]
||
vertId
[
1
]
==
this
->
vertId
[
2
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
0
])
{
Reflect
();
}
else
{
Rotate
(
2
);
}
}
}
else
if
(
vertId
[
0
]
==
this
->
vertId
[
2
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
0
]
||
vertId
[
1
]
==
this
->
vertId
[
1
])
{
if
(
vertId
[
1
]
==
this
->
vertId
[
1
])
{
Rotate
(
2
);
Reflect
();
}
else
{
Rotate
(
1
);
}
}
}
}
};
/**
* @brief Basic information about an element.
*
...
...
library/NekMeshUtils/MeshElements/Face.cpp
View file @
d96622e2
...
...
@@ -36,6 +36,8 @@
#include <NekMeshUtils/MeshElements/Face.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
namespace
Nektar
{
namespace
NekMeshUtils
...
...
library/NekMeshUtils/MeshElements/Hexahedron.cpp
View file @
d96622e2
...
...
@@ -36,6 +36,8 @@
#include <SpatialDomains/HexGeom.h>
#include <NekMeshUtils/MeshElements/Hexahedron.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Line.cpp
View file @
d96622e2
...
...
@@ -34,6 +34,9 @@
////////////////////////////////////////////////////////////////////////////////
#include <NekMeshUtils/MeshElements/Line.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Prism.cpp
View file @
d96622e2
...
...
@@ -38,7 +38,10 @@
#include <SpatialDomains/PrismGeom.h>
#include <NekMeshUtils/MeshElements/Prism.h>
#include <NekMeshUtils/MeshElements/Quadrilateral.h>
#include <NekMeshUtils/MeshElements/HOAlignment.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Quadrilateral.cpp
View file @
d96622e2
...
...
@@ -36,6 +36,8 @@
#include <LocalRegions/QuadExp.h>
#include <NekMeshUtils/MeshElements/Quadrilateral.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Quadrilateral.h
View file @
d96622e2
...
...
@@ -86,158 +86,6 @@ public:
NEKMESHUTILS_EXPORT
static
unsigned
int
GetNumNodes
(
ElmtConfig
pConf
);
};
/**
* @brief A lightweight struct for dealing with high-order quadrilateral
* alignment.
*/
template
<
typename
T
>
struct
HOQuadrilateral
{
HOQuadrilateral
(
std
::
vector
<
int
>
pVertId
,
std
::
vector
<
T
>
pSurfVerts
)
:
vertId
(
pVertId
),
surfVerts
(
pSurfVerts
)
{
}
HOQuadrilateral
(
std
::
vector
<
int
>
pVertId
)
:
vertId
(
pVertId
)
{
}
/// The quadrilateral vertex IDs
std
::
vector
<
int
>
vertId
;
/// The quadrilateral surface vertices -- templated so that this can either
/// be nodes or IDs.
std
::
vector
<
T
>
surfVerts
;
void
ReverseX
()
{
int
np
=
(
int
)(
sqrt
((
NekDouble
)
surfVerts
.
size
())
+
0.5
);
for
(
int
i
=
0
;
i
<
np
;
++
i
)
{
for
(
int
j
=
0
;
j
<
np
/
2
;
++
j
)
{
swap
(
surfVerts
[
i
*
np
+
j
],
surfVerts
[
i
*
np
+
np
-
j
-
1
]);
}
}
}
void
ReverseY
()
{
int
np
=
(
int
)(
sqrt
((
NekDouble
)
surfVerts
.
size
())
+
0.5
);
// Reverse y direction
for
(
int
j
=
0
;
j
<
np
;
++
j
)
{
for
(
int
i
=
0
;
i
<
np
/
2
;
++
i
)
{
swap
(
surfVerts
[
i
*
np
+
j
],
surfVerts
[(
np
-
i
-
1
)
*
np
+
j
]);
}
}
}
void
Transpose
()
{
int
np
=
(
int
)(
sqrt
((
NekDouble
)
surfVerts
.
size
())
+
0.5
);
std
::
vector
<
T
>
tmp
(
surfVerts
.
size
());
for
(
int
i
=
0
;
i
<
np
;
++
i
)
{
for
(
int
j
=
0
;
j
<
np
;
++
j
)
{
tmp
[
i
*
np
+
j
]
=
surfVerts
[
j
*
np
+
i
];
}
}
surfVerts
=
tmp
;
}
/**
* @brief Align this surface to a given vertex ID.
*/
void
Align
(
std
::
vector
<
int
>
vertId
)
{
int
vmap
[
4
]
=
{
-
1
,
-
1
,
-
1
,
-
1
};
// Determine which vertices map to vertId
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
for
(
int
j
=
0
;
j
<
4
;
++
j
)
{
if
(
this
->
vertId
[
j
]
==
vertId
[
i
])
{
vmap
[
i
]
=
j
;
break
;
}
}
ASSERTL1
(
vmap
[
i
]
!=
-
1
,
"Could not determine mapping between vertex IDs"
);
}
StdRegions
::
Orientation
orient
=
StdRegions
::
eNoOrientation
;
if
(
vmap
[
1
]
==
(
vmap
[
0
]
+
1
)
%
4
)
{
switch
(
vmap
[
0
])
{
case
0
:
orient
=
StdRegions
::
eDir1FwdDir1_Dir2FwdDir2
;
break
;
case
1
:
orient
=
StdRegions
::
eDir1BwdDir2_Dir2FwdDir1
;
break
;
case
2
:
orient
=
StdRegions
::
eDir1BwdDir1_Dir2BwdDir2
;
break
;
case
3
:
orient
=
StdRegions
::
eDir1FwdDir2_Dir2BwdDir1
;
break
;
}
}
else
{
switch
(
vmap
[
0
])
{
case
0
:
orient
=
StdRegions
::
eDir1FwdDir2_Dir2FwdDir1
;
break
;
case
1
:
orient
=
StdRegions
::
eDir1BwdDir1_Dir2FwdDir2
;
break
;
case
2
:
orient
=
StdRegions
::
eDir1BwdDir2_Dir2BwdDir1
;
break
;
case
3
:
orient
=
StdRegions
::
eDir1FwdDir1_Dir2BwdDir2
;
break
;
}
}
if
(
orient
==
StdRegions
::
eDir1FwdDir2_Dir2FwdDir1
||
orient
==
StdRegions
::
eDir1BwdDir2_Dir2FwdDir1
||
orient
==
StdRegions
::
eDir1FwdDir2_Dir2BwdDir1
||
orient
==
StdRegions
::
eDir1BwdDir2_Dir2BwdDir1
)
{
Transpose
();
}
if
(
orient
==
StdRegions
::
eDir1BwdDir1_Dir2FwdDir2
||
orient
==
StdRegions
::
eDir1BwdDir1_Dir2BwdDir2
||
orient
==
StdRegions
::
eDir1FwdDir2_Dir2BwdDir1
||
orient
==
StdRegions
::
eDir1BwdDir2_Dir2BwdDir1
)
{
ReverseX
();
}
if
(
orient
==
StdRegions
::
eDir1FwdDir1_Dir2BwdDir2
||
orient
==
StdRegions
::
eDir1BwdDir1_Dir2BwdDir2
||
orient
==
StdRegions
::
eDir1BwdDir2_Dir2FwdDir1
||
orient
==
StdRegions
::
eDir1BwdDir2_Dir2BwdDir1
)
{
ReverseY
();
}
}
};
}
}
...
...
library/NekMeshUtils/MeshElements/Tetrahedron.cpp
View file @
d96622e2
...
...
@@ -40,6 +40,8 @@
#include <NekMeshUtils/MeshElements/Tetrahedron.h>
#include <NekMeshUtils/MeshElements/Triangle.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Triangle.cpp
View file @
d96622e2
...
...
@@ -37,6 +37,8 @@
#include <LocalRegions/TriExp.h>
#include <NekMeshUtils/MeshElements/Triangle.h>
#include <LibUtilities/Foundations/ManagerAccess.h>
using
namespace
std
;
namespace
Nektar
...
...
library/NekMeshUtils/MeshElements/Triangle.h
View file @
d96622e2
...
...
@@ -38,6 +38,7 @@
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
#include <NekMeshUtils/MeshElements/Element.h>
#include <NekMeshUtils/MeshElements/HOAlignment.h>
namespace
Nektar
{
...
...
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