escript  Revision_4925
FinleyDomain.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_FINLEYDOMAIN_H__
18 #define __WEIPA_FINLEYDOMAIN_H__
19 
20 #include <weipa/DomainChunk.h>
21 #include <weipa/FinleyElements.h>
22 #include <boost/enable_shared_from_this.hpp>
23 
24 namespace finley {
25  class Mesh;
26 }
27 
28 namespace weipa {
29 
41 class FinleyDomain : public DomainChunk, public boost::enable_shared_from_this<FinleyDomain>
42 {
43 public:
44  FinleyDomain();
45  FinleyDomain(const FinleyDomain& m);
46  virtual ~FinleyDomain();
47  virtual bool initFromEscript(const escript::AbstractDomain* domain);
48  virtual bool initFromFile(const std::string& filename);
49  virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
50  const StringVec& labels, const StringVec& units,
51  bool writeMeshData);
52  virtual void reorderGhostZones(int ownIndex);
53  virtual void removeGhostZones(int ownIndex);
54  virtual StringVec getMeshNames() const;
55  virtual StringVec getVarNames() const;
56  virtual ElementData_ptr getElementsByName(const std::string& name) const;
57  virtual NodeData_ptr getMeshByName(const std::string& name) const;
58  virtual DataVar_ptr getDataVarByName(const std::string& name) const;
59  virtual Centering getCenteringForFunctionSpace(int fsCode) const;
60  virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const;
61  virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const;
62  virtual NodeData_ptr getNodes() const { return nodes; }
63  virtual std::string getSiloPath() const { return siloPath; }
64  virtual void setSiloPath(const std::string& path) { siloPath = path; }
65 
66 private:
67  void cleanup();
68 
74  std::string siloPath;
75 };
76 
77 } // namespace weipa
78 
79 #endif // __WEIPA_FINLEYDOMAIN_H__
80 
Represents a full Finley or Dudley domain including nodes and elements.
Definition: FinleyDomain.h:41
bool initialized
Definition: FinleyDomain.h:69
std::string siloPath
Definition: FinleyDomain.h:74
boost::shared_ptr< FinleyNodes > FinleyNodes_ptr
Definition: FinleyNodes.h:31
FinleyElements_ptr faces
Definition: FinleyDomain.h:72
boost::shared_ptr< FinleyElements > FinleyElements_ptr
Definition: FinleyElements.h:49
virtual void setSiloPath(const std::string &path)
Sets the silo path to be used when saving to a Silo file.
Definition: FinleyDomain.h:64
virtual StringVec getVarNames() const
Returns the names of all 'special' domain variables.
Definition: FinleyDomain.cpp:269
virtual void removeGhostZones(int ownIndex)
Removes 'ghost' elements and nodes.
Definition: FinleyDomain.cpp:386
std::vector< std::string > StringVec
Definition: weipa.h:56
virtual bool writeToSilo(DBfile *dbfile, const std::string &pathInSilo, const StringVec &labels, const StringVec &units, bool writeMeshData)
Writes the domain to a Silo file.
Definition: FinleyDomain.cpp:405
virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const
Returns the node mesh for given function space code.
Definition: FinleyDomain.cpp:176
virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const
Returns the element data for given function space code.
Definition: FinleyDomain.cpp:193
Abstract base class for weipa's interface to an Escript domain or one chunk thereof if domain decompo...
Definition: DomainChunk.h:45
virtual DataVar_ptr getDataVarByName(const std::string &name) const
Creates and returns a variable with domain data.
Definition: FinleyDomain.cpp:289
virtual std::string getSiloPath() const
Returns the absolute path within Silo file if writeToSilo() or setSiloPath() was called before...
Definition: FinleyDomain.h:63
virtual ElementData_ptr getElementsByName(const std::string &name) const
Returns element data with given name.
Definition: FinleyDomain.cpp:331
FinleyElements_ptr cells
Definition: FinleyDomain.h:71
virtual NodeData_ptr getNodes() const
Returns a pointer to the full nodes.
Definition: FinleyDomain.h:62
boost::shared_ptr< DataVar > DataVar_ptr
Definition: weipa.h:60
virtual ~FinleyDomain()
Definition: FinleyDomain.cpp:66
virtual Centering getCenteringForFunctionSpace(int fsCode) const
Returns whether data on given function space is node or cell centered.
Definition: FinleyDomain.cpp:167
FinleyElements_ptr contacts
Definition: FinleyDomain.h:73
Centering
Definition: DomainChunk.h:30
FinleyDomain()
Definition: FinleyDomain.cpp:45
void cleanup()
Definition: FinleyDomain.cpp:74
virtual bool initFromFile(const std::string &filename)
Reads the domain from a dump file.
Definition: FinleyDomain.cpp:133
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:62
virtual NodeData_ptr getMeshByName(const std::string &name) const
Returns the node mesh with given name.
Definition: FinleyDomain.cpp:353
Definition: AbstractDomain.h:62
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:64
FinleyNodes_ptr nodes
Definition: FinleyDomain.h:70
virtual void reorderGhostZones(int ownIndex)
Reorders elements so that 'ghost' elements (i.e. those that do not belong to ownIndex) appear last...
Definition: FinleyDomain.cpp:368
virtual bool initFromEscript(const escript::AbstractDomain *domain)
Initialises the domain using an escript domain instance.
Definition: FinleyDomain.cpp:86
virtual StringVec getMeshNames() const
Returns the names of all meshes within this domain.
Definition: FinleyDomain.cpp:251