Commit 804c9d85 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont
Browse files

full C++ examples added to documentation

parent f709ab4a
......@@ -65,8 +65,57 @@
* constructors in the XDMF API are protected, ensuring that only
* shared pointers can be created. These pointers are freed
* automatically by the shared pointer reference counting mechanism.
*
* C++ Examples:
*
* \subpage cppwrite "C++ Example of Xdmf Creation"
*
* \subpage cppread "C++ Example of Reading Xdmf"
*
* \subpage cppedit "C++ Example of Reading and Modifying Xdmf"
*
* Python Examples:
*
* \subpage pywrite "Python Example of Xdmf Creation"
*
* \subpage pyread "Python Example of Reading Xdmf"
*
* \subpage pyedit "Python Example of Reading and Modifying Xdmf"
*
*/
/*!
* \page cppwrite Example of Xdmf Creation
* \include ExampleXdmfWrite.cpp
*/
/*!
* \page cppread Example of Reading Xdmf
* \include ExampleXdmfRead.cpp
*/
/*!
* \page cppedit Example of Reading and Modifying
* \include ExampleXdmfEdit.cpp
*/
/*!
* \page pywrite Example of Xdmf Creation
* \include XdmfExampleWrite.py
*/
/*!
* \page pyread Example of Reading Xdmf
* \include XdmfExampleRead.py
*/
/*!
* \page pyedit Example of Reading and Modifying
* \include XdmfExampleEdit.py
*/
/* Keep all our Win32 Conversions here */
#ifdef _WIN32
/* Used to export/import from the dlls */
......
......@@ -54,7 +54,7 @@ public:
*
* @code {.cpp}
* shared_ptr<XdmfAttribute> exampleAttribute = XdmfAttribute::New();
* #endcode
* @endcode
*
* Python
*
......
......@@ -192,16 +192,16 @@ public:
* //(2, 4, 6)
* //(3, 5, 5)
* //(3, 6, 4)
* std::map<int, std::map<int, int> > taskIDMap = exampleMap->getMap();
* std::map<int, std::map<int, std::set<int> > > taskIDMap = exampleMap->getMap();
* //taskIDMap now contains the same tuples as exampleMap
* std::map<int, std::map<int, int> >::iterator taskWalker = taskIDMap.begin();
* std::map<int, std::map<int, std::set<int> > >::iterator taskWalker = taskIDMap.begin();
* int taskIDValue = (*taskWalker).first;
* //taskIDValue is now equal to 1, because that is the first taskID listed
* std::map<int, int> nodeIDMap = taskIDMap[1];
* std::map<int, std::set<int> > nodeIDMap = taskIDMap[1];
* //nodeIDMap now contains the following tuples because it retrieved the tuples associated with taskID 1
* //(1, 9)
* //(2, 8)
* std::map<int, int>::iterator mapWalker = nodeIDMap.begin();
* std::map<int, std::set<int> >::iterator mapWalker = nodeIDMap.begin();
* int localNodeValue = (*mapWalker).first;
* //localNodeValue is now equal to 1, because it is the first entry in the first tuple in the set
* std::set<int> remoteNodeSet = exampleMap[1];
......@@ -303,11 +303,11 @@ public:
* //(2, 4, 6)
* //(3, 5, 5)
* //(3, 6, 4)
* std::map<int, int> nodeIDMap = exampleMap->getRemoteNodeIds(1);
* std::map<int, std::set<int> > nodeIDMap = exampleMap->getRemoteNodeIds(1);
* //nodeIDMap now contains the following tuples because it retrieved the tuples associated with taskID 1
* //(1, 9)
* //(2, 8)
* std::map<int, int>::iterator mapWalker = nodeIDMap.begin();
* std::map<int, std::set<int> >::iterator mapWalker = nodeIDMap.begin();
* int localNodeValue = (*mapWalker).first;
* //localNodeValue is now equal to 1, because it is the first entry in the first tuple in the set
* std::set<int> remoteNodeSet = exampleMap[1];
......@@ -569,25 +569,36 @@ public:
*
* @code {.cpp}
* shared_ptr<XdmfMap> exampleMap = XdmfMap::New();
* //First create several std::map<int, int>
* std::map<int, int> nodeMap;
* nodeMap.insert(pair<int, int>(2,3));
* nodeMap.insert(pair<int, int>(2,6));
* nodeMap.insert(pair<int, int>(2,8));
* nodeMap.insert(pair<int, int>(3,3));
* nodeMap.insert(pair<int, int>(4,7));
* nodeMap.insert(pair<int, int>(4,9));
* std::map<int, int> nodeMap2;
* nodeMap.insert(pair<int, int>(5,3));
* nodeMap.insert(pair<int, int>(5,6));
* nodeMap.insert(pair<int, int>(5,8));
* nodeMap.insert(pair<int, int>(7,3));
* nodeMap.insert(pair<int, int>(9,7));
* nodeMap.insert(pair<int, int>(9,9));
* //Then create a std::map<int, std::map<int, int> >
* std::map<int, std::map<int, int> > taskMap;
* taskMap.insert(pair<int, std::map<int, int> >(1, nodeMap);
* taskMap.insert(pair<int, std::map<int, int> >(2, nodeMap2);
* //First create a std::map<int, std::set<int> >
* std::map<int, std::map<int, std::set<int> > > taskMap;
* std::map<int, std::set<int> > nodeMap;
* std::set<int> remoteIDset;
* remoteIDset.insert(3);
* remoteIDset.insert(6);
* remoteIDset.insert(8);
* nodeMap.insert(pair<int, std::set<int> >(2, remoteIDset));
* remoteIDset.clear();
* remoteIDset.insert(3);
* nodeMap.insert(pair<int, std::set<int> >(3, remoteIDset));
* remoteIDset.clear();
* remoteIDset.insert(7);
* remoteIDset.insert(9);
* nodeMap.insert(pair<int, std::set<int> >(4, remoteIDset));
* taskMap.insert(pair<int, std::map<int, std::set<int> > >(1, nodeMap);
* nodeMap.clear();
* remoteIDset.clear();
* remoteIDset.insert(3);
* remoteIDset.insert(6);
* remoteIDset.insert(8);
* nodeMap.insert(pair<int, std::set<int> >(5, remoteIDset));
* remoteIDset.clear();
* remoteIDset.insert(3);
* nodeMap.insert(pair<int, std::set<int> >(7, remoteIDset));
* remoteIDset.clear();
* remoteIDset.insert(7);
* remoteIDset.insert(9);
* nodeMap.insert(pair<int, std::set<int> >(9, remoteIDset));
* taskMap.insert(pair<int, std::map<int, std::set<int> > >(2, nodeMap);
* //then the result is set to the XdmfMap
* exampleMap->setMap(taskMap);
* //This fills the XdmfMap with the following tuples
......
......@@ -127,14 +127,14 @@ public:
*
* C++
*
* @code {.cpp}
* @code{.cpp}
* //Assuming that exampleArray is a shared pointer to an XdmfArray object
* exampleArray->clear();
* @endcode
*
* Python
*
* @code {.py}
* @code{.py}
* '''
* Assuming that exampleArray is a shared pointer to an XdmfArray object
* '''
......
......@@ -201,7 +201,7 @@ public:
* '''
* "Your New Key" is now the key for infoExample
* '''
* @endocode
* @endcode
*
* @param key a string containing the key to set.
*/
......
......@@ -47,19 +47,19 @@ public: \
Example of use:
C++
@code {.cpp}
unsigned int getIndex = 0;
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
shared_ptr<XdmfInformation> exampleChild = exampleItem->getInformation(getIndex);
unsigned int getIndex = 0;<br>
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
shared_ptr<XdmfInformation> exampleChild = exampleItem->getInformation(getIndex);<br>
@endcode
Python
@code {.py}
getIndex = 0;
'''
Assume that exampleItem is a shared pointer to the ParentClass object
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
'''
exampleChild = exampleItem.getInformation(getIndex)
getIndex = 0;<br>
'''<br>
Assume that exampleItem is a shared pointer to the ParentClass object<br>
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
'''<br>
exampleChild = exampleItem.getInformation(getIndex)<br>
@endcode
@param index of the ChildClass to retrieve.
@return requested ChildClass. If no ChildClass##s exist at the index,
......@@ -72,10 +72,10 @@ public: \
Example of use:
C++
@code {.cpp}
unsigned int getIndex = 0;
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
shared_ptr<const XdmfInformation> exampleChild = exampleItem->getInfomation(getIndex);
unsigned int getIndex = 0;<br>
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
shared_ptr<const XdmfInformation> exampleChild = exampleItem->getInfomation(getIndex);<br>
@endcode
Python: does not support a constant version of this function
@param index of the ChildClass to retrieve.
......@@ -89,19 +89,19 @@ public: \
Example of use:
C++
@code {.cpp}
std::string findingInfo = "Find this";
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
shared_ptr<XdmfInformation> exampleChild = exampleItem->getInformation(findingInfo);
std::string findingInfo = "Find this";<br>
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
shared_ptr<XdmfInformation> exampleChild = exampleItem->getInformation(findingInfo);<br>
@endcode
Python
@code {.py}
findingInfo = "Find this"
'''
Assume that exampleItem is a shared pointer to the ParentClass object
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
'''
exampleChild = exampleItem.getInformation(findingInfo)
findingInfo = "Find this"<br>
'''<br>
Assume that exampleItem is a shared pointer to the ParentClass object<br>
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
'''<br>
exampleChild = exampleItem.getInformation(findingInfo)<br>
@endcode
@param SearchName of the ChildClass to retrieve.
@return requested ChildClass. If no ChildClass##s are found with the
......@@ -114,10 +114,10 @@ public: \
Example of use:
C++
@code {.cpp}
std::string findingInfo = "Find this";
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
shared_ptr<const XdmfInfomation> exampleChild = exampleItem->getInformation(findingInfo);
std::string findingInfo = "Find this";<br>
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
shared_ptr<const XdmfInfomation> exampleChild = exampleItem->getInformation(findingInfo);<br>
@endcode
Python: does not support a constant version of this function
@param SearchName of the ChildClass to retrieve.
......@@ -131,17 +131,17 @@ public: \
Example of use:
C++
@code {.cpp}
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
unsigned int exampleSize = exampleItem->getNumberInformations();
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
unsigned int exampleSize = exampleItem->getNumberInformations();<br>
@endcode
Python
@code {.py}
'''
Assume that exampleItem is a shared pointer to the ParentClass object
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
'''
exampleSize = exampleItem.getNumberInformations()
'''<br>
Assume that exampleItem is a shared pointer to the ParentClass object<br>
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
'''<br>
exampleSize = exampleItem.getNumberInformations()<br>
@endcode
@return number of ChildClass##s attached to this item.
*/ \
......@@ -151,17 +151,17 @@ public: \
Example of use:
C++
@code {.cpp}
//Assume that exampleChild is a shared pointer to a Child object
//Assume that exampleItem is a shared pointer to a Parent object
exampleItem->insert(exampleChild);
//Assume that exampleChild is a shared pointer to a Child object<br>
//Assume that exampleItem is a shared pointer to a Parent object<br>
exampleItem->insert(exampleChild);<br>
@endcode
Python
@code {.py}
'''
Assume that exampleChild is a shared pointer to a Child object
Assume that exampleItem is a shared pointer to a Parent object
'''
exampleItem.insert(exampleChild)
'''<br>
Assume that exampleChild is a shared pointer to a Child object<br>
Assume that exampleItem is a shared pointer to a Parent object<br>
'''<br>
exampleItem.insert(exampleChild)<br>
@endcode
@param ChildName to attach to this item.
*/ \
......@@ -172,19 +172,19 @@ public: \
Example of use:
C++
@code {.cpp}
//Assume that exampleItem is a shared pointer to the ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
unsigned int removeIndex = 0;
exampleItem->removeInformation(removeIndex);
//Assume that exampleItem is a shared pointer to the ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
unsigned int removeIndex = 0;<br>
exampleItem->removeInformation(removeIndex);<br>
@endcode
Python
@code {.py}
'''
Assume that exampleItem is a shared pointer to the ParentClass object
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
'''
removeIndex = 0
exampleItem.removeInformation(removeIndex)
'''<br>
Assume that exampleItem is a shared pointer to the ParentClass object<br>
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
'''<br>
removeIndex = 0<br>
exampleItem.removeInformation(removeIndex)<br>
@endcode
@param index of the ChildClass to remove.
*/ \
......@@ -195,19 +195,19 @@ public: \
Example of use:
C++
@code {.cpp}
//Assume that exampleItem is a shared pointer to an ParentClass object
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
unsigned int removeInfo = "Remove this";
exampleItem->removeInformation(removeInfo);
//Assume that exampleItem is a shared pointer to an ParentClass object<br>
//Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
unsigned int removeInfo = "Remove this";<br>
exampleItem->removeInformation(removeInfo);<br>
@endcode
Python
@code {.py}
'''
Assume that exampleItem is a shared pointer to an ParentClass object
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class
'''
removeInfo = "Remove this"
exampleItem.removeInformation(removeInfo)
'''<br>
Assume that exampleItem is a shared pointer to an ParentClass object<br>
Using an XdmfInformation as an example because all XdmfItems have XdmfInformation as a child class<br>
'''<br>
removeInfo = "Remove this"<br>
exampleItem.removeInformation(removeInfo)<br>
@endcode
@param SearchName of the ChildClass to remove.
*/ \
......
......@@ -43,6 +43,9 @@ class XdmfHeavyDataWriter;
* written to disk. Heavy data is written to a heavy data format using
* an XdmfHeavyDataWriter and light data is written to XML.
*
* An infinite loop is possible if an XdmfItem somehow ends up as its own child,
* either directly or by way of another Xdmf Item.
*
* By default, the XdmfWriter writes all heavy data to a single heavy
* data file specified by the XdmfHeavyDataWriter. If a dataset is
* encountered that resides in a different heavy data file on disk,
......
......@@ -638,7 +638,7 @@ EXAMPLE_PATTERNS =
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
......
#include "XdmfAttribute.hpp"
#include "XdmfAttributeType.hpp"
#include "XdmfAttributeCenter.hpp"
int main(int, char **)
{
shared_ptr<XdmfAttribute> exampleAttribute = XdmfAttribute::New();
exampleAttribute->setCenter(XdmfAttributeCenter::Node());
std::string newName = "New Name";
exampleAttribute->setName(newName);
exampleAttribute->setType(XdmfAttributeType::Node());
shared_ptr<const XdmfAttributeCenter> exampleCenter = exampleAttribute->getCenter();
std::string exampleName = exampleAttribute->getName();
shared_ptr<const XdmfAttributeType> exampleType = exampleAttribute->getType();
return 0;
}
This diff is collapsed.
This diff is collapsed.
#include "XdmfDomain.hpp"
#include "XdmfSystemUtils.hpp"
#include "XdmfWriter.hpp"
#include "XdmfHDF5Writer.hpp"
#include "XdmfInformation.hpp"
#include "XdmfAttribute.hpp"
#include "XdmfUnstructuredGrid.hpp"
#include "XdmfCurvilinearGrid.hpp"
#include "XdmfRectilinearGrid.hpp"
#include "XdmfRegularGrid.hpp"
#include "XdmfMap.hpp"
#include "XdmfGridCollection.hpp"
#include "XdmfGridCollectionType.hpp"
#include "XdmfAttributeType.hpp"
#include "XdmfAttributeCenter.hpp"
#include "XdmfSet.hpp"
#include "XdmfArray.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfTopology.hpp"
#include "XdmfTestDataGenerator.hpp"
int main(int, char **)
{
shared_ptr<XdmfDomain> primaryDomain = XdmfDomain::New();
shared_ptr<XdmfInformation> domaininfo = XdmfInformation::New("Domain", "This is the primary data structure in Xdmf");
shared_ptr<XdmfInformation> domaininfoinfo = XdmfInformation::New("Information", "Information can have information");
domaininfo->insert(domaininfoinfo);
primaryDomain->insert(domaininfo);
shared_ptr<XdmfGridCollection> gridHolder = XdmfGridCollection::New();
gridHolder->setType(XdmfGridCollectionType::Spatial());
shared_ptr<XdmfInformation> holderInfo = XdmfInformation::New("Grid Collection 1", "This is the main grid collection");
gridHolder->insert(holderInfo);
gridHolder->setName("GridCollection Example");
shared_ptr<XdmfUnstructuredGrid> ungrid = XdmfUnstructuredGrid::New();
ungrid->setName("Unstructured Grid Example");
shared_ptr<XdmfTime> untime = XdmfTime::New(5.0);
shared_ptr<XdmfInformation> untimeinfo = XdmfInformation::New("Time", "This is the time for the Unstructured Grid");
untime->insert(untimeinfo);
ungrid->setTime(untime);
shared_ptr<XdmfAttribute> unglobalID = XdmfAttribute::New();
unglobalID->setType(XdmfAttributeType::GlobalId());
unglobalID->setCenter(XdmfAttributeCenter::Node());
unglobalID->setName("Global Node Equivalencies");
int task1globalnodes [] = {1, 4, 5, 7, 3, 6};
unglobalID->insert(0, task1globalnodes, 6, 1, 1 );
shared_ptr<XdmfInformation> unglobalIDinfo = XdmfInformation::New("Global Nodes", "This is the global nodes that accociate with the local nodes");
ungrid->insert(unglobalID);
shared_ptr<XdmfSet> unset = XdmfSet::New();
shared_ptr<XdmfInformation> unsetinfo = XdmfInformation::New("Data Set", "This is a set of arbitrary data");
unset->insert(unsetinfo);
unset->setName("Unstructured Grid's Set");
unset->setType(XdmfSetType::Node());
shared_ptr<XdmfAttribute> unsetattribute = XdmfAttribute::New();
unsetattribute->setType(XdmfAttributeType::Scalar());
unsetattribute->setCenter(XdmfAttributeCenter::Node());
unsetattribute->setName("The Set's attribute");
double unsetattribdata [] = {1.9, 2.8, 3.7, 4.6, 5.5, 6.4, 7.3, 8.2, 9.1};
unsetattribute->insert(0, unsetattribdata, 9, 1, 1);
unset->insert(unsetattribute);
double unsetdata [] = {5.1, 4.2, 3.3, 2.4, 1.5};
unset->insert(0, unsetdata, 5, 1, 1);
ungrid->insert(unset);
shared_ptr<XdmfGeometry> ungeometry = XdmfGeometry::New();
ungeometry->setType(XdmfGeometryType::XYZ());
ungeometry->setName("Unstructured Geometry");
double ungeopoints [] = {0.1, 0.1, 1.1, 1.1, 0.1, 1.1, 3.1, 0.1, 2.1, 0.1, 1.1, 1.1, 1.1,
1.1, 1.1, 3.1, 2.1, 2.1, 0.1, 0.1, -1.1, 1.1, 0.1, -1.1, 3.1,
0.1, -2.1, 0.1, 1.1, -1.1, 1.1, 1.1, -1.1, 3.1, 2.1, -2.1};
ungeometry->insert(0, ungeopoints, 36, 1, 1);
shared_ptr<XdmfInformation> ungeometryinfo = XdmfInformation::New("Geometry", "This is the geometry associated with the unstructured grid");
ungeometry->insert(ungeometryinfo);
ungrid->setGeometry(ungeometry);
shared_ptr<XdmfTopology> untopology = XdmfTopology::New();
untopology->setType(XdmfTopologyType::Hexahedron());
untopology->setName("Unstructured Topology");
int untopovalues [] = {0, 1, 7, 6, 3, 4, 10, 9, 1, 2, 8, 7, 4, 5, 11, 10};
untopology->insert(0, untopovalues, 16, 1, 1);
shared_ptr<XdmfInformation> untopologyinfo = XdmfInformation::New("Topology", "This is the topology associated with the unstructured grid");
ungrid->setTopology(untopology);
shared_ptr<XdmfArray> curvdimensions = XdmfArray::New();
curvdimensions->pushBack(12);
curvdimensions->pushBack(12);
curvdimensions->pushBack(12);
shared_ptr<XdmfCurvilinearGrid> curvgrid = XdmfCurvilinearGrid::New(curvdimensions);
curvgrid->setName("Curvilinear Grid Example");
shared_ptr<XdmfInformation> curvgridinfo = XdmfInformation::New("Curvilinear Grid", "This is an example curvilinear grid");
curvgrid->insert(curvgridinfo);
shared_ptr<XdmfTime>curvtime = XdmfTime::New(5.0);
shared_ptr<XdmfInformation> curvtimeinfo = XdmfInformation::New("Time", "The Time of the Curvilinear Grid");
curvtime->insert(curvtimeinfo);
curvgrid->setTime(curvtime);
shared_ptr<XdmfAttribute> curvglobalID = XdmfAttribute::New();
curvglobalID->setType(XdmfAttributeType::GlobalId());
curvglobalID->setCenter(XdmfAttributeCenter::Node());
curvglobalID->setName("Global Node Equivalencies");
int task2globalnodes [] = {7, 3, 8, 2, 5, 1};
curvglobalID->insert(0, task1globalnodes, 6, 1, 1);
shared_ptr<XdmfInformation> curvglobalIDinfo = XdmfInformation::New("Global Node Equivalencies", "These are the global nodes that accociate with the local nodes");
curvglobalID->insert(curvglobalIDinfo);
curvgrid->insert(curvglobalID);
shared_ptr<XdmfGeometry> curvgeometry = XdmfGeometry::New();
curvgeometry->setType(XdmfGeometryType::XYZ());
curvgeometry->setName("Curvilinear Geometry");
double curvgeopoints [] = {1.1, 1.1, 2.1, 2.1, 1.1, 2.1, 4.1, 1.1, 3.1, 1.1, 2.1, 2.1, 2.1,
2.1, 2.1, 4.1, 3.1, 3.1, 1.1, 1.1, 0.1, 2.1, 1.1, 0.1, 4.1,
1.1, -1.1, 1.1, 2.1, 0.1, 1.1, 2.1, -0.1, 4.1, 3.1, -1.1};
curvgeometry->insert(0, curvgeopoints, 36, 1, 1);
shared_ptr<XdmfInformation> curvgeometryinfo = XdmfInformation::New("Geometry", "The geometry of the curvilinear grid");
curvgeometry->insert(curvgeometryinfo);
curvgrid->setGeometry(curvgeometry);
double rectXcoordinates [] = {1.1, 1.1, 2.1, 2.1, 1.1, 2.1, 4.1, 1.1, 3.1, 1.1, 2.1, 2.1};
double rectYcoordinates [] = {2.1, 2.1, 2.1, 4.1, 3.1, 3.1, 1.1, 1.1, 0.1, 2.1, 1.1, 0.1};
double rectZcoordinates [] = {4.1, 1.1, -1.1, 1.1, 2.1, 0.1, 1.1, 2.1, -0.1, 4.1, 3.1, -1.1};
shared_ptr<XdmfArray> rectXarray = XdmfArray::New();
rectXarray->insert(0, rectXcoordinates, 12, 1, 1);
shared_ptr<XdmfArray> rectYarray = XdmfArray::New();
rectYarray->insert(0, rectYcoordinates, 12, 1, 1);
shared_ptr<XdmfArray> rectZarray = XdmfArray::New();
rectZarray->insert(0, rectZcoordinates, 12, 1, 1);
std::vector<shared_ptr<XdmfArray> > coordinatecontainer;
coordinatecontainer.push_back(rectXarray);
coordinatecontainer.push_back(rectYarray);
coordinatecontainer.push_back(rectZarray);
shared_ptr<XdmfRectilinearGrid> rectgrid = XdmfRectilinearGrid::New(coordinatecontainer);
rectgrid->setName("Rectilinear Grid Example");
shared_ptr<XdmfInformation> rectgridinfo = XdmfInformation::New("Rectilinear Grid", "This is an example of a rectilinear grid");
shared_ptr<XdmfAttribute> rectglobalID = XdmfAttribute::New();
rectglobalID->setType(XdmfAttributeType::GlobalId());
rectglobalID->setCenter(XdmfAttributeCenter::Node());
rectglobalID->setName("Global Node Equivalencies");
int task3globalnodes [] = {2, 7, 9, 0, 8, 6};
rectglobalID->insert(0, task3globalnodes, 6, 1, 1);
shared_ptr<XdmfInformation> rectglobalIDinfo = XdmfInformation::New("Global Node Equivalencies", "These are the global nodes that associate with the local nodes");
rectglobalID->insert(rectglobalIDinfo);
shared_ptr<XdmfTime> recttime = XdmfTime::New(5.0);
shared_ptr<XdmfInformation> recttimeinfo = XdmfInformation::New("Time", "The time of the rectiliniear grid");
recttime->insert(recttimeinfo);
rectgrid->setTime(recttime);
rectgrid->insert(rectglobalID);
shared_ptr<XdmfArray> regbrick = XdmfArray::New();
double regbrickvals [] = {10, 10, 10};
regbrick->insert(0, regbrickvals, 3, 1, 1);
shared_ptr<XdmfArray> regdimensions = XdmfArray::New();
int regdimensionvals [] = {5, 5, 5};
regdimensions->insert(0, regdimensionvals, 3, 1, 1);
shared_ptr<XdmfArray> regorigin = XdmfArray::New();
double regoriginvals [] = {0, 0, 0};
regorigin->insert(0, regoriginvals, 3, 1, 1);
shared_ptr<XdmfRegularGrid> reggrid = XdmfRegularGrid::New(regbrick, regdimensions, regorigin);
reggrid->setName("Regular Grid Example");
shared_ptr<XdmfInformation> reggridinfo = XdmfInformation::New("Regular Grid", "This is an example of a regular grid");
shared_ptr<XdmfTime> regtime = XdmfTime::New(5.0);
shared_ptr<XdmfInformation> regtimeinfo = XdmfInformation::New("Time", "This is the time for the regular grid");
regtime->insert(regtimeinfo);
reggrid->setTime(regtime);
shared_ptr<XdmfAttribute> regglobalID = XdmfAttribute::New();
regglobalID->setType(XdmfAttributeType::GlobalId());
regglobalID->setCenter(XdmfAttributeCenter::Node());
regglobalID->setName("Global Node Equivalencies");
int task4globalnodes [] = {3, 6, 1, 4, 2, 5, 9};
regglobalID->insert(0, task4globalnodes, 7, 1, 1);
shared_ptr<XdmfInformation> regglobalIDinfo = XdmfInformation::New("Global Node Equivalencies", "These are the global nodes that associate with the local nodes");
regglobalID->insert(regglobalIDinfo);
reggrid->insert(regglobalID);
std::vector<shared_ptr<XdmfAttribute> > nodeholder;
nodeholder.push_back(unglobalID);
nodeholder.push_back(curvglobalID);
nodeholder.push_back(rectglobalID);
nodeholder.push_back(regglobalID);
std::vector<shared_ptr<XdmfMap> > mapcollection = XdmfMap::New(nodeholder);
<