你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Throw exception if unknown grid type
这个提交包含在:
@@ -16,6 +16,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
import gprMax.config as config
|
import gprMax.config as config
|
||||||
from gprMax.grid.mpi_grid import MPIGrid
|
from gprMax.grid.mpi_grid import MPIGrid
|
||||||
from gprMax.model import Model
|
from gprMax.model import Model
|
||||||
@@ -31,6 +33,8 @@ from .updates.cuda_updates import CUDAUpdates
|
|||||||
from .updates.opencl_updates import OpenCLUpdates
|
from .updates.opencl_updates import OpenCLUpdates
|
||||||
from .updates.updates import Updates
|
from .updates.updates import Updates
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Solver:
|
class Solver:
|
||||||
"""Generic solver for Update objects"""
|
"""Generic solver for Update objects"""
|
||||||
@@ -120,6 +124,9 @@ def create_solver(model: Model) -> Solver:
|
|||||||
updates = CUDAUpdates(grid)
|
updates = CUDAUpdates(grid)
|
||||||
elif type(grid) is OpenCLGrid:
|
elif type(grid) is OpenCLGrid:
|
||||||
updates = OpenCLUpdates(grid)
|
updates = OpenCLUpdates(grid)
|
||||||
|
else:
|
||||||
|
logger.error("Cannot create Solver: Unknown grid type")
|
||||||
|
raise ValueError
|
||||||
|
|
||||||
solver = Solver(updates)
|
solver = Solver(updates)
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户