I want to generate a 2D rectangular mesh with an arbitrary fault discontinuity (straight line) within the domain.
It looks as follows. For this toy case, I have:
Lx, Ly = 4,4
fault_start = (2,4)
fault_end = (2,2)
creep_end = (2,0)
(fault_start)
(0,Ly) _____________________________(Lx,Ly)
| | |
| | |
| | |
| (fault_end)/(creep_start)|
| - |
| - |
| - |
| - |
(0,0)|______________________________ | (Lx, 0)
(creep_end)
I want to use this type of mesh with a manually-written spectral-element code. It has Linear Elasticity/Wave propagation in the domain, a friction ODE along the fault, and fixed velocity along the creep. So I would just want to get (x, y, connectivity index) across all these interfaces.
I want to use HOHQMesh because eventually I want to have unstructured meshes with curved faults.
Creating my control file gives a segmentation fault error when I define those inner boundaries. The control file looks like this:
open("$(@__DIR__)/../out/rectangular-structured-boundary.control", "w") do io
println(io, raw"""
\begin{CONTROL_INPUT}
\begin{RUN_PARAMETERS}
mesh file name = rectangular-structured-boundary.mesh
plot file name = rectangular-structured-boundary.tec
stats file name = none
mesh file format = ISM-v2
polynomial order = 4
plot file format = skeleton
\end{RUN_PARAMETERS}
\begin{BACKGROUND_GRID}
x0 = [0.0, 0.0, 0.0]
dx = [1.0, 1.0, 0.0]
N = [4,4,1]
\end{BACKGROUND_GRID}
\end{CONTROL_INPUT}
\begin{MODEL}
\begin{OUTER_BOUNDARIES}
\begin{END_POINTS_LINE}
name = bottom
xStart = [0.0,0.0,0.0]
xEnd = [4.0,0.0,0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = right
xStart = [4.0,0.0,0.0]
xEnd = [4.0,4.0,0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = top
xStart = [4.0,4.0,0.0]
xEnd = [0.0,4.0,0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = left
xStart = [0.0,4.0,0.0]
xEnd = [0.0,0.0,0.0]
\end{END_POINTS_LINE}
\end{OUTER_BOUNDARIES}
\begin{INNER_BOUNDARIES}
\begin{END_POINTS_LINE}
name = Fault
xStart = [ 2.0, 4.0, 0.0]
xEnd = [ 2.0, 2.0, 0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = Creep
xStart = [ 2.0, 0.0, 0.0]
xEnd = [ 2.0, 2.0, 0.0]
\end{END_POINTS_LINE}
\end{INNER_BOUNDARIES}
\end{MODEL}
\end{FILE}
""")
end
end
using HOHQMesh
create_mesh_control()
control_file = "$(@__DIR__)/../out/rectangular-structured-boundary.control"
generate_mesh(control_file);
The error is:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x10d92263c
#1 0x10d9219d3
#2 0x7ff80cd52dfc
#3 0x104f3f54e
#4 0x104f48461
#5 0x104f30033
#6 0x104f30112
#7 0x104f30cd8
#8 0x104f310af
#9 0x104f3098d
#10 0x104f310af
#11 0x104f3098d
#12 0x104f310af
#13 0x104f3098d
#14 0x104f31221
#15 0x104f4c317
#16 0x104f4b808
#17 0x104fa21d0
ERROR: LoadError: failed process: Process(setenv(`/Users/prithvi/.julia/artifacts/dcfa115e4439dcb2e24beadcb54361c4e46318e0/bin/HOHQMesh -f /var/folders/17/tlgpbfwx3p56q2gxlzt5gx2c0000gn/T/jl_o8auM1`,["_CE_M=", "LSCOLORS=Gxfxcxdxbxegedabagacad", "PATH=/Users/prithvi/.julia/artifacts/dcfa115e4439dcb2e24beadcb54361c4e46318e0/bin:/Users/prithvi/opt/chromedriver:/Users/prithvi/opt/anaconda3/bin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/prithvi/opt/chromedriver:/Users/prithvi/opt/anaconda3/bin:/Users/prithvi/opt/anaconda3/condabin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin", "HDF5_USE_FILE_LOCKING=FALSE", "MANPATH=/opt/local/share/man:/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/opt/local/share/man:/opt/homebrew/share/man:", "USER=prithvi", "UCX_ERROR_SIGNALS=SIGILL,SIGBUS,SIGFPE", "LESS=-R", "CONDA_PROMPT_MODIFIER=(base) ", "VSCODE_GIT_ASKPASS_NODE=/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper" … "UCX_MEMTYPE_CACHE=no", "TERM_PROGRAM_VERSION=1.68.1", "ZSH=/Users/prithvi/.oh-my-zsh", "COMMAND_MODE=unix2003", "PWD=/Users/prithvi/Library/Mobile Documents/com~apple~CloudDocs/spear-parallel", "TERM_PROGRAM=vscode", "VSCODE_GIT_ASKPASS_MAIN=/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js", "ORIGINAL_XDG_CURRENT_DESKTOP=undefined", "CONDA_PREFIX=/Users/prithvi/opt/anaconda3", "OPENBLAS_MAIN_FREE=1"]), ProcessSignaled(11)) [0]
Stacktrace:
[1] pipeline_error
@ ./process.jl:540 [inlined]
[2] read(cmd::Cmd)
@ Base ./process.jl:427
[3] read(cmd::Cmd, #unused#::Type{String})
@ Base ./process.jl:436
[4] readchomp
@ ./io.jl:926 [inlined]
[5] (::HOHQMesh.var"#17#18"{Bool, String, String, String, String})(tmppath::String, tmpio::IOStream)
@ HOHQMesh ~/.julia/packages/HOHQMesh/wrBSY/src/HOHQMesh.jl:226
[6] mktemp(fn::HOHQMesh.var"#17#18"{Bool, String, String, String, String}, parent::String)
@ Base.Filesystem ./file.jl:722
[7] mktemp
@ ./file.jl:720 [inlined]
[8] generate_mesh(control_file::String; output_directory::String, mesh_filename::Nothing, plot_filename::Nothing, stats_filename::Nothing, verbose::Bool)
@ HOHQMesh ~/.julia/packages/HOHQMesh/wrBSY/src/HOHQMesh.jl:206
[9] generate_mesh(control_file::String)
@ HOHQMesh ~/.julia/packages/HOHQMesh/wrBSY/src/HOHQMesh.jl:174
[10] top-level scope
@ ~/Library/Mobile Documents/com~apple~CloudDocs/spear-parallel/src/mesh.jl:105
[11] include(fname::String)
@ Base.MainInclude ./client.jl:451
[12] top-level scope
@ REPL[29]:1
in expression starting at /Users/prithvi/Library/Mobile Documents/com~apple~CloudDocs/spear-parallel/src/mesh.jl:105
Thanks for the great package!