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).

source
Bcube._cube_pile_meshMethod
_cube_pile_mesh()

Only for testing purpose.

level 1 7–––8 | | | | 4–––5–––6 | | | | | | 1–––2–––3

level 2 15––16 | | | | 12––13––-14 | | | | | | 9––-10––-11

level 3

  19-----20
   |      |
   |      |
  17-----18
source
Bcube._two_cubes_meshMethod
_two_cubes_mesh(; zmin = 0, zmax = 1)

Only for testing purpose.

z=zmin 4–––5–––6 | | | | | | 1–––2–––3

z=zmax 10––11––-12 | | | | | | 7–––8–––9

source
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

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

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

source
Bcube.hexa_meshMethod
hexa_mesh(
    nx,
    ny,
    nz;
    xmin = 0.0,
    xmax = 1.0,
    ymin = 0.0,
    ymax = 1.0,
    zmin = 0.0,
    zmax = 1.0,
    order = 1,
    bnd_names = ("xmin", "xmax", "ymin", "ymax", "zmin", "zmax"),
)

Mesh a hexahedral domain with hexahedral mesh elements.

source
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)
source
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])
source
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.

source
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)
source
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.

source
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.

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

Translate the input mesh with vector t.

Usefull for debugging.

source