XdmfGrid.hpp 30.4 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 : XdmfGrid.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.                                                 */
/*                                                                           */
/*****************************************************************************/

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
24 25 26
#ifndef XDMFGRID_HPP_
#define XDMFGRID_HPP_

27
// C Compatible Includes
28
#include "Xdmf.hpp"
29
#include "XdmfItem.hpp"
30 31 32 33 34 35 36 37 38 39 40 41
#include "XdmfAttribute.hpp"
#include "XdmfGeometry.hpp"
#include "XdmfGridController.hpp"
#include "XdmfTopology.hpp"
#include "XdmfMap.hpp"
#include "XdmfSet.hpp"

#ifdef __cplusplus

// Forward Declarations
class XdmfSubGrid;
class XdmfTime;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
42

43
/**
44 45
 * @brief A mesh containing elements, points, and fields attached to
 * the mesh.
46
 *
47 48 49 50 51 52
 * XdmfGrid represents a mesh. It is required to contain two other
 * Xdmf data structures, an XdmfGeometry that stores point locations
 * and an XdmfTopology that store connectivity
 * information. XdmfAttributes can be inserted into the XdmfGrid to
 * specify fields centered on various parts of the mesh.  XdmfSets can
 * be inserted into XdmfGrids to specify collections of mesh elements.
53
 *
54 55 56
 * XdmfGrid is an abstract base class. There are several
 * implementations for representing both structured and unstructured
 * grids.
57
 */
58
class XDMF_EXPORT XdmfGrid : public virtual XdmfItem {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
59

60
public:
61

62
  virtual ~XdmfGrid();
63

64 65 66 67
  LOKI_DEFINE_VISITABLE(XdmfGrid, XdmfItem)
  XDMF_CHILDREN(XdmfGrid, XdmfAttribute, Attribute, Name)
  XDMF_CHILDREN(XdmfGrid, XdmfSet, Set, Name)
  XDMF_CHILDREN(XdmfGrid, XdmfMap, Map, Name)
68 69 70 71 72
  static const std::string ItemTag;

  /**
   * Get the geometry associated with this grid.
   *
73 74 75 76
   * Example of use:
   *
   * C++
   *
77
   * @dontinclude ExampleXdmfGrid.cpp
78 79 80 81
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getGeometry
   * @until //#getGeometry
82 83 84
   *
   * Python
   *
85
   * @dontinclude XdmfExampleGrid.py
86 87 88 89
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getGeometry
   * @until #//getGeometry
90
   *
91
   * @return    The geometry associated with this grid.
92
   */
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
  virtual shared_ptr<const XdmfGeometry> getGeometry() const;

  /**
   * Gets the current external reference for this grid.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfGrid.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setGridController
   * @until //#setGridController
   * @skipline //#getGridController
   * @until //#getGridController
   *
   * Python
   *
   * @dontinclude XdmfExampleGrid.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setGridController
   * @until #//setGridController
   * @skipline #//getGridController
   * @until #//getGridController
   *
   * @return    The current reference.
   */
  shared_ptr<XdmfGridController> getGridController();
123 124 125 126 127 128 129 130

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

  virtual std::string getItemTag() const;

  /**
   * Get the name of the grid.
   *
131 132 133 134
   * Example of use:
   *
   * C++
   *
135
   * @dontinclude ExampleXdmfGrid.cpp
136 137 138 139 140 141
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setName
   * @until //#setName
   * @skipline //#getName
   * @until //#getName
142
   *
143 144
   * Python
   *
145
   * @dontinclude XdmfExampleGrid.py
146 147 148 149 150 151
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setName
   * @until #//setName
   * @skipline #//getName
   * @until #//getName
152
   *
153
   * @return    The name of the grid.
154 155 156 157 158 159
   */
  std::string getName() const;

  /**
   * Get the time associated with this grid.
   *
160 161 162 163
   * Example of use:
   *
   * C++
   *
164
   * @dontinclude ExampleXdmfGrid.cpp
165 166 167 168 169 170
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setTime
   * @until //#setTime
   * @skipline //#getTime
   * @until //#getTime
171
   *
172 173
   * Python
   *
174
   * @dontinclude XdmfExampleGrid.py
175 176 177 178 179 180
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setTime
   * @until #//setTime
   * @skipline #//getTime
   * @until #//getTime
181
   *
182 183
   * @return    Pointer to the XdmfTime attached to this grid. If no
   *            XdmfTime is attached, return a NULL pointer.
184
   */
185
  virtual shared_ptr<XdmfTime> getTime();
186 187 188 189

