ESYS13  Revision_
FinleyDomain.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 #ifndef __WEIPA_FINLEYDOMAIN_H__
00015 #define __WEIPA_FINLEYDOMAIN_H__
00016 
00017 #include <weipa/DomainChunk.h>
00018 #include <weipa/FinleyElements.h>
00019 #include <boost/enable_shared_from_this.hpp>
00020 
00021 struct Finley_Mesh;
00022 
00023 namespace weipa {
00024 
00036 class FinleyDomain : public DomainChunk, public boost::enable_shared_from_this<FinleyDomain>
00037 {
00038 public:
00039     FinleyDomain();
00040     FinleyDomain(const FinleyDomain& m);
00041     virtual ~FinleyDomain();
00042     virtual bool initFromEscript(const escript::AbstractDomain* domain);
00043     virtual bool initFromFile(const std::string& filename);
00044     virtual bool writeToSilo(DBfile* dbfile, const std::string& pathInSilo,
00045                              const StringVec& labels, const StringVec& units,
00046                              bool writeMeshData);
00047     virtual void reorderGhostZones(int ownIndex);
00048     virtual void removeGhostZones(int ownIndex);
00049     virtual StringVec getMeshNames() const;
00050     virtual StringVec getVarNames() const;
00051     virtual ElementData_ptr getElementsByName(const std::string& name) const;
00052     virtual NodeData_ptr getMeshByName(const std::string& name) const;
00053     virtual DataVar_ptr getDataVarByName(const std::string& name) const;
00054     virtual Centering getCenteringForFunctionSpace(int fsCode) const;
00055     virtual NodeData_ptr getMeshForFunctionSpace(int fsCode) const;
00056     virtual ElementData_ptr getElementsForFunctionSpace(int fsCode) const;
00057     virtual NodeData_ptr getNodes() const { return nodes; }
00058     virtual std::string getSiloPath() const { return siloPath; }
00059     virtual void setSiloPath(const std::string& path)  { siloPath = path; }
00060 
00061 private:
00062     void cleanup();
00063 
00064     bool initialized;
00065     FinleyNodes_ptr    nodes;
00066     FinleyElements_ptr cells;
00067     FinleyElements_ptr faces;
00068     FinleyElements_ptr contacts;
00069     std::string        siloPath;
00070 };
00071 
00072 } // namespace weipa
00073 
00074 #endif // __WEIPA_FINLEYDOMAIN_H__
00075