XdmfTopologyType.hpp 5.13 KB
Newer Older
1 2 3
#ifndef XDMFTOPOLOGYTYPE_HPP_
#define XDMFTOPOLOGYTYPE_HPP_

4
// Includes
5
#include "XdmfItemProperty.hpp"
6 7 8 9
/**
 * @brief Property describing the types of elements stored in an XdmfTopology.
 *
 * XdmfTopologyType is a property used by XdmfTopology to specify the element types stored in the XdmfTopology.
10
 * A specific XdmfTopologyType can be created by calling on one of the static methods in the class, i.e.
11 12 13 14
 * XdmfTopologyType::Tetrahedron().
 *
 * Xdmf supports the following topology types:
 * 	NoTopologyType
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
 * 	Polyvertex - Unconnected Points
 * 	Polyline - Line Segments
 * 	Polygon - N Edge Polygon
 * 	Triangle - 3 Edge Polygon
 * 	Quadrilateral - 4 Edge Polygon
 * 	Tetrahedron - 4 Triangular Faces
 * 	Wedge - 4 Triangular Faces, Quadrilateral Base
 * 	Hexahedron - 6 Quadrilateral Faces
 * 	Edge_3 - 3 Node Quadratic Line
 * 	Triangle_6 - 6 Node Quadratic Triangle
 * 	Quadrilateral_8 - 8 Node Quadratic Quadrilateral
 * 	Quadrilateral_9 - 9 Node Bi-Quadratic Quadrilateral
 * 	Tetrahedron_10 - 10 Node Quadratic Tetrahedron
 * 	Pyramid_13 - 13 Node Quadratic Pyramid
 * 	Wedge_15 - 15 Node Quadratic Wedge
 * 	Wedge_18 - 18 Node Bi-Quadratic Wedge
 * 	Hexahedron_20 - 20 Node Quadratic Hexahedron
 * 	Hexahedron_24 - 24 Node Bi-Quadratic Hexahedron
 * 	Hexahedron_27 - 27 Node Tri-Quadratic Hexahedron
 * 	Hexahedron_64 - 64 Node Tri-Cubic Hexahedron
 * 	Hexahedron_64_GLL - 64 Node Spectral Tri-Cubic Hexahedron with Gauss-Lobatto-Legendre points.
 * 	Hexahedron_125 - 125 Node Tri-Quartic Hexahedron
 * 	Hexahedron_125_GLL - 125 Node Spectral Tri-Quartic Hexahedron with Gauss-Lobatto-Legendre points.
 * 	Mixed - Mixture of Unstructured Topologies
39
 */
40
class XdmfTopologyType : public XdmfItemProperty {
41 42 43

public:

44 45
	virtual ~XdmfTopologyType();

46 47
	friend class XdmfTopology;

48
	enum CellType {
49
		NoCellType, Linear, Quadratic, Cubic, Quartic, Arbitrary, Structured
50 51 52
	};

	// Supported Xdmf Topology Types
53 54 55 56 57 58 59 60 61 62 63 64 65
	static boost::shared_ptr<const XdmfTopologyType> NoTopologyType();
	static boost::shared_ptr<const XdmfTopologyType> Polyvertex();
	static boost::shared_ptr<const XdmfTopologyType> Polyline();
	static boost::shared_ptr<const XdmfTopologyType> Polygon(const unsigned int nodesPerElement);
	static boost::shared_ptr<const XdmfTopologyType> Triangle();
	static boost::shared_ptr<const XdmfTopologyType> Quadrilateral();
	static boost::shared_ptr<const XdmfTopologyType> Tetrahedron();
	static boost::shared_ptr<const XdmfTopologyType> Pyramid();
	static boost::shared_ptr<const XdmfTopologyType> Wedge();
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron();
	static boost::shared_ptr<const XdmfTopologyType> Edge_3();
	static boost::shared_ptr<const XdmfTopologyType> Triangle_6();
	static boost::shared_ptr<const XdmfTopologyType> Quadrilateral_8();
66
	static boost::shared_ptr<const XdmfTopologyType> Quadrilateral_9();
67 68 69
	static boost::shared_ptr<const XdmfTopologyType> Tetrahedron_10();
	static boost::shared_ptr<const XdmfTopologyType> Pyramid_13();
	static boost::shared_ptr<const XdmfTopologyType> Wedge_15();
70
	static boost::shared_ptr<const XdmfTopologyType> Wedge_18();
71 72 73 74
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_20();
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_24();
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_27();
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_64();
75
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_64_GLL();
76
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_125();
77
	static boost::shared_ptr<const XdmfTopologyType> Hexahedron_125_GLL();
78
	static boost::shared_ptr<const XdmfTopologyType> Mixed();
79 80

	/**
81
	 * Get the cell type associated with this topology type.
82
	 *
83
	 * @return a CellType containing the cell type.
84
	 */
85
	CellType getCellType() const;
86

87 88 89 90 91 92 93
	/**
	 * Get the id of this cell type, necessary in order to create grids containing mixed cells.
	 *
	 * @return the ID of the topology type.
	 */
	virtual unsigned int getID() const;

94 95 96 97 98
	/**
	 * Get the name of this topology type.
	 *
	 * @return the name of this topology type.
	 */
99
	virtual std::string getName() const;
100

101
	/**
102
	 * Get the number of nodes per element associated with this topology type.
103
	 *
104
	 * @return an unsigned int containing number of nodes per element.
105
	 */
106
	virtual unsigned int getNodesPerElement() const;
107

108
	void getProperties(std::map<std::string, std::string> & collectedProperties) const;
109

110 111 112 113
protected:

	/**
	 * Protected constructor for XdmfTopologyType.  The constructor is protected because all topology types supported
114 115
	 * by Xdmf should be accessed through more specific static methods that construct XdmfTopologyType -
	 * i.e. XdmfTopologyType::Tetrahedron()
116
	 */
117
	XdmfTopologyType(const unsigned int nodesPerElement, const std::string & name, const CellType cellType, const unsigned int id);
118 119 120

private:

121 122 123 124
	XdmfTopologyType(const XdmfTopologyType & topologyType); // Not implemented.
	void operator=(const XdmfTopologyType & topologyType); // Not implemented.

	static boost::shared_ptr<const XdmfTopologyType> New(const std::map<std::string, std::string> & itemProperties);
125

126 127 128 129 130
	const CellType mCellType;
	const unsigned int mID;
	const std::string mName;
	const unsigned int mNodesPerElement;

131 132 133
};

#endif /* XDMFTOPOLOGYTYPE_HPP_ */