Incomplete mods and updates as discussed will John. Not implemented new config yet.

这个提交包含在:
Craig Warren
2019-10-10 16:45:25 +01:00
父节点 3cad0f25b0
当前提交 c11dbd7671
共有 31 个文件被更改,包括 537 次插入574 次删除

查看文件

@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
from tqdm import tqdm
import logging
import gprMax.config as config
from .cmds_geometry import UserObjectGeometry
@@ -25,6 +25,8 @@ from ..materials import Material
from ..utilities import round_value
log = logging.getLogger(__name__)
class AddSurfaceWater(UserObjectGeometry):
"""Allows you to add surface water to a :class:`gprMax.cmds_geometry.fractal_box.FractalBox` in the model.
@@ -54,12 +56,12 @@ class AddSurfaceWater(UserObjectGeometry):
except KeyError:
raise CmdInputError(self.__str__() + ' requires exactly eight parameters')
# grab the correct fractal volume
# Get the correct fractal volume
volumes = [volume for volume in grid.fractalvolumes if volume.ID == fractal_box_id]
if volumes:
volume = volumes[0]
else:
raise CmdInputError(self.__str__() + ' Cant find FractalBox {}'.format(fractal_box_id))
raise CmdInputError(self.__str__() + f' cannot find FractalBox {fractal_box_id}')
p1, p2 = uip.check_box_points(p1, p2, self.__str__())
xs, ys, zs = p1
@@ -143,4 +145,4 @@ class AddSurfaceWater(UserObjectGeometry):
raise CmdInputError(self.__str__() + ' requires the time step for the model to be less than the relaxation time required to model water.')
if config.is_messages():
tqdm.write('Water on surface from {:g}m, {:g}m, {:g}m, to {:g}m, {:g}m, {:g}m with depth {:g}m, added to {}.'.format(xs * grid.dx, ys * grid.dy, zs * grid.dz, xf * grid.dx, yf * grid.dy, zf * grid.dz, filldepth, surface.operatingonID))
log.info('Water on surface from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m with depth {filldepth:g}m, added to {surface.operatingonID}.')