Mesh generator
Bcube._duplicate_mesh
— Method_duplicate_mesh(mesh::AbstractMesh)
Make an exact copy of the input mesh.
Bcube.basic_mesh
— Methodbasic_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_mesh
— Methodcircle_mesh(n; r = 1, order = 1)
Mesh a circle (in 2D) with n
nodes on the circumference.
Bcube.line_mesh
— Methodline_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_mesh
— Methodncube_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_mesh
— Methodone_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_mesh
— Methodrectangle_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.scale
— Methodscale(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.transform
— Methodtransform(mesh::AbstractMesh, fun)
Transform the input mesh nodes coordinates by applying the given fun
function and return the resulted mesh.
Usefull for debugging.
Bcube.translate
— Methodtranslate(mesh::AbstractMesh, t::AbstractVector)
Translate the input mesh with vector t
.
Usefull for debugging.