你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Ran pre-commit run --all-files to modify all the files correctly.
这个提交包含在:
@@ -1031,5 +1031,5 @@ The CFS values (which are internally specified) used for the default standard fi
|
|||||||
The parameters will be applied to all slabs of the PML that are switched on.
|
The parameters will be applied to all slabs of the PML that are switched on.
|
||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
|
|
||||||
``forward`` direction implies minimum parameter value at the inner boundary of the PML and maximum parameter value at the edge of computational domain, ``reverse`` is the opposite.
|
``forward`` direction implies minimum parameter value at the inner boundary of the PML and maximum parameter value at the edge of computational domain, ``reverse`` is the opposite.
|
||||||
|
@@ -44,10 +44,7 @@ for obj in gssi_objects:
|
|||||||
scene.add(obj)
|
scene.add(obj)
|
||||||
|
|
||||||
gv1 = gprMax.GeometryView(
|
gv1 = gprMax.GeometryView(
|
||||||
p1=(0, 0, 0),
|
p1=(0, 0, 0), p2=(x, y, z), dl=(dl, dl, dl), filename="antenna_like_GSSI_400", output_type="n"
|
||||||
p2=(x, y, z),
|
|
||||||
dl=(dl, dl, dl),
|
|
||||||
filename="antenna_like_GSSI_400", output_type="n"
|
|
||||||
)
|
)
|
||||||
gv2 = gprMax.GeometryView(
|
gv2 = gprMax.GeometryView(
|
||||||
p1=(ant_pos[0] - 0.150, ant_pos[1] - 0.150, ant_pos[2]),
|
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",
|
filename="antenna_like_GSSI_400_pcb",
|
||||||
output_type="f",
|
output_type="f",
|
||||||
)
|
)
|
||||||
#scene.add(gv1)
|
# scene.add(gv1)
|
||||||
#scene.add(gv2)
|
# scene.add(gv2)
|
||||||
|
|
||||||
# Run model
|
# Run model
|
||||||
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn, gpu=None)
|
gprMax.run(scenes=[scene], geometry_only=False, outputfile=fn, gpu=None)
|
||||||
|
@@ -230,8 +230,8 @@ class SimulationConfig:
|
|||||||
"c": c, # Speed of light in free space (m/s)
|
"c": c, # Speed of light in free space (m/s)
|
||||||
"e0": e0, # Permittivity of free space (F/m)
|
"e0": e0, # Permittivity of free space (F/m)
|
||||||
"m0": m0, # Permeability of free space (H/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
|
# Store information about host machine
|
||||||
self.hostinfo = get_host_info()
|
self.hostinfo = get_host_info()
|
||||||
|
@@ -35,18 +35,18 @@ x_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
$REAL *Ey,
|
$REAL *Ey,
|
||||||
$REAL *Ez,
|
$REAL *Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -103,15 +103,15 @@ y_args = {
|
|||||||
$REAL *Ex,
|
$REAL *Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
$REAL *Ez,
|
$REAL *Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -169,14 +169,14 @@ z_args = {
|
|||||||
$REAL *Ey,
|
$REAL *Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
|
@@ -35,18 +35,18 @@ x_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
$REAL *Ey,
|
$REAL *Ey,
|
||||||
$REAL *Ez,
|
$REAL *Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -103,15 +103,15 @@ y_args = {
|
|||||||
$REAL *Ex,
|
$REAL *Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
$REAL *Ez,
|
$REAL *Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -168,15 +168,15 @@ z_args = {
|
|||||||
$REAL *Ex,
|
$REAL *Ex,
|
||||||
$REAL *Ey,
|
$REAL *Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
|
@@ -35,18 +35,18 @@ x_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
$REAL *Hy,
|
$REAL *Hy,
|
||||||
$REAL *Hz,
|
$REAL *Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -100,18 +100,18 @@ y_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
$REAL *Hx,
|
$REAL *Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
$REAL *Hz,
|
$REAL *Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -165,18 +165,18 @@ z_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
$REAL *Hx,
|
$REAL *Hx,
|
||||||
$REAL *Hy,
|
$REAL *Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
|
@@ -35,18 +35,18 @@ x_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
const $REAL* __restrict__ Hx,
|
const $REAL* __restrict__ Hx,
|
||||||
$REAL *Hy,
|
$REAL *Hy,
|
||||||
$REAL *Hz,
|
$REAL *Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -100,18 +100,18 @@ y_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
$REAL *Hx,
|
$REAL *Hx,
|
||||||
const $REAL* __restrict__ Hy,
|
const $REAL* __restrict__ Hy,
|
||||||
$REAL *Hz,
|
$REAL *Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -165,18 +165,18 @@ z_args = {
|
|||||||
int NZ_PHI2,
|
int NZ_PHI2,
|
||||||
int NY_R,
|
int NY_R,
|
||||||
const unsigned int* __restrict__ ID,
|
const unsigned int* __restrict__ ID,
|
||||||
const $REAL* __restrict__ Ex,
|
const $REAL* __restrict__ Ex,
|
||||||
const $REAL* __restrict__ Ey,
|
const $REAL* __restrict__ Ey,
|
||||||
const $REAL* __restrict__ Ez,
|
const $REAL* __restrict__ Ez,
|
||||||
$REAL *Hx,
|
$REAL *Hx,
|
||||||
$REAL *Hy,
|
$REAL *Hy,
|
||||||
const $REAL* __restrict__ Hz,
|
const $REAL* __restrict__ Hz,
|
||||||
$REAL *PHI1,
|
$REAL *PHI1,
|
||||||
$REAL *PHI2,
|
$REAL *PHI2,
|
||||||
const $REAL* __restrict__ RA,
|
const $REAL* __restrict__ RA,
|
||||||
const $REAL* __restrict__ RB,
|
const $REAL* __restrict__ RB,
|
||||||
const $REAL* __restrict__ RE,
|
const $REAL* __restrict__ RE,
|
||||||
const $REAL* __restrict__ RF,
|
const $REAL* __restrict__ RF,
|
||||||
$REAL d)
|
$REAL d)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
|
@@ -45,38 +45,33 @@ args_defaults = {
|
|||||||
# Argument help messages (used for CLI argparse)
|
# Argument help messages (used for CLI argparse)
|
||||||
help_msg = {
|
help_msg = {
|
||||||
"scenes": "(list, req): Scenes to run the model. Multiple scene objects "
|
"scenes": "(list, req): Scenes to run the model. Multiple scene objects "
|
||||||
"can given in order to run multiple simulation runs. Each scene "
|
"can given in order to run multiple simulation runs. Each scene "
|
||||||
"must contain the essential simulation objects",
|
"must contain the essential simulation objects",
|
||||||
"inputfile": "(str, opt): Input file path. Can also run simulation by "
|
"inputfile": "(str, opt): Input file path. Can also run simulation by " "providing an input file.",
|
||||||
"providing an input file.",
|
|
||||||
"outputfile": "(str, req): File path to the output data file.",
|
"outputfile": "(str, req): File path to the output data file.",
|
||||||
"n": "(int, req): Number of required simulation runs.",
|
"n": "(int, req): Number of required simulation runs.",
|
||||||
"i": "(int, opt): Model number to start/restart simulation from. It would "
|
"i": "(int, opt): Model number to start/restart simulation from. It would "
|
||||||
"typically be used to restart a series of models from a specific "
|
"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 "
|
"model number, with the n argument, e.g. to restart from A-scan 45 "
|
||||||
"when creating a B-scan with 60 traces.",
|
"when creating a B-scan with 60 traces.",
|
||||||
"mpi": "(bool, opt): Flag to use Message Passing Interface (MPI) task farm. "
|
"mpi": "(bool, opt): Flag to use Message Passing Interface (MPI) task farm. "
|
||||||
"This option is most usefully combined with n to allow individual "
|
"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 "
|
"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 "
|
"B-scan with 60 traces and use MPI to farm out each trace. For "
|
||||||
"further details see the performance section of the User Guide.",
|
"further details see the performance section of the User Guide.",
|
||||||
"gpu": "(list/bool, opt): Flag to use NVIDIA GPU or list of NVIDIA GPU "
|
"gpu": "(list/bool, opt): Flag to use NVIDIA GPU or list of NVIDIA GPU " "device ID(s) for specific GPU card(s).",
|
||||||
"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).",
|
||||||
"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.",
|
"subgrid": "(bool, opt): Flag to use sub-gridding.",
|
||||||
"autotranslate": "(bool, opt): For sub-gridding - auto translate objects "
|
"autotranslate": "(bool, opt): For sub-gridding - auto translate objects "
|
||||||
"with main grid coordinates to their equivalent local "
|
"with main grid coordinates to their equivalent local "
|
||||||
"grid coordinate within the subgrid. If this option is "
|
"grid coordinate within the subgrid. If this option is "
|
||||||
"off users must specify sub-grid object point within the "
|
"off users must specify sub-grid object point within the "
|
||||||
"global subgrid space.",
|
"global subgrid space.",
|
||||||
"geometry_only": "(bool, opt): Build a model and produce any geometry "
|
"geometry_only": "(bool, opt): Build a model and produce any geometry " "views but do not run the simulation.",
|
||||||
"views but do not run the simulation.",
|
"geometry_fixed": "(bool, opt): Run a series of models where the geometry " "does not change between models.",
|
||||||
"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 "
|
"write_processed": "(bool, opt): Writes another input file after any "
|
||||||
"Python code (#python blocks) and in the original input "
|
"Python code (#python blocks) and in the original input "
|
||||||
"file has been processed.",
|
"file has been processed.",
|
||||||
"log_level": "(int, opt): Level of logging to use.",
|
"log_level": "(int, opt): Level of logging to use.",
|
||||||
"log_file": "(bool, opt): Write logging information to file.",
|
"log_file": "(bool, opt): Write logging information to file.",
|
||||||
}
|
}
|
||||||
@@ -222,5 +217,5 @@ def run_main(args):
|
|||||||
context = Context()
|
context = Context()
|
||||||
|
|
||||||
results = context.run()
|
results = context.run()
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
@@ -57,9 +57,9 @@ class FDTDGrid:
|
|||||||
self.pmls["cfs"] = []
|
self.pmls["cfs"] = []
|
||||||
self.pmls["slabs"] = []
|
self.pmls["slabs"] = []
|
||||||
# Ordered dictionary required so *updating* the PMLs always follows the
|
# Ordered dictionary required so *updating* the PMLs always follows the
|
||||||
# same order (the order for *building* PMLs does not matter). The order
|
# same order (the order for *building* PMLs does not matter). The order
|
||||||
# itself does not matter, however, if must be the same from model to
|
# itself does not matter, however, if must be the same from model to
|
||||||
# model otherwise the numerical precision from adding the PML
|
# model otherwise the numerical precision from adding the PML
|
||||||
# corrections will be different.
|
# corrections will be different.
|
||||||
self.pmls["thickness"] = OrderedDict((key, 10) for key in PML.boundaryIDs)
|
self.pmls["thickness"] = OrderedDict((key, 10) for key in PML.boundaryIDs)
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ class CUDAGrid(FDTDGrid):
|
|||||||
self.Hx_dev = gpuarray.to_gpu(self.Hx)
|
self.Hx_dev = gpuarray.to_gpu(self.Hx)
|
||||||
self.Hy_dev = gpuarray.to_gpu(self.Hy)
|
self.Hy_dev = gpuarray.to_gpu(self.Hy)
|
||||||
self.Hz_dev = gpuarray.to_gpu(self.Hz)
|
self.Hz_dev = gpuarray.to_gpu(self.Hz)
|
||||||
|
|
||||||
elif config.sim_config.general["solver"] == "opencl":
|
elif config.sim_config.general["solver"] == "opencl":
|
||||||
import pyopencl.array as clarray
|
import pyopencl.array as clarray
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .cmds_multiuse import (
|
from .cmds_multiuse import (
|
||||||
|
PMLCFS,
|
||||||
AddDebyeDispersion,
|
AddDebyeDispersion,
|
||||||
AddDrudeDispersion,
|
AddDrudeDispersion,
|
||||||
AddLorentzDispersion,
|
AddLorentzDispersion,
|
||||||
@@ -29,7 +30,6 @@ from .cmds_multiuse import (
|
|||||||
Material,
|
Material,
|
||||||
MaterialList,
|
MaterialList,
|
||||||
MaterialRange,
|
MaterialRange,
|
||||||
PMLCFS,
|
|
||||||
Rx,
|
Rx,
|
||||||
RxArray,
|
RxArray,
|
||||||
Snapshot,
|
Snapshot,
|
||||||
@@ -387,27 +387,29 @@ def process_multicmds(multicmds):
|
|||||||
material_list = MaterialList(list_of_materials=lmats, id=tmp[tokens - 1])
|
material_list = MaterialList(list_of_materials=lmats, id=tmp[tokens - 1])
|
||||||
scene_objects.append(material_list)
|
scene_objects.append(material_list)
|
||||||
|
|
||||||
cmdname = '#pml_cfs'
|
cmdname = "#pml_cfs"
|
||||||
if multicmds[cmdname] is not None:
|
if multicmds[cmdname] is not None:
|
||||||
for cmdinstance in multicmds[cmdname]:
|
for cmdinstance in multicmds[cmdname]:
|
||||||
tmp = cmdinstance.split()
|
tmp = cmdinstance.split()
|
||||||
|
|
||||||
if len(tmp) != 12:
|
if len(tmp) != 12:
|
||||||
logger.exception("'" + cmdname + ": " + " ".join(tmp) + "'" + " requires exactly twelve parameters")
|
logger.exception("'" + cmdname + ": " + " ".join(tmp) + "'" + " requires exactly twelve parameters")
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
pml_cfs = PMLCFS(alphascalingprofile=tmp[0],
|
pml_cfs = PMLCFS(
|
||||||
alphascalingdirection=tmp[1],
|
alphascalingprofile=tmp[0],
|
||||||
alphamin=tmp[2],
|
alphascalingdirection=tmp[1],
|
||||||
alphamax=tmp[3],
|
alphamin=tmp[2],
|
||||||
kappascalingprofile=tmp[4],
|
alphamax=tmp[3],
|
||||||
kappascalingdirection=tmp[5],
|
kappascalingprofile=tmp[4],
|
||||||
kappamin=tmp[6],
|
kappascalingdirection=tmp[5],
|
||||||
kappamax=tmp[7],
|
kappamin=tmp[6],
|
||||||
sigmascalingprofile=tmp[8],
|
kappamax=tmp[7],
|
||||||
sigmascalingdirection=tmp[9],
|
sigmascalingprofile=tmp[8],
|
||||||
sigmamin=tmp[10],
|
sigmascalingdirection=tmp[9],
|
||||||
sigmamax=tmp[11])
|
sigmamin=tmp[10],
|
||||||
|
sigmamax=tmp[11],
|
||||||
|
)
|
||||||
|
|
||||||
scene_objects.append(pml_cfs)
|
scene_objects.append(pml_cfs)
|
||||||
|
|
||||||
|
@@ -135,15 +135,19 @@ def process_singlecmds(singlecmds):
|
|||||||
if len(tmp) not in [1, 6]:
|
if len(tmp) not in [1, 6]:
|
||||||
logger.exception(f"{cmd} requires either one or six parameter(s)")
|
logger.exception(f"{cmd} requires either one or six parameter(s)")
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
if 'pml_formulation' in locals():
|
if "pml_formulation" in locals():
|
||||||
if len(tmp) == 1:
|
if len(tmp) == 1:
|
||||||
pml_props = PMLProps(formulation=pml_formulation, thickness=int(tmp[0]))
|
pml_props = PMLProps(formulation=pml_formulation, thickness=int(tmp[0]))
|
||||||
else:
|
else:
|
||||||
pml_props = PMLProps(
|
pml_props = PMLProps(
|
||||||
formulation=pml_formulation,
|
formulation=pml_formulation,
|
||||||
x0=int(tmp[0]), y0=int(tmp[1]), z0=int(tmp[2]),
|
x0=int(tmp[0]),
|
||||||
xmax=int(tmp[3]), ymax=int(tmp[4]), zmax=int(tmp[5])
|
y0=int(tmp[1]),
|
||||||
|
z0=int(tmp[2]),
|
||||||
|
xmax=int(tmp[3]),
|
||||||
|
ymax=int(tmp[4]),
|
||||||
|
zmax=int(tmp[5]),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if len(tmp) == 1:
|
if len(tmp) == 1:
|
||||||
@@ -152,7 +156,7 @@ def process_singlecmds(singlecmds):
|
|||||||
pml_props = PMLProps(
|
pml_props = PMLProps(
|
||||||
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])
|
||||||
)
|
)
|
||||||
|
|
||||||
scene_objects.append(pml_props)
|
scene_objects.append(pml_props)
|
||||||
|
|
||||||
cmd = "#src_steps"
|
cmd = "#src_steps"
|
||||||
|
@@ -24,6 +24,7 @@ import numpy as np
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def diff_output_files(filename1, filename2):
|
def diff_output_files(filename1, filename2):
|
||||||
"""Calculates differences between two output files.
|
"""Calculates differences between two output files.
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ def diff_output_files(filename1, filename2):
|
|||||||
f"Type of floating point number in test model ({file1[path + outputs1[0]].dtype}) "
|
f"Type of floating point number in test model ({file1[path + outputs1[0]].dtype}) "
|
||||||
f"does not match type in reference solution ({file2[path + outputs2[0]].dtype})\n"
|
f"does not match type in reference solution ({file2[path + outputs2[0]].dtype})\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Arrays for storing time
|
# Arrays for storing time
|
||||||
time1 = np.zeros((file1.attrs["Iterations"]), dtype=floattype1)
|
time1 = np.zeros((file1.attrs["Iterations"]), dtype=floattype1)
|
||||||
time1 = np.linspace(0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"])
|
time1 = np.linspace(0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"])
|
||||||
|
@@ -50,8 +50,9 @@ fig, ax = plt.subplots(
|
|||||||
)
|
)
|
||||||
|
|
||||||
for x, model in enumerate(testmodels):
|
for x, model in enumerate(testmodels):
|
||||||
time, datadiffs = diff_output_files(fn.parent.joinpath(basename + "_ref.h5"),
|
time, datadiffs = diff_output_files(
|
||||||
fn.parent.joinpath(basename + str(x + 1) + ".h5"))
|
fn.parent.joinpath(basename + "_ref.h5"), fn.parent.joinpath(basename + str(x + 1) + ".h5")
|
||||||
|
)
|
||||||
|
|
||||||
# Print maximum error value
|
# Print maximum error value
|
||||||
start = 210
|
start = 210
|
||||||
|
@@ -56,7 +56,7 @@ for x, PMLID in enumerate(PMLIDs):
|
|||||||
fig, ax = plt.subplots(figsize=(20, 10), facecolor="w", edgecolor="w")
|
fig, ax = plt.subplots(figsize=(20, 10), facecolor="w", edgecolor="w")
|
||||||
ax.remove()
|
ax.remove()
|
||||||
fig.suptitle(f"{PMLID}")
|
fig.suptitle(f"{PMLID}")
|
||||||
|
|
||||||
outputs = ["Ex", "Ey", "Ez", "Hx", "Hy", "Hz"]
|
outputs = ["Ex", "Ey", "Ez", "Hx", "Hy", "Hz"]
|
||||||
for i, output in enumerate(outputs):
|
for i, output in enumerate(outputs):
|
||||||
if i < 3:
|
if i < 3:
|
||||||
@@ -74,9 +74,7 @@ for x, PMLID in enumerate(PMLIDs):
|
|||||||
ax.set_ylabel(f"{output} error [dB]")
|
ax.set_ylabel(f"{output} error [dB]")
|
||||||
|
|
||||||
# Save a PDF/PNG of the figure
|
# 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)
|
# fig.savefig(basename + "_diffs_" + PMLID + ".png", dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)
|
||||||
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ for i, model in enumerate(testmodels):
|
|||||||
f"({float_or_doubletest}) does not "
|
f"({float_or_doubletest}) does not "
|
||||||
f"match type in reference solution ({float_or_doubleref})\n"
|
f"match type in reference solution ({float_or_doubleref})\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Arrays for storing time
|
# Arrays for storing time
|
||||||
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
|
timeref = np.zeros((fileref.attrs["Iterations"]), dtype=float_or_doubleref)
|
||||||
timeref = (
|
timeref = (
|
||||||
|
@@ -422,9 +422,9 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs):
|
|||||||
|
|
||||||
def antenna_like_GSSI_400(x, y, z, resolution=0.002, **kwargs):
|
def antenna_like_GSSI_400(x, y, z, resolution=0.002, **kwargs):
|
||||||
"""Inserts a description of an antenna similar to the GSSI 400MHz antenna.
|
"""Inserts a description of an antenna similar to the GSSI 400MHz antenna.
|
||||||
This model represents an update to the previous model of the GSSI 400MHz
|
This model represents an update to the previous model of the GSSI 400MHz
|
||||||
antenna and was created and optimised by Stadler et al. (2022)
|
antenna and was created and optimised by Stadler et al. (2022)
|
||||||
in: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9686638.
|
in: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9686638.
|
||||||
Can be used with 2mm spatial resolution.
|
Can be used with 2mm spatial resolution.
|
||||||
The external dimensions of the antenna are 300x300x178mm.
|
The external dimensions of the antenna are 300x300x178mm.
|
||||||
One output point is defined between the arms of the receiver bowtie.
|
One output point is defined between the arms of the receiver bowtie.
|
||||||
@@ -459,7 +459,7 @@ def antenna_like_GSSI_400(x, y, z, resolution=0.002, **kwargs):
|
|||||||
metalmiddleplateheight = 0.11
|
metalmiddleplateheight = 0.11
|
||||||
|
|
||||||
smooth_dec = "yes" # choose to use dielectric smoothing or not
|
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
|
pcber = 6.401200848809589
|
||||||
hdper = 1.0
|
hdper = 1.0
|
||||||
skidthickness = 0.01
|
skidthickness = 0.01
|
||||||
|
@@ -39996,4 +39996,4 @@ time my_pulse
|
|||||||
9.9992499437e-08 0.0000000000e+00
|
9.9992499437e-08 0.0000000000e+00
|
||||||
9.9994999625e-08 0.0000000000e+00
|
9.9994999625e-08 0.0000000000e+00
|
||||||
9.9997499812e-08 0.0000000000e+00
|
9.9997499812e-08 0.0000000000e+00
|
||||||
1.0000000000e-07 0.0000000000e+00
|
1.0000000000e-07 0.0000000000e+00
|
||||||
|
在新工单中引用
屏蔽一个用户