过去两天我一直被这个问题困扰,到目前为止还没有找到解决方案。我有以下格式的数据:
x1, y1, val1
.. .. ..
.. .. ..
xn, yn, valn
这些值val1, ..., valn
是我在几何模拟后获得的场量,如下所示。
Only the grey region is the domain of interest whereas the one in blue/dark blue is not (including the inverted L shaped blue region in the interior). Thus the x and y coordinates of the data are scattered/irregular and with large gaps due to the hole in my original geometry. Is there a way to get a filled contour plot for this data? Trying the following in Matlab gives me triangulation with triangles outside the original polygon. Also, it fills the holes which is not what I want.
x = data(:,1);
y = data(:,2);
z = data(:,3);
%
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
xi = dt.Points(:,1) ;
yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zI = F(xi,yi) ;
trisurf(tri,xi,yi,zI)
Another possibility was to import the data in ParaView and do filtering as Table-to-Points--> Delaunay Triangulation 2D
. But this has the same problems as Matlab. The holes are not analytical to mask the unwanted interpolated regions with NaN
s by using some mathematical expression.
Paraview 似乎对此有解决方案。虽然我没有使用有限元来求解 pde,但我可以在 GMsh 中为我的带孔几何体生成一个有限元网格。然后我在 ParaView 中导入我的 CSV 数据文件和 GMsh 网格文件(.vtk 格式)。使用数据集过滤器对我的字段数据进行重新采样,并将 Delaunay2D 的结果作为输入给我仅在原始几何体上的轮廓。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句