Mesh generator

Bcube._compute_space_dimMethod
_compute_space_dim(topodim, lx, ly, lz, tol, verbose::Bool)

Deduce the number of space dimensions from the mesh boundaries : if one (or more) dimension of the bounding box is way lower than the other dimensions, the number of space dimension is decreased.

Currently, having for instance (x,z) is not supported. Only (x), or (x,y), or (x,y,z).

Bcube.basic_meshMethod
basic_mesh()

Generate a toy mesh of two quads and one triangle.

v1 v2 v3 v4 +–-e1–>+–-e5–>+–-e8–>+ ^ | | c3 / e4 c1 e2 c2 e6 e9 | | | / +<–e3–-+<–e7–-+/ v5 v6 v7

Bcube.circle_meshMethod
circle_mesh(n; r = 1, order = 1)

Mesh a circle (in 2D) with n nodes on the circumference.

Bcube.line_meshMethod
line_mesh(n; xmin = 0., xmax = 1., order = 1, names = ("xmin", "xmax"))

Generate a mesh of a line of n vertices.

Example

julia> mesh = line_mesh(5)
Bcube.ncube_meshMethod
ncube_mesh(n::Vector{Int}; order = 1)

Generate either a line mesh, a rectangle mesh, a cubic mesh... depending on the dimension of n.

Argument

  • n number of vertices in each spatial directions

Example

mesh_of_a_line = ncube_mesh([10])
mesh_of_a_square = ncube_mesh([4, 5])
mesh_of_a_hexa = ncube_mesh([4, 5, 6])
Bcube.one_cell_meshMethod
one_cell_mesh(type::Symbol, order = 1)

Generate a mesh of one cell. type can be :line, :quad, :tri, :hexa, :penta, :pyra.

The argument order refers to the geometry order. It has the same effect as the -order parameter in gmsh.

Bcube.rectangle_meshMethod
rectangle_mesh(
    nx,
    ny;
    type = :quad,
    xmin = 0.0,
    xmax = 1.0,
    ymin = 0.0,
    ymax = 1.0,
    order = 1,
    bnd_names = ("xmin", "xmax", "ymin", "ymax"),
)

Generate a 2D mesh of a rectangle with nx and ny vertices in the x and y directions respectively.

Example

julia> mesh = rectangle_mesh(5, 4)
Bcube.scaleMethod
scale(mesh, factor)

Scale the input mesh nodes coordinates by a given factor and return the resulted mesh. The factor can be a number or a vector.

Usefull for debugging.

Bcube.transformMethod
transform(mesh::AbstractMesh, fun)

Transform the input mesh nodes coordinates by applying the given fun function and return the resulted mesh.

Usefull for debugging.

Bcube.translateMethod
translate(mesh::AbstractMesh, t::AbstractVector)

Translate the input mesh with vector t.

Usefull for debugging.