/[escript]/trunk/weipa/src/FinleyDomain.h
ViewVC logotype

Contents of /trunk/weipa/src/FinleyDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (8 years, 11 months ago) by jfenwick
File MIME type: text/plain
File size: 2743 byte(s)
Merging dudley and scons updates from branches

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14 #ifndef __WEIPA_FINLEYDOMAIN_H__
15 #define __WEIPA_FINLEYDOMAIN_H__
16
17 #include <weipa/DomainChunk.h>
18 #include <weipa/FinleyElements.h>
19 #include <boost/enable_shared_from_this.hpp>
20
21 struct Finley_Mesh;
22
23 namespace weipa {
24
25 /// \brief Represents a full Finley or Dudley domain including nodes and
26 /// elements.
27 ///
28 /// This class represents a Finley or Dudley domain including nodes, cells,
29 /// and face elements (plus contact elements for Finley). It provides
30 /// functionality to read a domain from a netCDF file (generated by the
31 /// domain's dump() method) or directly through an instance of Finley_Mesh or
32 /// Dudley_Mesh.
33 ///
34 /// Once initialised, the domain can be saved to a Silo file or its nodes
35 /// and elements accessed through the respective methods.
36 class FinleyDomain : public DomainChunk, public boost::enable_shared_from_this<FinleyDomain>
37 {
38 public:
39 FinleyDomain();
40 FinleyDomain(const FinleyDomain& m);
41 virtual ~FinleyDomain();
42 virtual bool initFromEscript(const escript::AbstractDomain* domain);
43 virtual bool initFromFile(const std::string& filename);
44 virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
45 const StringVec& labels, const StringVec& units);
46 virtual void reorderGhostZones(int ownIndex);
47 virtual void removeGhostZones(int ownIndex);
48 virtual StringVec getMeshNames() const;
49 virtual StringVec getVarNames() const;
50 virtual ElementData_ptr getElementsByName(const std::string& name) const;
51 virtual NodeData_ptr getMeshByName(const std::string& name) const;
52 virtual DataVar_ptr getDataVarByName(const std::string& name) const;
53 virtual Centering getCenteringForFunctionSpace(int fsCode) const;
54 virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const;
55 virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const;
56 virtual NodeData_ptr getNodes() const { return nodes; }
57 virtual std::string getSiloPath() const { return siloPath; }
58 virtual void setSiloPath(const std::string& path) { siloPath = path; }
59
60 private:
61 void cleanup();
62
63 bool initialized;
64 FinleyNodes_ptr nodes;
65 FinleyElements_ptr cells;
66 FinleyElements_ptr faces;
67 FinleyElements_ptr contacts;
68 std::string siloPath;
69 };
70
71 } // namespace weipa
72
73 #endif // __WEIPA_FINLEYDOMAIN_H__
74

  ViewVC Help
Powered by ViewVC 1.1.26