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