escript  Revision_
ElementData.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
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-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 #ifndef __WEIPA_ELEMENTDATA_H__
19 #define __WEIPA_ELEMENTDATA_H__
20 
21 #include <weipa/weipa.h>
22 #include <weipa/vtkCellType.h>
23 #include <ostream>
24 
25 namespace weipa {
26 
27 typedef enum {
35 } ZoneType;
36 
40 struct QuadMaskInfo {
41  std::vector<IntVec> mask;
42  IntVec factor;
43 };
44 
49 class ElementData
50 {
51 public:
53  virtual void writeConnectivityVTK(std::ostream& os) = 0;
54 
56  virtual StringVec getMeshNames() const = 0;
57 
59  virtual StringVec getVarNames() const = 0;
60 
62  virtual int getNumElements() const = 0;
63 
65  virtual int getNodesPerElement() const = 0;
66 
68  virtual int getGhostCount() const = 0;
69 
71  virtual ZoneType getType() const = 0;
72 
74  virtual const IntVec& getNodeList() const = 0;
75 
77  virtual const IntVec& getIDs() const = 0;
78 
80  virtual NodeData_ptr getNodes() const = 0;
81 
83  virtual ElementData_ptr getReducedElements() const = 0;
84 
86  virtual const QuadMaskInfo& getQuadMask(int fsCode) const = 0;
87 
91  virtual int getElementFactor() const = 0;
92 
93 protected:
94  virtual ~ElementData() {}
95 };
96 
97 } // namespace weipa
98 
99 #endif // __WEIPA_ELEMENTDATA_H__
100 
weipa::ElementData::getType
virtual ZoneType getType() const =0
Returns the element type.
weipa::ElementData::getVarNames
virtual StringVec getVarNames() const =0
Returns a vector with the mesh variable names.
weipa::ElementData::getNumElements
virtual int getNumElements() const =0
Returns the number of elements.
VTK_TRIANGLE
#define VTK_TRIANGLE
Definition: vtkCellType.h:41
weipa::ZONETYPE_HEX
Definition: ElementData.h:55
weipa::ElementData::getMeshNames
virtual StringVec getMeshNames() const =0
Returns the names of the meshes associated with the elements.
weipa::QuadMaskInfo::mask
std::vector< IntVec > mask
Definition: ElementData.h:53
weipa::ElementData::getNodesPerElement
virtual int getNodesPerElement() const =0
Returns the number of nodes per element.
weipa::ElementData::getIDs
virtual const IntVec & getIDs() const =0
Returns a vector of element IDs.
weipa::ZONETYPE_TRIANGLE
Definition: ElementData.h:59
weipa::QuadMaskInfo
This struct holds a mask (0's and 1's) that indicates which quad nodes contribute to a sub-element wh...
Definition: ElementData.h:52
weipa::ElementData::writeConnectivityVTK
virtual void writeConnectivityVTK(std::ostream &os)=0
Writes connectivity data to a stream in VTK text format.
weipa::ZONETYPE_UNKNOWN
Definition: ElementData.h:53
weipa
Definition: DataVar.cpp:50
weipa::ZoneType
ZoneType
Definition: ElementData.h:39
weipa::ElementData::getNodeList
virtual const IntVec & getNodeList() const =0
Returns a vector of the node IDs used by the elements.
weipa::QuadMaskInfo::factor
IntVec factor
Definition: ElementData.h:54
weipa::ElementData::getElementFactor
virtual int getElementFactor() const =0
If the original element type is not supported they are subdivided into N smaller elements (e....
weipa::ElementData::~ElementData
virtual ~ElementData()
Definition: ElementData.h:106
weipa::ElementData::getNodes
virtual NodeData_ptr getNodes() const =0
Returns the NodeData instance used by the elements.
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:66
weipa::ElementData::getGhostCount
virtual int getGhostCount() const =0
Returns the number of "ghost" elements.
weipa::ElementData::getQuadMask
virtual const QuadMaskInfo & getQuadMask(int fsCode) const =0
Returns a QuadMaskInfo structure for given functionspace code.
weipa::ZONETYPE_QUAD
Definition: ElementData.h:57
VTK_POLYGON
#define VTK_POLYGON
Definition: vtkCellType.h:43
VTK_TETRA
#define VTK_TETRA
Definition: vtkCellType.h:46
weipa::NodeData_ptr
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:68
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:60
VTK_LINE
#define VTK_LINE
Definition: vtkCellType.h:39
VTK_QUAD
#define VTK_QUAD
Definition: vtkCellType.h:45
weipa::ZONETYPE_TET
Definition: ElementData.h:58
weipa::ZONETYPE_POLYGON
Definition: ElementData.h:56
VTK_HEXAHEDRON
#define VTK_HEXAHEDRON
Definition: vtkCellType.h:48
weipa::ElementData::getReducedElements
virtual ElementData_ptr getReducedElements() const =0
Returns the reduced elements if available.
weipa::IntVec
std::vector< int > IntVec
Definition: weipa.h:59
weipa::ZONETYPE_BEAM
Definition: ElementData.h:54