你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Updated tests for .h5 output file suffix. Work of CUDA string for dispersive materials.
这个提交包含在:
@@ -103,9 +103,14 @@ class ModelConfig:
|
||||
# maxpoles: Maximum number of dispersive material poles in a model
|
||||
# dispersivedtype: Data type for dispersive materials
|
||||
# dispersiveCdtype: Data type for dispersive materials in Cython
|
||||
# drudelorentz: True/False model contains Drude or Lorentz materials
|
||||
# cudarealfunc: String to substitute into CUDA kernels for fields
|
||||
# dependent on dispersive material type
|
||||
self.materials = {'maxpoles': 0,
|
||||
'dispersivedtype': None,
|
||||
'dispersiveCdtype': None}
|
||||
'dispersiveCdtype': None,
|
||||
'drudelorentz': None,
|
||||
'cudarealfunc': ''}
|
||||
|
||||
def get_scene(self):
|
||||
if sim_config.scenes:
|
||||
@@ -126,11 +131,10 @@ class ModelConfig:
|
||||
materials are present. Real if Debye materials.
|
||||
"""
|
||||
if self.materials['drudelorentz']:
|
||||
self.materials['cuda_real_func'] = '.real()'
|
||||
self.materials['cudarealfunc'] = '.real()'
|
||||
self.materials['dispersivedtype'] = sim_config.dtypes['complex']
|
||||
self.materials['dispersiveCdtype'] = sim_config.dtypes['C_complex']
|
||||
else:
|
||||
self.materials['cuda_real_func'] = ''
|
||||
self.materials['dispersivedtype'] = sim_config.dtypes['float_or_double']
|
||||
self.materials['dispersiveCdtype'] = sim_config.dtypes['C_float_or_double']
|
||||
|
||||
@@ -156,7 +160,7 @@ class ModelConfig:
|
||||
|
||||
parts = self.output_file_path.parts
|
||||
self.output_file_path = Path(*parts[:-1], parts[-1] + self.appendmodelnumber)
|
||||
self.output_file_path_ext = self.output_file_path.with_suffix('.out')
|
||||
self.output_file_path_ext = self.output_file_path.with_suffix('.h5')
|
||||
|
||||
def set_snapshots_dir(self):
|
||||
"""Set directory to store any snapshots."""
|
||||
@@ -227,6 +231,10 @@ class SimulationConfig:
|
||||
except AttributeError:
|
||||
self.general['subgrid'] = False
|
||||
|
||||
# Double precision should be used with subgrid for best accuracy
|
||||
if self.general['subgrid']:
|
||||
self.general['precision'] = 'double'
|
||||
|
||||
# Scenes parameter may not exist if user enters via CLI
|
||||
try:
|
||||
self.scenes = args.scenes
|
||||
|
在新工单中引用
屏蔽一个用户