Commit 5d773b0e authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

ENH: Add additional topology types.

Modify XdmfTopologyConverter and XdmfPartitioner to work with new
topology types.
parent 3ada9fd4
...@@ -220,29 +220,66 @@ XdmfTopologyType::Hexahedron_64() ...@@ -220,29 +220,66 @@ XdmfTopologyType::Hexahedron_64()
} }
shared_ptr<const XdmfTopologyType> shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_64_GLL() XdmfTopologyType::Hexahedron_125()
{ {
static shared_ptr<const XdmfTopologyType> static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(64, "Hexahedron_64_GLL", Cubic, 0x35)); p(new XdmfTopologyType(125, "Hexahedron_125", Quartic, 0x34));
return p; return p;
} }
shared_ptr<const XdmfTopologyType> shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_125() XdmfTopologyType::Hexahedron_216()
{ {
static shared_ptr<const XdmfTopologyType> static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(125, "Hexahedron_125", Quartic, 0x34)); p(new XdmfTopologyType(216, "Hexahedron_216", Quintic, 0x35));
return p; return p;
} }
shared_ptr<const XdmfTopologyType> shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_125_GLL() XdmfTopologyType::Hexahedron_343()
{ {
static shared_ptr<const XdmfTopologyType> static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(125, "Hexahedron_125_GLL", Quartic, 0x36)); p(new XdmfTopologyType(343, "Hexahedron_343", Sextic, 0x36));
return p; return p;
} }
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_512()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(512, "Hexahedron_512", Septic, 0x37));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_729()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(729, "Hexahedron_729", Octic, 0x38));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_1000()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(1000, "Hexahedron_1000", Nonic, 0x39));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_1331()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(1331, "Hexahedron_1331", Decic, 0x40));
return p;
}
shared_ptr<const XdmfTopologyType> shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Mixed() XdmfTopologyType::Mixed()
{ {
...@@ -320,14 +357,26 @@ XdmfTopologyType::New(const unsigned int id) ...@@ -320,14 +357,26 @@ XdmfTopologyType::New(const unsigned int id)
else if(id == XdmfTopologyType::Hexahedron_64()->getID()) { else if(id == XdmfTopologyType::Hexahedron_64()->getID()) {
return XdmfTopologyType::Hexahedron_64(); return XdmfTopologyType::Hexahedron_64();
} }
else if(id == XdmfTopologyType::Hexahedron_64_GLL()->getID()) {
return XdmfTopologyType::Hexahedron_64_GLL();
}
else if(id == XdmfTopologyType::Hexahedron_125()->getID()) { else if(id == XdmfTopologyType::Hexahedron_125()->getID()) {
return XdmfTopologyType::Hexahedron_125(); return XdmfTopologyType::Hexahedron_125();
} }
else if(id == XdmfTopologyType::Hexahedron_125_GLL()->getID()) { else if(id == XdmfTopologyType::Hexahedron_216()->getID()) {
return XdmfTopologyType::Hexahedron_125_GLL(); return XdmfTopologyType::Hexahedron_216();
}
else if(id == XdmfTopologyType::Hexahedron_343()->getID()) {
return XdmfTopologyType::Hexahedron_343();
}
else if(id == XdmfTopologyType::Hexahedron_512()->getID()) {
return XdmfTopologyType::Hexahedron_512();
}
else if(id == XdmfTopologyType::Hexahedron_729()->getID()) {
return XdmfTopologyType::Hexahedron_729();
}
else if(id == XdmfTopologyType::Hexahedron_1000()->getID()) {
return XdmfTopologyType::Hexahedron_1000();
}
else if(id == XdmfTopologyType::Hexahedron_1331()->getID()) {
return XdmfTopologyType::Hexahedron_1331();
} }
else if(id == XdmfTopologyType::Mixed()->getID()) { else if(id == XdmfTopologyType::Mixed()->getID()) {
return XdmfTopologyType::Mixed(); return XdmfTopologyType::Mixed();
...@@ -440,6 +489,24 @@ XdmfTopologyType::New(const std::map<std::string, std::string> & itemProperties) ...@@ -440,6 +489,24 @@ XdmfTopologyType::New(const std::map<std::string, std::string> & itemProperties)
else if(typeVal.compare("HEXAHEDRON_125") == 0) { else if(typeVal.compare("HEXAHEDRON_125") == 0) {
return Hexahedron_125(); return Hexahedron_125();
} }
else if(typeVal.compare("HEXAHEDRON_216") == 0) {
return Hexahedron_216();
}
else if(typeVal.compare("HEXAHEDRON_343") == 0) {
return Hexahedron_343();
}
else if(typeVal.compare("HEXAHEDRON_512") == 0) {
return Hexahedron_512();
}
else if(typeVal.compare("HEXAHEDRON_729") == 0) {
return Hexahedron_729();
}
else if(typeVal.compare("HEXAHEDRON_1000") == 0) {
return Hexahedron_1000();
}
else if(typeVal.compare("HEXAHEDRON_1331") == 0) {
return Hexahedron_1331();
}
else if(typeVal.compare("MIXED") == 0) { else if(typeVal.compare("MIXED") == 0) {
return Mixed(); return Mixed();
} }
......
...@@ -59,9 +59,13 @@ ...@@ -59,9 +59,13 @@
* Hexahedron_24 - 24 Node Bi-Quadratic Hexahedron * Hexahedron_24 - 24 Node Bi-Quadratic Hexahedron
* Hexahedron_27 - 27 Node Tri-Quadratic Hexahedron * Hexahedron_27 - 27 Node Tri-Quadratic Hexahedron
* Hexahedron_64 - 64 Node Tri-Cubic 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 - 125 Node Tri-Quartic Hexahedron
* Hexahedron_125_GLL - 125 Node Spectral Tri-Quartic Hexahedron with Gauss-Lobatto-Legendre points. * Hexahedron_216 - 216 Node Tri-Quintic Hexahedron
* Hexahedron_343 - 343 Node Tri-Hexic Hexahedron
* Hexahedron_512 - 512 Node Tri-Septic Hexahedron
* Hexahedron_729 - 729 Node Tri-Octic Hexahedron
* Hexahedron_1000 - 1000 Node Tri-Nonic Hexahedron
* Hexahedron_1331 - 1331 Node Tri-Decic Hexahedron
* Mixed - Mixture of Unstructured Topologies * Mixed - Mixture of Unstructured Topologies
*/ */
class XDMF_EXPORT XdmfTopologyType : public XdmfItemProperty { class XDMF_EXPORT XdmfTopologyType : public XdmfItemProperty {
...@@ -73,13 +77,19 @@ public: ...@@ -73,13 +77,19 @@ public:
friend class XdmfTopology; friend class XdmfTopology;
enum CellType { enum CellType {
NoCellType, NoCellType = 0,
Linear, Linear = 1,
Quadratic, Quadratic = 2,
Cubic, Cubic = 3,
Quartic, Quartic = 4,
Arbitrary, Quintic = 5,
Structured Sextic = 6,
Septic = 7,
Octic = 8,
Nonic = 9,
Decic = 10,
Arbitrary = 100,
Structured = 101
}; };
/** /**
...@@ -109,9 +119,13 @@ public: ...@@ -109,9 +119,13 @@ public:
static shared_ptr<const XdmfTopologyType> Hexahedron_24(); static shared_ptr<const XdmfTopologyType> Hexahedron_24();
static shared_ptr<const XdmfTopologyType> Hexahedron_27(); static shared_ptr<const XdmfTopologyType> Hexahedron_27();
static shared_ptr<const XdmfTopologyType> Hexahedron_64(); static shared_ptr<const XdmfTopologyType> Hexahedron_64();
static shared_ptr<const XdmfTopologyType> Hexahedron_64_GLL();
static shared_ptr<const XdmfTopologyType> Hexahedron_125(); static shared_ptr<const XdmfTopologyType> Hexahedron_125();
static shared_ptr<const XdmfTopologyType> Hexahedron_125_GLL(); static shared_ptr<const XdmfTopologyType> Hexahedron_216();
static shared_ptr<const XdmfTopologyType> Hexahedron_343();
static shared_ptr<const XdmfTopologyType> Hexahedron_512();
static shared_ptr<const XdmfTopologyType> Hexahedron_729();
static shared_ptr<const XdmfTopologyType> Hexahedron_1000();
static shared_ptr<const XdmfTopologyType> Hexahedron_1331();
static shared_ptr<const XdmfTopologyType> Mixed(); static shared_ptr<const XdmfTopologyType> Mixed();
/** /**
......
...@@ -113,7 +113,13 @@ XdmfPartitioner::partition(const shared_ptr<XdmfUnstructuredGrid> gridToPartitio ...@@ -113,7 +113,13 @@ XdmfPartitioner::partition(const shared_ptr<XdmfUnstructuredGrid> gridToPartitio
topologyType == XdmfTopologyType::Hexahedron_24() || topologyType == XdmfTopologyType::Hexahedron_24() ||
topologyType == XdmfTopologyType::Hexahedron_27() || topologyType == XdmfTopologyType::Hexahedron_27() ||
topologyType == XdmfTopologyType::Hexahedron_64() || topologyType == XdmfTopologyType::Hexahedron_64() ||
topologyType == XdmfTopologyType::Hexahedron_125()) { topologyType == XdmfTopologyType::Hexahedron_125() ||
topologyType == XdmfTopologyType::Hexahedron_216() ||
topologyType == XdmfTopologyType::Hexahedron_343() ||
topologyType == XdmfTopologyType::Hexahedron_512() ||
topologyType == XdmfTopologyType::Hexahedron_729() ||
topologyType == XdmfTopologyType::Hexahedron_1000() ||
topologyType == XdmfTopologyType::Hexahedron_1331()) {
metisElementType = 3; metisElementType = 3;
nodesPerElement = 8; nodesPerElement = 8;
} }
......
This diff is collapsed.
...@@ -48,11 +48,26 @@ class XdmfUnstructuredGrid; ...@@ -48,11 +48,26 @@ class XdmfUnstructuredGrid;
* *
* Currently supported conversions: * Currently supported conversions:
* Hexahedron to Hexahedron_64 * Hexahedron to Hexahedron_64
* Hexahedron to Hexahedron_64_GLL
* Hexahedron to Hexahedron_125 * Hexahedron to Hexahedron_125
* Hexahedron to Hexahedron_125_GLL * Hexahedron to Hexahedron_216
* Hexahedron to Hexahedron_343
* Hexahedron to Hexahedron_512
* Hexahedron to Hexahedron_729
* Hexahedron to Hexahedron_1000
* Hexahedron to Hexahedron_1331
* Hexahedron_64 to Hexahedron * Hexahedron_64 to Hexahedron
* Hexahedron_125 to Hexahedron * Hexahedron_125 to Hexahedron
* Hexahedron_216 to Hexahedron
* Hexahedron_343 to Hexahedron
* Hexahedron_512 to Hexahedron
* Hexahedron_729 to Hexahedron
* Hexahedron_1000 to Hexahedron
* Hexahedron_1331 to Hexahedron
*
* Additional options:
* When generating high order hexahedrons an option of 0 adds nodes at
* equal intervals inside the element. An option of 1 places nodes at
* Guass Lobatto Legendre points.
*/ */
class XDMFUTILS_EXPORT XdmfTopologyConverter { class XDMFUTILS_EXPORT XdmfTopologyConverter {
...@@ -73,6 +88,7 @@ public: ...@@ -73,6 +88,7 @@ public:
* @param gridToConvert the unstructured grid to convert to a different * @param gridToConvert the unstructured grid to convert to a different
* topology * topology
* @param topologyType the topology type to convert to. * @param topologyType the topology type to convert to.
* @param options additional options used when converting.
* @param heavyDataWriter an heavy data writer to write the converted mesh * @param heavyDataWriter an heavy data writer to write the converted mesh
* to. If no heavyDataWriter is specified, all mesh data will remain in * to. If no heavyDataWriter is specified, all mesh data will remain in
* memory. * memory.
...@@ -82,6 +98,7 @@ public: ...@@ -82,6 +98,7 @@ public:
shared_ptr<XdmfUnstructuredGrid> shared_ptr<XdmfUnstructuredGrid>
convert(const shared_ptr<XdmfUnstructuredGrid> gridToConvert, convert(const shared_ptr<XdmfUnstructuredGrid> gridToConvert,
const shared_ptr<const XdmfTopologyType> topologyType, const shared_ptr<const XdmfTopologyType> topologyType,
unsigned int options = 0,
const shared_ptr<XdmfHeavyDataWriter> heavyDataWriter = shared_ptr<XdmfHeavyDataWriter>()) const; const shared_ptr<XdmfHeavyDataWriter> heavyDataWriter = shared_ptr<XdmfHeavyDataWriter>()) const;
protected: protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment