GeMA
The GeMA main application
Cell boundary object methods

Cell boundary objects are used to store a set of cell borders, either a set of cell edges for 2D meshes or a set of cell faces for 3D meshes. Their main use is to represent mesh borders, serving as application points for boundary conditions. Cell boundary objects can be obtained in the orchestration from a mesh object by calling the mesh:cellBoundaryGroups() method or from a boundary condition object by calling the bc:boundary() method.

Example:

-- Get the boundary object named 'boundary_name' from the mesh
local boundaryMap = m:cellBoundaryGroups()
local boundary = boundaryMap['boundary_name']
-- Get the first application point from a boundary condition applied over cell borders
local boundary = bc:boundary(1)

Index:

Boundary metadata methods

boundary:id()
Description: Returns the boundary id.
Parameters: None.
Returns: Returns a string with the boundary name.

Example:

-- Print boundary object name
print(boundary:id())


boundary:type()
Description: Returns the type of border stored by this object (a cell edge or a cell face).
Parameters: None.
Returns: Returns a string identifying the border type ('edges' or 'faces').

Example:

-- Print boundary object type
print(boundary:type())


boundary:mesh()
Description: Returns the mesh object owning the cells included in this boundary.
Parameters: None.
Returns: Returns the associated mesh object.

Example:

local mesh = boundary:mesh()


Boundary query methods

boundary:numCells()
Description: Returns the number of {cell, border} pairs in this boundary.
Parameters: None.
Returns: Returns the number of cells in this boundary.

Example:

local ncells = boundary:numCells()


boundary:cell(index)
Description: Returns a cell object given its index inside the boundary.
Parameters: index - The boundary index (a value between 1 and boundary:numCells()).
Returns: Returns the cell object.

Example:

local c = boundary:cell(1) -- Returns the first cell in this boundary


boundary:cellBorder(index)
Description: Returns the boundary border given its index inside the boundary. The returned value can be an edge number or a face number depending on the boundary type returned by boundary:type(). See the Element types page for the edge/face organization for each cell type.
Parameters: index - The boundary index (a value between 1 and boundary:numCells()).
Returns: Returns the border (edge/face) number.

Example:

local border = boundary:cellBorder(1) -- Returns the border for the first cell in this boundary


Boundary updating methods

boundary:setBoundaryData(cells, borders)
Description: Replaces the complete set of cells and edges/faces of a boundary object by the given ones.
Parameters: cells A table with the new set of cells. Can store either cell numbers or cell objects.
borders A table with the new set of border edge/face numbers. Should have the same size as the cells table. See the Element types page for the edge/face organization for each cell type.
Returns: Nothing.

Example:

-- Updates the boundary with the following pairs of {cell, edge} : {{2, 3}, {3, 2}, {1, 3}}
local newCells = {m:cell(2), 3, m:cell(1)} -- Table can store either indices or cell objects
local newBorders = {3, 2, 3}
boundary:setBoundaryData(newCells, newBorders)