XdmfTopology.cpp 2.79 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1 2 3 4 5 6 7 8
/*
 * XdmfGrid.cpp
 *
 *  Created on: Jan 29, 2010
 *      Author: kleiter
 */

#include "XdmfTopology.hpp"
9
#include "XdmfVisitor.hpp"
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
10

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
const XdmfTopologyType XdmfTopologyType::NoTopology(0, "NoTopology", NoCellType);
const XdmfTopologyType XdmfTopologyType::Polyvertex(1, "Polyvertex", Linear);
const XdmfTopologyType XdmfTopologyType::Polyline(1, "Polyline", Linear);
const XdmfTopologyType XdmfTopologyType::Polygon(1, "Polygon", Linear);
const XdmfTopologyType XdmfTopologyType::Triangle(3, "Triangle", Linear);
const XdmfTopologyType XdmfTopologyType::Quadrilateral(4, "Quadrilateral", Linear);
const XdmfTopologyType XdmfTopologyType::Tetrahedron(4, "Tetrahedron", Linear);
const XdmfTopologyType XdmfTopologyType::Pyramid(5, "Pyramid", Linear);
const XdmfTopologyType XdmfTopologyType::Wedge(6, "Wedge", Linear);
const XdmfTopologyType XdmfTopologyType::Hexahedron(8, "Hexahedron", Linear);
const XdmfTopologyType XdmfTopologyType::Edge_3(3, "Edge_3", Quadratic);
const XdmfTopologyType XdmfTopologyType::Triangle_6(6, "Triangle_6", Quadratic);
const XdmfTopologyType XdmfTopologyType::Quadrilateral_8(8, "Quadrilateral_8", Quadratic);
const XdmfTopologyType XdmfTopologyType::Tetrahedron_10(10, "Tetrahedron_10", Quadratic);
const XdmfTopologyType XdmfTopologyType::Pyramid_13(13, "Pyramid_13", Quadratic);
const XdmfTopologyType XdmfTopologyType::Wedge_15(15, "Wedge_15", Quadratic);
const XdmfTopologyType XdmfTopologyType::Hexahedron_20(20, "Hexahedron_20", Quadratic);
const XdmfTopologyType XdmfTopologyType::Mixed(0, "Mixed", Arbitrary);
const XdmfTopologyType XdmfTopologyType::TwoDSMesh(1, "2DSMesh", Structured);
const XdmfTopologyType XdmfTopologyType::TwoDRectMesh(1, "2DRectMesh", Structured);
const XdmfTopologyType XdmfTopologyType::TwoDCoRectMesh(1, "2DCoRectMesh", Structured);
const XdmfTopologyType XdmfTopologyType::ThreeDSMesh(1, "3DSMesh", Structured);
const XdmfTopologyType XdmfTopologyType::ThreeDRectMesh(1, "3DRectMesh", Structured);
const XdmfTopologyType XdmfTopologyType::ThreeDCoRectMesh(1, "3DCoRectMesh", Structured);

XdmfTopology::XdmfTopology() :
mTopologyType(&XdmfTopologyType::NoTopology)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
38 39 40 41 42 43 44 45 46
{
	std::cout << "Created Topology " << this << std::endl;
}

XdmfTopology::~XdmfTopology()
{
	std::cout << "Deleted Topology " << this << std::endl;
}

47 48 49 50 51
void XdmfTopology::write(boost::shared_ptr<XdmfVisitor> visitor) const
{
	visitor->visit(this);
}

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
const XdmfTopologyType & XdmfTopology::getTopologyType() const
{
	return *mTopologyType;
}

void XdmfTopology::setTopologyType(const XdmfTopologyType& topType)
{
	mTopologyType = &topType;
	return;
}

const int XdmfTopology::getNodesPerElement() const
{
	return mTopologyType->nodesPerElement;
}

68 69 70 71 72 73
const std::string XdmfTopology::getTopologyTypeAsString() const
{
	return mTopologyType->name;
}

const std::string XdmfTopology::printSelf() const
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
74 75 76
{
	return "XdmfTopology";
}