Ran pre-commit run --all-files to modify all the files correctly.

这个提交包含在:
Sai-Suraj-27
2023-09-08 16:06:59 +05:30
父节点 caa566702c
当前提交 caa9ed88ae
共有 17 个文件被更改,包括 155 次插入157 次删除

查看文件

@@ -44,10 +44,7 @@ for obj in gssi_objects:
scene.add(obj)
gv1 = gprMax.GeometryView(
p1=(0, 0, 0),
p2=(x, y, z),
dl=(dl, dl, dl),
filename="antenna_like_GSSI_400", output_type="n"
p1=(0, 0, 0), p2=(x, y, z), dl=(dl, dl, dl), filename="antenna_like_GSSI_400", output_type="n"
)
gv2 = gprMax.GeometryView(
p1=(ant_pos[0] - 0.150, ant_pos[1] - 0.150, ant_pos[2]),
@@ -56,8 +53,8 @@ gv2 = gprMax.GeometryView(
filename="antenna_like_GSSI_400_pcb",
output_type="f",
)
#scene.add(gv1)
#scene.add(gv2)
# scene.add(gv1)
# scene.add(gv2)
# Run model
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn, gpu=None)

查看文件

@@ -230,7 +230,7 @@ class SimulationConfig:
"c": c, # Speed of light in free space (m/s)
"e0": e0, # Permittivity of free space (F/m)
"m0": m0, # Permeability of free space (H/m)
"z0": np.sqrt(m0 / e0), # Impedance of free space (Ohms)
"z0": np.sqrt(m0 / e0), # Impedance of free space (Ohms)
}
# Store information about host machine

查看文件

