GeomProcess
The GeMA Geometry Process Plugin
Loading...
Searching...
No Matches
GmpGeomProcess Class Reference

Basic class for the Geometry Utils process plugin object. More...

#include <gmpGeomProcess.h>

Inheritance diagram for GmpGeomProcess:
Collaboration diagram for GmpGeomProcess:

Public Member Functions

 GmpGeomProcess (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. Will be called by the plugin loading code.
 
virtual ~GmpGeomProcess ()
 Destructor.
 
virtual const char * pluginName () const
 
virtual const char * pluginType () const
 
virtual void loadFunctions (LuaTable &table)
 
virtual QStringList functionList () const
 
- Public Member Functions inherited from GmProcess
 GmProcess (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
virtual const char * pluginCategory () const
 
virtual bool loadPrivateData (LuaTable &table)
 
virtual void printParameters (const GmLogCategory &logger)
 
int createProgressStatsItem (GmRunProgressStats *ps, const char *name)
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
QString id () const
 
QString description () const
 
QString pluginTypeName () const
 

Private Member Functions

GmProcessMethodRedirector< GmpGeomProcess >::MethodRegistry * processMethodTable () const
 Returns the table storing the process exported function names / methods.
 
int getConvexHull (lua_State *L)
 The geom.getConvexHull() process implementation.
 
int pointInConvexPolygon (lua_State *L)
 The geom.pointInConvexPolygon() process implementation.
 
int delaunayTriangulation (lua_State *L)
 The geom.delaunayTriangulation() process implementation.
 
int isMeshValid (lua_State *L)
 The geom.isMeshValid process implementation.
 
int isMeshQualityGT (lua_State *L)
 The geom.isMeshQualityGT process implementation.
 
int meshQualityHistogram (lua_State *L)
 The geom.MeshQualityHistogram process implementation.
 
int extractMeshFromMeshBorders (lua_State *L)
 Creates a new mesh with cells extracted from a src mesh border and filtered by an optional user filter. If the mesh is a solid mesh, the new mesh will be a surface composed of a set of 3d quads and/or triangles. If it is a surface mesh, the new mesh will be a set of bar elements.
 
int extractMeshFromMeshBoundary (lua_State *L)
 Creates a new mesh with cells extracted from the given boundary group. If the group is an edge group, the new mesh will be a set of bar elements. If it is a face group, the new mesh will be a set of 3d quads and/or triangles.
 
int extractProjectedMeshFromMesh (lua_State *L)
 Creates a new mesh that projects the given src mesh cells on the XY plane. The src mesh should be composed of Quad3D and Tri3D elements. There is a one to one correspondence between the src mesh and the destination mesh elements. The element with id 'i' in the serc mesh is equivalent to the element 'i' on the new mesh.
 
int releaseExtractedMesh (lua_State *L)
 Releases the extracted mesh object received as parameter. The given mesh should be a mesh returned by one of the extract calls, it mustn't have been registered in any other object (another process object, for example) and any remaining Lua references to it MUST not be used again. As seen by the restrictions this is an inherently UNSAFE function, provided so that test code can create and destroy meshes as a way to handle the 8 mesh limit. Use with CARE.
 
int burialDepth (lua_State *L)
 Given a 3d point coordinate, returns its burial depth by finding the point projection on the sea floor surface mesh and returning the depth difference. If the xy coordinate is outside the sea floor mesh domain, returns nil. Once the cell of the sea floor mesh that contains the query point is located (by using the spatial index), the depth is calculated from the average of the cell's node depths (it could also be calculated from the shape function, but that would imply doing a cartesian to natural conversion, a costly function that seems unnecessary for this simple burial calculation). Parameters are: the sea floor 3d surface mesh object, an accessor for the mesh coordinates, the spatial index object for the projected 2d sea floor surface mesh and the query point (either a vector or a Lua table) using the same unit as the given accessor.
 
int createSimpleMesh (lua_State *L)
 Creates a new mesh with nodes and cells provided by the given Lua tables.
 
int fillEmptyMesh (lua_State *L)
 Fills an EMPTY mesh with nodes and cells provided by the given Lua tables.
 
int createEmptyDiscSet (lua_State *L)
 Creates a new empty discontinuitySet.
 
void parseExtractParameters (int start, LuaEnv *env, const char *fname, QString &newMeshName, QVariantMap &attributes, QString &plugin, bool &addToModel, bool *projected, bool *saveSrc, LuaFunction *filter, int *borderCellOrIndex, int *borderSide) const
 Parses and validates the mesh name and option parameters from the calls to the extract functions. It will always parse the mesh name, the attributes, pluginType and addToModel options, filling them with the default if not given by the user. The other options, projected, saveSrc, etc, will be parsed and validated when the parameter is not a NULL pointer. Notice that borderCellOrIndex and borderSide are not checked to see if the ids
are valid since the src mesh is unknown on this function. They are also kept as "1-based" values. On errors, raises a LuaError and does not returns.
 
bool parseExtractIndexParameters (LuaEnv *env, const char *fname, QString newMeshName, QString &newIndexName, QVariantMap &attributes, QString &plugin) const
 Parses and validates option parameters related to spatial index creation from the calls to the extract functions. On errors, raises a LuaError and does not returns. Returns true if the user asked for spatial index creation, false otherwise.
 

Additional Inherited Members

- Protected Member Functions inherited from GmProcess
void registerFunctions (LuaTable &table, typename GmProcessMethodRedirector< T >::MethodRegistry *methods, bool noProgressStats=false)
 
QStringList buildFunctionList (typename GmProcessMethodRedirector< T >::MethodRegistry *methods) const
 
- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 
GmSimulationDatasimulationData () const
 

Detailed Description

Basic class for the Geometry Utils process plugin object.

Member Function Documentation

◆ createSimpleMesh()

int GmpGeomProcess::createSimpleMesh ( lua_State * L)
private

Creates a new mesh with nodes and cells provided by the given Lua tables.

Parameters: 1) The node list (a table with sub tables storing node coordinates); 2) A string with cell types. Can be nil or empty if the mesh is either heterogeneous or a node mesh - in the later case, the pluginType must be set on the options parameter below; 3) A table with cell incidence lists or nil for node meshes. Each table entry should be a subtable with node incidences (1-based). If the mesh is heterogeneous, the first entry of the incidence list should be a string with the cell type; 4) The new mesh name; 5) An options table with the following optional fields:

  • attributes: A table with additional attributes to pass to the mesh creation
  • pluginType: The name of the plugin used for mesh creation. Default = "GemaMesh.elem"
  • addToModel: Should we add the new mesh to the model? Default = true. Also applied to the spatial index when createIndex is true.

