XdmfDomain.hpp 4.95 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 27
#ifndef XDMFDOMAIN_HPP_
#define XDMFDOMAIN_HPP_

// Forward Declarations
28
class XdmfCurvilinearGrid;
Kenneth Leiter's avatar
Kenneth Leiter committed
29
class XdmfGraph;
30
class XdmfGridCollection;
31 32 33
class XdmfRectilinearGrid;
class XdmfRegularGrid;
class XdmfUnstructuredGrid;
Kenneth Leiter's avatar
Kenneth Leiter committed
34 35

// Includes
36
#include "Xdmf.hpp"
37
#include "XdmfItem.hpp"
Kenneth Leiter's avatar
Kenneth Leiter committed
38

39
/**
40
 * @brief The root XdmfItem that holds XdmfGrids.
41
 *
42 43 44
 * 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.
45
 */
46
class XDMF_EXPORT XdmfDomain : public virtual XdmfItem {
Kenneth Leiter's avatar
Kenneth Leiter committed
47

48
public:
Kenneth Leiter's avatar
Kenneth Leiter committed
49

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

71
  virtual ~XdmfDomain();
72

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

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

84
  virtual std::string getItemTag() const;
85

86
  using XdmfItem::insert;
Kenneth Leiter's avatar
Kenneth Leiter committed
87

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

90
protected:
Kenneth Leiter's avatar
Kenneth Leiter committed
91

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

98
private:
99 100 101

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

};

105
#ifdef _WIN32
106
XDMF_TEMPLATE template class XDMF_EXPORT
107
std::allocator<shared_ptr<XdmfGridCollection> >;
108
XDMF_TEMPLATE template class XDMF_EXPORT
109 110
std::vector<shared_ptr<XdmfGridCollection>,
            std::allocator<shared_ptr<XdmfGridCollection> > >;
111
XDMF_TEMPLATE template class XDMF_EXPORT
112
std::allocator<shared_ptr<XdmfCurvilinearGrid> >;
113
XDMF_TEMPLATE template class XDMF_EXPORT
114 115
std::vector<shared_ptr<XdmfCurvilinearGrid>,
            std::allocator<shared_ptr<XdmfCurvilinearGrid> > >;
116
XDMF_TEMPLATE template class XDMF_EXPORT
117
std::allocator<shared_ptr<XdmfRectilinearGrid> >;
118
XDMF_TEMPLATE template class XDMF_EXPORT
119 120
std::vector<shared_ptr<XdmfRectilinearGrid>,
            std::allocator<shared_ptr<XdmfRectilinearGrid> > >;
121
XDMF_TEMPLATE template class XDMF_EXPORT
122
std::allocator<shared_ptr<XdmfRegularGrid> >;
123
XDMF_TEMPLATE template class XDMF_EXPORT
124 125
std::vector<shared_ptr<XdmfRegularGrid>,
            std::allocator<shared_ptr<XdmfRegularGrid> > >;
126
XDMF_TEMPLATE template class XDMF_EXPORT
127
std::allocator<shared_ptr<XdmfUnstructuredGrid> >;
128
XDMF_TEMPLATE template class XDMF_EXPORT
129 130
std::vector<shared_ptr<XdmfUnstructuredGrid>,
            std::allocator<shared_ptr<XdmfUnstructuredGrid> > >;
131 132
#endif

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