JuliaGeodynamics / LaMEM.jl

Julia interface to LaMEM (Lithosphere and Mantle Evolution Model)
GNU General Public License v3.0
24 stars 12 forks source link

non-uniform grid implementation not working #24

Closed wenrongcao closed 6 months ago

wenrongcao commented 6 months ago

Dear LaMEM.jl developers, I tried to implement non-uniform grid in a simple falling ball model.

using LaMEM, GeophysicalModelGenerator

model = Model(Grid(coord_x=[-1, 0, 1],   bias_x=[1.0,1.0],  nel_x=[8,16],            
                    coord_y=[-1, 0, 1],  bias_y=[1.0,1.0],  nel_y=[8,16],
                    coord_z=[-1, 0, 1],  bias_z=[1.0,1.0],  nel_z=[8,16]))

matrix = Phase(ID=0,Name="matrix",eta=1e20,rho=3000)
sphere = Phase(ID=1,Name="sphere",eta=1e23,rho=3200)
add_phase!(model, sphere, matrix)
AddSphere!(model,cen=(0.0,0.0,0.0), radius=(0.5, ))

run_lamem(model,2)

In Julia code, model.Grid returns a correct non-uniform grid setup.

LaMEM grid with constant Δ: 
  nel         : ([8, 16], [8, 16], [8, 16])
  marker/cell : (3, 3, 3)
  x           ϵ [-1.0, 0.0, 1.0], bias=[1.0, 1.0], nseg=2, Δmin=0.0625, Δmax=0.125
  y           ϵ [-1.0, 0.0, 1.0], bias=[1.0, 1.0], nseg=2, Δmin=0.0625, Δmax=0.125
  z           ϵ [-1.0, 0.0, 1.0], bias=[1.0, 1.0], nseg=2, Δmin=0.0625, Δmax=0.125
  Phases      : range ϵ [0 - 1]
  Temp        : range ϵ [0.0 - 0.0]

Yet, the generated output.dat file has missing informations (miss segmentation and bias information). Markers are generated. PETSC error occurs: Non-local point cannot be mapped to local cell.

Package versions: LaMEM v0.2.6, GeophysicalModelGenerator v0.5.5
Julia 1.9.4, VS code Jupyter notebook IDE, Macbook Pro (Intel Core), Ventura 13.6

boriskaus commented 6 months ago

Can you please add the text of the scripts here rather than a picture? In that case we can just copy-paste the scripts to julia and run it locally rather than having to retype it. You can use three backticks (`) at the beginning and end to format it.

also the example should be self contained and result in the *.dat file you describe. In your first figure there is no file saved at the end.

thanks!

wenrongcao commented 6 months ago

Ok, I directly added the julia text in the issue.

boriskaus commented 6 months ago

this was closed by PR #25