![]() |
GeMA
The GeMA main application
|
Most used:
mesh:
numCells()
mesh:
cell()
mesh:
cellAttributeAccessor()
mesh:
cellPropertyAccessor()
Index:
mesh:
numCells()
mesh:
numActiveCells()
mesh:
cell()
mesh:
numCellTypes()
mesh:
numActiveCellTypes()
mesh:
maxNumCellNodes()
mesh:
maxNumCellGhostNodes()
mesh:
maxTotalNumCellNodes()
mesh:
addCells()
mesh:
adjacentCell()
mesh:
nodeAdjacentNodes()
mesh:
nodeAdjacentCells()
mesh:
edgeAdjacentCells()
mesh:
isBorderNode()
mesh:
clearTopology()
mesh:
cellAttributeIds()
mesh:
cellAttributeInfo()
mesh:
cellAttributeAccessor()
mesh:
addCellAttributeSet()
mesh:
removeCellAttributeSet()
mesh:
clearCellAttributeSets()
mesh:
cellPropertyInfo()
mesh:
cellPropertyAccessor()
mesh:
numPropertySets()
mesh:
propertySets()
mesh:
propertySetIndex()
mesh:
isValid()
mesh:
edgeMinLength()
mesh:
edgeMaxLength()
mesh:
cellBboxMinLength()
mesh:
cellBboxMaxLength()
mesh:
clearCellStatistics()
mesh:
printQualityHistogram()
mesh:
cellGroupIds()
mesh:
cellGroupIndex()
mesh:
numCellsInGroup()
mesh:
cellInGroup()
mesh:
addCellGroup()
mesh:
addCellsToGroup()
mesh:
cellBoundaryGroups()
mesh:
saveCellAttributeState()
mesh:
numCellAttributeStates()
mesh:
cellAttributeStateTag()
mesh:
cellAttributeStateTime()
mesh:
setCellAttributeStateTag()
mesh:
setCellAttributeStateTime()
mesh:numCells() | |
---|---|
Description: | Returns the number of cells in this mesh (elements for an element mesh). |
Parameters: | None. |
Returns: | Returns the number of cells in the mesh. |
Example:
mesh:numActiveCells() | |
---|---|
Description: | Returns the number of active cells in this mesh. Inactive cells do not take part in analysis processes. A cell can be marked as active or inactive by calling the cell: setActive() method over a cell object returned by mesh: cell() . |
Parameters: | None. |
Returns: | Returns the number of active cells in the mesh. |
Example:
mesh:cell(index) | |
---|---|
Description: | Returns a cell object given its id in the mesh. |
Parameters: | index - The cell id number (an index between 1 and mesh: numCells() ). |
Returns: | Returns the cell object. |
Example:
mesh:numCellTypes() | |
---|---|
Description: | Returns a table specifying the number of cells in the mesh for each cell type. |
Parameters: | None. |
Returns: | Returns a table indexed by cell type name (see Element types), with the number of cells in the mesh for each type. Entries for cell types that are not present in the mesh are not filled (value equals nil ). |
Example:
mesh:numActiveCellTypes() | |
---|---|
Description: | Returns a table specifying the number of active cells in the mesh for each cell type. |
Parameters: | None. |
Returns: | Returns a table indexed by cell type name (see Element types), with the number of active cells in the mesh for each type. Entries for cell types that do not have active cells in the mesh are not filled (value equals nil ). |
Example:
mesh:maxNumCellNodes() | |
---|---|
Description: | Returns the maximum number of nodes in a mesh cell (equivalent to calculating the maximum of the number of nodes of each type that has a non nil entry in the table returned by mesh: numCellTypes() ). |
Parameters: | None. |
Returns: | Returns the maximum number of nodes among types present in the mesh. |
Example:
mesh:maxNumCellGhostNodes() | |
---|---|
Description: | Returns the maximum number of ghost nodes in a mesh cell. Depending on the mesh implementation, this number might be an upper limit, meaning that no cell has more than the returned number of ghost nodes, but without implying that there is a cell with that number. |
Parameters: | None. |
Returns: | Returns the maximum number of ghost nodes among cells present in the mesh. |
Example:
mesh:maxTotalNumCellNodes() | |
---|---|
Description: | Returns the maximum number of regular + ghost nodes in a mesh cell. Depending on the mesh implementation, this number might be an upper limit, meaning that no cell has more than the returned number of nodes, but without implying that there is a cell with that number. |
Parameters: | None. |
Returns: | Returns the maximum number of regular + ghost nodes among cells present in the mesh. |
Example:
mesh:addCells(numCells) | |
---|---|
Description: | Adds the specified number of cells to the mesh, whithout initializing their nodes or properties. After calling this function, make sure to initialize cell node lists and properties by calling cell: setNodes() and cell: setProperties() for each added cell. Attribute values for the new cells are initialized with their respective default values. IMPORTANT: When adding cells to the mesh, if at all possible, avoid calling this function several times in a sequence. Calling it once with the total number of cells is much more efficent than calling it repeatedlly with just a few cells. If cells are added during the simulation loop, please remember to call mesh: emitMeshChanged() . This function can only be called if mesh: hasCapability("addCells") returns true. |
Parameters: | numCells - A table defining the number of cells to add, grouped by cell type. The given table should be keyed by the cell type name (see Element types) and have as values the number of added cells for each type. Notice that cells are added to the mesh in the order defined by the GmCellType enumeration, i.e., if the numCells list defines that we want 10 new "quad4" elements and 20 new "tri3" elements, all the "quad4" elements will be added before the "tri3" elements since "quad4" appears before "tri3" in that enumeration. For a finer control of the cell creation order, consider calling this function multiple times, each one with a single type entry in the numCells table. |
Returns: | Returns the index of the first new included cell. |
Example:
mesh:adjacentCell(cellIndex, edgeSide) mesh:adjacentCell(cell, edgeSide) | ||
---|---|---|
Description: | Given a cell (defined either by its index or by a cell object) and a cell side index (edge index for surface elements or face index for solid elements, undefined for line elements), returns the adjacent cell by that side or nil if that side is at the mesh border. Also returns the index of the neighbor side in the adjacent cell. IMPORTANT: This function should only be called if mesh: hasCapability("topology") returns true. | |
Parameters: | cellIndex | The cell id number (an index between 1 and mesh: numCells() ). |
cell | The cell object. | |
sideIndex | The index of the side whose adjacent neighbor will be queried. It should be an edge local index (a value between 1 and geometry: numEdges() ) for surface elements and a face local index (a value between 1 and geometry: numFaces() ) for solid elements. See the Element types page for the edge and face organization for each cell type. | |
Returns: | Returns the adjacent cell object or nil if the edge or face is on the mesh border. If there is an adjacent side, also returns the index of the neighbor side at the adjacent cell. |
Example:
mesh:nodeAdjacentNodes(nodeIndex, options) | ||
---|---|---|
Description: | Returns a list with the set of nodes that are adjacent to the given node. Nodes are considered adjacent if they are connected by an edge. Each list entry is a node index (a value between 1 and mesh: numNodes() ). IMPORTANT: This function should only be called if mesh: hasCapability("topology") returns true. | |
Parameters: | nodeIndex | The node index (a value from 1 to mesh: numNodes() - the given node can not be a ghost node). |
options | An optional string parameter defining the behaviour of the function when applied over a node from a quadratic element. If equal to "star" (the default if the parameter is ommited) and nodeIndex is a cell vertex, the adjacent nodes will be other cell vertices, ignoring any quadratic nodes between them. If equal to "qstar" , the quadratic nodes on the edges leaving nodeIndex will be returned instead. If nodeIndex is itself a quadratic node in the middle of an edge, the edge endpoints will be returned independently of the selecetd option. For quadratic mid surface or mid volume nodes, an empty list will be returned. | |
Returns: | Returns a list (table) with the set of adjacent nodes. Will return an empty list if the node does not belong to any element or if it belongs only to a bar on a surface mesh, or to a bar or surface element on a solid mesh. |
Example:
mesh:nodeAdjacentCells(nodeIndex) | |
---|---|
Description: | Returns a list with the set of cells sharing the given node. Each list entry is a cell object. IMPORTANT: This function should only be called if mesh: hasCapability("topology") returns true. |
Parameters: | nodeIndex - The node index (a value from 1 to mesh: numNodes() - the given node can not be a ghost node). |
Returns: | Returns a list (table) with the set of cell objects including the given node on their definition. Will return an empty list if the node does not belong to any element or if it belongs only to a bar on a surface mesh, or to a bar or surface element on a solid mesh. |
Example:
mesh:edgeAdjacentCells(cellIndex, edgeIndex) mesh:edgeAdjacentCells(cell, edgeIndex) | ||
---|---|---|
Description: | Given a cell (defined either by its index or by a cell object) and a cell edge index, returns the list of cells including that edge. The original input cell is added to the list. For surface meshes, this is simmilar to calling mesh: adjacentCell() . IMPORTANT: This function should only be called if mesh: hasCapability("topology") returns true. | |
Parameters: | cellIndex | The cell id number (an index between 1 and mesh: numCells() ). |
cell | The cell object. | |
edgeIndex | The index of the edge whose adjacent cells will be queried. It should be an edge local index (a value between 1 and geometry: numEdges() ). See the Element types page for the edge organization for each cell type. | |
Returns: | Returns a list (table) filled with the set of adjacent cell objects. |
Example:
mesh:isBorderNode(nodeIndex) | |
---|---|
Description: | Returns true if this node belongs to any edge or face that does not have an adjacent cell. Returns false otherwise (this includes nodes that do not belong to any cell or belonging only to non manifold cells - bars or surface cells in a solid mesh). IMPORTANT: This function should only be called if mesh: hasCapability("topology") returns true. |
Parameters: | nodeIndex - The node index (a value from 1 to mesh: numNodes() - the given node can not be a ghost node). |
Returns: | Returns true or false defining whether the node is on the mesh border or not. |
Example:
mesh:clearTopology() | |
---|---|
Description: | If the mesh has an associated topology structure, gives a hint to the mesh that the topology information will not be needed anymore and can be removed, if at all possible. |
Parameters: | None. |
Returns: | None. |
Example:
mesh:cellAttributeIds() | |
---|---|
Description: | Returns a list with the name (id) of every cell attribute associated with the mesh. |
Parameters: | None. |
Returns: | Returns a table with cell attribute ids (strings). |
Example:
mesh:cellAttributeInfo(name) | |
---|---|
Description: | Returns an object with metadata information about the named mesh cell attribute. |
Parameters: | name - The cell attribute name (id). |
Returns: | Returns a value info object or nil if the requested name was not found in the mesh. |
Example:
mesh:cellAttributeAccessor(name, unit) mesh:cellAttributeAccessor(name, state, locked, unit) | ||
---|---|---|
Description: | Returns a Cell accessor object that can be used to retrieve and update data for cell attributes. Can be called with two different signatures. The first, receiving only the attribute name and an optional unit, always retrieves data from the current state and is the most used. The second, allows for defining the desired state from which data will be recovered / written. As a matter of fact, the first format is equivalent to calling the second one as mesh:cellAttributeAccessor(name, 0, true, unit) . | |
Parameters: | name | The name (id) of the cell attribute. |
state | An optional state number referencing the history state that the accessor will operate on. A value of zero means the most recent state, 1 the previous one, 2 the one before that and so on. Valid values range from zero to the oldest state for the requested variable, which can be queried with a call to mesh: numCellAttributeStates() . Remember that for a cell accessor to support states, the history parameter must be set on its value info object. | |
locked | The locked parameter controls the behaviour of the accessor once a new state is created for the value. The 'lock' refers to the state number, so if locked is false and a new state is created, the accessor doesn't change and continues to point to the same data. If locked is true, the accessor will be locked to that state number, so when a new state is created, the accessor changes the data its looking upon to reflect the new state. For example, an accessor locked on state 0 will always point to the current state, and one locked to state 1 will always point to the previous saved value. | |
unit | An optional string with the desired unit for returned values. If different from the data unit, the accessor will automatically convert values. | |
Returns: | A Cell accessor object or nil on errors (the requested name is unknown, or the requested unit is incompatible with the data unit, for example). |
Example:
mesh:addCellAttributeSet(valInfo) | |
---|---|
Description: | Creates a new value set for storing data for a new cell attribute and associates this new attribute with the mesh. |
Parameters: | valInfo - A new value info object created by a call to ValueInfo() , with valueKind equal to "cell attribute" . |
Returns: | Returns true on success, false on error. |
Example:
mesh:removeCellAttributeSet(name) | |
---|---|
Description: | Removes the named cell attribute from the mesh. Use carefully. |
Parameters: | name - The name (id) of the cell attribute. |
Returns: | Nothing. |
Example:
mesh:clearCellAttributeSets() | |
---|---|
Description: | Removes all cell attributes from the mesh. Use carefully. |
Parameters: | None. |
Returns: | Nothing. |
Example:
mesh:cellPropertyInfo(name) | |
---|---|
Description: | Returns an object with metadata information about the named cell property. |
Parameters: | name - The property name (id). |
Returns: | Returns a value info object or nil if the requested name was not found in the mesh. |
Example:
mesh:cellPropertyAccessor(name, unit) | ||
---|---|---|
Description: | Returns a Cell accessor object that can be used to retrieve data for cell properties. Unlike other accessor types, a property accessor always retrieves data from the current state. | |
Parameters: | name | The name (id) of the cell property. |
unit | An optional string with the desired unit for returned values. If different from the data unit, the accessor will automatically convert values. | |
Returns: | A Cell accessor object or nil on errors (the requested name is unknown, or the requested unit is incompatible with the data unit, for example). |
Example:
mesh:numPropertySets() | |
---|---|
Description: | Returns the number of property sets attached to this mesh. |
Parameters: | None. |
Returns: | Returns the number of property sets. |
Example:
mesh:propertySets() | |
---|---|
Description: | Returns a list with the property set objects attached to this mesh. |
Parameters: | None. |
Returns: | Returns a list of property set objects. |
Example:
mesh:propertySetIndex(name) | |
---|---|
Description: | Returns the index of the property set that includes the given property name. |
Parameters: | name - The property name. |
Returns: | Returns the index inside the list returned by mesh: propertySets() of the property set object that contains 'name' among its properties. Returns nil for unknown names. |
Example:
mesh:isValid() | |
---|---|
Description: | Checks the mesh cells validity. The mesh is considered valid if all of its cells are valid according to cell: isValid() . |
Parameters: | None. |
Returns: | Returns true if all the mesh cells are valid, false otherwise. |
Example:
mesh:edgeMinLength() | |
---|---|
Description: | Returns the minimum edge length for all edges in the mesh. The returned value is expressed in the mesh coordinates unit and might be an approximation for quadratic elements. The returned statistics are calculated on first usage (of any of the edge or bounding box min/max length functions) and are not updated automatically when cell nodes change or have their coordinates updated. Use mesh: clearCellStatistics() to force an update. |
Parameters: | None. |
Returns: | Returns the minimum mesh edge length. |
Example:
mesh:edgeMaxLength() | |
---|---|
Description: | Returns the maximum edge length for all edges in the mesh. The returned value is expressed in the mesh coordinates unit and might be an approximation for quadratic elements. The returned statistics are calculated on first usage (of any of the edge or bounding box min/max length functions) and are not updated automatically when cell nodes change or have their coordinates updated. Use mesh: clearCellStatistics() to force an update.i |
Parameters: | None. |
Returns: | Returns the maximum mesh edge length. |
Example:
mesh:cellBboxMinLength() | |
---|---|
Description: | Among all the cells in the mesh, returns the minimum length of a mesh cell bounding box diagonal. The returned value is expressed in the mesh coordinates unit. The returned statistics are calculated on first usage (of any of the edge or bounding box min/max length functions) and are not updated automatically when cell nodes change or have their coordinates updated. Use mesh: clearCellStatistics() to force an update. |
Parameters: | None. |
Returns: | Returns the minimum length of a mesh cell bounding box diagonal. |
Example:
mesh:cellBboxMaxLength() | |
---|---|
Description: | Among all the cells in the mesh, returns the maximum length of a mesh cell bounding box diagonal. The returned value is expressed in the mesh coordinates unit. The returned statistics are calculated on first usage (of any of the edge or bounding box min/max length functions) and are not updated automatically when cell nodes change or have their coordinates updated. Use mesh: clearCellStatistics() to force an update. |
Parameters: | None. |
Returns: | Returns the maximum length of a mesh cell bounding box diagonal. |
Example:
mesh:clearCellStatistics() | |
---|---|
Description: | Clears the internal statistics returned by the edge and bounding box min/max length functions. This function should be called after mesh geometry changes, if those statistics are being used. |
Parameters: | None. |
Returns: | Nothing. |
Example:
mesh:printQualityHistogram(activeOnly) | |
---|---|
Description: | Prints cells quality histogram. |
Parameters: | activeOnly - If true, only the active cells will be scanned, all of them otherwise. Default = true. |
Returns: | Nothing. |
Example:
mesh:cellGroupIds() | |
---|---|
Description: | Returns a list with the names of the configured mesh cell groups. |
Parameters: | None. |
Returns: | Returns a table with cell group names (can be empty). |
Example:
mesh:cellGroupIndex(name) | |
---|---|
Description: | Returns the index of the given group in the group names list returned by mesh: cellGroupIds() . |
Parameters: | name - The cell group name (id). |
Returns: | Returns the group index or nil if the given name does not correspond to any mesh cell group. |
Example:
mesh:numCellsInGroup(groupIndex) | |
---|---|
Description: | Given a group index, returns the number of cells in this group. |
Parameters: | groupIndex - The cell group index (a value between 1 and the number of entries in the list returned by mesh: cellGroupIds() ). |
Returns: | Returns the number of cells in the given group. |
Example:
mesh:cellInGroup(groupIndex, cellIndex) | ||
---|---|---|
Description: | Returns the cell object given its position inside a cell group. | |
Parameters: | groupIndex | The cell group index (a value between 1 and the number of entries in the list returned by mesh: cellGroupIds() ). |
cellIndex | The cell index inside the group (a value between 1 and mesh: numCellsInGroup() ). | |
Returns: | Returns the cell object. |
Example:
mesh:addCellGroup(groupName) | ||
---|---|---|
Description: | Adds a new (empty) cell group to the mesh. This function can only be called if mesh: hasCapability("editGroups") returns true. | |
Parameters: | groupName | The name of the cell group that will be added to the mesh. Must be a new group name. |
Returns: | Returns the added cell group index (its index in the list returned by mesh: cellGroupIds() ) or nil if the group could not be added. |
Example:
mesh:addCellsToGroup(groupIndex, cellIdList) mesh:addCellsToGroup(groupIndex, cellRangeList) | ||
---|---|---|
Description: | Adds a list of cells to the given cell group. Added cells can be given either as a table with cell ids or as a table with sub-tables containing id ranges. This function can only be called if mesh: hasCapability("editGroups") returns true. | |
Parameters: | groupIndex | The cell group index (a value between 1 and the number of entries in the list returned by mesh: cellGroupIds() ). |
cellIdList | A table with the cell ids for the cells to be added to the group. | |
cellRangeList | A table with cell id ranges for the cells to be added to the group. Each range is given as a sub-table storing the first and last cell indices in the range. | |
Returns: | Returns true on success, false if it was not possible to add cells to the group. |
Example:
mesh:cellBoundaryGroups() | |
---|---|
Description: | Returns a map storing the configured set of cell boundary objects. |
Parameters: | None. |
Returns: | Returns a table indexed by cell boundary group names, with each entry storing a reference to a cell boundary object. |
Example:
mesh:saveCellAttributeState(name, mode) | ||
---|---|---|
Description: | Saves the current state for the given cell attribute, creating a new current state. The time associated with the new current state is initialized to the value of the current simulation time (set either explicitly by a call to setCurrentTime() or implicitly by some process functions). This can later be changed by a call to mesh: setCellAttributeStateTime() . | |
Parameters: | name | The name (id) of the cell attribute. |
mode | The requested save mode, defining how the new state will be initialized. Can be one of the following strings: "init" (new state is initialized with the data default value), "noinit" (new state is not initialized at all) or "copy" (new state is initialized with a copy of the current state). | |
Returns: | Returns true if successful, false otherwise. In particular, this function returns false if the given attribute does not have history values enabled. |
Example:
mesh:numCellAttributeStates(name) | |
---|---|
Description: | Returns the number of existing history states for the given cell attribute. |
Parameters: | name - The name (id) of the cell attribute. |
Returns: | Returns the number of existing states or -1 for unknown names. |
Example:
mesh:cellAttributeStateTag(name, state) | ||
---|---|---|
Description: | Returns the tag attached to the requested state, for the given cell attribute. | |
Parameters: | name | The name (id) of the cell attribute. |
state | The state number, referencing the history state to be queried. A value of zero means the most recent state, 1 the previous one, 2 the one before that and so on. Valid values range from zero to the oldest state for the requested attribute, which can be obtained with a call to mesh: numCellAttributeStates() . | |
Returns: | The state tag attached to the requested state or "" if the name doesn't exists. |
Example:
mesh:cellAttributeStateTime(name, state) | ||
---|---|---|
Description: | Returns the time attached to the requested state, for the given cell attribute. | |
Parameters: | name | The name (id) of the cell attribute. |
state | The state number, referencing the history state to be queried. A value of zero means the most recent state, 1 the previous one, 2 the one before that and so on. Valid values range from zero to the oldest state for the requested attribute, which can be obtained with a call to mesh: numCellAttributeStates() . | |
Returns: | The time attached to the requested state or -1 if the name doesn't exists. |
Example:
mesh:setCellAttributeStateTag(name, state, tag) | ||
---|---|---|
Description: | Updates the tag attached to the requested state, for the given cell attribute. | |
Parameters: | name | The name (id) of the cell attribute. |
state | The state number, referencing the history state to be queried. A value of zero means the most recent state, 1 the previous one, 2 the one before that and so on. Valid values range from zero to the oldest state for the requested attribute, which can be obtained with a call to mesh: numCellAttributeStates() . | |
tag | The new state tag. | |
Returns: | Nothing. |
Example:
mesh:setCellAttributeStateTime(name, state, time) | ||
---|---|---|
Description: | Updates the time attached to the requested state, for the given cell attribute. | |
Parameters: | name | The name (id) of the cell attribute. |
state | The state number, referencing the history state to be queried. A value of zero means the most recent state, 1 the previous one, 2 the one before that and so on. Valid values range from zero to the oldest state for the requested attribute, which can be obtained with a call to mesh: numCellAttributeStates() . | |
time | The new state time, expressed in the same unit as the current simulation time unit. | |
Returns: | Nothing. |
Example: