XdmfTopology.cpp 863 Bytes
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
 *
 *  Created on: Jan 29, 2010
 *      Author: kleiter
 */

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
8
#include "XdmfArray.hpp"
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
9
#include "XdmfTopology.hpp"
10
#include "XdmfVisitor.hpp"
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
11

12
XdmfTopology::XdmfTopology() :
13 14
	mTopologyType(XdmfTopologyType::NoTopologyType()),
	mNumberElements(0)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
15 16 17 18 19 20 21 22 23
{
	std::cout << "Created Topology " << this << std::endl;
}

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

24 25 26 27 28
void XdmfTopology::accept(boost::shared_ptr<XdmfVisitor> visitor) const
{
	visitor->visit(this, visitor);
}

29
unsigned int XdmfTopology::getNumberElements() const
30
{
31
	return this->getArray()->getSize() / this->getTopologyType().getNodesPerElement();
32 33
}

34
XdmfTopologyType XdmfTopology::getTopologyType() const
35
{
36
	return mTopologyType;
37 38
}

39
void XdmfTopology::setTopologyType(const XdmfTopologyType & topologyType)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
40
{
41
	mTopologyType = topologyType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
42
}