@@ -45,38 +45,33 @@ args_defaults = {
# Argument help messages (used for CLI argparse)
help_msg = {
"scenes": "(list, req): Scenes to run the model. Multiple scene objects "
"can given in order to run multiple simulation runs. Each scene "
"must contain the essential simulation objects",
"inputfile": "(str, opt): Input file path. Can also run simulation by "
"providing an input file.",
"can given in order to run multiple simulation runs. Each scene "
"must contain the essential simulation objects",
"inputfile": "(str, opt): Input file path. Can also run simulation by " "providing an input file.",
"outputfile": "(str, req): File path to the output data file.",
"n": "(int, req): Number of required simulation runs.",
"i": "(int, opt): Model number to start/restart simulation from. It would "
"typically be used to restart a series of models from a specific "
"model number, with the n argument, e.g. to restart from A-scan 45 "
"when creating a B-scan with 60 traces.",
"typically be used to restart a series of models from a specific "
"model number, with the n argument, e.g. to restart from A-scan 45 "
"when creating a B-scan with 60 traces.",
"mpi": "(bool, opt): Flag to use Message Passing Interface (MPI) task farm. "
"This option is most usefully combined with n to allow individual "
"models to be farmed out using a MPI task farm, e.g. to create a "
"B-scan with 60 traces and use MPI to farm out each trace. For "
"further details see the performance section of the User Guide.",
"gpu": "(list/bool, opt): Flag to use NVIDIA GPU or list of NVIDIA GPU "
"device ID(s) for specific GPU card(s).",
"opencl": "(list/bool, opt): Flag to use OpenCL or list of OpenCL device "
"ID(s) for specific compute device(s).",
"This option is most usefully combined with n to allow individual "
"models to be farmed out using a MPI task farm, e.g. to create a "
"B-scan with 60 traces and use MPI to farm out each trace. For "
"further details see the performance section of the User Guide.",
"gpu": "(list/bool, opt): Flag to use NVIDIA GPU or list of NVIDIA GPU " "device ID(s) for specific GPU card(s).",
"opencl": "(list/bool, opt): Flag to use OpenCL or list of OpenCL device " "ID(s) for specific compute device(s).",
"subgrid": "(bool, opt): Flag to use sub-gridding.",
"autotranslate": "(bool, opt): For sub-gridding - auto translate objects "
"with main grid coordinates to their equivalent local "
"grid coordinate within the subgrid. If this option is "
"off users must specify sub-grid object point within the "
"global subgrid space.",
"geometry_only": "(bool, opt): Build a model and produce any geometry "
"views but do not run the simulation.",
"geometry_fixed": "(bool, opt): Run a series of models where the geometry "
"does not change between models.",
"with main grid coordinates to their equivalent local "
"grid coordinate within the subgrid. If this option is "
"off users must specify sub-grid object point within the "
"global subgrid space.",
"geometry_only": "(bool, opt): Build a model and produce any geometry " "views but do not run the simulation.",
"geometry_fixed": "(bool, opt): Run a series of models where the geometry " "does not change between models.",
"write_processed": "(bool, opt): Writes another input file after any "
"Python code (#python blocks) and in the original input "
"file has been processed.",
"Python code (#python blocks) and in the original input "
"file has been processed.",
"log_level": "(int, opt): Level of logging to use.",
"log_file": "(bool, opt): Write logging information to file.",
}

查看文件

@@ -19,6 +19,7 @@
import logging
from .cmds_multiuse import (
PMLCFS,
AddDebyeDispersion,
AddDrudeDispersion,
AddLorentzDispersion,
@@ -29,7 +30,6 @@ from .cmds_multiuse import (
Material,
MaterialList,
MaterialRange,
PMLCFS,
Rx,
RxArray,
Snapshot,
@@ -387,7 +387,7 @@ def process_multicmds(multicmds):
material_list = MaterialList(list_of_materials=lmats, id=tmp[tokens - 1])
scene_objects.append(material_list)
cmdname = '#pml_cfs'
cmdname = "#pml_cfs"
if multicmds[cmdname] is not None:
for cmdinstance in multicmds[cmdname]:
tmp = cmdinstance.split()
@@ -396,18 +396,20 @@ def process_multicmds(multicmds):
logger.exception("'" + cmdname + ": " + " ".join(tmp) + "'" + " requires exactly twelve parameters")
raise ValueError
pml_cfs = PMLCFS(alphascalingprofile=tmp[0],
alphascalingdirection=tmp[1],
alphamin=tmp[2],
alphamax=tmp[3],
kappascalingprofile=tmp[4],
kappascalingdirection=tmp[5],
kappamin=tmp[6],
kappamax=tmp[7],
sigmascalingprofile=tmp[8],
sigmascalingdirection=tmp[9],
sigmamin=tmp[10],
sigmamax=tmp[11])
pml_cfs = PMLCFS(
alphascalingprofile=tmp[0],
alphascalingdirection=tmp[1],
alphamin=tmp[2],
alphamax=tmp[3],
kappascalingprofile=tmp[4],
kappascalingdirection=tmp[5],
kappamin=tmp[6],
kappamax=tmp[7],
sigmascalingprofile=tmp[8],
sigmascalingdirection=tmp[9],
sigmamin=tmp[10],
sigmamax=tmp[11],
)
scene_objects.append(pml_cfs)

查看文件

@@ -136,14 +136,18 @@ def process_singlecmds(singlecmds):
logger.exception(f"{cmd} requires either one or six parameter(s)")
raise ValueError
if 'pml_formulation' in locals():
if "pml_formulation" in locals():
if len(tmp) == 1:
pml_props = PMLProps(formulation=pml_formulation, thickness=int(tmp[0]))
else:
pml_props = PMLProps(
formulation=pml_formulation,
x0=int(tmp[0]), y0=int(tmp[1]), z0=int(tmp[2]),
xmax=int(tmp[3]), ymax=int(tmp[4]), zmax=int(tmp[5])
x0=int(tmp[0]),
y0=int(tmp[1]),
z0=int(tmp[2]),
xmax=int(tmp[3]),
ymax=int(tmp[4]),
zmax=int(tmp[5]),
)
else:
if len(tmp) == 1:

查看文件

@@ -24,6 +24,7 @@ import numpy as np
logger = logging.getLogger(__name__)
def diff_output_files(filename1, filename2):
"""Calculates differences between two output files.

查看文件

@@ -50,8 +50,9 @@ fig, ax = plt.subplots(
)
for x, model in enumerate(testmodels):
time, datadiffs = diff_output_files(fn.parent.joinpath(basename + "_ref.h5"),
fn.parent.joinpath(basename + str(x + 1) + ".h5"))
time, datadiffs = diff_output_files(
fn.parent.joinpath(basename + "_ref.h5"), fn.parent.joinpath(basename + str(x + 1) + ".h5")
)
# Print maximum error value
start = 210

查看文件

@@ -74,9 +74,7 @@ for x, PMLID in enumerate(PMLIDs):
ax.set_ylabel(f"{output} error [dB]")
# Save a PDF/PNG of the figure
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)
fig.savefig(basename + "_diffs_" + PMLID + ".pdf", dpi=None, format="pdf", bbox_inches="tight", pad_inches=0.1)
# fig.savefig(basename + "_diffs_" + PMLID + ".png", dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
plt.show()

查看文件

@@ -459,7 +459,7 @@ def antenna_like_GSSI_400(x, y, z, resolution=0.002, **kwargs):
metalmiddleplateheight = 0.11
smooth_dec = "yes" # choose to use dielectric smoothing or not
src_type = "GSSI_400MHz_pulse" # (or voltage_source)
src_type = "GSSI_400MHz_pulse" # (or voltage_source)
pcber = 6.401200848809589
hdper = 1.0
skidthickness = 0.01