From 8b5ea61c52c045efffaec139112a8f9a97a6b7f3 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:02:28 +0200 Subject: [PATCH 01/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 41e4b93d..0288f20a 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -566,7 +566,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para ``` """ function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input - base::NTuple{3, } = (-1,-1,-1.5), cap::NTuple{3, } = (-1,-1,-0.5), radius::Number, # center and radius of the sphere + base::NTuple{3} = (-1,-1,-1.5), cap::NTuple{3} = (-1,-1,-0.5), radius::Number, # center and radius of the sphere phase = ConstantPhase(1), # Sets the phase number(s) in the sphere T=nothing, cell=false ) # Sets the thermal structure (various functions are available) From b0416c9eaae5be5d77fd54e415d18587826a9e38 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:03:45 +0200 Subject: [PATCH 02/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 0288f20a..f242dba9 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -622,7 +622,7 @@ end """ - add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::Tuple = (0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false ) + add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; xlim=(), ylim::Tuple = (0.0,0.8), zlim=(), phase = ConstantPhase(1), T=nothing, cell=false ) Adds a polygon with phase & temperature structure to a 3D model setup. This simplifies creating model geometries in geodynamic models From 12ead9b7d3c9bbc4b1a6f16c8819e02de18392cc Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:03:54 +0200 Subject: [PATCH 03/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index f242dba9..f31f0084 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -601,7 +601,7 @@ function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input end # Set the phase. Different routines are available for that - see below. - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) return nothing end From a4decaf2c6efe81a8ea8b698f10f0d543289f567 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:04:05 +0200 Subject: [PATCH 04/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index f31f0084..e47097e0 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -597,7 +597,7 @@ function add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; # required input # Compute thermal structure accordingly. See routines below for different options if !isnothing(T) - Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) + @views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) end # Set the phase. Different routines are available for that - see below. From 30a658e1747d664cc45101e49210860932af6d6f Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:04:40 +0200 Subject: [PATCH 05/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index e47097e0..e9d2332e 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -522,7 +522,7 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i end """ - add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::NTuple{3, } = (-1,-1,-1.5), cap::NTuple{3, } = (-1,-1,-0.5), radius::Number, + add_cylinder!(Phase, Temp, Grid::AbstractGeneralGrid; base::NTuple{3} = (-1,-1,-1.5), cap::NTuple{3} = (-1,-1,-0.5), radius::Number, phase = ConstantPhase(1), T=nothing, cell=false ) From 8fb92e6fa9e2483d28560c92d9bc1b3995838c99 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:04:58 +0200 Subject: [PATCH 06/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index e9d2332e..41b4b348 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -426,7 +426,7 @@ function add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; # required input # Compute thermal structure accordingly. See routines below for different options if T != nothing - Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) + @views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) end # Set the phase. Different routines are available for that - see below. From 4a1a436ed48977a37e538d9b32d4e190ae3d0596 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:05:46 +0200 Subject: [PATCH 07/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 41b4b348..e1955b0a 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -516,7 +516,7 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i end # Set the phase. Different routines are available for that - see below. - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) return nothing end From 769cb6818423fa26e5a600bf331937f05ba34ad0 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:05:53 +0200 Subject: [PATCH 08/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index e1955b0a..ce9303c2 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -664,7 +664,7 @@ julia> write_paraview(Model3D,"LaMEM_ModelSetup") # Save model to para """ function add_polygon!(Phase, Temp, Grid::AbstractGeneralGrid; # required input - xlim=(), ylim::Tuple = (0,0.8), zlim=(), # limits of the box + xlim=(), ylim::Tuple = (0.0,0.8), zlim=(), # limits of the box phase = ConstantPhase(1), # Sets the phase number(s) in the box T=nothing, cell=false ) # Sets the thermal structure (various functions are available) From 3d1899e70c393cf59a9b0d2e631aab7082a44755 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:06:01 +0200 Subject: [PATCH 09/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index ce9303c2..d4d911f3 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -430,7 +430,7 @@ function add_sphere!(Phase, Temp, Grid::AbstractGeneralGrid; # required input end # Set the phase. Different routines are available for that - see below. - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) return nothing end From c0f9cdc7388360ef2cb8752fd09698156b4fce6b Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:06:09 +0200 Subject: [PATCH 10/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index d4d911f3..6f0b1201 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -512,7 +512,7 @@ function add_ellipsoid!(Phase, Temp, Grid::AbstractGeneralGrid; # required i # Compute thermal structure accordingly. See routines below for different options if T != nothing - Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T) + @views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T) end # Set the phase. Different routines are available for that - see below. From 7016142519073601b6b8fe3aa0fe5544533f06e9 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:06:21 +0200 Subject: [PATCH 11/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 6f0b1201..1e45bcb4 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -253,7 +253,7 @@ function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input # Compute thermal structure accordingly. See routines below for different options if T != nothing if isa(T,LithosphericTemp) - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) end Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T) end From fb574558ec0e70ca017b73fe442bd98b6686905d Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:06:42 +0200 Subject: [PATCH 12/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 1e45bcb4..7992c2f0 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -255,7 +255,7 @@ function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input if isa(T,LithosphericTemp) @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) end - Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T) + @views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], Phase[ind_flat], T) end # Set the phase. Different routines are available for that - see below. From 8fb17a39f3bdab52660f11146f390386a8919a11 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:06:54 +0200 Subject: [PATCH 13/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index 7992c2f0..ef2baac6 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -259,7 +259,7 @@ function add_box!(Phase, Temp, Grid::AbstractGeneralGrid; # required input end # Set the phase. Different routines are available for that - see below. - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], Xrot[ind], Yrot[ind], Zrot[ind], phase) return nothing end From a34d1f1e0ec1065193f54c84ea5335f05f53347c Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:07:08 +0200 Subject: [PATCH 14/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index ef2baac6..eafd9d0d 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -355,7 +355,7 @@ function add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; # required input # Compute thermal structure accordingly. See routines below for different options if !isnothing(T) - Temp[ind_flat] = compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) + @views Temp[ind_flat] .= compute_thermal_structure(Temp[ind_flat], X[ind], Y[ind], Z[ind], Phase[ind_flat], T) end # Set the phase. Different routines are available for that - see below. From 41e9b4321e664ffbb0d48ff206779891aed29d03 Mon Sep 17 00:00:00 2001 From: Boris Kaus <61824822+boriskaus@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:07:19 +0200 Subject: [PATCH 15/15] Update src/Setup_geometry.jl Co-authored-by: Albert de Montserrat <58044444+albert-de-montserrat@users.noreply.github.com> --- src/Setup_geometry.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Setup_geometry.jl b/src/Setup_geometry.jl index eafd9d0d..06f87c2b 100644 --- a/src/Setup_geometry.jl +++ b/src/Setup_geometry.jl @@ -359,7 +359,7 @@ function add_layer!(Phase, Temp, Grid::AbstractGeneralGrid; # required input end # Set the phase. Different routines are available for that - see below. - Phase[ind_flat] = compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) + @views Phase[ind_flat] .= compute_phase(Phase[ind_flat], Temp[ind_flat], X[ind], Y[ind], Z[ind], phase) return nothing end