Trying to resolve all the merge conflicts.

这个提交包含在:
Sai-Suraj-27
2023-06-27 16:34:09 +05:30
当前提交 64b3068aa3
共有 18 个文件被更改,包括 81 次插入106 次删除

查看文件

@@ -111,7 +111,7 @@ class AddGrass(UserObjectGeometry):
if ys == yf or zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if xs != volume.xs and xs != volume.xf:
if xs not in [volume.xs and volume.xf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dx), round_value(limits[1] / grid.dx))
@@ -133,10 +133,10 @@ class AddGrass(UserObjectGeometry):
requestedsurface = "xplus"
elif ys == yf:
if xs == xf or zs == zf:
if zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if ys != volume.ys and ys != volume.yf:
if ys not in [volume.ys and volume.yf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dy), round_value(limits[1] / grid.dy))
@@ -158,10 +158,7 @@ class AddGrass(UserObjectGeometry):
requestedsurface = "yplus"
elif zs == zf:
if xs == xf or ys == yf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if zs != volume.zs and zs != volume.zf:
if zs not in [volume.zs and volume.zf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dz), round_value(limits[1] / grid.dz))
@@ -238,7 +235,7 @@ class AddGrass(UserObjectGeometry):
surface.grass.append(g)
# Check to see if grass has been already defined as a material
if not any(x.ID == "grass" for x in grid.materials):
if all(x.ID == "grass" for x in grid.materials):
create_grass(grid)
# Check if time step for model is suitable for using grass

查看文件

@@ -123,7 +123,7 @@ class AddSurfaceRoughness(UserObjectGeometry):
if ys == yf or zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if xs != volume.xs and xs != volume.xf:
if xs not in [volume.xs, volume.xf]:
logger.exception(f"{self.__str__()} can only be used on the external " + "surfaces of a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dx), round_value(limits[1] / grid.dx))
@@ -151,10 +151,10 @@ class AddSurfaceRoughness(UserObjectGeometry):
requestedsurface = "xplus"
elif ys == yf:
if xs == xf or zs == zf:
if zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if ys != volume.ys and ys != volume.yf:
if ys not in [volume.ys and volume.yf]:
logger.exception(f"{self.__str__()} can only be used on the external " + "surfaces of a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dy), round_value(limits[1] / grid.dy))
@@ -182,10 +182,7 @@ class AddSurfaceRoughness(UserObjectGeometry):
requestedsurface = "yplus"
elif zs == zf:
if xs == xf or ys == yf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if zs != volume.zs and zs != volume.zf:
if zs not in [volume.zs and volume.zf]:
logger.exception(f"{self.__str__()} can only be used on the external " + "surfaces of a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dz), round_value(limits[1] / grid.dz))

查看文件

@@ -144,14 +144,13 @@ class FractalBox(UserObjectGeometry):
f"{self.__str__()} must be used with more than " + "one material from the mixing model."
)
raise ValueError
if isinstance(mixingmodel, ListMaterial):
if nbins > len(mixingmodel.mat):
logger.exception(
f"{self.__str__()} too many materials/bins "
+ "requested compared to materials in "
+ "mixing model."
)
raise ValueError
if isinstance(mixingmodel, ListMaterial) and nbins > len(mixingmodel.mat):
logger.exception(
f"{self.__str__()} too many materials/bins "
+ "requested compared to materials in "
+ "mixing model."
)
raise ValueError
# Create materials from mixing model as number of bins now known
# from fractal_box command.
mixingmodel.calculate_properties(nbins, grid)

查看文件

@@ -385,7 +385,7 @@ class HertzianDipole(UserObjectMulti):
p2 = uip.round_to_grid_static_point(p1)
# Check if there is a waveformID in the waveforms list
if not any(x.ID == waveform_id for x in grid.waveforms):
if all(x.ID == waveform_id for x in grid.waveforms):
logger.exception(f"{self.params_str()} there is no waveform " + f"with the identifier {waveform_id}.")
raise ValueError
@@ -526,7 +526,7 @@ class MagneticDipole(UserObjectMulti):
p2 = uip.round_to_grid_static_point(p1)
# Check if there is a waveformID in the waveforms list
if not any(x.ID == waveform_id for x in grid.waveforms):
if all(x.ID == waveform_id for x in grid.waveforms):
logger.exception(f"{self.params_str()} there is no waveform " + f"with the identifier {waveform_id}.")
raise ValueError

查看文件

@@ -73,7 +73,7 @@ class ModelConfig:
# N.B. This will happen if the requested snapshots are too large to
# fit on the memory of the GPU. If True this will slow
# performance significantly.
if sim_config.general["solver"] == "cuda" or sim_config.general["solver"] == "opencl":
if sim_config.general["solver"] in ["cuda", "opencl"]:
if sim_config.general["solver"] == "cuda":
devs = sim_config.args.gpu
elif sim_config.general["solver"] == "opencl":

查看文件

@@ -51,7 +51,6 @@ class Context:
results: dict that can contain useful results/data from simulation.
"""
results = {}
self.tsimstart = timer()
self.print_logo_copyright()
print_host_info(config.sim_config.hostinfo)
@@ -86,7 +85,7 @@ class Context:
self.tsimend = timer()
self.print_sim_time_taken()
return results
return {}
def print_logo_copyright(self):
"""Prints gprMax logo, version, and copyright/licencing information."""

查看文件

@@ -217,10 +217,9 @@ def run_main(args):
# MPI running with (OpenMP/CUDA/OpenCL)
if config.sim_config.args.mpi:
context = MPIContext()
results = context.run()
# Standard running (OpenMP/CUDA/OpenCL)
else:
context = Context()
results = context.run()
results = context.run()
return results

查看文件

@@ -417,7 +417,7 @@ def dispersion_analysis(G):
# Find maximum significant frequency
if G.waveforms:
for waveform in G.waveforms:
if waveform.type == "sine" or waveform.type == "contsine":
if waveform.type in ["sine", "contsine"]:
results["maxfreq"].append(4 * waveform.freq)
elif waveform.type == "impulse":

查看文件

@@ -322,14 +322,13 @@ def check_cmd_names(processedlines, checkessential=True):
lindex += 1
if checkessential:
if countessentialcmds < len(essentialcmds):
logger.exception(
"Your input file is missing essential commands "
+ "required to run a model. Essential commands are: "
+ ", ".join(essentialcmds)
)
raise SyntaxError
if checkessential and countessentialcmds < len(essentialcmds):
logger.exception(
"Your input file is missing essential commands "
+ "required to run a model. Essential commands are: "
+ ", ".join(essentialcmds)
)
raise SyntaxError
return singlecmds, multiplecmds, geometry

查看文件

@@ -1209,7 +1209,6 @@ class OpenCLUpdates:
self.grid.Hy_dev,
self.grid.Hz_dev,
)
event.wait()
# If there are any dispersive materials do 1st part of dispersive update
# (it is split into two parts as it requires present and updated electric field values).
@@ -1231,7 +1230,8 @@ class OpenCLUpdates:
self.grid.Hy_dev,
self.grid.Hz_dev,
)
event.wait()
event.wait()
def update_electric_pml(self):
"""Updates electric field components with the PML correction."""
@@ -1319,7 +1319,6 @@ class OpenCLUpdates:
# if iteration == self.grid.iterations - 1:
# return self.drv.mem_get_info()[1] - self.drv.mem_get_info()[0]
logger.debug("Look at memory estimate for pyopencl")
pass
def calculate_solve_time(self):
"""Calculates solving time for model."""