Skip to content
Snippets Groups Projects
Commit 3056b9c3 authored by Norihiro Watanabe's avatar Norihiro Watanabe Committed by Dmitri Naumov
Browse files

include comments from DN

parent 064f0276
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,6 @@ int VtkMeshSource::RequestData( vtkInformation* request, ...@@ -135,7 +135,6 @@ int VtkMeshSource::RequestData( vtkInformation* request,
// Generate mesh elements // Generate mesh elements
for (unsigned i = 0; i < nElems; ++i) for (unsigned i = 0; i < nElems; ++i)
{ {
int type(0);
const MeshLib::Element* elem (elems[i]); const MeshLib::Element* elem (elems[i]);
materialIDs->InsertValue(i, elem->getValue()); materialIDs->InsertValue(i, elem->getValue());
...@@ -145,8 +144,8 @@ int VtkMeshSource::RequestData( vtkInformation* request, ...@@ -145,8 +144,8 @@ int VtkMeshSource::RequestData( vtkInformation* request,
for (unsigned j = 0; j < nElemNodes; ++j) for (unsigned j = 0; j < nElemNodes; ++j)
point_ids->SetId(j, elem->getNode(j)->getID()); point_ids->SetId(j, elem->getNode(j)->getID());
type = OGSToVtkCellType(elem->getCellType()); const int type = OGSToVtkCellType(elem->getCellType());
if (type==0) if (type == -1)
{ {
ERR("VtkMeshSource::RequestData(): Unknown element type \"%s\".", ERR("VtkMeshSource::RequestData(): Unknown element type \"%s\".",
CellType2String(elem->getCellType()).c_str()); CellType2String(elem->getCellType()).c_str());
......
...@@ -13,127 +13,88 @@ ...@@ -13,127 +13,88 @@
CellType VtkCellTypeToOGS(int type) CellType VtkCellTypeToOGS(int type)
{ {
CellType ogs;
switch (type) switch (type)
{ {
case VTK_LINE: case VTK_LINE:
ogs = CellType::LINE2; return CellType::LINE2;
break;
case VTK_QUADRATIC_EDGE: case VTK_QUADRATIC_EDGE:
ogs = CellType::LINE3; return CellType::LINE3;
break;
case VTK_TRIANGLE: case VTK_TRIANGLE:
ogs = CellType::TRI3; return CellType::TRI3;
break;
case VTK_QUADRATIC_TRIANGLE: case VTK_QUADRATIC_TRIANGLE:
ogs = CellType::TRI6; return CellType::TRI6;
break;
case VTK_QUAD: case VTK_QUAD:
ogs = CellType::QUAD4; return CellType::QUAD4;
break;
case VTK_QUADRATIC_QUAD: case VTK_QUADRATIC_QUAD:
ogs = CellType::QUAD8; return CellType::QUAD8;
break;
case VTK_BIQUADRATIC_QUAD: case VTK_BIQUADRATIC_QUAD:
ogs = CellType::QUAD9; return CellType::QUAD9;
break;
case VTK_HEXAHEDRON: case VTK_HEXAHEDRON:
ogs = CellType::HEX8; return CellType::HEX8;
break;
case VTK_QUADRATIC_HEXAHEDRON: case VTK_QUADRATIC_HEXAHEDRON:
ogs = CellType::HEX20; return CellType::HEX20;
break;
case VTK_TRIQUADRATIC_HEXAHEDRON: case VTK_TRIQUADRATIC_HEXAHEDRON:
ogs = CellType::HEX27; return CellType::HEX27;
break;
case VTK_TETRA: case VTK_TETRA:
ogs = CellType::TET4; return CellType::TET4;
break;
case VTK_QUADRATIC_TETRA: case VTK_QUADRATIC_TETRA:
ogs = CellType::TET10; return CellType::TET10;
break;
case VTK_WEDGE: case VTK_WEDGE:
ogs = CellType::PRISM6; return CellType::PRISM6;
break;
case VTK_QUADRATIC_WEDGE: case VTK_QUADRATIC_WEDGE:
ogs = CellType::PRISM15; return CellType::PRISM15;
break;
case VTK_BIQUADRATIC_QUADRATIC_WEDGE: case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
ogs = CellType::PRISM18; return CellType::PRISM18;
break;
case VTK_PYRAMID: case VTK_PYRAMID:
ogs = CellType::PYRAMID5; return CellType::PYRAMID5;
break;
case VTK_QUADRATIC_PYRAMID: case VTK_QUADRATIC_PYRAMID:
ogs = CellType::PYRAMID13; return CellType::PYRAMID13;
break;
default: default:
ogs = CellType::INVALID; return CellType::INVALID;
break;
} }
return ogs;
} }
int OGSToVtkCellType(CellType ogs) int OGSToVtkCellType(CellType ogs)
{ {
int type = 0;
switch (ogs) switch (ogs)
{ {
case CellType::INVALID:
break;
case CellType::LINE2: case CellType::LINE2:
type = VTK_LINE; return VTK_LINE;
break;
case CellType::LINE3: case CellType::LINE3:
type = VTK_QUADRATIC_EDGE; return VTK_QUADRATIC_EDGE;
break;
case CellType::TRI3: case CellType::TRI3:
type = VTK_TRIANGLE; return VTK_TRIANGLE;
break;
case CellType::TRI6: case CellType::TRI6:
type = VTK_QUADRATIC_TRIANGLE; return VTK_QUADRATIC_TRIANGLE;
break;
case CellType::QUAD4: case CellType::QUAD4:
type = VTK_QUAD; return VTK_QUAD;
break;
case CellType::QUAD8: case CellType::QUAD8:
type = VTK_QUADRATIC_QUAD; return VTK_QUADRATIC_QUAD;
break;
case CellType::QUAD9: case CellType::QUAD9:
type = VTK_BIQUADRATIC_QUAD; return VTK_BIQUADRATIC_QUAD;
break;
case CellType::HEX8: case CellType::HEX8:
type = VTK_HEXAHEDRON; return VTK_HEXAHEDRON;
break;
case CellType::HEX20: case CellType::HEX20:
type = VTK_QUADRATIC_HEXAHEDRON; return VTK_QUADRATIC_HEXAHEDRON;
break;
case CellType::HEX27: case CellType::HEX27:
type = VTK_TRIQUADRATIC_HEXAHEDRON; return VTK_TRIQUADRATIC_HEXAHEDRON;
break;
case CellType::TET4: case CellType::TET4:
type = VTK_TETRA; return VTK_TETRA;
break;
case CellType::TET10: case CellType::TET10:
type = VTK_QUADRATIC_TETRA; return VTK_QUADRATIC_TETRA;
break;
case CellType::PRISM6: case CellType::PRISM6:
type = VTK_WEDGE; return VTK_WEDGE;
break;
case CellType::PRISM15: case CellType::PRISM15:
type = VTK_QUADRATIC_WEDGE; return VTK_QUADRATIC_WEDGE;
break;
case CellType::PRISM18: case CellType::PRISM18:
type = VTK_BIQUADRATIC_QUADRATIC_WEDGE; return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
break;
case CellType::PYRAMID5: case CellType::PYRAMID5:
type = VTK_PYRAMID; return VTK_PYRAMID;
break;
case CellType::PYRAMID13: case CellType::PYRAMID13:
type = VTK_QUADRATIC_PYRAMID; return VTK_QUADRATIC_PYRAMID;
break; default:
return -1;
} }
return type;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment