XdmfDomain.hpp 41.5 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfDomain.hpp                                                      */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

Kenneth Leiter's avatar
Kenneth Leiter committed
24 25 26
#ifndef XDMFDOMAIN_HPP_
#define XDMFDOMAIN_HPP_

27
// C Compatible Includes
28
#include "Xdmf.hpp"
29
#include "XdmfItem.hpp"
30 31 32 33 34 35 36 37 38 39
#include "XdmfCurvilinearGrid.hpp"
#include "XdmfGraph.hpp"
#include "XdmfRectilinearGrid.hpp"
#include "XdmfRegularGrid.hpp"
#include "XdmfUnstructuredGrid.hpp"

#ifdef __cplusplus

// Forward Declarations
class XdmfGridCollection;
Kenneth Leiter's avatar
Kenneth Leiter committed
40

41
/**
42
 * @brief The root XdmfItem that holds XdmfGrids.
43
 *
44 45 46
 * XdmfDomain is the top XdmfItem in an Xdmf structure.  It can store
 * a number of grids and provides methods to insert, retrieve, and
 * remove these grids.
47
 */
48
class XDMF_EXPORT XdmfDomain : public virtual XdmfItem {
Kenneth Leiter's avatar
Kenneth Leiter committed
49

50
public:
Kenneth Leiter's avatar
Kenneth Leiter committed
51

52 53 54
  /**
   * Create a new XdmfDomain.
   *
55 56 57 58
   * Example of use:
   *
   * C++
   *
59
   * @dontinclude ExampleXdmfDomain.cpp
60 61
   * @skipline //#initialization
   * @until //#initialization
62 63 64
   *
   * Python
   *
65
   * @dontinclude XdmfExampleDomain.py
66 67
   * @skipline #//initialization
   * @until #//initialization
68
   *
69
   * @return    Constructed XdmfDomain.
70
   */
71
  static shared_ptr<XdmfDomain> New();
72

73
  virtual ~XdmfDomain();
74

75 76 77 78 79 80 81
  LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
  XDMF_CHILDREN(XdmfDomain, XdmfGridCollection, GridCollection, Name)
  XDMF_CHILDREN(XdmfDomain, XdmfGraph, Graph, Name)
  XDMF_CHILDREN(XdmfDomain, XdmfCurvilinearGrid, CurvilinearGrid, Name)
  XDMF_CHILDREN(XdmfDomain, XdmfRectilinearGrid, RectilinearGrid, Name)
  XDMF_CHILDREN(XdmfDomain, XdmfRegularGrid, RegularGrid, Name)
  XDMF_CHILDREN(XdmfDomain, XdmfUnstructuredGrid, UnstructuredGrid, Name)
82
  static const std::string ItemTag;
Kenneth Leiter's avatar
Kenneth Leiter committed
83

84
  std::map<std::string, std::string> getItemProperties() const;
85

86
  virtual std::string getItemTag() const;
87

88
  using XdmfItem::insert;
Kenneth Leiter's avatar
Kenneth Leiter committed
89

90
  virtual void traverse(const shared_ptr<XdmfBaseVisitor> visitor);
Kenneth Leiter's avatar
Kenneth Leiter committed
91

92
protected:
Kenneth Leiter's avatar
Kenneth Leiter committed
93

94 95 96
  XdmfDomain();
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
97
               const std::vector<shared_ptr<XdmfItem> > & childItems,
98
               const XdmfCoreReader * const reader);
Kenneth Leiter's avatar
Kenneth Leiter committed
99

100
private:
101 102 103

  XdmfDomain(const XdmfDomain &);  // Not implemented.
  void operator=(const XdmfDomain &);  // Not implemented.
Kenneth Leiter's avatar
Kenneth Leiter committed
104 105 106

};

107 108 109 110 111 112 113 114 115 116 117 118 119
#endif

