Skip to content

Simple Mesh ​

Here, we consider generating rectangular domain nodes (2D) and cuboidal domain nodes (3D) by controlling the starting range and step size in each direction.

2D ​

Consider a rectangular area where the range in the x-direction is from 0 to 10 and in the y-direction from 0 to 6. The step size in the x-direction is 1, and in the y-direction, it is 2. Therefore, we can do:

MaterialPointGenerator.meshbuilder Method
julia
meshbuilder(x::T, y::T; ϵ::String="FP64") where T <: AbstractRange

Description:

Generate structured mesh in 2D space.

source
julia
julia> pts = meshbuilder(0.0 : 1.0 : 10.0, 0.0: 2.0 : 6.0)
44Ă—2 Matrix{Float64}:
  0.0  0.0
  0.0  2.0
  0.0  4.0
  0.0  6.0
  1.0  0.0
  1.0  2.0
  â‹®    
  9.0  6.0
 10.0  0.0
 10.0  2.0
 10.0  4.0
 10.0  6.0

This way, we can obtain the results shown in the figure. The variable pts is an array where the first column contains the x-coordinates of all the nodes, and the second column contains the corresponding y-coordinates.

3D ​

Similarly, we can use this function to generate a set of points in three-dimensional space.

MaterialPointGenerator.meshbuilder Method
julia
meshbuilder(x::T, y::T, z::T; ϵ::String="FP64") where T <: AbstractRange

Description:

Generate structured mesh in 3D space.

source
julia
julia> pts = meshbuilder(0.0 : 1.0 : 10.0, 0.0: 2.0 : 6.0, 0.0 : 2.0 : 4.0)
132Ă—3 Matrix{Float64}:
  0.0  0.0  0.0
  0.0  2.0  0.0
  0.0  4.0  0.0
  0.0  6.0  0.0
  1.0  0.0  0.0
  1.0  2.0  0.0
  â‹®         
  9.0  6.0  4.0
 10.0  0.0  4.0
 10.0  2.0  4.0
 10.0  4.0  4.0
 10.0  6.0  4.0

Export ​

For two-dimensional points and three-dimensional points, you can use the functions savexy and savexyz to save them as .xy and .xyz files, respectively. You can also use readxy and readxyz to read these files.

MaterialPointGenerator.savexy Method
julia
savexy(file_dir::P, pts::T) where {P <: String, T <: AbstractMatrix}

Description:

Save the 2D points pts to the .xy file (file_dir).

source
MaterialPointGenerator.savexyz Method
julia
savexyz(file_dir::P, pts::T) where {P <: String, T <: AbstractMatrix}

Description:

Save the 3D points pts to the .xyz file (file_dir).

source
MaterialPointGenerator.readxy Method
julia
readxy(file_dir::P) where P <: String

Description:

Read the 2D .xy file from file_dir.

source
MaterialPointGenerator.readxyz Method
julia
readxyz(file_dir::P) where P <: String

Description:

Read the 3D .xyz file from file_dir.

source
julia
output_file = joinpath(@__DIR__, "test.xyz")
savexyz(output_file, pts)
data = readxyz(output_file)

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.