◆ extractMeshFromMeshBorders()

int GmpGeomProcess::extractMeshFromMeshBorders ( lua_State * L)
private

Creates a new mesh with cells extracted from a src mesh border and filtered by an optional user filter. If the mesh is a solid mesh, the new mesh will be a surface composed of a set of 3d quads and/or triangles. If it is a surface mesh, the new mesh will be a set of bar elements.

Parameters: The src cell mesh (either id or object), the new mesh name and an options table with the following optional fields:

  • filter: An optional user function for side filtering following the specifications given by GmLuaIteratorFilter.
  • border: Either an optional table with a (cell, side) pair defining the border that will be used for extraction or a borer index itself. Other borders will be ignored. If not given, all borders are considered.
  • attributes: A table with additional attributes to pass to the mesh creation
  • pluginType: The name of the plugin used for mesh creation. Default = "GemaMesh.elem"
  • addToModel: Should we add the new mesh to the model? Default = true. Also applied to the spatial index when createIndex is true.
  • projected: If true, the mesh elements will be projected on the XY plane. Default = false.
  • saveSrc: If true, the new mesh will have attributes srcCellId and srcSide, linking new mesh elements with the original border sides. Values are Lua based (1-based).
  • createIndex: If projected is true and createIndex is true, also returns a new spatial index for the created mesh.
  • indexPluginType: The plugin type used when createIndex is true. Default is "MmProcess.cell"
  • indexAttributes: A table with additional attributes to pass to the spatial index creation
  • indexName: The index name. Default is equal to the mesh name + "_sindex"

◆ extractMeshFromMeshBoundary()

int GmpGeomProcess::extractMeshFromMeshBoundary ( lua_State * L)
private

Creates a new mesh with cells extracted from the given boundary group. If the group is an edge group, the new mesh will be a set of bar elements. If it is a face group, the new mesh will be a set of 3d quads and/or triangles.

