Escript  Revision_4320
FinleyDomain.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_FINLEYDOMAIN_H__
17 #define __WEIPA_FINLEYDOMAIN_H__
18 
19 #include <weipa/DomainChunk.h>
20 #include <weipa/FinleyElements.h>
21 #include <boost/enable_shared_from_this.hpp>
22 
23 struct Finley_Mesh;
24 
25 namespace weipa {
26 
38 class FinleyDomain : public DomainChunk, public boost::enable_shared_from_this<FinleyDomain>
39 {
40 public:
41  FinleyDomain();
42  FinleyDomain(const FinleyDomain& m);
43  virtual ~FinleyDomain();
44  virtual bool initFromEscript(const escript::AbstractDomain* domain);
45  virtual bool initFromFile(const std::string& filename);
46  virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
47  const StringVec& labels, const StringVec& units,
48  bool writeMeshData);
49  virtual void reorderGhostZones(int ownIndex);
50  virtual void removeGhostZones(int ownIndex);
51  virtual StringVec getMeshNames() const;
52  virtual StringVec getVarNames() const;
53  virtual ElementData_ptr getElementsByName(const std::string& name) const;
54  virtual NodeData_ptr getMeshByName(const std::string& name) const;
55  virtual DataVar_ptr getDataVarByName(const std::string& name) const;
56  virtual Centering getCenteringForFunctionSpace(int fsCode) const;
57  virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const;
58  virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const;
59  virtual NodeData_ptr getNodes() const { return nodes; }
60  virtual std::string getSiloPath() const { return siloPath; }
61  virtual void setSiloPath(const std::string& path) { siloPath = path; }
62 
63 private:
64  void cleanup();
65 
71  std::string siloPath;
72 };
73 
74 } // namespace weipa
75 
76 #endif // __WEIPA_FINLEYDOMAIN_H__
77