Mesh

Entity

Bcube.NodeType

A Node is a point in space of dimension dim.

Bcube.topology_styleMethod
topology_style(::AbstractEntityType{topoDim}, ::Node{spaceDim, T}) where {topoDim, spaceDim, T}
topology_style(::AbstractEntityType{topoDim}, ::AbstractArray{Node{spaceDim, T}, N}) where {spaceDim, T, N, topoDim}

Indicate the TopologyStyle of an entity of topology topoDim living in space of dimension spaceDim.

Connectivity

Bcube.inverse_connectivityMethod
inverse_connectivity(c::Connectivity{T}) where {T}

Returns the "inverse" of the connectivity 'c' and the corresponding 'keys'. 'keys' are provided because indices in 'c' could be sparse in the general case.

Example

mesh = basic_mesh()
c2n = connectivities_indices(mesh,:c2n)
n2c, keys = inverse_connectivity(c2n)

Here, 'n2c' is the node->cell graph of connectivity and, 'n2c[i]' contains the indices of the cells connected to the node of index 'keys[i]'. If 'c2n' is dense, 'keys' is not necessary (because keys[i]==i, ∀i)

Mesh

Bcube.AbstractMeshType

Implementation

All subtypes should implement the following functions:

  • Base.parent(AbstractMesh) (default should be Base.parent(m::MyMesh) = m)
Bcube.MeshType

bc_names : <boundary tag> => <boundary names> bc_nodes : <boundary tag> => <boundary nodes tags> bc_faces : <boundary tag> => <boundary faces tags>

Bcube.oriented_cell_sideMethod
oriented_cell_side(mesh::Mesh,icell::Int,iface::Int)

Return the side number to which the face 'iface' belongs in the cell 'icell' of the mesh. A negative side number is returned if the face is inverted. Returns '0' if the face does not belongs the cell.

Bcube.outer_facesMethod
outer_faces(mesh)

Return the indices of the outer (=boundary) faces.

Domain

Bcube.AbstractDomainType

An AbstractDomain designates any set of entities from a mesh. For instance a set of cells, a set of faces etc.

Bcube.AbstractDomainIndexType
abstract type AbstractDomainIndex

Devs notes

All subtypes should implement the following functions:

  • getelementtype(::AbstractDomainIndex)
Bcube.BoundaryFaceDomainMethod
BoundaryFaceDomain(mesh)
BoundaryFaceDomain(mesh, label::String)
BoundaryFaceDomain(mesh, labels::Tuple{String, Vararg{String}})

Build a BoundaryFaceDomain corresponding to the boundaries designated by one or several labels (=names).

If no label is provided, all the BoundaryFaceDomain corresponds to all the boundary faces.

Bcube.CellDomainType

A CellDomain is a representation of the cells of a mesh. It's primary purpose is to represent a domain to integrate over.

Examples

julia> mesh = rectangle_mesh(10, 10)
julia> Ω_all = CellDomain(mesh)
julia> selectedCells = [1,3,5,6]
julia> Ω_selected = CellDomain(mesh, selectedCells)
Bcube.CellInfoMethod

Legacy constructor for CellInfo : no information about node indices

Bcube.CellInfoMethod
CellInfo(mesh, icell)

DEBUG constructor for icell-th cell of mesh. For performance issues, don't use this version in production.

Bcube.FaceInfoType
FaceInfo{CN<:CellInfo,CP<:CellInfo,FT,FN,F2N,I}

Type describing a face as the common side of two adjacent cells. CellInfo of cells from both sides is stored with the local side index of the face relative to each adjacent cell.

iface is the mesh-face-index (and not the domain-face-index).

Remark:

  • For boundary face with no periodic condition, positive cell side info

are duplicate from the negative ones.

  • For performance reason (type stability), nodes and type of the face

is stored explicitely in FaceInfo even if it could have been computed by collecting info from the side of the negative or positive cells.

Bcube.FaceInfoMethod

FaceInfo constructor

Cell sides are computed automatically.

Bcube.FaceInfoMethod

DEBUG FaceInfo constructor for kface-th cell of mesh. For performance issues, don't use this version in production.

Bcube.opposite_sideMethod

Return the opposite side of the FaceInfo : cellside "n" because cellside "p"