API Reference

Simple Mesh

MaterialPointGenerator.meshbuilderFunction
meshbuilder(x::T, y::T) where T <: AbstractRange

Description:

Generate structured mesh in 2D space.

source
meshbuilder(x::T, y::T, z::T) where T <: AbstractRange

Description:

Generate structured mesh in 3D space.

source

Polygon

MaterialPointGenerator.particle_in_polygonFunction
particle_in_polygon(px, py, polygon)

Description:

Determine whether a point is inside a polygon. Note the vertices of the polygon should be ordered in a counterclockwise manner; otherwise, it may lead to incorrect results.

(This function is generated by ChatGPT 4o - 2024.10.10)

source
MaterialPointGenerator.polygon2particleFunction
polygon2particle(domain, lpx, lpy)

Description:

Generate structured particles from a given polygon. Note the vertices of the polygon should be ordered in a counterclockwise manner; otherwise, it may lead to incorrect results.

lpx and lpy are the space of particles in x and y directions, respectively.

domain is the polygon, for example, domain = [0 0; 2 0; 2 1; 0 1] means generate structured particles in a rectangle area.

source

Polyhedron

MaterialPointGenerator.polyhedron2particleFunction
polyhedron2particle(msh_path::String, lpx, lpy, lpz, ::Val{:CPU})

Description:

Generate structured particles from a given polyhedron. Please provide .msh file that generated by Gmsh GUI/Script.

source
MaterialPointGenerator.particle_in_polyhedron!Function
particle_in_polyhedron!(pts, node, tet, results)

Description:

Determine whether a point is inside a polyhedron. This function is able to run on any hardware backends, so the input need to preallocate the results array. Users should not call this function directly, please check polyhedron2particle.

source

DEM

MaterialPointGenerator.dem2particleFunction
dem2particle(dem, lpz, bottom)

Description:

Generate particles from a given DEM file. dem is a coordinates Array with three columns (x, y, z). lpz is the space of particles in z direction. bottom is a Float64 value, which means the plane z = bottom.

source
dem2particle(dem, lpz, bottom_surf)

Description:

Generate particles from a given DEM file and a bottom surface file. dem is a coordinates Array with three columns (x, y, z). bottom_surf is a coordinates Array with three columns, but it should have the same x and y coordinates as the DEM, and the z value should be lower than the DEM. lpz is the space of particles in z direction.

source
MaterialPointGenerator.rasterizeDEMFunction
rasterizeDEM(lpx, lpy, dem; k=10, p=2, trimbounds=[0.0 0.0], dembounds=[0.0, 0.0])

Description:

Rasterize the DEM file to generate particles. lpx and lpy are the space of particles in x and y directions. dem is a coordinates Array with three columns (x, y, z). k is the number of nearest neighbors (10 by default), p is the power parameter (2 by default), trimbounds is the boundary of the particles, dembounds is the boundary of the DEM.

source
MaterialPointGenerator.IDW!Function
IDW!(k, p, dem, idxs, ptslist, tree)

Description:

Inverse Distance Weighting (IDW) interpolation method. k is the number of nearest neighbors, p is the power parameter, dem is a coordinates Array with three columns (x, y, z), idxs is the index of the nearest neighbors, ptslist is the coordinates Array of the particles, tree is the KDTree of the DEM.

source

Utils