  /**
   * Get the time associated with this grid (const version).
   *
190 191 192 193
   * Example of use:
   *
   * C++
   *
194
   * @dontinclude ExampleXdmfGrid.cpp
195 196 197 198 199 200
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setTime
   * @until //#setTime
   * @skipline //#getTimeconst
   * @until //#getTimeconst
201
   *
202 203
   * Python: Python doesn't have a constant version
   * 
204 205
   * @return    Pointer to the XdmfTime attached to this grid. If no
   *            XdmfTime is attached, return a NULL pointer.
206
   */
207
  virtual shared_ptr<const XdmfTime> getTime() const;
208 209 210 211

  /**
   * Get the topology associated with this grid.
   *
212 213 214 215
   * Example of use:
   *
   * C++
   *
216
   * @dontinclude ExampleXdmfGrid.cpp
217 218 219 220
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getTopology
   * @until //#getTopology
221 222 223
   *
   * Python
   *
224
   * @dontinclude XdmfExampleGrid.py
225 226 227 228
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getTopology
   * @until #//getTopology
229
   *
230
   * @return    The topology associated with this grid.
231
   */
232
  virtual shared_ptr<const XdmfTopology> getTopology() const;
233 234 235

  using XdmfItem::insert;

236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
  /**
   * Reads the tree structure fromt he grid controller set to this grid
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfGrid.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#read
   * @until //#read
   *
   * Python
   *
   * @dontinclude XdmfExampleGrid.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//read
   * @until #//read
   */
  virtual void read();

  /**
   * Releases the grid structure that this grid contains.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfGrid.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#release
   * @until //#release
   *
   * Python
   *
   * @dontinclude XdmfExampleGrid.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//release
   * @until #//release
   */
  virtual void release();

  /**
   * Sets the reference to an external xdmf tree from which to populate the grid.
   *
   * Example of use:
   *
   * C++
   *
   * @dontinclude ExampleXdmfGrid.cpp
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setGridController
   * @until //#setGridController
   *
   * Python
   *
   * @dontinclude XdmfExampleGrid.py
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setGridController
   * @until #//setGridController
   *
   * @param     newController   A reference to the external tree.
   */
  void setGridController(shared_ptr<XdmfGridController> newController);

307 308 309
  /**
   * Set the name of the grid.
   *
310 311 312 313
   * Example of use:
   *
   * C++
   *
314
   * @dontinclude ExampleXdmfGrid.cpp
315 316 317 318
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setName
   * @until //#setName
319 320 321
   *
   * Python
   *
322
   * @dontinclude XdmfExampleGrid.py
323 324 325 326
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setName
   * @until #//setName
327
   *
328
   * @param     name    Name of the grid to set.
329 330 331 332 333 334
   */
  void setName(const std::string & name);

  /**
   * Set the time associated with this grid.
   *
335 336 337 338
   * Example of use:
   *
   * C++
   *
339
   * @dontinclude ExampleXdmfGrid.cpp
340 341 342 343
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setTime
   * @until //#setTime
344 345 346
   *
   * Python
   *
347
   * @dontinclude XdmfExampleGrid.py
348 349 350 351
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setTime
   * @until #//setTime
352
   *
353
   * @param     time    An XdmfTime to associate with this grid.
354
   */
355
  virtual void setTime(const shared_ptr<XdmfTime> time);
356

357
  virtual void traverse(const shared_ptr<XdmfBaseVisitor> visitor);
358

359 360
  XdmfGrid(XdmfGrid &);

361
protected:
362

363 364
  XdmfGrid(const shared_ptr<XdmfGeometry> geometry,
           const shared_ptr<XdmfTopology> topology,
365 366
           const std::string & name = "Grid");

367 368 369
  virtual void
  copyGrid(shared_ptr<XdmfGrid> sourceGrid);

370 371
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
372
               const std::vector<shared_ptr<XdmfItem> > & childItems,
373 374
               const XdmfCoreReader * const reader);

375 376
  shared_ptr<XdmfGeometry> mGeometry;
  shared_ptr<XdmfTopology> mTopology;
377

