escript Revision_
DomainChunk.h
Go to the documentation of this file.
1
2/*****************************************************************************
3*
4* Copyright (c) 2003-2020 by The University of Queensland
5* http://www.uq.edu.au
6*
7* Primary Business: Queensland, Australia
8* Licensed under the Apache License, version 2.0
9* http://www.apache.org/licenses/LICENSE-2.0
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-2017 by Centre for Geoscience Computing (GeoComp)
14* Development from 2019 by School of Earth and Environmental Sciences
15**
16*****************************************************************************/
17
18#ifndef __WEIPA_DOMAINCHUNK_H__
19#define __WEIPA_DOMAINCHUNK_H__
20
21#include <weipa/weipa.h>
22
23class DBfile;
24
25namespace escript {
26 class AbstractDomain;
27}
28
29namespace weipa {
30
31typedef enum {
35
36
47{
48public:
50 virtual bool initFromEscript(const escript::AbstractDomain* domain) = 0;
51
53 virtual bool initFromFile(const std::string& filename) = 0;
54
56 virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
57 const StringVec& labels,
58 const StringVec& units,
59 bool writeMeshData) = 0;
60
63 virtual void reorderGhostZones(int ownIndex) = 0;
64
66 virtual void removeGhostZones(int ownIndex) = 0;
67
69 virtual StringVec getMeshNames() const = 0;
70
72 virtual StringVec getVarNames() const = 0;
73
75 virtual ElementData_ptr getElementsByName(const std::string& name) const=0;
76
78 virtual NodeData_ptr getMeshByName(const std::string& name) const = 0;
79
81 virtual DataVar_ptr getDataVarByName(const std::string& name) const = 0;
82
85 virtual Centering getCenteringForFunctionSpace(int fsCode) const = 0;
86
88 virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const = 0;
89
91 virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const = 0;
92
94 virtual NodeData_ptr getNodes() const = 0;
95
98 virtual std::string getSiloPath() const = 0;
99
101 virtual void setSiloPath(const std::string& path) = 0;
102
103protected:
105 virtual ~DomainChunk() {}
106};
107
108} // namespace weipa
109
110#endif // __WEIPA_DOMAINCHUNK_H__
111
Base class for all escript domains.
Definition: AbstractDomain.h:51
Abstract base class for weipa's interface to an Escript domain or one chunk thereof if domain decompo...
Definition: DomainChunk.h:47
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 getMeshForFunctionSpace(int fsCode) const =0
Returns the node mesh for given function space code.
virtual bool initFromFile(const std::string &filename)=0
Reads the domain from a dump file.
virtual Centering getCenteringForFunctionSpace(int fsCode) const =0
Returns whether data on given function space is node or cell centered.
virtual std::string getSiloPath() const =0
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before,...
virtual bool initFromEscript(const escript::AbstractDomain *domain)=0
Initialises the domain using an escript domain instance.
virtual StringVec getMeshNames() const =0
Returns the names of all meshes within this domain.
virtual DataVar_ptr getDataVarByName(const std::string &name) const =0
Creates and returns a variable with domain data.
virtual ElementData_ptr getElementsByName(const std::string &name) const =0
Returns element data with given name.
virtual NodeData_ptr getNodes() const =0
Returns a pointer to the full nodes.
virtual ~DomainChunk()
Destructor.
Definition: DomainChunk.h:105
virtual NodeData_ptr getMeshByName(const std::string &name) const =0
Returns the node mesh with given name.
virtual StringVec getVarNames() const =0
Returns the names of all 'special' domain variables.
virtual void reorderGhostZones(int ownIndex)=0
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last.
virtual void setSiloPath(const std::string &path)=0
Sets the silo path to be used when saving to a Silo file.
virtual void removeGhostZones(int ownIndex)=0
Removes 'ghost' elements and nodes.
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const =0
Returns the element data for given function space code.
Definition: AbstractContinuousDomain.cpp:23
Definition: DataVar.cpp:51
std::vector< std::string > StringVec
Definition: weipa.h:61
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:67
Centering
Definition: DomainChunk.h:31
@ ZONE_CENTERED
Definition: DomainChunk.h:33
@ NODE_CENTERED
Definition: DomainChunk.h:32
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:69
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:65