/[escript]/branches/split/weipa/src/FinleyDomain.h
ViewVC logotype

Contents of /branches/split/weipa/src/FinleyDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4724 - (show annotations)
Thu Mar 6 05:22:12 2014 UTC (5 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 2997 byte(s)
Work towards parallel domains

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
30 /// \brief Represents a full Finley or Dudley domain including nodes and
31 /// elements.
32 ///
33 /// This class represents a Finley or Dudley domain including nodes, cells,
34 /// and face elements (plus contact elements for Finley). It provides
35 /// functionality to read a domain from a netCDF file (generated by the
36 /// domain's dump() method) or directly through an instance of finley::Mesh or
37 /// Dudley_Mesh.
38 ///
39 /// Once initialised, the domain can be saved to a Silo file or its nodes
40 /// and elements accessed through the respective methods.
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
69 bool initialized;
70 FinleyNodes_ptr nodes;
71 FinleyElements_ptr cells;
72 FinleyElements_ptr faces;
73 FinleyElements_ptr contacts;
74 std::string siloPath;
75 };
76
77 } // namespace weipa
78
79 #endif // __WEIPA_FINLEYDOMAIN_H__
80

  ViewVC Help
Powered by ViewVC 1.1.26