#ifdef __cplusplus
extern "C" {
#endif

// C wrappers go here

struct XDMFDOMAIN; // Simply as a typedef to ensure correct typing
typedef struct XDMFDOMAIN XDMFDOMAIN;

#ifndef XDMFGRIDCOLLECTIONCDEFINE
#define XDMFGRIDCOLLECTIONCDEFINE
120

121
struct XDMFGRIDCOLLECTION; // Simply as a typedef to ensure correct typing
122

123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
typedef struct XDMFGRIDCOLLECTION XDMFGRIDCOLLECTION;
#endif

XDMF_EXPORT XDMFDOMAIN * XdmfDomainNew();

XDMF_EXPORT XDMFGRIDCOLLECTION * XdmfDomainGetGridCollection(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFGRIDCOLLECTION * XdmfDomainGetGridCollectionByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberGridCollections(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertGridCollection(XDMFDOMAIN * domain, XDMFGRIDCOLLECTION * GridCollection, int passControl);

XDMF_EXPORT void XdmfDomainRemoveGridCollection(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveGridCollectionByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT XDMFGRAPH * XdmfDomainGetGraph(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFGRAPH * XdmfDomainGetGraphByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberGraphs(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertGraph(XDMFDOMAIN * domain, XDMFGRAPH * graph, int passControl);

XDMF_EXPORT void XdmfDomainRemoveGraph(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveGraphByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT XDMFCURVILINEARGRID * XdmfDomainGetCurvilinearGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFCURVILINEARGRID * XdmfDomainGetCurvilinearGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberCurvilinearGrids(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertCurvilinearGrid(XDMFDOMAIN * domain, XDMFCURVILINEARGRID * CurvilinearGrid, int passControl);

XDMF_EXPORT void XdmfDomainRemoveCurvilinearGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveCurvilinearGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT XDMFRECTILINEARGRID * XdmfDomainGetRectilinearGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFRECTILINEARGRID * XdmfDomainGetRectilinearGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberRectilinearGrids(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertRectilinearGrid(XDMFDOMAIN * domain, XDMFRECTILINEARGRID * RectilinearGrid, int passControl);

XDMF_EXPORT void XdmfDomainRemoveRectilinearGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveRectilinearGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT XDMFREGULARGRID * XdmfDomainGetRegularGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFREGULARGRID * XdmfDomainGetRegularGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberRegularGrids(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertRegularGrid(XDMFDOMAIN * domain, XDMFREGULARGRID * RegularGrid, int passControl);

XDMF_EXPORT void XdmfDomainRemoveRegularGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveRegularGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT XDMFUNSTRUCTUREDGRID * XdmfDomainGetUnstructuredGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT XDMFUNSTRUCTUREDGRID * XdmfDomainGetUnstructuredGridByName(XDMFDOMAIN * domain, char * Name);

XDMF_EXPORT unsigned int XdmfDomainGetNumberUnstructuredGrids(XDMFDOMAIN * domain);

XDMF_EXPORT void XdmfDomainInsertUnstructuredGrid(XDMFDOMAIN * domain, XDMFUNSTRUCTUREDGRID * UnstructuredGrid, int passControl);

XDMF_EXPORT void XdmfDomainRemoveUnstructuredGrid(XDMFDOMAIN * domain, unsigned int index);

XDMF_EXPORT void XdmfDomainRemoveUnstructuredGridByName(XDMFDOMAIN * domain, char * Name);

200

201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
XDMF_ITEM_C_CHILD_DECLARE(XdmfDomain, XDMFDOMAIN, XDMF)

#define XDMF_DOMAIN_C_CHILD_DECLARE(ClassName, CClassName, Level)                                                                     \
                                                                                                                                      \
Level##_EXPORT XDMFGRIDCOLLECTION * ClassName##GetGridCollection(CClassName * domain, unsigned int index);                            \
Level##_EXPORT XDMFGRIDCOLLECTION * ClassName##GetGridCollectionByName(CClassName * domain, char * Name);                             \
Level##_EXPORT unsigned int ClassName##GetNumberGridCollections(CClassName * domain);                                                 \
Level##_EXPORT void ClassName##InsertGridCollection(CClassName * domain, XDMFGRIDCOLLECTION * GridCollection, int passControl);       \
Level##_EXPORT void ClassName##RemoveGridCollection(CClassName * domain, unsigned int index);                                         \
Level##_EXPORT void ClassName##RemoveGridCollectionByName(CClassName * domain, char * Name);                                          \
Level##_EXPORT XDMFGRAPH * ClassName##GetGraph(CClassName * domain, unsigned int index);                                              \
Level##_EXPORT XDMFGRAPH * ClassName##GetGraphByName(CClassName * domain, char * Name);                                               \
Level##_EXPORT unsigned int ClassName##GetNumberGraphs(CClassName * domain);                                                          \
Level##_EXPORT void ClassName##InsertGraph(CClassName * domain, XDMFGRAPH * Graph, int passControl);                                  \
Level##_EXPORT void ClassName##RemoveGraph(CClassName * domain, unsigned int index);                                                  \
Level##_EXPORT void ClassName##RemoveGraphByName(CClassName * domain, char * Name);                                                   \
Level##_EXPORT XDMFCURVILINEARGRID * ClassName##GetCurvilinearGrid(CClassName * domain, unsigned int index);                          \
Level##_EXPORT XDMFCURVILINEARGRID * ClassName##GetCurvilinearGridByName(CClassName * domain, char * Name);                           \
Level##_EXPORT unsigned int ClassName##GetNumberCurvilinearGrids(CClassName * domain);                                                \
Level##_EXPORT void ClassName##InsertCurvilinearGrid(CClassName * domain, XDMFCURVILINEARGRID * CurvilinearGrid, int passControl);    \
Level##_EXPORT void ClassName##RemoveCurvilinearGrid(CClassName * domain, unsigned int index);                                        \
Level##_EXPORT void ClassName##RemoveCurvilinearGridByName(CClassName * domain, char * Name);                                         \
Level##_EXPORT XDMFRECTILINEARGRID * ClassName##GetRectilinearGrid(CClassName * domain, unsigned int index);                          \
Level##_EXPORT XDMFRECTILINEARGRID * ClassName##GetRectilinearGridByName(CClassName * domain, char * Name);                           \
Level##_EXPORT unsigned int ClassName##GetNumberRectilinearGrids(CClassName * domain);                                                \
Level##_EXPORT void ClassName##InsertRectilinearGrid(CClassName * domain, XDMFRECTILINEARGRID * RectilinearGrid, int passControl);    \
Level##_EXPORT void ClassName##RemoveRectilinearGrid(CClassName * domain, unsigned int index);                                        \
Level##_EXPORT void ClassName##RemoveRectilinearGridByName(CClassName * domain, char * Name);                                         \
Level##_EXPORT XDMFREGULARGRID * ClassName##GetRegularGrid(CClassName * domain, unsigned int index);                                  \
Level##_EXPORT XDMFREGULARGRID * ClassName##GetRegularGridByName(CClassName * domain, char * Name);                                   \
Level##_EXPORT unsigned int ClassName##GetNumberRegularGrids(CClassName * domain);                                                    \
Level##_EXPORT void ClassName##InsertRegularGrid(CClassName * domain, XDMFREGULARGRID * RegularGrid, int passControl);                \
Level##_EXPORT void ClassName##RemoveRegularGrid(CClassName * domain, unsigned int index);                                            \
Level##_EXPORT void ClassName##RemoveRegularGridByName(CClassName * domain, char * Name);                                             \
Level##_EXPORT XDMFUNSTRUCTUREDGRID * ClassName##GetUnstructuredGrid(CClassName * domain, unsigned int index);                        \
Level##_EXPORT XDMFUNSTRUCTUREDGRID * ClassName##GetUnstructuredGridByName(CClassName * domain, char * Name);                         \
Level##_EXPORT unsigned int ClassName##GetNumberUnstructuredGrids(CClassName * domain);                                               \
Level##_EXPORT void ClassName##InsertUnstructuredGrid(CClassName * domain, XDMFUNSTRUCTUREDGRID * UnstructuredGrid, int passControl); \
Level##_EXPORT void ClassName##RemoveUnstructuredGrid(CClassName * domain, unsigned int index);                                       \
Level##_EXPORT void ClassName##RemoveUnstructuredGridByName(CClassName * domain, char * Name);


#define XDMF_DOMAIN_C_CHILD_WRAPPER(ClassName, CClassName)                                                                            \
                                                                                                                                      \
XDMFGRIDCOLLECTION * ClassName##GetGridCollection(CClassName * domain, unsigned int index)                                            \
{                                                                                                                                     \
247 248
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetGridCollection((XDMFDOMAIN *)((void *)&baseDomain), index);                                                     \
249 250 251 252
}                                                                                                                                     \
                                                                                                                                      \
XDMFGRIDCOLLECTION * ClassName##GetGridCollectionByName(CClassName * domain, char * Name)                                             \
{                                                                                                                                     \
253 254
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetGridCollectionByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                \
255 256 257 258
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberGridCollections(CClassName * domain)                                                                 \
{                                                                                                                                     \
259 260
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberGridCollections((XDMFDOMAIN *)((void *)&baseDomain));                                                      \
261 262 263 264
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertGridCollection(CClassName * domain, XDMFGRIDCOLLECTION * GridCollection, int passControl)                       \
{                                                                                                                                     \
265 266
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertGridCollection((XDMFDOMAIN *)((void *)&baseDomain), GridCollection, passControl);                                        \
267 268 269 270
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveGridCollection(CClassName * domain, unsigned int index)                                                         \
{                                                                                                                                     \
271 272
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveGridCollection((XDMFDOMAIN *)((void *)&baseDomain), index);                                                              \
273 274 275 276
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveGridCollectionByName(CClassName * domain, char * Name)                                                          \
{                                                                                                                                     \
277 278
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveGridCollectionByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                         \
279 280 281 282
}                                                                                                                                     \
                                                                                                                                      \
XDMFGRAPH * ClassName##GetGraph(CClassName * domain, unsigned int index)                                                              \
{                                                                                                                                     \
283 284
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetGraph((XDMFDOMAIN *)((void *)&baseDomain), index);                                                                   \
285 286 287 288
}                                                                                                                                     \
                                                                                                                                      \
XDMFGRAPH * ClassName##GetGraphByName(CClassName * domain, char * Name)                                                               \
{                                                                                                                                     \
289 290
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetGraphByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                              \
291 292 293 294
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberGraphs(CClassName * domain)                                                                          \
{                                                                                                                                     \
295 296
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberGraphs((XDMFDOMAIN *)((void *)&baseDomain));                                                                   \
297 298 299 300
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertGraph(CClassName * domain, XDMFGRAPH * Graph, int passControl)                                                  \
{                                                                                                                                     \
301 302
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertGraph((XDMFDOMAIN *)((void *)&baseDomain), Graph, passControl);                                                          \
303 304 305 306
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveGraph(CClassName * domain, unsigned int index)                                                                  \
{                                                                                                                                     \
307 308
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveGraph((XDMFDOMAIN *)((void *)&baseDomain), index);                                                                       \
309 310 311 312
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveGraphByName(CClassName * domain, char * Name)                                                                   \
{                                                                                                                                     \
313 314
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveGraphByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                                  \
315 316 317 318
}                                                                                                                                     \
                                                                                                                                      \
XDMFCURVILINEARGRID * ClassName##GetCurvilinearGrid(CClassName * domain, unsigned int index)                                          \
{                                                                                                                                     \
319 320
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetCurvilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                         \
321 322 323 324
}                                                                                                                                     \
                                                                                                                                      \
XDMFCURVILINEARGRID * ClassName##GetCurvilinearGridByName(CClassName * domain, char * Name)                                           \
{                                                                                                                                     \
325 326
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetCurvilinearGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                    \
327 328 329 330
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberCurvilinearGrids(CClassName * domain)                                                                \
{                                                                                                                                     \
331 332
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberCurvilinearGrids((XDMFDOMAIN *)((void *)&baseDomain));                                                         \
333 334 335 336
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertCurvilinearGrid(CClassName * domain, XDMFCURVILINEARGRID * CurvilinearGrid, int passControl)                    \
{                                                                                                                                     \
337 338
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertCurvilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), CurvilinearGrid, passControl);                                      \
339 340 341 342
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveCurvilinearGrid(CClassName * domain, unsigned int index)                                                        \
{                                                                                                                                     \
343 344
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveCurvilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                             \
345 346 347 348
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveCurvilinearGridByName(CClassName * domain, char * Name)                                                         \
{                                                                                                                                     \
349 350
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveCurvilinearGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                        \
351 352 353 354
}                                                                                                                                     \
                                                                                                                                      \
XDMFRECTILINEARGRID * ClassName##GetRectilinearGrid(CClassName * domain, unsigned int index)                                          \
{                                                                                                                                     \
355 356
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetRectilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                         \
357 358 359 360
}                                                                                                                                     \
                                                                                                                                      \
XDMFRECTILINEARGRID * ClassName##GetRectilinearGridByName(CClassName * domain, char * Name)                                           \
{                                                                                                                                     \
361 362
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetRectilinearGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                    \
363 364 365 366
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberRectilinearGrids(CClassName * domain)                                                                \
{                                                                                                                                     \
367 368
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberRectilinearGrids((XDMFDOMAIN *)((void *)&baseDomain));                                                         \
369 370 371 372
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertRectilinearGrid(CClassName * domain, XDMFRECTILINEARGRID * RectilinearGrid, int passControl)                    \
{                                                                                                                                     \
373 374
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertRectilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), RectilinearGrid, passControl); \
375 376 377 378
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveRectilinearGrid(CClassName * domain, unsigned int index)                                                        \
{                                                                                                                                     \
379 380
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveRectilinearGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                             \
381 382 383 384
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveRectilinearGridByName(CClassName * domain, char * Name)                                                         \
{                                                                                                                                     \
385 386
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveRectilinearGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                        \
387 388 389 390
}                                                                                                                                     \
                                                                                                                                      \
XDMFREGULARGRID * ClassName##GetRegularGrid(CClassName * domain, unsigned int index)                                                  \
{                                                                                                                                     \
391 392
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetRegularGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                             \
393 394 395 396
}                                                                                                                                     \
                                                                                                                                      \
XDMFREGULARGRID * ClassName##GetRegularGridByName(CClassName * domain, char * Name)                                                   \
{                                                                                                                                     \
397 398
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetRegularGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                        \
399 400 401 402
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberRegularGrids(CClassName * domain)                                                                    \
{                                                                                                                                     \
403 404
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberRegularGrids((XDMFDOMAIN *)((void *)&baseDomain));                                                        \
405 406 407 408
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertRegularGrid(CClassName * domain, XDMFREGULARGRID * RegularGrid, int passControl)                                \
{                                                                                                                                     \
409 410
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertRegularGrid((XDMFDOMAIN *)((void *)&baseDomain), RegularGrid, passControl);                                         \
411 412 413 414
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveRegularGrid(CClassName * domain, unsigned int index)                                                            \
{                                                                                                                                     \
415 416
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveRegularGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                            \
417 418 419 420
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveRegularGridByName(CClassName * domain, char * Name)                                                             \
{                                                                                                                                     \
421 422
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveRegularGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                       \
423 424 425 426
}                                                                                                                                     \
                                                                                                                                      \
XDMFUNSTRUCTUREDGRID * ClassName##GetUnstructuredGrid(CClassName * domain, unsigned int index)                                        \
{                                                                                                                                     \
427 428
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetUnstructuredGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                   \
429 430 431 432
}                                                                                                                                     \
                                                                                                                                      \
XDMFUNSTRUCTUREDGRID * ClassName##GetUnstructuredGridByName(CClassName * domain, char * Name)                                         \
{                                                                                                                                     \
433 434
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetUnstructuredGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                              \
435 436 437 438
}                                                                                                                                     \
                                                                                                                                      \
unsigned int ClassName##GetNumberUnstructuredGrids(CClassName * domain)                                                               \
{                                                                                                                                     \
439 440
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  return XdmfDomainGetNumberUnstructuredGrids((XDMFDOMAIN *)((void *)&baseDomain));                                                   \
441 442 443 444
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##InsertUnstructuredGrid(CClassName * domain, XDMFUNSTRUCTUREDGRID * UnstructuredGrid, int passControl)                 \
{                                                                                                                                     \
445 446
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainInsertUnstructuredGrid((XDMFDOMAIN *)((void *)&baseDomain), UnstructuredGrid, passControl);                               \
447 448 449 450
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveUnstructuredGrid(CClassName * domain, unsigned int index)                                                       \
{                                                                                                                                     \
451 452
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveUnstructuredGrid((XDMFDOMAIN *)((void *)&baseDomain), index);                                                       \
453 454 455 456
}                                                                                                                                     \
                                                                                                                                      \
void ClassName##RemoveUnstructuredGridByName(CClassName * domain, char * Name)                                                        \
{                                                                                                                                     \
457 458
  shared_ptr< XdmfDomain > baseDomain = *(shared_ptr< ClassName > *) domain;                                                          \
  XdmfDomainRemoveUnstructuredGridByName((XDMFDOMAIN *)((void *)&baseDomain), Name);                                                  \
459 460 461 462 463 464
}

#ifdef __cplusplus
}
#endif

Kenneth Leiter's avatar
Kenneth Leiter committed
465
#endif /* XDMFDOMAIN_HPP_ */