Commit 4084f4e6 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

Merge branch 'ajb-dev', remote-tracking branch 'origin' into ajb-dev

parents 4b1c1d0b 15d33cb0
......@@ -282,6 +282,80 @@ XdmfTopologyType::Hexahedron_1331()
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_64()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(64, 6, 12, "Hexahedron_Spectral_64", Cubic, 0x41));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_125()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(125, 6, 12,
"Hexahedron_Spectral_125", Quartic, 0x42));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_216()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(216, 6, 12,
"Hexahedron_Spectral_216", Quintic, 0x43));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_343()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(343, 6, 12,
"Hexahedron_Spectral_343", Sextic, 0x44));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_512()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(512, 6, 12,
"Hexahedron_Spectral_512", Septic, 0x45));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_729()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(729, 6, 12,
"Hexahedron_Spectral_729", Octic, 0x46));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_1000()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(1000, 6, 12,
"Hexahedron_Spectral_1000", Nonic, 0x47));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Hexahedron_Spectral_1331()
{
static shared_ptr<const XdmfTopologyType>
p(new XdmfTopologyType(1331, 6, 12,
"Hexahedron_Spectral_1331", Decic, 0x48));
return p;
}
shared_ptr<const XdmfTopologyType>
XdmfTopologyType::Mixed()
......@@ -381,6 +455,30 @@ XdmfTopologyType::New(const unsigned int id)
else if(id == XdmfTopologyType::Hexahedron_1331()->getID()) {
return XdmfTopologyType::Hexahedron_1331();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_64()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_64();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_125()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_125();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_216()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_216();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_343()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_343();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_512()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_512();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_729()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_729();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_1000()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_1000();
}
else if(id == XdmfTopologyType::Hexahedron_Spectral_1331()->getID()) {
return XdmfTopologyType::Hexahedron_Spectral_1331();
}
else if(id == XdmfTopologyType::Mixed()->getID()) {
return XdmfTopologyType::Mixed();
}
......@@ -519,6 +617,30 @@ XdmfTopologyType::New(const std::map<std::string, std::string> & itemProperties)
else if(typeVal.compare("HEXAHEDRON_1331") == 0) {
return Hexahedron_1331();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_64") == 0) {
return Hexahedron_Spectral_64();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_125") == 0) {
return Hexahedron_Spectral_125();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_216") == 0) {
return Hexahedron_Spectral_216();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_343") == 0) {
return Hexahedron_Spectral_343();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_512") == 0) {
return Hexahedron_Spectral_512();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_729") == 0) {
return Hexahedron_Spectral_729();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_1000") == 0) {
return Hexahedron_Spectral_1000();
}
else if(typeVal.compare("HEXAHEDRON_SPECTRAL_1331") == 0) {
return Hexahedron_Spectral_1331();
}
else if(typeVal.compare("MIXED") == 0) {
return Mixed();
}
......
......@@ -80,6 +80,14 @@
* Hexahedron_729 - 729 Node Tri-Octic Hexahedron
* Hexahedron_1000 - 1000 Node Tri-Nonic Hexahedron
* Hexahedron_1331 - 1331 Node Tri-Decic Hexahedron
* Hexahedron_Spectral_64 - 64 Node Spectral Tri-Cubic Hexahedron
* Hexahedron_Spectral_125 - 125 Node Spectral Tri-Quartic Hexahedron
* Hexahedron_Spectral_216 - 216 Node Spectral Tri-Quintic Hexahedron
* Hexahedron_Spectral_343 - 343 Node Spectral Tri-Hexic Hexahedron
* Hexahedron_Spectral_512 - 512 Node Spectral Tri-Septic Hexahedron
* Hexahedron_Spectral_729 - 729 Node Spectral Tri-Octic Hexahedron
* Hexahedron_Spectral_1000 - 1000 Node Spectral Tri-Nonic Hexahedron
* Hexahedron_Spectral_1331 - 1331 Node Spectral Tri-Decic Hexahedron
* Mixed - Mixture of Unstructured Topologies
*/
class XDMF_EXPORT XdmfTopologyType : public XdmfItemProperty {
......@@ -140,6 +148,14 @@ public:
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> Hexahedron_Spectral_64();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_125();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_216();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_343();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_512();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_729();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_1000();
static shared_ptr<const XdmfTopologyType> Hexahedron_Spectral_1331();
static shared_ptr<const XdmfTopologyType> Mixed();
/**
......
......@@ -22,6 +22,7 @@
/*****************************************************************************/
#include <boost/tokenizer.hpp>
#include <limits>
#include <sstream>
#include <utility>
#include "XdmfArray.hpp"
......@@ -282,6 +283,7 @@ public:
}
std::stringstream toReturn;
toReturn.precision(std::numeric_limits<U>::digits10 + 2);
for(int i=0; i<lastIndex; ++i) {
toReturn << (U)array[i] << " ";
}
......
......@@ -2,6 +2,7 @@
#include "XdmfArrayType.hpp"
#include "XdmfHDF5Controller.hpp"
#include "XdmfHDF5Writer.hpp"
#include <iostream>
int main(int, char **)
{
......
......@@ -1111,7 +1111,6 @@ XdmfTopologyConverter::~XdmfTopologyConverter()
shared_ptr<XdmfUnstructuredGrid>
XdmfTopologyConverter::convert(const shared_ptr<XdmfUnstructuredGrid> gridToConvert,
const shared_ptr<const XdmfTopologyType> topologyType,
unsigned int options,
const shared_ptr<XdmfHeavyDataWriter> heavyDataWriter) const
{
// Make sure geometry and topology are non null
......@@ -1138,107 +1137,107 @@ XdmfTopologyConverter::convert(const shared_ptr<XdmfUnstructuredGrid> gridToConv
if(topologyType == XdmfTopologyType::Hexahedron_27()) {
converter = new HexahedronToHexahedron27();
}
if(topologyType == XdmfTopologyType::Hexahedron_64()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<3, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<3, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_64()) {
converter = new HexahedronToHighOrderHexahedron<3, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_64()) {
converter = new HexahedronToHighOrderHexahedron<3, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_125()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<4, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<4, false>();
}
converter = new HexahedronToHighOrderHexahedron<4, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_125()) {
converter = new HexahedronToHighOrderHexahedron<4, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_216()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<5, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<5, false>();
}
converter = new HexahedronToHighOrderHexahedron<5, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_216()) {
converter = new HexahedronToHighOrderHexahedron<5, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_343()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<6, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<6, false>();
}
converter = new HexahedronToHighOrderHexahedron<6, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_343()) {
converter = new HexahedronToHighOrderHexahedron<6, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_512()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<7, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<7, false>();
}
converter = new HexahedronToHighOrderHexahedron<7, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_512()) {
converter = new HexahedronToHighOrderHexahedron<7, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_729()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<8, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<8, false>();
}
converter = new HexahedronToHighOrderHexahedron<8, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_729()) {
converter = new HexahedronToHighOrderHexahedron<8, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_1000()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<9, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<9, false>();
}
converter = new HexahedronToHighOrderHexahedron<9, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_1000()) {
converter = new HexahedronToHighOrderHexahedron<9, true>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_1331()) {
if(options == 1) {
converter = new HexahedronToHighOrderHexahedron<10, true>();
}
else {
converter = new HexahedronToHighOrderHexahedron<10, false>();
}
converter = new HexahedronToHighOrderHexahedron<10, false>();
}
else if(topologyType == XdmfTopologyType::Hexahedron_Spectral_1331()) {
converter = new HexahedronToHighOrderHexahedron<10, true>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_64()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_64() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_64()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<3>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_125()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_125() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_125()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<4>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_216()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_216() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_216()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<5>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_343()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_343() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_343()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<6>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_512()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_512() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_512()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<7>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_729()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_729() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_729()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<8>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_1000()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_1000() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_1000()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<9>();
}
}
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_1331()) {
else if(topologyTypeToConvert == XdmfTopologyType::Hexahedron_1331() ||
topologyTypeToConvert ==
XdmfTopologyType::Hexahedron_Spectral_1331()) {
if(topologyType == XdmfTopologyType::Hexahedron()) {
converter = new HighOrderHexahedronToHexahedron<10>();
}
......
......@@ -56,6 +56,14 @@ class XdmfUnstructuredGrid;
* Hexahedron to Hexahedron_729
* Hexahedron to Hexahedron_1000
* Hexahedron to Hexahedron_1331
* Hexahedron to Hexahedron_Spectral_64
* Hexahedron to Hexahedron_Spectral_125
* Hexahedron to Hexahedron_Spectral_216
* Hexahedron to Hexahedron_Spectral_343
* Hexahedron to Hexahedron_Spectral_512
* Hexahedron to Hexahedron_Spectral_729
* Hexahedron to Hexahedron_Spectral_1000
* Hexahedron to Hexahedron_Spectral_1331
* Hexahedron_64 to Hexahedron
* Hexahedron_125 to Hexahedron
* Hexahedron_216 to Hexahedron
......@@ -64,11 +72,14 @@ class XdmfUnstructuredGrid;
* 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.
* Hexahedron_Spectral_64 to Hexahedron
* Hexahedron_Spectral_125 to Hexahedron
* Hexahedron_Spectral_216 to Hexahedron
* Hexahedron_Spectral_343 to Hexahedron
* Hexahedron_Spectral_512 to Hexahedron
* Hexahedron_Spectral_729 to Hexahedron
* Hexahedron_Spectral_1000 to Hexahedron
* Hexahedron_Spectral_1331 to Hexahedron
*/
class XDMFUTILS_EXPORT XdmfTopologyConverter {
......@@ -89,7 +100,6 @@ public:
* @param gridToConvert the unstructured grid to convert to a different
* topology
* @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
* to. If no heavyDataWriter is specified, all mesh data will remain in
* memory.
......@@ -99,7 +109,6 @@ public:
shared_ptr<XdmfUnstructuredGrid>
convert(const shared_ptr<XdmfUnstructuredGrid> gridToConvert,
const shared_ptr<const XdmfTopologyType> topologyType,
unsigned int options = 0,
const shared_ptr<XdmfHeavyDataWriter> heavyDataWriter = shared_ptr<XdmfHeavyDataWriter>()) const;
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