/[escript]/trunk/weipa/src/ElementData.h
ViewVC logotype

Contents of /trunk/weipa/src/ElementData.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3143 - (show annotations)
Fri Sep 3 00:31:55 2010 UTC (8 years, 10 months ago) by caltinay
File MIME type: text/plain
File size: 3028 byte(s)
-Moved finley specifics into weipa subclasses
-EscriptDataset is now the only weipa class exported in Windows
-Some weipa code cleanup


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

  ViewVC Help
Powered by ViewVC 1.1.26