JuliaGeodynamics / LaMEM.jl

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

Adding VelocityBoxes to the setup and their respective utils/tests #20

Closed jaime-almeida closed 7 months ago

jaime-almeida commented 7 months ago

Added a new structure to BoundaryConditions.jl, VelocityBox, to allow for the use of these boundary conditions. They follow the definitions on the LaMEM source and ask for the same variables to be set. I've also added the utility functions for this structure, add_vbox!(), rm_vbox!() and rm_last_vbox!() to the Utils.jl file.

vbox = VelocityBox(cenX=0, cenY=0, cenZ=0,
                        widthX=1, widthY=1, widthZ=1,
                        vx=1)
add_vbox!(model, vbox)

I also edited the print function in BoundaryConditions.jl to allow for this structure to be written into the input file following the LaMEM structure:

<VelBoxStart>
      cenX      =  0  # X-coordinate of center of box
      cenY      =  0  # Y-coordinate of center of box
      cenZ      =   0 # Z-coordinate of center of box
      widthX   =  0  # Width of box in x-direction
      widthY   =   0 # Width of box in y-direction
      widthZ   =   0 # Width of box in z-direction
      vx           =   1 # Vx velocity of box 
      advect   =   0  # box advection flag
<VelBoxEnd>

I also added a test to ~test_julia_setups.jl which verifies that the velocity box was correctly placed.