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
7b5fa905
Commit
7b5fa905
authored
Jul 01, 2017
by
Michael Turner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ssherw/nektar-fix/NekMesh_StarInput'
parents
8e19333c
ac5e1e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
CHANGELOG.md
CHANGELOG.md
+2
-1
utilities/NekMesh/InputModules/InputStar.cpp
utilities/NekMesh/InputModules/InputStar.cpp
+26
-12
No files found.
CHANGELOG.md
View file @
7b5fa905
Changelog
=========
v
4.
5.0
v5.0
.0
------
**NekMesh**
:
...
...
@@ -9,6 +9,7 @@ v4.5.0
-
Add periodic boundary condition meshing in 2D (!733)
-
Adjust boundary layer thickness in corners in 2D (!739)
-
Add non-O BL meshing in 2D (!757)
-
Fix issue with reading CCM files due to definition of default arrays rather than a vector (!797)
**Library**
-
Added in sum factorisation version for pyramid expansions and orthogonal
...
...
utilities/NekMesh/InputModules/InputStar.cpp
View file @
7b5fa905
...
...
@@ -107,7 +107,7 @@ void InputStar::SetupElements(void)
// Read in Nodes
std
::
vector
<
NodeSharedPtr
>
Nodes
;
ReadNodes
(
Nodes
);
// Get list of faces nodes and adjacents elements.
map
<
int
,
vector
<
int
>
>
FaceNodes
;
Array
<
OneD
,
vector
<
int
>
>
ElementFaces
;
...
...
@@ -115,7 +115,7 @@ void InputStar::SetupElements(void)
// Read interior faces and set up first part of Element
// Faces and FaceNodes
ReadInternalFaces
(
FaceNodes
,
ElementFaces
);
vector
<
vector
<
int
>
>
BndElementFaces
;
vector
<
string
>
Facelabels
;
ReadBoundaryFaces
(
BndElementFaces
,
FaceNodes
,
ElementFaces
,
Facelabels
);
...
...
@@ -137,12 +137,12 @@ void InputStar::SetupElements(void)
// Reset node ordering so that all prism faces have
// consistent numbering for singular vertex re-ordering
ResetNodes
(
Nodes
,
ElementFaces
,
FaceNodes
);
m_mesh
->
m_node
=
Nodes
;
// create Prisms/Pyramids first
int
nelements
=
ElementFaces
.
num_elements
();
cout
<<
" Generating 3D Zones: "
;
cout
<<
" Generating 3D Zones: "
<<
endl
;
int
cnt
=
0
;
for
(
i
=
0
;
i
<
nelements
;
++
i
)
{
...
...
@@ -154,7 +154,7 @@ void InputStar::SetupElements(void)
++
cnt
;
}
}
cout
<<
cnt
<<
" Prisms
,
"
;
cout
<<
"
\t
"
<<
cnt
<<
" Prisms"
<<
endl
;
nComposite
++
;
...
...
@@ -169,7 +169,7 @@ void InputStar::SetupElements(void)
++
cnt
;
}
}
cout
<<
cnt
<<
" Tets"
<<
endl
;
cout
<<
"
\t
"
<<
cnt
<<
" Tets"
<<
endl
;
nComposite
++
;
ProcessVertices
();
...
...
@@ -899,6 +899,7 @@ void InputStar::InitCCM(void)
// and then assign the return value to 'err'.).
string
fname
=
m_config
[
"infile"
].
as
<
string
>
();
m_ccmErr
=
CCMIOOpenFile
(
NULL
,
fname
.
c_str
(),
kCCMIORead
,
&
root
);
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Error opening file"
);
CCMIOSize_t
i
=
CCMIOSIZEC
(
0
);
CCMIOID
state
,
problem
;
...
...
@@ -918,6 +919,7 @@ void InputStar::InitCCM(void)
// initialized to 0) and read the mesh and solution
// information.
CCMIONextEntity
(
&
m_ccmErr
,
state
,
kCCMIOProcessor
,
&
i
,
&
m_ccmProcessor
);
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Failed to find Next Entity"
);
}
void
InputStar
::
ReadNodes
(
std
::
vector
<
NodeSharedPtr
>
&
Nodes
)
...
...
@@ -927,7 +929,9 @@ void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes)
CCMIOReadProcessor
(
&
m_ccmErr
,
m_ccmProcessor
,
&
vertices
,
&
m_ccmTopology
,
NULL
,
NULL
);
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Error Reading Processor"
);
CCMIOEntitySize
(
&
m_ccmErr
,
vertices
,
&
nVertices
,
NULL
);
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Error Reading NextEntitySize in ReadNodes"
);
// Read the vertices. This involves reading both the vertex data and
// the map, which maps the index into the data array with the ID number.
...
...
@@ -935,23 +939,33 @@ void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes)
// appropriate scaling factor. The offset is just to show you can read
// any chunk. Normally this would be in a for loop.
float
scale
;
int
mapData
[
nVertices
.
getValue
()];
float
verts
[
3
*
nVertices
.
getValue
()];
for
(
int
k
=
0
;
k
<
nVertices
;
++
k
)
int
nvert
=
nVertices
.
getValue
();
vector
<
int
>
mapData
;
mapData
.
resize
(
nvert
);
vector
<
float
>
verts
;
verts
.
resize
(
3
*
nvert
);
for
(
int
k
=
0
;
k
<
nvert
;
++
k
)
{
verts
[
3
*
k
]
=
verts
[
3
*
k
+
1
]
=
verts
[
3
*
k
+
2
]
=
0.0
;
mapData
[
k
]
=
0
;
}
CCMIOReadVerticesf
(
&
m_ccmErr
,
vertices
,
&
dims
,
&
scale
,
&
mapID
,
verts
,
&
verts
[
0
]
,
CCMIOINDEXC
(
0
),
CCMIOINDEXC
(
0
+
nVertices
));
CCMIOReadMap
(
&
m_ccmErr
,
mapID
,
mapData
,
CCMIOINDEXC
(
0
),
CCMIOINDEXC
(
0
+
nVertices
));
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Error Reading Vertices in ReadNodes"
);
CCMIOReadMap
(
&
m_ccmErr
,
mapID
,
&
mapData
[
0
],
CCMIOINDEXC
(
0
),
CCMIOINDEXC
(
0
+
nVertices
));
ASSERTL0
(
m_ccmErr
==
kCCMIONoErr
,
"Error Reading Map in ReadNodes"
);
for
(
int
i
=
0
;
i
<
nVertices
;
++
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