Skip to content
Snippets Groups Projects
Commit 164b79e4 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

move getElementDimension() to generateStructuredMesh.cpp

parent 7636bdb3
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,32 @@
// FileIO
#include "FileIO/Legacy/MeshIO.h"
namespace
{
/// Get dimension of the mesh element type.
/// @param eleType element type
unsigned getDimension(MeshElemType eleType)
{
switch (eleType)
{
case MeshElemType::LINE:
return 1;
case MeshElemType::QUAD:
case MeshElemType::TRIANGLE:
return 2;
case MeshElemType::HEXAHEDRON:
case MeshElemType::PRISM:
case MeshElemType::PYRAMID:
case MeshElemType::TETRAHEDRON:
return 3;
default:
return 0;
}
}
} // end namespace
int main (int argc, char* argv[])
{
......@@ -68,7 +94,7 @@ int main (int argc, char* argv[])
cmd.parse(argc, argv);
const std::string eleTypeName(eleTypeArg.getValue());
const MeshElemType eleType = String2MeshElemType(eleTypeName);
const unsigned dim = MeshLib::Element::getDimension(eleType);
const unsigned dim = getDimension(eleType);
bool dim_used[3] = {false};
for (unsigned i=0; i<dim; i++)
......
......@@ -170,23 +170,4 @@ bool Element::isBoundaryElement() const
[](MeshLib::Element const*const e){ return e == nullptr; });
}
unsigned Element::getDimension(MeshElemType eleType)
{
switch (eleType)
{
case MeshElemType::LINE:
return 1;
case MeshElemType::QUAD:
case MeshElemType::TRIANGLE:
return 2;
case MeshElemType::HEXAHEDRON:
case MeshElemType::PRISM:
case MeshElemType::PYRAMID:
case MeshElemType::TETRAHEDRON:
return 3;
default:
return 0;
}
}
}
......@@ -80,10 +80,6 @@ public:
/// Get dimension of the mesh element.
virtual unsigned getDimension() const = 0;
/// Get dimension of the mesh element type.
/// @param eleType element type
static unsigned getDimension(MeshElemType eleType);
/// Returns the i-th edge of the element.
const Element* getEdge(unsigned i) const;
......
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