Commit 7b5fa905 authored by Michael Turner's avatar Michael Turner
Browse files

Merge branch 'ssherw/nektar-fix/NekMesh_StarInput'

parents 8e19333c ac5e1e60
Changelog Changelog
========= =========
v4.5.0 v5.0.0
------ ------
**NekMesh**: **NekMesh**:
...@@ -9,6 +9,7 @@ v4.5.0 ...@@ -9,6 +9,7 @@ v4.5.0
- Add periodic boundary condition meshing in 2D (!733) - Add periodic boundary condition meshing in 2D (!733)
- Adjust boundary layer thickness in corners in 2D (!739) - Adjust boundary layer thickness in corners in 2D (!739)
- Add non-O BL meshing in 2D (!757) - 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** **Library**
- Added in sum factorisation version for pyramid expansions and orthogonal - Added in sum factorisation version for pyramid expansions and orthogonal
......
...@@ -107,7 +107,7 @@ void InputStar::SetupElements(void) ...@@ -107,7 +107,7 @@ void InputStar::SetupElements(void)
// Read in Nodes // Read in Nodes
std::vector<NodeSharedPtr> Nodes; std::vector<NodeSharedPtr> Nodes;
ReadNodes(Nodes); ReadNodes(Nodes);
// Get list of faces nodes and adjacents elements. // Get list of faces nodes and adjacents elements.
map<int, vector<int> > FaceNodes; map<int, vector<int> > FaceNodes;
Array<OneD, vector<int> > ElementFaces; Array<OneD, vector<int> > ElementFaces;
...@@ -115,7 +115,7 @@ void InputStar::SetupElements(void) ...@@ -115,7 +115,7 @@ void InputStar::SetupElements(void)
// Read interior faces and set up first part of Element // Read interior faces and set up first part of Element
// Faces and FaceNodes // Faces and FaceNodes
ReadInternalFaces(FaceNodes, ElementFaces); ReadInternalFaces(FaceNodes, ElementFaces);
vector<vector<int> > BndElementFaces; vector<vector<int> > BndElementFaces;
vector<string> Facelabels; vector<string> Facelabels;
ReadBoundaryFaces(BndElementFaces, FaceNodes, ElementFaces, Facelabels); ReadBoundaryFaces(BndElementFaces, FaceNodes, ElementFaces, Facelabels);
...@@ -137,12 +137,12 @@ void InputStar::SetupElements(void) ...@@ -137,12 +137,12 @@ void InputStar::SetupElements(void)
// Reset node ordering so that all prism faces have // Reset node ordering so that all prism faces have
// consistent numbering for singular vertex re-ordering // consistent numbering for singular vertex re-ordering
ResetNodes(Nodes, ElementFaces, FaceNodes); ResetNodes(Nodes, ElementFaces, FaceNodes);
m_mesh->m_node = Nodes; m_mesh->m_node = Nodes;
// create Prisms/Pyramids first // create Prisms/Pyramids first
int nelements = ElementFaces.num_elements(); int nelements = ElementFaces.num_elements();
cout << " Generating 3D Zones: "; cout << " Generating 3D Zones: " << endl;
int cnt = 0; int cnt = 0;
for (i = 0; i < nelements; ++i) for (i = 0; i < nelements; ++i)
{ {
...@@ -154,7 +154,7 @@ void InputStar::SetupElements(void) ...@@ -154,7 +154,7 @@ void InputStar::SetupElements(void)
++cnt; ++cnt;
} }
} }
cout << cnt << " Prisms,"; cout <<" \t" << cnt << " Prisms" << endl;
nComposite++; nComposite++;
...@@ -169,7 +169,7 @@ void InputStar::SetupElements(void) ...@@ -169,7 +169,7 @@ void InputStar::SetupElements(void)
++cnt; ++cnt;
} }
} }
cout << cnt << " Tets" << endl; cout <<"\t" << cnt << " Tets" << endl;
nComposite++; nComposite++;
ProcessVertices(); ProcessVertices();
...@@ -899,6 +899,7 @@ void InputStar::InitCCM(void) ...@@ -899,6 +899,7 @@ void InputStar::InitCCM(void)
// and then assign the return value to 'err'.). // and then assign the return value to 'err'.).
string fname = m_config["infile"].as<string>(); string fname = m_config["infile"].as<string>();
m_ccmErr = CCMIOOpenFile(NULL, fname.c_str(), kCCMIORead, &root); m_ccmErr = CCMIOOpenFile(NULL, fname.c_str(), kCCMIORead, &root);
ASSERTL0(m_ccmErr == kCCMIONoErr,"Error opening file");
CCMIOSize_t i = CCMIOSIZEC(0); CCMIOSize_t i = CCMIOSIZEC(0);
CCMIOID state, problem; CCMIOID state, problem;
...@@ -918,6 +919,7 @@ void InputStar::InitCCM(void) ...@@ -918,6 +919,7 @@ void InputStar::InitCCM(void)
// initialized to 0) and read the mesh and solution // initialized to 0) and read the mesh and solution
// information. // information.
CCMIONextEntity(&m_ccmErr, state, kCCMIOProcessor, &i, &m_ccmProcessor); CCMIONextEntity(&m_ccmErr, state, kCCMIOProcessor, &i, &m_ccmProcessor);
ASSERTL0(m_ccmErr == kCCMIONoErr,"Failed to find Next Entity");
} }
void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes) void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes)
...@@ -927,7 +929,9 @@ void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes) ...@@ -927,7 +929,9 @@ void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes)
CCMIOReadProcessor( CCMIOReadProcessor(
&m_ccmErr, m_ccmProcessor, &vertices, &m_ccmTopology, NULL, NULL); &m_ccmErr, m_ccmProcessor, &vertices, &m_ccmTopology, NULL, NULL);
ASSERTL0(m_ccmErr == kCCMIONoErr,"Error Reading Processor");
CCMIOEntitySize(&m_ccmErr, vertices, &nVertices, NULL); 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 // 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. // 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) ...@@ -935,23 +939,33 @@ void InputStar::ReadNodes(std::vector<NodeSharedPtr> &Nodes)
// appropriate scaling factor. The offset is just to show you can read // appropriate scaling factor. The offset is just to show you can read
// any chunk. Normally this would be in a for loop. // any chunk. Normally this would be in a for loop.
float scale; float scale;
int mapData[nVertices.getValue()]; int nvert = nVertices.getValue();
float verts[3 * nVertices.getValue()]; vector<int> mapData;
for (int k = 0; k < nVertices; ++k) 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; verts[3 * k] = verts[3 * k + 1] = verts[3 * k + 2] = 0.0;
mapData[k] = 0; mapData[k] = 0;
} }
CCMIOReadVerticesf(&m_ccmErr, CCMIOReadVerticesf(&m_ccmErr,
vertices, vertices,
&dims, &dims,
&scale, &scale,
&mapID, &mapID,
verts, &verts[0],
CCMIOINDEXC(0), CCMIOINDEXC(0),
CCMIOINDEXC(0 + nVertices)); CCMIOINDEXC(0 + nVertices));
CCMIOReadMap( ASSERTL0(m_ccmErr == kCCMIONoErr,"Error Reading Vertices in ReadNodes");
&m_ccmErr, mapID, mapData, CCMIOINDEXC(0), CCMIOINDEXC(0 + nVertices)); 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) for (int i = 0; i < nVertices; ++i)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment