escript  Revision_
RipleyElements.h
Go to the documentation of this file.
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_RIPLEYELEMENTS_H__
00018 #define __WEIPA_RIPLEYELEMENTS_H__
00019 
00020 #include <weipa/ElementData.h>
00021 #include <weipa/RipleyNodes.h>
00022 
00023 class DBfile;
00024 
00025 namespace ripley {
00026 class RipleyDomain;
00027 }
00028 
00029 
00030 namespace weipa {
00031  
00032 class RipleyElements;
00033 typedef boost::shared_ptr<RipleyElements> RipleyElements_ptr;
00034 
00044 class RipleyElements : public ElementData
00045 {
00046 public:
00047 
00049     RipleyElements(const std::string& elementName, RipleyNodes_ptr nodes);
00050 
00052     RipleyElements(const RipleyElements& e);
00053 
00055     virtual ~RipleyElements() {}
00056 
00058     bool initFromRipley(const ripley::RipleyDomain* ripleyDomain, int fsType);
00059 
00062     void reorderGhostZones(int ownIndex);
00063 
00065     void removeGhostZones(int ownIndex);
00066 
00068     virtual void writeConnectivityVTK(std::ostream& os);
00069 
00075     bool writeToSilo(DBfile* dbfile, const std::string& siloPath,
00076                      const StringVec& labels, const StringVec& units,
00077                      bool writeMeshData);
00078 
00080     virtual StringVec getMeshNames() const;
00081 
00083     virtual StringVec getVarNames() const;
00084 
00086     virtual int getNumElements() const { return numElements; }
00087 
00089     virtual int getNodesPerElement() const { return nodesPerElement; }
00090 
00092     virtual int getGhostCount() const { return numGhostElements; }
00093 
00095     virtual ZoneType getType() const { return type; }
00096 
00098     virtual const IntVec& getNodeList() const { return nodes; }
00099 
00101     virtual const IntVec& getIDs() const { return ID; }
00102 
00106     virtual const IntVec& getVarDataByName(const std::string varName) const;
00107 
00109     virtual NodeData_ptr getNodes() const { return nodeMesh; }
00110 
00112     virtual ElementData_ptr getReducedElements() const { return ElementData_ptr(); }
00113  
00115     virtual const QuadMaskInfo& getQuadMask(int functionSpace) const { return quadMask; }
00116  
00120     virtual int getElementFactor() const { return 1; }
00121 
00122 private:
00123     RipleyElements() {}
00124     void buildMeshes();
00125     IntVec prepareGhostIndices(int ownIndex);
00126     void reorderArray(IntVec& v, const IntVec& idx, int elementsPerIndex);
00127 
00128     RipleyNodes_ptr nodeMesh;
00129     RipleyNodes_ptr originalMesh;
00130     std::string name;
00131     int numElements;
00132     int numGhostElements;
00133     int nodesPerElement;
00134     ZoneType type;
00135     IntVec nodes;
00136     IntVec ID, tag, owner;
00137     QuadMaskInfo quadMask; // dummy
00138 };
00139 
00140 } // namespace weipa
00141 
00142 #endif // __WEIPA_RIPLEYELEMENTS_H__
00143