/[escript]/branches/split/weipa/src/ElementData.h
ViewVC logotype

Contents of /branches/split/weipa/src/ElementData.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4724 - (show annotations)
Thu Mar 6 05:22:12 2014 UTC (5 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3214 byte(s)
Work towards parallel domains

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
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 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #ifndef __WEIPA_ELEMENTDATA_H__
18 #define __WEIPA_ELEMENTDATA_H__
19
20 #include <weipa/weipa.h>
21 #include <weipa/vtkCellType.h>
22 #include <ostream>
23
24 namespace weipa {
25
26 typedef enum {
27 ZONETYPE_UNKNOWN=0,
28 ZONETYPE_BEAM=VTK_LINE,
29 ZONETYPE_HEX=VTK_HEXAHEDRON,
30 ZONETYPE_POLYGON=VTK_POLYGON,
31 ZONETYPE_QUAD=VTK_QUAD,
32 ZONETYPE_TET=VTK_TETRA,
33 ZONETYPE_TRIANGLE=VTK_TRIANGLE
34 } ZoneType;
35
36 /// \brief This struct holds a mask (0's and 1's) that indicates which quad
37 /// nodes contribute to a sub-element when full element order is used.
38 /// factor[i] contains the number of non-zeroes in mask[i].
39 struct QuadMaskInfo {
40 std::vector<IntVec> mask;
41 IntVec factor;
42 };
43
44 /// \brief Stores and manipulates one type of domain elements.
45 ///
46 /// \note The corresponding mesh nodes are not part of this class but are
47 /// stored in a NodeData instance.
48 class ElementData
49 {
50 public:
51 /// \brief Writes connectivity data to a stream in VTK text format.
52 virtual void writeConnectivityVTK(std::ostream& os) = 0;
53
54 /// \brief Returns the names of the meshes associated with the elements.
55 virtual StringVec getMeshNames() const = 0;
56
57 /// \brief Returns a vector with the mesh variable names.
58 virtual StringVec getVarNames() const = 0;
59
60 /// \brief Returns the number of elements.
61 virtual int getNumElements() const = 0;
62
63 /// \brief Returns the number of nodes per element.
64 virtual int getNodesPerElement() const = 0;
65
66 /// \brief Returns the number of "ghost" elements.
67 virtual int getGhostCount() const = 0;
68
69 /// \brief Returns the element type.
70 virtual ZoneType getType() const = 0;
71
72 /// \brief Returns a vector of the node IDs used by the elements.
73 virtual const IntVec& getNodeList() const = 0;
74
75 /// \brief Returns a vector of element IDs.
76 virtual const IntVec& getIDs() const = 0;
77
78 /// \brief Returns the NodeData instance used by the elements.
79 virtual NodeData_ptr getNodes() const = 0;
80
81 /// \brief Returns the reduced elements if available.
82 virtual ElementData_ptr getReducedElements() const = 0;
83
84 /// \brief Returns a QuadMaskInfo structure for given functionspace code.
85 virtual const QuadMaskInfo& getQuadMask(int fsCode) const = 0;
86
87 /// \brief If the original element type is not supported they are
88 /// subdivided into N smaller elements (e.g. one Rec9 -> four Rec4)
89 /// and this method returns the multiplication factor N.
90 virtual int getElementFactor() const = 0;
91
92 protected:
93 virtual ~ElementData() {}
94 };
95
96 } // namespace weipa
97
98 #endif // __WEIPA_ELEMENTDATA_H__
99

  ViewVC Help
Powered by ViewVC 1.1.26