XdmfDomain.hpp 4.54 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;
29
class XdmfGridCollection;
30 31 32
class XdmfRectilinearGrid;
class XdmfRegularGrid;
class XdmfUnstructuredGrid;
Kenneth Leiter's avatar
Kenneth Leiter committed
33 34

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

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

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

49 50 51 52 53
  /**
   * Create a new XdmfDomain.
   *
   * @return constructed XdmfDomain.
   */
54
  static shared_ptr<XdmfDomain> New();
55

56
  virtual ~XdmfDomain();
57

58 59 60 61 62 63 64
  LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem);
  XDMF_CHILDREN(XdmfGridCollection, GridCollection, Name);
  XDMF_CHILDREN(XdmfCurvilinearGrid, CurvilinearGrid, Name);
  XDMF_CHILDREN(XdmfRectilinearGrid, RectilinearGrid, Name);
  XDMF_CHILDREN(XdmfRegularGrid, RegularGrid, Name);
  XDMF_CHILDREN(XdmfUnstructuredGrid, UnstructuredGrid, Name);
  static const std::string ItemTag;
Kenneth Leiter's avatar
Kenneth Leiter committed
65

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

68
  virtual std::string getItemTag() const;
69

70
  using XdmfItem::insert;
Kenneth Leiter's avatar
Kenneth Leiter committed
71

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

74
protected:
Kenneth Leiter's avatar
Kenneth Leiter committed
75

76 77 78
  XdmfDomain();
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
79
               std::vector<shared_ptr<XdmfItem> > & childItems,
80
               const XdmfCoreReader * const reader);
Kenneth Leiter's avatar
Kenneth Leiter committed
81

82
private:
83 84 85

  XdmfDomain(const XdmfDomain &);  // Not implemented.
  void operator=(const XdmfDomain &);  // Not implemented.
Kenneth Leiter's avatar
Kenneth Leiter committed
86 87 88

};

89
#ifdef _WIN32
90
XDMF_TEMPLATE template class XDMF_EXPORT
91
std::allocator<shared_ptr<XdmfGridCollection> >;
92
XDMF_TEMPLATE template class XDMF_EXPORT
93 94
std::vector<shared_ptr<XdmfGridCollection>,
            std::allocator<shared_ptr<XdmfGridCollection> > >;
95
XDMF_TEMPLATE template class XDMF_EXPORT
96
std::allocator<shared_ptr<XdmfCurvilinearGrid> >;
97
XDMF_TEMPLATE template class XDMF_EXPORT
98 99
std::vector<shared_ptr<XdmfCurvilinearGrid>,
            std::allocator<shared_ptr<XdmfCurvilinearGrid> > >;
100
XDMF_TEMPLATE template class XDMF_EXPORT
101
std::allocator<shared_ptr<XdmfRectilinearGrid> >;
102
XDMF_TEMPLATE template class XDMF_EXPORT
103 104
std::vector<shared_ptr<XdmfRectilinearGrid>,
            std::allocator<shared_ptr<XdmfRectilinearGrid> > >;
105
XDMF_TEMPLATE template class XDMF_EXPORT
106
std::allocator<shared_ptr<XdmfRegularGrid> >;
107
XDMF_TEMPLATE template class XDMF_EXPORT
108 109
std::vector<shared_ptr<XdmfRegularGrid>,
            std::allocator<shared_ptr<XdmfRegularGrid> > >;
110
XDMF_TEMPLATE template class XDMF_EXPORT
111
std::allocator<shared_ptr<XdmfUnstructuredGrid> >;
112
XDMF_TEMPLATE template class XDMF_EXPORT
113 114
std::vector<shared_ptr<XdmfUnstructuredGrid>,
            std::allocator<shared_ptr<XdmfUnstructuredGrid> > >;
115 116
#endif

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