Commit 9eb48aa9 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Fixed MeshConvert VTK modules.

parent f2386034
......@@ -78,7 +78,7 @@ namespace Nektar
*/
void InputVtk::Process()
{
if (m_mesh->verbose)
if (m_mesh->m_verbose)
{
cout << "InputVtk: Start reading file..." << endl;
}
......@@ -103,20 +103,20 @@ namespace Nektar
{
vtkPoints->GetPoint(i, p);
if ((p[0] * p[0]) > 0.000001 && m_mesh->spaceDim < 1)
if ((p[0] * p[0]) > 0.000001 && m_mesh->m_spaceDim < 1)
{
m_mesh->spaceDim = 1;
m_mesh->m_spaceDim = 1;
}
if ((p[1] * p[1]) > 0.000001 && m_mesh->spaceDim < 2)
if ((p[1] * p[1]) > 0.000001 && m_mesh->m_spaceDim < 2)
{
m_mesh->spaceDim = 2;
m_mesh->m_spaceDim = 2;
}
if ((p[2] * p[2]) > 0.000001 && m_mesh->spaceDim < 3)
if ((p[2] * p[2]) > 0.000001 && m_mesh->m_spaceDim < 3)
{
m_mesh->spaceDim = 3;
m_mesh->m_spaceDim = 3;
}
m_mesh->node.push_back(boost::shared_ptr<Node>(new Node(i, p[0], p[1], p[2])));
m_mesh->m_node.push_back(boost::shared_ptr<Node>(new Node(i, p[0], p[1], p[2])));
}
for (int c = 0; c < numCellTypes; ++c)
......@@ -129,25 +129,26 @@ namespace Nektar
// Create element tags
vector<int> tags;
tags.push_back(0); // composite
tags.push_back(eTriangle); // element type
tags.push_back(LibUtilities::eTriangle); // element type
// Read element node list
vector<NodeSharedPtr> nodeList;
for (int k = j; k < j + 3; ++k)
{
nodeList.push_back(m_mesh->node[pts[k]]);
nodeList.push_back(m_mesh->m_node[pts[k]]);
}
// Create element
ElmtConfig conf(eTriangle,1,false,false);
ElmtConfig conf(LibUtilities::eTriangle,1,false,false);
ElementSharedPtr E = GetElementFactory().
CreateInstance(eTriangle,conf,nodeList,tags);
CreateInstance(LibUtilities::eTriangle,
conf,nodeList,tags);
// Determine mesh expansion dimension
if (E->GetDim() > m_mesh->expDim) {
m_mesh->expDim = E->GetDim();
if (E->GetDim() > m_mesh->m_expDim) {
m_mesh->m_expDim = E->GetDim();
}
m_mesh->element[E->GetDim()].push_back(E);
m_mesh->m_element[E->GetDim()].push_back(E);
}
}
}
......
......@@ -66,7 +66,7 @@ namespace Nektar
void OutputVtk::Process()
{
if (m_mesh->verbose)
if (m_mesh->m_verbose)
{
cout << "OutputVtk: Writing file..." << endl;
}
......@@ -88,13 +88,14 @@ namespace Nektar
}
vtkIdType p[8];
vector<ElementSharedPtr> &elmt = m_mesh->element[m_mesh->expDim];
vector<ElementSharedPtr> &elmt =
m_mesh->m_element[m_mesh->m_expDim];
for(int i = 0; i < elmt.size(); ++i)
{
int vertexCount = elmt[i]->GetVertexCount();
for (int j = 0; j < vertexCount; ++j)
{
p[j] = elmt[i]->GetVertex(j)->id;
p[j] = elmt[i]->GetVertex(j)->m_id;
}
vtkPolys->InsertNextCell(vertexCount, &p[0]);
}
......
Supports Markdown
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