378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
  class XdmfGridImpl
  {
    public:
    XdmfGridImpl()
    {
    }

    ~XdmfGridImpl()
    {
    }

    virtual XdmfGridImpl * duplicate() = 0;

    std::string getGridType() const
    {
      return mGridType;
    }

    std::string mGridType;
  };

  XdmfGridImpl * mImpl;

  shared_ptr<XdmfGridController> mGridController;

403
private:
404 405 406 407 408

  XdmfGrid(const XdmfGrid &);  // Not implemented.
  void operator=(const XdmfGrid &);  // Not implemented.

  std::string mName;
409
  shared_ptr<XdmfTime> mTime;
410

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
411 412
};

413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
#endif

#ifdef __cplusplus
extern "C" {
#endif

// C wrappers go here

#ifndef XDMFGRIDCDEFINE
#define XDMFGRIDCDEFINE
struct XDMFGRID; // Simply as a typedef to ensure correct typing
typedef struct XDMFGRID XDMFGRID;
#endif

XDMF_EXPORT XDMFATTRIBUTE * XdmfGridGetAttribute(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT XDMFATTRIBUTE * XdmfGridGetAttributeByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT unsigned int XdmfGridGetNumberAttributes(XDMFGRID * grid);

XDMF_EXPORT void XdmfGridInsertAttribute(XDMFGRID * grid, XDMFATTRIBUTE * Attribute, int passControl);

XDMF_EXPORT void XdmfGridRemoveAttribute(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT void XdmfGridRemoveAttributeByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT XDMFSET * XdmfGridGetSet(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT XDMFSET * XdmfGridGetSetByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT unsigned int XdmfGridGetNumberSets(XDMFGRID * grid);

XDMF_EXPORT void XdmfGridInsertSet(XDMFGRID * grid, XDMFSET * Set, int passControl);

XDMF_EXPORT void XdmfGridRemoveSet(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT void XdmfGridRemoveSetByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT XDMFMAP * XdmfGridGetMap(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT XDMFMAP * XdmfGridGetMapByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT unsigned int XdmfGridGetNumberMaps(XDMFGRID * grid); 

XDMF_EXPORT void XdmfGridInsertMap(XDMFGRID * grid, XDMFMAP * Map, int passControl);

XDMF_EXPORT void XdmfGridRemoveMap(XDMFGRID * grid, unsigned int index);

XDMF_EXPORT void XdmfGridRemoveMapByName(XDMFGRID * grid, char * Name);

XDMF_EXPORT XDMFGRIDCONTROLLER * XdmfGridGetGridController(XDMFGRID * grid);

XDMF_EXPORT char * XdmfGridGetName(XDMFGRID * grid);

XDMF_EXPORT XDMFTIME * XdmfGridGetTime(XDMFGRID * grid);

XDMF_EXPORT void XdmfGridRead(XDMFGRID * grid, int * status);

XDMF_EXPORT void XdmfGridRelease(XDMFGRID * grid);

XDMF_EXPORT void XdmfGridSetGridController(XDMFGRID * grid, XDMFGRIDCONTROLLER * controller, int passControl);

XDMF_EXPORT void XdmfGridSetName(XDMFGRID * grid, char * name, int * status);

XDMF_EXPORT void XdmfGridSetTime(XDMFGRID * grid, XDMFTIME * time, int passControl);

XDMF_ITEM_C_CHILD_DECLARE(XdmfGrid, XDMFGRID, XDMF)

#define XDMF_GRID_C_CHILD_DECLARE(ClassName, CClassName, Level)                                                        \
                                                                                                                       \
Level##_EXPORT XDMFATTRIBUTE * ClassName##GetAttribute(CClassName * grid, unsigned int index);                         \
Level##_EXPORT XDMFATTRIBUTE * ClassName##GetAttributeByName(CClassName * grid, char * Name);                          \
Level##_EXPORT unsigned int ClassName##GetNumberAttributes(CClassName * grid);                                         \
Level##_EXPORT void ClassName##InsertAttribute(CClassName * grid, XDMFATTRIBUTE * Attribute, int passControl);         \
Level##_EXPORT void ClassName##RemoveAttribute(CClassName * grid, unsigned int index);                                 \
Level##_EXPORT void ClassName##RemoveAttributeByName(CClassName * grid, char * Name);                                  \
Level##_EXPORT XDMFSET * ClassName##GetSet(CClassName * grid, unsigned int index);                                     \
Level##_EXPORT XDMFSET * ClassName##GetSetByName(CClassName * grid, char * Name);                                      \
Level##_EXPORT unsigned int ClassName##GetNumberSets(CClassName * grid);                                               \
Level##_EXPORT void ClassName##InsertSet(CClassName * grid, XDMFSET * Set, int passControl);                           \
Level##_EXPORT void ClassName##RemoveSet(CClassName * grid, unsigned int index);                                       \
Level##_EXPORT void ClassName##RemoveSetByName(CClassName * grid, char * Name);                                        \
Level##_EXPORT XDMFMAP * ClassName##GetMap(CClassName * grid, unsigned int index);                                     \
Level##_EXPORT XDMFMAP * ClassName##GetMapByName(CClassName * grid, char * Name);                                      \
Level##_EXPORT unsigned int ClassName##GetNumberMaps(CClassName * grid);                                               \
Level##_EXPORT void ClassName##InsertMap(CClassName * grid, XDMFMAP * Map, int passControl);                           \
Level##_EXPORT void ClassName##RemoveMap(CClassName * grid, unsigned int index);                                       \
Level##_EXPORT void ClassName##RemoveMapByName(CClassName * grid, char * Name);                                        \
Level##_EXPORT XDMFGRIDCONTROLLER * ClassName##GetGridController(CClassName * grid);                                   \
Level##_EXPORT char * ClassName##GetName(CClassName * grid);                                                           \
Level##_EXPORT XDMFTIME * ClassName##GetTime(CClassName * grid);                                                       \
Level##_EXPORT void ClassName##Read( CClassName * grid, int * status);                                                 \
Level##_EXPORT void ClassName##Release( CClassName * grid);                                                            \
Level##_EXPORT void ClassName##SetGridController(CClassName * grid, XDMFGRIDCONTROLLER * controller, int passControl); \
Level##_EXPORT void ClassName##SetName(CClassName * grid, char * name, int * status);                                  \
Level##_EXPORT void ClassName##SetTime(CClassName * grid, XDMFTIME * time, int passControl);



#define XDMF_GRID_C_CHILD_WRAPPER(ClassName, CClassName)                                                       \
XDMFATTRIBUTE * ClassName##GetAttribute(CClassName * grid, unsigned int index)                                 \
{                                                                                                              \
  return XdmfGridGetAttribute((XDMFGRID *)((void *)grid), index);                                              \
}                                                                                                              \
                                                                                                               \
XDMFATTRIBUTE * ClassName##GetAttributeByName(CClassName * grid, char * Name)                                  \
{                                                                                                              \
  return XdmfGridGetAttributeByName((XDMFGRID *)((void *)grid), Name);                                         \
}                                                                                                              \
                                                                                                               \
unsigned int ClassName##GetNumberAttributes(CClassName * grid)                                                 \
{                                                                                                              \
  return XdmfGridGetNumberAttributes((XDMFGRID *)((void *)grid));                                              \
}                                                                                                              \
                                                                                                               \
void ClassName##InsertAttribute(CClassName * grid, XDMFATTRIBUTE * Attribute, int passControl)                 \
{                                                                                                              \
  XdmfGridInsertAttribute((XDMFGRID *)((void *)grid), Attribute, passControl);                                 \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveAttribute(CClassName * grid, unsigned int index)                                         \
{                                                                                                              \
  XdmfGridRemoveAttribute((XDMFGRID *)((void *)grid), index);                                                  \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveAttributeByName(CClassName * grid, char * Name)                                          \
{                                                                                                              \
  XdmfGridRemoveAttributeByName((XDMFGRID *)((void *)grid), Name);                                             \
}                                                                                                              \
                                                                                                               \
XDMFSET * ClassName##GetSet(CClassName * grid, unsigned int index)                                             \
{                                                                                                              \
  return XdmfGridGetSet((XDMFGRID *)((void *)grid), index);                                                    \
}                                                                                                              \
                                                                                                               \
XDMFSET * ClassName##GetSetByName(CClassName * grid, char * Name)                                              \
{                                                                                                              \
  return XdmfGridGetSetByName((XDMFGRID *)((void *)grid), Name);                                               \
}                                                                                                              \
                                                                                                               \
unsigned int ClassName##GetNumberSets(CClassName * grid)                                                       \
{                                                                                                              \
  return XdmfGridGetNumberSets((XDMFGRID *)((void *)grid));                                                    \
}                                                                                                              \
                                                                                                               \
void ClassName##InsertSet(CClassName * grid, XDMFSET * Set, int passControl)                                   \
{                                                                                                              \
  XdmfGridInsertSet((XDMFGRID *)((void *)grid), Set, passControl);                                             \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveSet(CClassName * grid, unsigned int index)                                               \
{                                                                                                              \
  XdmfGridRemoveSet((XDMFGRID *)((void *)grid), index);                                                        \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveSetByName(CClassName * grid, char * Name)                                                \
{                                                                                                              \
  XdmfGridRemoveSetByName((XDMFGRID *)((void *)grid), Name);                                                   \
}                                                                                                              \
                                                                                                               \
XDMFMAP * ClassName##GetMap(CClassName * grid, unsigned int index)                                             \
{                                                                                                              \
  return XdmfGridGetMap((XDMFGRID *)((void *)grid), index);                                                    \
}                                                                                                              \
                                                                                                               \
XDMFMAP * ClassName##GetMapByName(CClassName * grid, char * Name)                                              \
{                                                                                                              \
  return XdmfGridGetMapByName((XDMFGRID *)((void *)grid), Name);                                               \
}                                                                                                              \
                                                                                                               \
unsigned int ClassName##GetNumberMaps(CClassName * grid)                                                       \
{                                                                                                              \
  return XdmfGridGetNumberMaps((XDMFGRID *)((void *)grid));                                                    \
}                                                                                                              \
                                                                                                               \
void ClassName##InsertMap(CClassName * grid, XDMFMAP * Map, int passControl)                                   \
{                                                                                                              \
  XdmfGridInsertMap((XDMFGRID *)((void *)grid), Map, passControl);                                             \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveMap(CClassName * grid, unsigned int index)                                               \
{                                                                                                              \
  XdmfGridRemoveMap((XDMFGRID *)((void *)grid), index);                                                        \
}                                                                                                              \
                                                                                                               \
void ClassName##RemoveMapByName(CClassName * grid, char * Name)                                                \
{                                                                                                              \
  XdmfGridRemoveMapByName((XDMFGRID *)((void *)grid), Name);                                                   \
}                                                                                                              \
                                                                                                               \
XDMFGRIDCONTROLLER * ClassName##GetGridController(CClassName * grid)                                           \
{                                                                                                              \
  return XdmfGridGetGridController((XDMFGRID *)((void *)grid));                                                \
}                                                                                                              \
                                                                                                               \
char * ClassName##GetName(CClassName * grid)                                                                   \
{                                                                                                              \
  return XdmfGridGetName((XDMFGRID *)((void *)grid));                                                          \
}                                                                                                              \
                                                                                                               \
XDMFTIME * ClassName##GetTime(CClassName * grid)                                                               \
{                                                                                                              \
  return XdmfGridGetTime((XDMFGRID *)((void *)grid));                                                          \
}                                                                                                              \
                                                                                                               \
void                                                                                                           \
ClassName##Read( CClassName * grid, int * status)                                                              \
{                                                                                                              \
  XdmfGridRead((XDMFGRID *)((void *)grid), status);                                                            \
}                                                                                                              \
                                                                                                               \
void                                                                                                           \
ClassName##Release( CClassName * grid)                                                                         \
{                                                                                                              \
  XdmfGridRelease((XDMFGRID *)((void *)grid));                                                                 \
}                                                                                                              \
                                                                                                               \
void ClassName##SetGridController(CClassName * grid, XDMFGRIDCONTROLLER * controller, int passControl)         \
{                                                                                                              \
  XdmfGridSetGridController((XDMFGRID *)((void *)grid), controller, passControl);                              \
}                                                                                                              \
                                                                                                               \
void ClassName##SetName(CClassName * grid, char * name, int * status)                                          \
{                                                                                                              \
  XdmfGridSetName((XDMFGRID *)((void *)grid), name, status);                                                   \
}                                                                                                              \
                                                                                                               \
void ClassName##SetTime(CClassName * grid, XDMFTIME * time, int passControl)                                   \
{                                                                                                              \
  XdmfGridSetTime((XDMFGRID *)((void *)grid), time, passControl);                                              \
}

#ifdef __cplusplus
}
#endif

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
649
#endif /* XDMFGRID_HPP_ */