Parameters: The cell boundary group object, the new mesh name and an options table with the following optional fields:

  • attributes: A table with additional attributes to pass to the mesh creation
  • pluginType: The name of the plugin used for mesh creation. Default = "GemaMesh.elem"
  • addToModel: Should we add the new mesh to the model? Default = true. Also applied to the spatial index when createIndex is true.
  • projected: If true, the mesh elements will be projected on the XY plane. Default = false.
  • saveSrc: If true, the new mesh will have attributes srcCellId and srcSide, linking new mesh elements with the original border sides. Values are Lua based (1-based).
  • createIndex: If projected is true and createIndex is true, also returns a new spatial index for the created mesh.
  • indexPluginType: The plugin type used when createIndex is true. Default is "MmProcess.cell"
  • indexAttributes: A table with additional attributes to pass to the spatial index creation.
  • indexName: The index name. Default is equal to the mesh name + "_sindex"

◆ extractProjectedMeshFromMesh()

int GmpGeomProcess::extractProjectedMeshFromMesh ( lua_State * L)
private

Creates a new mesh that projects the given src mesh cells on the XY plane. The src mesh should be composed of Quad3D and Tri3D elements. There is a one to one correspondence between the src mesh and the destination mesh elements. The element with id 'i' in the serc mesh is equivalent to the element 'i' on the new mesh.

Parameters: The src cell mesh (either id or object), the new mesh name and an options table with the following optional fields:

  • attributes: A table with additional attributes to pass to the mesh creation
  • pluginType: The name of the plugin used for mesh creation. Default = "GemaMesh.elem"
  • addToModel: Should we add the new mesh to the model? Default = true. Also applied to the spatial index when createIndex is true.
  • createIndex: If true, also returns a new spatial index for the created mesh.
  • indexPluginType: The plugin type used when createIndex is true. Default is "MmProcess.cell"
  • indexAttributes: A table with additional attributes to pass to the spatial index creation.
  • indexName: The index name. Default is equal to the mesh name + "_sindex"

◆ fillEmptyMesh()

int GmpGeomProcess::fillEmptyMesh ( lua_State * L)
private

Fills an EMPTY mesh with nodes and cells provided by the given Lua tables.

Parameters: 1) Either the mesh name or object 2) The node list (a table with sub tables storing node coordinates); 3) A string with cell types. Can be nil or empty if the mesh is either heterogeneous or a node mesh; 4) A table with cell incidence lists or nil for node meshes. Each table entry should be a subtable with node incidences (1-based). If the mesh is heterogeneous, the first entry of the incidence list should be a string with the cell type; If the mesh is tied to property sets, the incidence indices should be followed by the property set indices, in the correct property sets mesh order.

◆ functionList()

virtual QStringList GmpGeomProcess::functionList ( ) const
inlinevirtual

Implements GmProcess.

◆ loadFunctions()

virtual void GmpGeomProcess::loadFunctions ( LuaTable & table)
inlinevirtual

Implements GmProcess.

◆ parseExtractParameters()

void GmpGeomProcess::parseExtractParameters ( int start,
LuaEnv * env,
const char * fname,
QString & newMeshName,
QVariantMap & attributes,
QString & plugin,
bool & addToModel,
bool * projected,
bool * saveSrc,
LuaFunction * filter,
int * borderCellOrIndex,
int * borderSide ) const
private

Parses and validates the mesh name and option parameters from the calls to the extract functions. It will always parse the mesh name, the attributes, pluginType and addToModel options, filling them with the default if not given by the user. The other options, projected, saveSrc, etc, will be parsed and validated when the parameter is not a NULL pointer. Notice that borderCellOrIndex and borderSide are not checked to see if the ids
are valid since the src mesh is unknown on this function. They are also kept as "1-based" values. On errors, raises a LuaError and does not returns.

Obs: We get a LuaEnv and not a lua_State as parameter since the loaded filter object must point to an environment that exists through all the filter object's life cycle.

◆ pluginName()

virtual const char * GmpGeomProcess::pluginName ( ) const
inlinevirtual

Implements GmPluginObject.

◆ pluginType()

virtual const char * GmpGeomProcess::pluginType ( ) const
inlinevirtual

Implements GmPluginObject.


The documentation for this class was generated from the following files: