Re-structuring package layout

这个提交包含在:
Craig Warren
2022-11-09 09:29:23 +00:00
父节点 50d17f33ef
当前提交 16df30968e
共有 269 个文件被更改,包括 14 次插入261 次删除

查看文件

@@ -0,0 +1,48 @@
from pathlib import Path
import gprMax
from user_libs.GPRAntennaModels.GSSI import antenna_like_GSSI_1500
# File path for output
fn = Path(__file__)
# Discretisation
dl = 0.001
# Domain
x = 0.250
y = 0.250
z = 0.220
scene = gprMax.Scene()
title = gprMax.Title(name=fn.with_suffix('').name)
domain = gprMax.Domain(p1=(x, y, z))
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
time_window = gprMax.TimeWindow(time=6e-9)
scene.add(title)
scene.add(domain)
scene.add(dxdydz)
scene.add(time_window)
# Import antenna model and add to model
ant_pos = (0.125, 0.094, 0.100)
gssi_objects = antenna_like_GSSI_1500(ant_pos[0], ant_pos[1], ant_pos[2],
resolution=dl)
for obj in gssi_objects:
obj.rotate('z', 90, origin=(ant_pos[0], ant_pos[1], ant_pos[2]))
scene.add(obj)
gv1 = gprMax.GeometryView(p1=(0, 0, 0), p2=(x, y, z),
dl=(dl, dl, dl), filename='antenna_like_GSSI_1500',
output_type='n')
gv2 = gprMax.GeometryView(p1=(ant_pos[0] - 0.170/2, ant_pos[1] - 0.108/2, ant_pos[2] - 0.050),
p2=(ant_pos[0] + 0.170/2, ant_pos[1] + 0.108/2, ant_pos[2] + 0.010),
dl=(dl, dl, dl), filename='antenna_like_GSSI_1500_pcb',
output_type='f')
scene.add(gv1)
scene.add(gv2)
# Run model
gprMax.run(scenes=[scene], geometry_only=True, outputfile=fn, gpu=None)

查看文件

@@ -0,0 +1,48 @@
from pathlib import Path
import gprMax
fn = Path(__file__)
title = gprMax.Title(name=fn.with_suffix('').name)
domain = gprMax.Domain(p1=(0.050, 0.050, 0.200))
dxdydz = gprMax.Discretisation(p1=(0.001, 0.001, 0.001))
time_window = gprMax.TimeWindow(time=10e-9)
waveform = gprMax.Waveform(wave_type='gaussian', amp=1, freq=1e9, id='mypulse')
transmission_line = gprMax.TransmissionLine(polarisation='z',
p1=(0.025, 0.025, 0.100),
resistance=73,
waveform_id='mypulse')
## 150mm length
e1 = gprMax.Edge(p1=(0.025, 0.025, 0.025),
p2=(0.025, 0.025, 0.175),
material_id='pec')
## 1mm gap at centre of dipole
e2 = gprMax.Edge(p1=(0.025, 0.025, 0.100),
p2=(0.025, 0.025, 0.100),
material_id='free_space')
gv = gprMax.GeometryView(p1=(0.020, 0.020, 0.020),
p2=(0.030, 0.030, 0.180),
dl=(0.001, 0.001, 0.001),
filename=fn.with_suffix('').name,
output_type='n')
# create a scene
scene = gprMax.Scene()
# add the simulation objects to the scene
scene.add(title)
scene.add(domain)
scene.add(dxdydz)
scene.add(time_window)
scene.add(waveform)
scene.add(transmission_line)
scene.add(e1)
scene.add(e2)
scene.add(gv)
# run the simulation
gprMax.run(scenes=[scene], n=1, outputfile=fn)

二进制
examples/cylinder_Ascan_2D.h5 普通文件

二进制文件未显示。

查看文件

@@ -0,0 +1,15 @@
#title: A-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.210 0.002
#dx_dy_dz: 0.002 0.002 0.002
#time_window: 3e-9
#material: 6 0 1 0 half_space
#waveform: ricker 1 1.5e9 my_ricker
#hertzian_dipole: z 0.100 0.170 0 my_ricker
#rx: 0.140 0.170 0
#box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec
#geometry_view: 0 0 0 0.240 0.210 0.002 0.002 0.002 0.002 cylinder_half_space n

查看文件

@@ -0,0 +1,15 @@
#title: B-scan from a metal cylinder buried in a dielectric half-space
#domain: 0.240 0.210 0.002
#dx_dy_dz: 0.002 0.002 0.002
#time_window: 3e-9
#material: 6 0 1 0 half_space
#waveform: ricker 1 1.5e9 my_ricker
#hertzian_dipole: z 0.040 0.170 0 my_ricker
#rx: 0.080 0.170 0
#src_steps: 0.002 0 0
#rx_steps: 0.002 0 0
#box: 0 0 0 0.240 0.170 0.002 half_space
#cylinder: 0.120 0.080 0 0.120 0.080 0.002 0.010 pec

二进制
examples/cylinder_half_space.vti 普通文件

二进制文件未显示。

查看文件

@@ -0,0 +1,14 @@
#title: Heterogeneous soil using a stochastic distribution of dielectric properties given by a mixing model from Peplinski
#domain: 0.15 0.15 0.1
#dx_dy_dz: 0.001 0.001 0.001
#time_window: 6e-9
#waveform: ricker 1 1.5e9 my_ricker
#hertzian_dipole: y 0.045 0.075 0.085 my_ricker
#rx: 0.105 0.075 0.085
#soil_peplinski: 0.5 0.5 2.0 2.66 0.001 0.25 my_soil
#fractal_box: 0 0 0 0.15 0.15 0.070 1.5 1 1 1 50 my_soil my_soil_box
#add_surface_roughness: 0 0 0.070 0.15 0.15 0.070 1.5 1 1 0.065 0.080 my_soil_box
#geometry_view: 0 0 0 0.15 0.15 0.1 0.001 0.001 0.001 heterogeneous_soil n

查看文件

@@ -0,0 +1 @@
**Tip:** ``ipynb`` files can be viewed on GitHub. Just click them.

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 498 KiB

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

文件差异因一行或多行过长而隐藏

查看文件

@@ -0,0 +1,137 @@
# Copyright (C) 2015-2021, John Hartley
#
# This module is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
from pathlib import Path
import gprMax
from user_libs.GPRAntennaModels.GSSI import antenna_like_GSSI_400
import numpy as np
# file path step
fn = Path(__file__)
parts = fn.parts
# subgrid Discretisation is 1 mm in x, y, z directions. This allows us
# to model the geometry of the antenna
dl_s = 1e-3
# subgridding ratio. This must always be an odd integer multiple. In this case
# the main grid discrestisation is 9e-3 m.
ratio = 9
dl = dl_s * 9
# estimated return time for signal to propagate 1 metre and back
tw = 2 / 3e8 * (np.sqrt(3.2) + np.sqrt(9))
# domain extent
x = 3
y = 1
z = 2
scene = gprMax.Scene()
title_gpr = gprMax.Title(name=fn.name)
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
domain = gprMax.Domain(p1=(x, y, z))
time_window = gprMax.TimeWindow(time=tw)
scene.add(domain)
scene.add(title_gpr)
scene.add(dxdydz)
scene.add(time_window)
# half space material
halfspace_m = gprMax.Material(er=3.2, se=0.397e-3, mr=1, sm=0, id='soil')
scene.add(halfspace_m)
antenna_case = (0.3, 0.3, 0.178)
bounding_box = 2 * dl
# pml + boundary_cells + is_os + subgrid+boundary + half antenna
x0 = (10 + 15 + 5 + 2) * dl + antenna_case[0] / 2
#antenna_p = (x / 2, y / 2, z - 30 * dl - bounding_box - antenna_case[2])
# Position of antenna base
antenna_p = (x / 2, y / 2, 170 * dl)
sg_x0 = antenna_p[0] - antenna_case[0] / 2 - bounding_box
sg_y0 = antenna_p[1] - antenna_case[1] / 2 - bounding_box
sg_z0 = antenna_p[2] - bounding_box
sg_x1 = antenna_p[0] + antenna_case[0] / 2 + bounding_box
sg_y1 = antenna_p[1] + antenna_case[1] / 2 + bounding_box
sg_z1 = antenna_p[2] + antenna_case[2] + bounding_box
sg = gprMax.SubGridHSG(p1=[sg_x0, sg_y0, sg_z0], p2=[sg_x1, sg_y1, sg_z1], ratio=ratio, id='subgrid1')
scene.add(sg)
# half space box in main grid
halfspace = gprMax.Box(p1=(0, 0, 0), p2=(x, y, antenna_p[2]), material_id='soil')
scene.add(halfspace)
# position half space box in the subgrid. The halfspace has to be positioned
# manually because it traverses the grid. Grid traversal requires that objects extend
# beyond the OS. Turning off autotranslate allows you to place objects beyond the OS.
# PML seperation from the OS
ps = ratio // 2 + 2
# number of pml cells in the subgrid
pc = 6
# is os seperation
isos = 3 * ratio
h = antenna_p[2] - sg_z0 + (ps + pc + isos) * dl_s
# half space box
halfspace = gprMax.Box(p1=(0, 0, 0), p2=(411 * dl_s, 411 * dl_s, h), material_id='soil')
# position the box using local coordinates3e8 / 400e6
halfspace.autotranslate = False
sg.add(halfspace)
# Import the antenna model and add components to subgrid
gssi_objects = antenna_like_GSSI_400(*antenna_p, resolution=dl_s)
for obj in gssi_objects:
sg.add(obj)
# half space box
halfspace = gprMax.Box(p1=(0, 0, 0), p2=(x, y, antenna_p[2]), material_id='soil')
scene.add(halfspace)
for i in range(1, 51):
snap = gprMax.Snapshot(p1=(0, y / 2, 0), p2=(x, y / 2 + dl, z), dl=(dl, dl, dl),
filename=Path(*parts[:-1], parts[-1] + '_' + str(i)).name,
time=i * tw / 50)
# scene.add(snap)
# create a geometry view of the main grid and the sub grid stitched together
gv = gprMax.GeometryView(p1=(0, 0, 0),
p2=(1, 1, 1),
dl=dl,
filename=fn.with_suffix('').parts[-1],
output_type='f',
multi_grid=True)
# create a geometry view of the main grid and the sub grid stitched together
gv_normal = gprMax.GeometryView(p1=(0, 0, 0),
p2=domain.props.p1,
dl=dl,
filename=fn.with_suffix('').parts[-1] + '_voxels',
output_type='n')
# scene.add(gv)
scene.add(gv_normal)
# half space material
layer_m = gprMax.Material(er=9, se=0.397e-3, mr=1, sm=0, id='soil_2')
scene.add(layer_m)
fb = gprMax.FractalBox(p1=(0, 0, 0), p2=(3, 1, 1), frac_dim=1.5, weighting=(1, 1, 1), n_materials=1, mixing_model_id='soil_2', id='fbox', seed=1)
scene.add(fb)
sr = gprMax.AddSurfaceRoughness(p1=(0, 0, 1), p2=(3, 1, 1), frac_dim=1.5, weighting=(1, 1), limits=(0.4, 1.2), fractal_box_id='fbox', seed=1)
scene.add(sr)
gprMax.run(scenes=[scene], n=1, geometry_only=False, outputfile=fn, subgrid=True, autotranslate=True)

查看文件

@@ -0,0 +1,81 @@
# Copyright (C) 2015-2021, John Hartley
#
# This module is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
from pathlib import Path
import gprMax
# file path step
fn = Path(__file__)
parts = fn.parts
# Subgrid Discretisation in x, y, z directions.
dl_s = 1e-3
# Subgridding ratio. This must always be an odd integer multiple.
ratio = 5
dl = dl_s * ratio
# Cells
# Default number of PML cells
pml_cells = 10
# Distance between model and PML cells
pml_gap = 15
# Number of cells between the Inner Surface and the Outer Surface of the sub-grid
is_os_gap = 4
# Size of the sub-gridded region
sub_gridded_region = 3
# Domain size
extent = sub_gridded_region + 2 * (pml_cells + pml_gap + is_os_gap)
# Domain extent
x = dl * extent
y = x
z = x
tw = 1e-9
scene = gprMax.Scene()
title_gpr = gprMax.Title(name=fn.name)
dxdydz = gprMax.Discretisation(p1=(dl, dl, dl))
domain = gprMax.Domain(p1=(x, y, z))
time_window = gprMax.TimeWindow(time=tw)
scene.add(domain)
scene.add(title_gpr)
scene.add(dxdydz)
scene.add(time_window)
sg_x0 = (pml_cells + pml_gap + is_os_gap) * dl
sg_y0 = sg_x0
sg_z0 = sg_x0
sg_x1 = sg_x0 + sub_gridded_region * dl
sg_y1 = sg_x1
sg_z1 = sg_x1
sg_p0 = [sg_x0, sg_y0, sg_z0]
sg_p1 = [sg_x1, sg_y1, sg_z1]
sg = gprMax.SubGridHSG(p1=sg_p0, p2=sg_p1, ratio=ratio, id='mysubgrid')
scene.add(sg)
# Plastic box in sub grid
material = gprMax.Material(er=3, mr=1, se=0, sm=0, id='plastic')
scene.add(material)
plastic_box = gprMax.Box(p1=(30*dl, 30*dl, 30*dl), p2=(31*dl, 31*dl, 31*dl), material_id='plastic')
sg.add(plastic_box)
# Create a geometry view of the sub grid only. This command currently exports the entire subgrid regardless of p1, p2
gv_sg_normal = gprMax.GeometryView(p1=sg_p0,
p2=sg_p1,
dl=(1e-3, 1e-3, 1e-3),
filename=fn.with_suffix('').parts[-1] + '_subgrid_normal',
output_type='n')
# Add the subgrid geometry view to the sub grid object
sg.add(gv_sg_normal)
gprMax.run(scenes=[scene], n=1, geometry_only=False, outputfile=fn, subgrid=True, autotranslate=True)