GemaLuaCoreLib
The GeMA Lua Core library
Loading...
Searching...
No Matches
gmLuaMesh.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMALUA_MESH_H_
25#define _GEMALUA_MESH_H_
26
27#include "gmLuaObject.h"
28
29#include <gmElementMesh.h>
30#include <gmRegularGridMesh.h>
31
32
34class GML_API_EXPORT GmLuaMesh: public GmLuaObject
35{
36public:
37 GmLuaMesh(GmMesh* mesh, const GmLogCategory& logger);
38
39 virtual ~GmLuaMesh();
40
41 // See comments on the base class
42 virtual const char* typeName() const { return "mesh"; }
43
44 virtual QString toString() const;
45
46 virtual void fillMetatable(lua_State* L, int index);
47
49 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
50
52 GmMesh* mesh() const { return _mesh; }
53
54private:
55 int id (lua_State* L);
56 int hasCapability (lua_State* L);
57 int nodeCoordInfo (lua_State* L);
58 int nodeCoordAccessor (lua_State* L);
59 int numNodes (lua_State* L);
60 int numGhostNodes (lua_State* L);
61 int totalNumNodes (lua_State* L);
62 int nodeSets (lua_State* L);
63 int nodeValueIds (lua_State* L);
64 int nodeValueInfo (lua_State* L);
65 int nodeValueAccessor (lua_State* L);
66 int addNodeValueSet (lua_State* L);
67 int removeNodeValueSet (lua_State* L);
68 int clearNodeValueSets (lua_State* L);
69 int saveState (lua_State* L);
70 int saveNodeValueState (lua_State* L);
71 int numNodeValueStates (lua_State* L);
72 int nodeValueStateTag (lua_State* L);
73 int nodeValueStateTime (lua_State* L);
74 int setNodeValueStateTag (lua_State* L);
75 int setNodeValueStateTime (lua_State* L);
76 int addNodes (lua_State* L);
77 int addGhostNodes (lua_State* L);
78 int toLinearGhostIndex (lua_State* L);
79 int toLocalGhostIndex (lua_State* L);
80 int clear (lua_State* L);
81 int emitMeshChanged (lua_State* L);
82 int print (lua_State* L);
83 int printValues (lua_State* L);
84 int originalToLocalOrderNode(lua_State* L);
85 int localOrderToOriginalNode(lua_State* L);
86
87protected:
89};
90
92class GML_API_EXPORT GmLuaCellMesh: public GmLuaMesh
93{
94public:
95 GmLuaCellMesh(GmCellMesh* mesh, const GmLogCategory& logger);
96
97 // See comments on the base class
98 virtual const char* typeName() const { return "cellMesh"; }
99
100 virtual void fillMetatable(lua_State* L, int index);
101
103 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
104
105private:
106 int numCells (lua_State* L);
107 int numActiveCells (lua_State* L);
108 int cell (lua_State* L);
109 int hasElementsWithoutTopology(lua_State* L);
110 int hasSolidElements (lua_State* L);
111 int adjacentCell (lua_State* L);
112 int nodeAdjacentNodes (lua_State* L);
113 int nodeAdjacentCells (lua_State* L);
114 int edgeAdjacentCells (lua_State* L);
115 int edgeAdjacentCellsFromNodes(lua_State* L);
116 int isBorderNode (lua_State* L);
117 int numBorders (lua_State* L);
118 int borderIndex (lua_State* L);
119 int firstBorderCurveEdge (lua_State* L);
120 int nextBorderCurveEdge (lua_State* L);
121 int borderTraverseStart (lua_State* L);
122 int borderTraverseNext (lua_State* L);
123 int borderTraverseEnd (lua_State* L);
124 int clearTopology (lua_State* L);
125 int numCellTypes (lua_State* L);
126 int numActiveCellTypes (lua_State* L);
127 int maxNumCellNodes (lua_State* L);
128 int maxNumCellGhostNodes (lua_State* L);
129 int maxTotalNumCellNodes (lua_State* L);
130 int isValid (lua_State* L);
131 int edgeMinLength (lua_State* L);
132 int edgeMaxLength (lua_State* L);
133 int cellBboxMinLength (lua_State* L);
134 int cellBboxMaxLength (lua_State* L);
135 int clearCellStatistics (lua_State* L);
136 int printQualityHistogram (lua_State* L);
137 int cellGroupIds (lua_State* L);
138 int cellGroupIndex (lua_State* L);
139 int numCellsInGroup (lua_State* L);
140 int cellInGroup (lua_State* L);
141 int cellBoundaryGroups (lua_State* L);
142 int numPropertySets (lua_State* L);
143 int propertySets (lua_State* L);
144 int propertySetIndex (lua_State* L);
145 int cellPropertyInfo (lua_State* L);
146 int cellPropertyAccessor (lua_State* L);
147 int cellValueIds (lua_State* L);
148 int cellValueInfo (lua_State* L);
149 int cellValueAccessor (lua_State* L);
150 int addCellValueSet (lua_State* L);
151 int removeCellValueSet (lua_State* L);
152 int clearCellValueSets (lua_State* L);
153 int saveCellValueState (lua_State* L);
154 int numCellValueStates (lua_State* L);
155 int cellValueStateTag (lua_State* L);
156 int cellValueStateTime (lua_State* L);
157 int setCellValueStateTag (lua_State* L);
158 int setCellValueStateTime (lua_State* L);
159 int addCells (lua_State* L);
160 int addCellGroup (lua_State* L);
161 int addCellsToGroup (lua_State* L);
162 int originalToLocalOrderCell (lua_State* L);
163 int localOrderToOriginalCell (lua_State* L);
164 int addColoringAsMeshAttribute(lua_State* L);
165 int printColoringStatistics (lua_State* L);
166 int addPartitionInfoAsMeshAttributes (lua_State* L);
167 int addDebugPartitionInfoAsMeshAttributes(lua_State* L);
168 int printPartitionRankTemplateData (lua_State* L);
169 int printPartitionClassStatistics (lua_State* L);
170
171
172 const GmCellMeshTopology* ensureTopologySupport(lua_State* L, const char* fname);
173 int pushCellList (lua_State* L, const QVector<GmCell*>& cellList);
174 GmCell* getCellFromObjectOrIndex(lua_State* L, int pos, const char* fname);
175};
176
177
179class GML_API_EXPORT GmLuaElementMesh: public GmLuaCellMesh
180{
181public:
182 GmLuaElementMesh(GmElementMesh* mesh, const GmLogCategory& logger);
183
184 // See comments on the base class
185 virtual const char* typeName() const { return "elementMesh"; }
186
187 virtual void fillMetatable(lua_State* L, int index);
188
190 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
191
192private:
193 int elementIntegrationRule (lua_State* L);
194 int borderIntegrationRule (lua_State* L);
195 int faceIntegrationRule (lua_State* L);
196 int edgeIntegrationRule (lua_State* L);
197 int numIntegrationRuleSets (lua_State* L);
198 int gaussAttributeIds (lua_State* L);
199 int gaussAttributeInfo (lua_State* L);
200 int gaussAttributeAccessor (lua_State* L);
201 int addGaussAttributeSet (lua_State* L);
202 int removeGaussAttributeSet (lua_State* L);
203 int clearGaussAttributeSets (lua_State* L);
204 int saveGaussAttributeState (lua_State* L);
205 int numGaussAttributeStates (lua_State* L);
206 int gaussAttributeStateTag (lua_State* L);
207 int gaussAttributeStateTime (lua_State* L);
208 int setGaussAttributeStateTag (lua_State* L);
209 int setGaussAttributeStateTime(lua_State* L);
210 int hPOrder (lua_State* L);
211 int hQOrder (lua_State* L);
212};
213
215class GML_API_EXPORT GmLuaRegularGridMesh : public GmLuaMesh
216{
217public:
219
220 // See comments on the base class
221 virtual const char* typeName() const { return "regularGridMesh"; }
222
223 virtual void fillMetatable(lua_State* L, int index);
224
226 virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
227
228private:
229 int nodeSpacing (lua_State* L);
230 int nodeCount (lua_State* L);
231 int nodeWrap (lua_State* L);
232 int nodeFromIndex(lua_State* L);
233 int indexFromNode(lua_State* L);
234 int neighbor (lua_State* L);
235};
236
237
238#endif
A proxy class to export GmCellMesh methods to the Lua environment.
Definition gmLuaMesh.h:93
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaMesh.h:103
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaMesh.h:98
A proxy class to export GmElementMesh methods to the Lua environment.
Definition gmLuaMesh.h:180
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaMesh.h:185
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaMesh.h:190
A proxy class to export GmMesh methods to the Lua environment.
Definition gmLuaMesh.h:35
GmMesh * _mesh
The mesh 'wrapped' by this proxy object.
Definition gmLuaMesh.h:88
GmMesh * mesh() const
Returns the wrapped mesh.
Definition gmLuaMesh.h:52
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaMesh.h:49
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaMesh.h:42
A proxy class to export object methods to the Lua environment.
Definition gmLuaObject.h:36
virtual QString toString() const
Default method used by the __tostring metamethod to capture the result of tostring() over an object.
Definition gmLuaObject.h:55
virtual void fillMetatable(lua_State *L, int index)=0
Function called by populateMetatable() to fill the metatable with exported methods by derived classes...
A proxy class to export GmRegularGridMesh methods to the Lua environment.
Definition gmLuaMesh.h:216
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaMesh object.
Definition gmLuaMesh.h:226
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaMesh.h:221
Declaration of the GmLuaObject class.