JuliaGeodynamics / LaMEM.jl

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

Geometric primitives #41

Closed boriskaus closed 5 months ago

boriskaus commented 5 months ago

You can create a LaMEM setup in various ways, for example by saving marker files, or by utilising geometric primitives that are specified in the LaMEM input files. Previously we only exposed the spherical object (geom_Sphere). With this PR, we add the other remaining objects as well:

Simple example of how to use this:

julia> model  = Model(Grid(nel=(16,16)), Time(nstep_max=2, dt=1, dt_max=10))
LaMEM Model setup
|
|-- Scaling             :  GeoParams.Units.GeoUnits{GeoParams.Units.GEO}
|-- Grid                :  nel=(16, 1, 16); xϵ(-10.0, 10.0), yϵ(-5.0, 5.0), zϵ(-10.0, 0.0) 
|-- Time                :  nstep_max=2; nstep_out=1; time_end=1.0; dt=1.0
|-- Boundary conditions :  noslip=[0, 0, 0, 0, 0, 0]
|-- Solution parameters :  eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options      :  direct solver; mumps; penalty term=10000.0
|-- Model setup options :  Type=files; 
|-- Output options      :  filename=output; pvd=1; avd=0; surf=0
|-- Materials           :  0 phases;

# Specify material properties
julia> matrix = Phase(ID=0,Name="matrix",eta=1e20,rho=3000);
julia> sphere = Phase(ID=1,Name="sphere",eta=1e23,rho=3200);
julia> add_phase!(model, sphere, matrix);

# add sphere
julia> geom_sphere = geom_Sphere(center=[0.0,0.0,-1.0], Temperature="constant", cstTemp=100)
Sphere(ph=1, radius=1.5, center=[0.0, 0.0, -1.0], Temperature=constant,  cstTemp = 100.0
julia> add_geom!(model, geom_sphere)
julia> model
LaMEM Model setup
|
|-- Scaling             :  GeoParams.Units.GeoUnits{GeoParams.Units.GEO}
|-- Grid                :  nel=(16, 1, 16); xϵ(-10.0, 10.0), yϵ(-5.0, 5.0), zϵ(-10.0, 0.0) 
|-- Time                :  nstep_max=2; nstep_out=1; time_end=1.0; dt=1.0
|-- Boundary conditions :  noslip=[0, 0, 0, 0, 0, 0]
|-- Solution parameters :  eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options      :  direct solver; mumps; penalty term=10000.0
|-- Model setup options :  Type=geom; 1 geometric primitive objects
|-- Output options      :  filename=output; pvd=1; avd=0; surf=0
|-- Materials           :  2 phases; 
julia> run_lamem(model)