提取由pdetool

时间:2018-07-16 01:26:35

标签: matlab mesh pde

当我使用pdetoolbox生成网格时,就像图像中的网格一样。如何提取网格的范数(最长边值)?我尝试阅读“ pdetool”的文档,并在“ FEMesh属性”中找到了“ MaxElementSize”属性。尽管我不知道如何在PDE工具箱GUI中使用“ MaxElementSize”。

enter image description here

1 个答案:

答案 0 :(得分:1)

从工具箱菜单中,依次选择MeshExport Mesh

enter image description here

然后,您可以选择更改变量名称。这里重要的是前两个,即 points edges 的名称。在此示例中,我将其保留为默认值,即对于{em> points 为p,对于 edges e

points是2 * n矩阵,每列代表顶点的X坐标和Y坐标。 e是一个7 * n矩阵,每一列都是用于构造边的参数。前两行是边缘顶点的索引,其余部分在这里不重要。

% Each edge is bounded by two vertices. 
% Extract the coordinates of the first set of vertices.
e1 = p(:,e(1,:)); 
% Extract the coordinates of the second set of vertices.
e2 = p(:,e(2,:));
% Calculate the square distance.
dsqr = sum((e1 - e2).^2);
% Take the maximum.
[dsqrMax, idx] = max(dsqr);
% Length of the longest edge
dMax = sqrt(dsqrMax);

idxe矩阵中最长边的索引。您可以通过e(:,idx);提取边缘的所有信息。