-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented nested structures up to Scenario
- Loading branch information
Showing
25 changed files
with
374 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
orienter(::SpatialDimensionSize{2}, r::Real; x₀::Real, y₀::Real, θ::Real) = (x₀, y₀) .+ r .* cossin(θ) | ||
orienter(SDS::SpatialDimensionSize{2}, x::Real, y::Real; x₀::Real, y₀::Real, θ::Real) = orienter(SDS, hypot(x, y); x₀ = x₀, y₀ = y₀, θ = θ) | ||
orienter(::SpatialDimensionSize{3}, z::Real; x₀::Real, y₀::Real, θ::Real) = (x₀, y₀, z) | ||
orienter(SDS::SpatialDimensionSize{3}, r::Real, z::Real; x₀::Real, y₀::Real, θ::Real) = orienter(SDS, z; x₀ = x₀, y₀ = y₀, θ = θ) .+ ((r .* cossin(θ))..., 0.0) | ||
orienter(SDS::SpatialDimensionSize{3}, x::Real, y::Real, z::Real; x₀::Real, y₀::Real, θ::Real) = orienter(SDS, hypot(x, y), z; x₀ = x₀, y₀ = y₀, θ = θ) | ||
orient(::SpatialDimensionSize{2}, r::Real; x₀::Real, y₀::Real, θ::Real) = (x₀, y₀) .+ r .* cossin(θ) | ||
orient(SDS::SpatialDimensionSize{2}, x::Real, y::Real; x₀::Real, y₀::Real, θ::Real) = orient(SDS, hypot(x, y); x₀ = x₀, y₀ = y₀, θ = θ) | ||
orient(::SpatialDimensionSize{3}, z::Real; x₀::Real, y₀::Real, θ::Real) = (x₀, y₀, z) | ||
orient(SDS::SpatialDimensionSize{3}, r::Real, z::Real; x₀::Real, y₀::Real, θ::Real) = orient(SDS, z; x₀ = x₀, y₀ = y₀, θ = θ) .+ ((r .* cossin(θ))..., 0.0) | ||
orient(SDS::SpatialDimensionSize{3}, x::Real, y::Real, z::Real; x₀::Real, y₀::Real, θ::Real) = orient(SDS, hypot(x, y), z; x₀ = x₀, y₀ = y₀, θ = θ) | ||
|
||
# TODO: Let SpatialDimensionSize{3} call SpatialDimensionSize{2} where appropriate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
15 changes: 15 additions & 0 deletions
15
src/99_postliminary/02_containers/02_environments/01_interface/00_preliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export Surface | ||
export Bottom | ||
|
||
abstract type InterfaceType <: EnvironmentComponent end | ||
|
||
struct SurfaceInterface <: InterfaceType end | ||
struct BottomInterface <: InterfaceType end | ||
|
||
@kwdef mutable struct AcousticInterface{IT <: InterfaceType} <: ModellingContainer | ||
dpt::Function | ||
rfl::Function | ||
end | ||
|
||
Surface = AcousticInterface{SurfaceInterface} | ||
Bottom = AcousticInterface{BottomInterface} |
24 changes: 24 additions & 0 deletions
24
src/99_postliminary/02_containers/02_environments/01_interface/01_bottom.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
AcousticInterface{BottomInterface}(::ModelName{:ReflectiveDeep}) = AcousticInterface{BottomInterface}( | ||
dpt = BathymetryProfile(:Deep), | ||
rfl = ReflectionCoefficientProfile(:Reflective), | ||
) | ||
|
||
AcousticInterface{BottomInterface}(::ModelName{:AbsorbentDeep}) = AcousticInterface{BottomInterface}( | ||
dpt = BathymetryProfile(:Deep), | ||
rfl = ReflectionCoefficientProfile(:Absorbent) | ||
) | ||
|
||
AcousticInterface{BottomInterface}(::ModelName{:TranslucentDeep}) = AcousticInterface{BottomInterface}( | ||
dpt = BathymetryProfile(:Deep), | ||
rfl = ReflectionCoefficientProfile(:Translucent) | ||
) | ||
|
||
AcousticInterface{BottomInterface}(::ModelName{:ParabolicBathymetry}) = AcousticInterface{BottomInterface}( | ||
dpt = BathymetryProfile(:Parabolic), | ||
rfl = ReflectionCoefficientProfile(:Reflective) | ||
) | ||
|
||
AcousticInterface{BottomInterface}(::ModelName{:AbsorbentMesopelagic}) = AcousticInterface{BottomInterface}( | ||
dpt = BathymetryProfile(:Mesopelagic), | ||
rfl = ReflectionCoefficientProfile(:Absorbent) | ||
) |
14 changes: 14 additions & 0 deletions
14
src/99_postliminary/02_containers/02_environments/01_interface/01_surface.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
AcousticInterface{SurfaceInterface}(::ModelName{:Mirror}) = AcousticInterface{SurfaceInterface}( | ||
dpt = AltimetryProfile(:Flat), | ||
rfl = ReflectionCoefficientProfile(:Mirror) | ||
) | ||
|
||
AcousticInterface{SurfaceInterface}(::ModelName{:Absorbent}) = AcousticInterface{SurfaceInterface}( | ||
dpt = AltimetryProfile(:Flat), | ||
rfl = ReflectionCoefficientProfile(:Absorbent) | ||
) | ||
|
||
AcousticInterface{SurfaceInterface}(::ModelName{:Translucent}) = AcousticInterface{SurfaceInterface}( | ||
dpt = AltimetryProfile(:Flat), | ||
rfl = ReflectionCoefficientProfile(:Translucent; ϕ = π) | ||
) |
49 changes: 49 additions & 0 deletions
49
src/99_postliminary/02_containers/02_environments/02_media/00_preliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export Atmosphere | ||
export Ocean | ||
export Seabed | ||
|
||
abstract type MediumType <: EnvironmentComponent end | ||
|
||
struct AtmosphereMedium <: MediumType end | ||
struct OceanMedium <: MediumType end | ||
struct SeabedMedium <: MediumType end | ||
|
||
mutable struct AcousticMedium{MT <: MediumType} <: ModellingContainer | ||
den::Function | ||
wnd::Function | ||
cel::Function | ||
shear_cel::Function | ||
atn::Function | ||
shear_atn::Function | ||
end | ||
|
||
Atmosphere = AcousticMedium{AtmosphereMedium} | ||
Ocean = AcousticMedium{OceanMedium} | ||
Seabed = AcousticMedium{SeabedMedium} | ||
|
||
AcousticMedium{AtmosphereMedium}(; | ||
den::Function = AtmosphereDensityProfile(:Homogeneous), | ||
wnd::Function = @initialise_function, | ||
cel::Function = AtmosphereCelerityProfile(:Homogeneous), | ||
shear_cel::Function = @initialise_function, | ||
atn::Function = @initialise_function, | ||
shear_atn::Function = @initialise_function, | ||
) = AcousticMedium{AtmosphereMedium}(den, wnd, cel, shear_cel, atn, shear_atn) | ||
|
||
AcousticMedium{OceanMedium}(; | ||
den::Function = OceanDensityProfile(:Homogeneous), | ||
wnd::Function = @initialise_function, | ||
cel::Function = OceanCelerityProfile(:Munk), | ||
shear_cel::Function = @initialise_function, | ||
atn::Function = @initialise_function, | ||
shear_atn::Function = @initialise_function, | ||
) = AcousticMedium{OceanMedium}(den, wnd, cel, shear_cel, atn, shear_atn) | ||
|
||
AcousticMedium{SeabedMedium}(; | ||
den::Function = SeabedDensityProfile(:Homogeneous), | ||
wnd::Function = @initialise_function, | ||
cel::Function = SeabedCelerityProfile(:Homogeneous), | ||
shear_cel::Function = @initialise_function, | ||
atn::Function = @initialise_function, | ||
shear_atn::Function = @initialise_function, | ||
) = AcousticMedium{SeabedMedium}(den, wnd, cel, shear_cel, atn, shear_atn) |
Oops, something went wrong.