这个提交包含在:
jasminium
2021-05-14 18:58:24 +02:00
父节点 98bb8d2ba7
当前提交 2455525206

查看文件

@@ -197,13 +197,12 @@ class GeometryView:
def evtk_voxels(self): def evtk_voxels(self):
G = self.G G = self.G
# sample the solid array
solid = np.copy(G.solid[self.xs:self.xf:self.dx, solid = np.copy(G.solid[self.xs:self.xf:self.dx,
self.ys:self.yf:self.dx, self.zs:self.zf:self.dx]) self.ys:self.yf:self.dx, self.zs:self.zf:self.dx])
# length is number of vertices in each direction * size of each block + starting offset # coordinates of vertices (rectilinear)
# vertices are number of cell + 1 # (length is number of vertices in each direction) * (size of each block [m]) + (starting offset)
# origin
x = np.arange( x = np.arange(
0, solid.shape[0] + 1) * (G.dx * self.dx) + (self.xs * G.dx) 0, solid.shape[0] + 1) * (G.dx * self.dx) + (self.xs * G.dx)
y = np.arange( y = np.arange(
@@ -211,10 +210,11 @@ class GeometryView:
z = np.arange( z = np.arange(
0, solid.shape[2] + 1) * (G.dz * self.dz) + (self.zs * G.dz) 0, solid.shape[2] + 1) * (G.dz * self.dz) + (self.zs * G.dz)
# get information about pml, sources, receivers # Get information about pml, sources, receivers
info = self.get_gprmax_info(G, materialsonly=False) info = self.get_gprmax_info(G, materialsonly=False)
comments = json.dumps(info) comments = json.dumps(info)
# Write the VTK file .vtr
rectilinearToVTK(self.format_filename_evtk(self.filename), x, y, z, cellData={ rectilinearToVTK(self.format_filename_evtk(self.filename), x, y, z, cellData={
"Material": solid}, comments=[comments]) "Material": solid}, comments=[comments])