JuliaGeodynamics / GeophysicalModelGenerator.jl

Import, process and interpret geophysical data sets to be used in numerical models.
MIT License
66 stars 29 forks source link

Function to add stripes on shapes #95

Closed NicolasRiel closed 7 months ago

NicolasRiel commented 7 months ago

This pull request adds addStripes! function.

This simple function allow to add stripes on existing phase to facilitate strain visualization when running forward LaMEM models.

The function takes as arguments

  1. a tuple of axes to activate the stripes in x,y and z dimensions
  2. a stripe width
  3. a stripe spacing
  4. Origin, StrikeAngle and DipAngle to apply rotation
  5. a reference phase for which the striping will be applied
  6. a stripe phase

And example of addStripes!:

using GeophysicalModelGenerator
Grid = ReadLaMEM_InputFile("test/test_files/SaltModels.dat")

Phases = zeros(Int32,   size(Grid.X));
Temp   = zeros(Float64, size(Grid.X));
AddBox!(Phases,Temp,Grid, xlim=(0,500), zlim=(-50,0), phase=ConstantPhase(3), DipAngle=10, T=ConstantTemp(1000))

addStripes!(Phases, Grid,                # required input
    stripAxes=(1,1,1),
    stripeWidth=0.2,stripeSpacing=1,
    Origin=nothing, StrikeAngle=0, DipAngle=10,                              # origin & dip/strike
    phase = ConstantPhase(3),
    stripePhase = ConstantPhase(4))

Model3D = ParaviewData(Grid, (Phases=Phases,Temp=Temp)); # Create Cartesian model
Write_Paraview(Model3D,"LaMEM_ModelSetup")           # Save model to paraview

Screenshot from 2024-03-11 11-58-44