XdmfTopology.cpp 1.22 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1
/*
2
 * XdmfTopology.cpp
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
3 4 5 6 7 8
 *
 *  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
XdmfTopology::XdmfTopology() :
12 13
	mTopologyType(XdmfTopologyType::NoTopologyType()),
	mNumberElements(0)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
14 15 16 17 18 19 20 21 22
{
	std::cout << "Created Topology " << this << std::endl;
}

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

23
XdmfTopologyType XdmfTopology::getTopologyType() const
24
{
25
	return mTopologyType;
26 27
}

28
void XdmfTopology::setTopologyType(const XdmfTopologyType& topType)
29
{
30
	mTopologyType = topType;
31
	mNumberValues = mNumberElements * mTopologyType.getNodesPerElement();
32 33
}

34 35 36 37 38 39
int XdmfTopology::getNodesPerElement() const
{
	return mTopologyType.getNodesPerElement();
}

int XdmfTopology::getNumberElements() const
40
{
41
	return mNumberElements;
42 43
}

44
void XdmfTopology::setNumberElements(int numberElements)
45
{
46
	mNumberElements = numberElements;
47
	mNumberValues = mNumberElements * mTopologyType.getNodesPerElement();
48 49
}

50
std::string XdmfTopology::getTopologyTypeAsString() const
51
{
52
	return mTopologyType.getName();
53 54
}

55
std::string XdmfTopology::printSelf() const
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
56 57 58
{
	return "XdmfTopology";
}
59 60 61 62 63

void XdmfTopology::write(boost::shared_ptr<XdmfVisitor> visitor) const
{
	visitor->visit(this);
}