你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Removed CUDA kernel now located in CUDA/OpenCL folder
这个提交包含在:
@@ -17,12 +17,10 @@
|
||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
from string import Template
|
||||
|
||||
import h5py
|
||||
|
||||
from ._version import __version__
|
||||
from .grid import Ix, Iy, Iz
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -54,47 +52,6 @@ def store_outputs(G):
|
||||
tl.Itotal[iteration] = tl.current[tl.antpos]
|
||||
|
||||
|
||||
knl_template_store_outputs = Template("""
|
||||
|
||||
// Macros for converting subscripts to linear index:
|
||||
#define INDEX2D_RXCOORDS(m, n) (m)*($NY_RXCOORDS)+(n)
|
||||
#define INDEX3D_RXS(i, j, k) (i)*($NY_RXS)*($NZ_RXS)+(j)*($NZ_RXS)+(k)
|
||||
#define INDEX3D_FIELDS(i, j, k) (i)*($NY_FIELDS)*($NZ_FIELDS)+(j)*($NZ_FIELDS)+(k)
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Stores field component values for every receiver //
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
__global__ void store_outputs(int NRX, int iteration, const int* __restrict__ rxcoords, $REAL *rxs, const $REAL* __restrict__ Ex, const $REAL* __restrict__ Ey, const $REAL* __restrict__ Ez, const $REAL* __restrict__ Hx, const $REAL* __restrict__ Hy, const $REAL* __restrict__ Hz) {
|
||||
|
||||
// This function stores field component values for every receiver in the model.
|
||||
//
|
||||
// Args:
|
||||
// NRX: Total number of receivers in the model
|
||||
// rxs: Array to store field components for receivers - rows are field components; columns are iterations; pages are receivers
|
||||
// E, H: Access to field component arrays
|
||||
|
||||
// Obtain the linear index corresponding to the current thread and use for each receiver
|
||||
int rx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
|
||||
int i, j, k;
|
||||
|
||||
if (rx < NRX) {
|
||||
i = rxcoords[INDEX2D_RXCOORDS(rx,0)];
|
||||
j = rxcoords[INDEX2D_RXCOORDS(rx,1)];
|
||||
k = rxcoords[INDEX2D_RXCOORDS(rx,2)];
|
||||
rxs[INDEX3D_RXS(0,iteration,rx)] = Ex[INDEX3D_FIELDS(i,j,k)];
|
||||
rxs[INDEX3D_RXS(1,iteration,rx)] = Ey[INDEX3D_FIELDS(i,j,k)];
|
||||
rxs[INDEX3D_RXS(2,iteration,rx)] = Ez[INDEX3D_FIELDS(i,j,k)];
|
||||
rxs[INDEX3D_RXS(3,iteration,rx)] = Hx[INDEX3D_FIELDS(i,j,k)];
|
||||
rxs[INDEX3D_RXS(4,iteration,rx)] = Hy[INDEX3D_FIELDS(i,j,k)];
|
||||
rxs[INDEX3D_RXS(5,iteration,rx)] = Hz[INDEX3D_FIELDS(i,j,k)];
|
||||
}
|
||||
}
|
||||
|
||||
""")
|
||||
|
||||
|
||||
def write_hdf5_outputfile(outputfile, G):
|
||||
"""Writes an output file in HDF5 (.h5) format.
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户