escript  Revision_4925
DomainChunk.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __WEIPA_DOMAINCHUNK_H__
18 #define __WEIPA_DOMAINCHUNK_H__
19 
20 #include <weipa/weipa.h>
21 
22 class DBfile;
23 
24 namespace escript {
25  class AbstractDomain;
26 }
27 
28 namespace weipa {
29 
30 typedef enum {
33 } Centering;
34 
35 
46 {
47 public:
49  virtual bool initFromEscript(const escript::AbstractDomain* domain) = 0;
50 
52  virtual bool initFromFile(const std::string& filename) = 0;
53 
55  virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
56  const StringVec& labels,
57  const StringVec& units,
58  bool writeMeshData) = 0;
59 
62  virtual void reorderGhostZones(int ownIndex) = 0;
63 
65  virtual void removeGhostZones(int ownIndex) = 0;
66 
68  virtual StringVec getMeshNames() const = 0;
69 
71  virtual StringVec getVarNames() const = 0;
72 
74  virtual ElementData_ptr getElementsByName(const std::string& name) const=0;
75 
77  virtual NodeData_ptr getMeshByName(const std::string& name) const = 0;
78 
80  virtual DataVar_ptr getDataVarByName(const std::string& name) const = 0;
81 
84  virtual Centering getCenteringForFunctionSpace(int fsCode) const = 0;
85 
87  virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const = 0;
88 
90  virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const = 0;
91 
93  virtual NodeData_ptr getNodes() const = 0;
94 
97  virtual std::string getSiloPath() const = 0;
98 
100  virtual void setSiloPath(const std::string& path) = 0;
101 
102 protected:
104  virtual ~DomainChunk() {}
105 };
106 
107 } // namespace weipa
108 
109 #endif // __WEIPA_DOMAINCHUNK_H__
110 
virtual DataVar_ptr getDataVarByName(const std::string &name) const =0
Creates and returns a variable with domain data.
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const =0
Returns the node mesh for given function space code.
virtual StringVec getMeshNames() const =0
Returns the names of all meshes within this domain.
virtual bool writeToSilo(DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)=0
Writes the domain to a Silo file.
virtual NodeData_ptr getNodes() const =0
Returns a pointer to the full nodes.
std::vector< std::string > StringVec
Definition: weipa.h:56
Definition: DomainChunk.h:32
virtual std::string getSiloPath() const =0
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before...
virtual void setSiloPath(const std::string &path)=0
Sets the silo path to be used when saving to a Silo file.
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const =0
Returns the element data for given function space code.
Definition: DomainChunk.h:31
Abstract base class for weipa's interface to an Escript domain or one chunk thereof if domain decompo...
Definition: DomainChunk.h:45
virtual void reorderGhostZones(int ownIndex)=0
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last...
virtual bool initFromEscript(const escript::AbstractDomain *domain)=0
Initialises the domain using an escript domain instance.
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:60
virtual StringVec getVarNames() const =0
Returns the names of all 'special' domain variables.
virtual ElementData_ptr getElementsByName(const std::string &name) const =0
Returns element data with given name.
Centering
Definition: DomainChunk.h:30
virtual ~DomainChunk()
Destructor.
Definition: DomainChunk.h:104
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:62
virtual void removeGhostZones(int ownIndex)=0
Removes 'ghost' elements and nodes.
Definition: AbstractDomain.h:62
virtual Centering getCenteringForFunctionSpace(int fsCode) const =0
Returns whether data on given function space is node or cell centered.
virtual NodeData_ptr getMeshByName(const std::string &name) const =0
Returns the node mesh with given name.
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:64
virtual bool initFromFile(const std::string &filename)=0
Reads the domain from a dump file.