ESScript  Revision_4488
RipleyElements.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 #ifndef __WEIPA_RIPLEYELEMENTS_H__
17 #define __WEIPA_RIPLEYELEMENTS_H__
18 
19 #include <weipa/ElementData.h>
20 #include <weipa/RipleyNodes.h>
21 
22 class DBfile;
23 
24 namespace ripley {
25 class RipleyDomain;
26 }
27 
28 
29 namespace weipa {
30 
32 typedef boost::shared_ptr<RipleyElements> RipleyElements_ptr;
33 
44 {
45 public:
46 
48  RipleyElements(const std::string& elementName, RipleyNodes_ptr nodes);
49 
52 
54  virtual ~RipleyElements() {}
55 
57  bool initFromRipley(const ripley::RipleyDomain* ripleyDomain, int fsType);
58 
61  void reorderGhostZones(int ownIndex);
62 
64  void removeGhostZones(int ownIndex);
65 
67  virtual void writeConnectivityVTK(std::ostream& os);
68 
74  bool writeToSilo(DBfile* dbfile, const std::string& siloPath,
75  const StringVec& labels, const StringVec& units,
76  bool writeMeshData);
77 
79  virtual StringVec getMeshNames() const;
80 
82  virtual StringVec getVarNames() const;
83 
85  virtual int getNumElements() const { return numElements; }
86 
88  virtual int getNodesPerElement() const { return nodesPerElement; }
89 
91  virtual int getGhostCount() const { return numGhostElements; }
92 
94  virtual ZoneType getType() const { return type; }
95 
97  virtual const IntVec& getNodeList() const { return nodes; }
98 
100  virtual const IntVec& getIDs() const { return ID; }
101 
105  virtual const IntVec& getVarDataByName(const std::string varName) const;
106 
108  virtual NodeData_ptr getNodes() const { return nodeMesh; }
109 
111  virtual ElementData_ptr getReducedElements() const { return ElementData_ptr(); }
112 
114  virtual const QuadMaskInfo& getQuadMask(int functionSpace) const { return quadMask; }
115 
119  virtual int getElementFactor() const { return 1; }
120 
121 private:
123  void buildMeshes();
124  IntVec prepareGhostIndices(int ownIndex);
125  void reorderArray(IntVec& v, const IntVec& idx, int elementsPerIndex);
126 
129  std::string name;
137 };
138 
139 } // namespace weipa
140 
141 #endif // __WEIPA_RIPLEYELEMENTS_H__
142