![]() |
GeMA
The GeMA main application
|
Boundary condition objects are a Lua wrapper over a GeMA boundary condition providing a rich set of methods for querying and updating its properties. Those include querying and updating boundary condition property values, as well as their application points. Boundary condition objects can be obtained in the orchestration by calling the modelData:
boundaryCondition()
method.
Example:
Index:
bc:
id()
bc:
description()
bc:
type()
bc:
mesh()
bc:
bcType()
bc:
numProperties()
bc:
propertyIds()
bc:
propertyInfo()
bc:
propertyAccessor()
bc:
numValues()
bc:
numNodes()
bc:
node()
bc:
cell()
bc:
numBoundaryCells()
bc:
boundaryCell()
bc:
boundary()
bc:
nodeSet()
bc:
setNode()
bc:
setCell()
bc:
setBoundary()
bc:
reloadNodeBoundaryData()
bc:
clear()
bc:
addLines()
bc:
removeLines()
bc:
addNodeLine()
bc:
addCellLine()
bc:
addBoundaryLine()
bc:
print()
bc:id() | |
---|---|
Description: | Returns the boundary condition name. |
Parameters: | None. |
Returns: | Returns a string with the boundary condition name (the id attribute given during its model definition). |
Example:
bc:description() | |
---|---|
Description: | Returns the boundary condition description. |
Parameters: | None. |
Returns: | Returns a string with the boundary condition description |
Example:
bc:type() | |
---|---|
Description: | Returns the boundary condition type. Boundary condition types are standard names defining the semanticas of the boundary condition data, and are interpreted by the physics responsible for applying the condition. |
Parameters: | None. |
Returns: | Returns a string with the boundary condition type. |
Example:
bc:mesh() | |
---|---|
Description: | Returns the mesh object owning the nodes or cells included in this condition. |
Parameters: | None. |
Returns: | Returns the associated mesh object. |
Example:
bc:bcType() | |
---|---|
Description: | Returns the type of application point expected by this boundary condition. Conditions can be applied over nodes, cells, cell edges or cell faces. |
Parameters: | None. |
Returns: | Returns a string with the condition application point type. Can be either "node" , "edge" , "face" or "cell" . |
Example:
bc:numProperties() | |
---|---|
Description: | Returns the number of properties (attribute columns) on the boundary condition. |
Parameters: | None. |
Returns: | Returns the number of properties. |
Example:
bc:propertyIds() | |
---|---|
Description: | Returns a list with the name (id) of every property (attribute column) on the boundary condition. |
Parameters: | None. |
Returns: | Returns a table with property ids (strings). |
Example:
bc:propertyInfo(name) | |
---|---|
Description: | Returns an object with metadata information about the named property. |
Parameters: | name - The property name (id). |
Returns: | Returns a value info object or nil if the requested name was not found in the boundary condition. |
Example:
bc:propertyAccessor(name, unit) | ||
---|---|---|
Description: | Returns a Bc accessor object that can be used to retrieve and update data for boundary condition properties. Unlike other accessor types, a boundary condition property accessor always retrieves data from the current state. | |
Parameters: | name | The name (id) of the 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 Bc accessor object or nil on errors (the requested name is unknown, or the requested unit is incompatible with the data unit, for example). |
Example:
bc:numValues() | |
---|---|
Description: | Returns the number of boundary conditions (lines) stored in the object. |
Parameters: | None. |
Returns: | Returns the number of 'lines' in the boundary condition table. |
Example:
bc:numNodes(bcIndex) | |
---|---|
Description: | Returns the number of nodes in the given application point (line), stored in the boundary condition object. The returned size will be greater than one when the application point is defined by the way of a cell boundary object or by a node set object. Meaningful only if the application point type is equal to "node" . |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Returns the number of nodes associated with the given boundary condition line or nil if bc: bcType() is different from "node" . |
Example:
bc:node(bcIndex, nodeIndex) | ||
---|---|---|
Description: | Returns a node from the set of nodes in the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "node" . | |
Parameters: | bcIndex | A boundary condition index (between 1 and bc: numValues() ). |
nodeIndex | A node list index (between 1 and bc: numNodes(bcIndex) ). | |
Returns: | Returns the node number or nil if bc: bcType() is different from "node" . If the node is a ghost node, it will have its high bit set. |
Example:
bc:cell(bcIndex) | |
---|---|
Description: | Returns the cell associated with the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "cell" . |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Returns a cell mesh index or nil if bc: bcType() is different from "cell" . |
Example:
bc:numBoundaryCells(bcIndex) | |
---|---|
Description: | Returns the number of (cell, border) pairs in the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "edge" or "face" . |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Returns the number of (cell, border) pairs associated with the given boundary condition line or nil if bc: bcType() is different from "edge" or "face" . |
Example:
bc:boundaryCell(bcIndex, borderIndex) | ||
---|---|---|
Description: | Returns a (cell, border) pair from the set of pairs in the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "edge" or "face" . | |
Parameters: | bcIndex | A boundary condition index (between 1 and bc: numValues() ). |
borderIndex | A border list index (between 1 and bc: numBoundaryCells(bcIndex) ). | |
Returns: | Returns the cell object, followed by the border number (see the Element types documentation for a reference about border numbering) or nil if bc: bcType() is different from "edge" or "face" . |
Example:
bc:boundary(bcIndex) | |
---|---|
Description: | Returns the cell boundary object associated with the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "edge" , "face" or "node" (and in the later case only if the application point was defined by a boundary object). |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Returns a cell boundary object or nil if there is no boundary object associated with this condition (bc: bcType() is equal to "cell" or equal to "node" and the application point was not defined through a boundary object). |
Example:
bc:nodeSet(bcIndex) | |
---|---|
Description: | Returns the node set object associated with the given application point (line), stored in the boundary condition object. Meaningful only if the application point type is equal to "node" and the application point was defined by a node set. |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Returns a node set object or nil if there is no node set object associated with this condition (bc: bcType() is different from "node" or the application point was not defined through a node set object). |
Example:
bc:setNode(bcIndex, value) | ||
---|---|---|
Description: | Updates the set of nodes defining the application point associated to a boundary condition (line) stored in the object. Can be called only if the application point type is equal to "node". Please remember that the properties associated with this application point can be updated through an accessor returned by bc: propertyAccessor() . | |
Parameters: | bcIndex | A boundary condition index (between 1 and bc: numValues() ). |
value | Either a mesh node index (ghost nodes should have their high bit set), a cell boundary object, a node set object or a table with a list of node indices (ghost nodes should have their high bit set). | |
Returns: | Nothing. |
Example:
bc:setCell(bcIndex, cellId) | ||
---|---|---|
Description: | Updates the cell defining the application point associated to a boundary condition (line) stored in the object. Can be called only if the application point type is equal to "cell". Please remember that the properties associated with this application point can be updated through an accessor returned by bc: propertyAccessor() . | |
Parameters: | bcIndex | A boundary condition index (between 1 and bc: numValues() ). |
cellId | The mesh cell index (a value between 1 and mesh: numCells() ). | |
Returns: | Nothing. |
Example:
bc:setBoundary(bcIndex, boundary) bc:setBoundary(bcIndex, cellId, borderId) bc:setBoundary(bcIndex, cellList, borderList) | ||
---|---|---|
Description: | Updates the border defining the application point associated to a boundary condition (line) stored in the object. Can be called with three different signatures: on the first the border is specified by a cell boundary object. On the second, by a pair of arguments providing the cell and border ids, and on the third, by a pair of equal sized lists providing a set of cell + border pairs. This function should be called only if the application point type is equal to "edge" or "face". Please remember that the properties associated with this application point can be updated through an accessor returned by bc: propertyAccessor() . | |
Parameters: | bcIndex | A boundary condition index (between 1 and bc: numValues() ). |
boundary | The cell boundary object with the new set of edges / faces or nodes. | |
cellId | The mesh cell index (a value between 1 and mesh: numCells() ). | |
borderId | The edge or face number (between 1 and either geometry: numEdges() or geometry: numFaces() ). See the Element types page for the edge/face organization for each cell type. | |
cellList | A table storing a set of cell ids with the same semantics as a cellId parameter. | |
borderList | A table storing a set of border ids with the same semantics as a borderId parameter. The table size must be equal to the cellList size. | |
Returns: | Nothing. |
Example:
bc:reloadNodeBoundaryData(bcIndex) | |
---|---|
Description: | Reloads node information for a boundary condition applied on nodes, where the set of nodes was specified by a cell boundary object. This is needed for the boundary condition to recognize changes in the boundary object contents. |
Parameters: | bcIndex - A boundary condition index (between 1 and bc: numValues() ). |
Returns: | Nothing. |
Example:
bc:clear() | |
---|---|
Description: | Clears all the application point (line) data stored in this boundary condition, including attribute values. |
Parameters: | None. |
Returns: | Nothing. |
Example:
bc:addLines(nlines) | |
---|---|
Description: | Adds the given number of lines to the boundary condition. Their application points must be filled by calls to bc: setNode() , bc: setCell() or bc: setBoundary() . Properties are initialized with their default values and can be updated through accessors returned by bc: propertyAccessor() . |
Parameters: | nlines - Optional number of lines (conditions) to add to the object. If this parameter is missing, only one line will be added. |
Returns: | Returns the index of the first newly added condition. |
Example:
bc:removeLines(bcIndex, nlines) | ||
---|---|---|
Description: | Removes the given number of lines frome the boundary condition starting at the given position. Both the application point data and the properties data from the specified lines are removed. | |
Parameters: | bcIndex | The boundary condition index (between 1 and bc: numValues() ) of the first line to be removed. |
nlines | Optional number of lines that will be removed. If missing, only one line will be removed. | |
Returns: | Nothing. |
Example:
bc:addNodeLine(value) | |
---|---|
Description: | Adds a single line to the boundary condition, filling its application point with the provided node information. Can be called only if the application point type is equal to "node". Equivalent to calling pos = bc:addLines(1) followed by bc:setNode(pos, value) . Properties are initialized with their default values and can be updated through accessors returned by bc: propertyAccessor() . |
Parameters: | value - Either a mesh node index (ghost nodes should have their high bit set), a cell boundary object, a node set object or a table with a list of node indices (ghost nodes should have their high bit set). |
Returns: | Returns the index of the newly added condition. |
Example:
bc:addCellLine(cellId) | |
---|---|
Description: | Adds a single line to the boundary condition, filling its application point with the provided cell. Can be called only if the application point type is equal to "cell". Equivalent to calling pos = bc:addLines(1) followed by bc:setCell(pos, cellId) . Properties are initialized with their default values and can be updated through accessors returned by bc: propertyAccessor() . |
Parameters: | cellId - The mesh cell index (a value between 1 and mesh: numCells() ). |
Returns: | Returns the index of the newly added condition. |
Example:
bc:addBoundaryLine(boundary) bc:addBoundaryLine(cellId, borderId) bc:addBoundaryLine(cellList, borderList) | ||
---|---|---|
Description: | Adds a single line to the boundary condition, filling its application point with the provided border. Can be called with three different signatures: on the first the border is specified by a cell boundary object. On the second, by a pair of arguments providing the cell and border ids, and on the third, by a pair of equal sized lists providing a set of cell + border pairs. This function should be called only if the application point type is equal to "edge" or "face". Equivalent to calling pos = bc:addLines(1) followed by bc:setBoundary(pos, boundary) , bc:setBoundary(cellId, borderId) or bc:setBoundary(cellList, borderList) . Properties are initialized with their default values and can be updated through accessors returned by bc: propertyAccessor() . | |
Parameters: | boundary | The cell boundary object with the new set of edges / faces or nodes. |
cellId | The mesh cell index (a value between 1 and mesh: numCells() ). | |
borderId | The edge or face number (between 1 and either geometry: numEdges() or geometry: numFaces() ). See the Element types page for the edge/face organization for each cell type. | |
cellList | A table storing a set of cell ids with the same semantics as a cellId parameter. | |
borderList | A table storing a set of border ids with the same semantics as a borderId parameter. The table size must be equal to the cellList size. | |
Returns: | Returns the index of the newly added condition. |
Example:
bc:print() | |
---|---|
Description: | Prints information about the boundary condition. This includes metadata and values (application point and property data) for each condition inside the object. |
Parameters: | None. |
Returns: | Nothing. |
Example: