凹面六边形有两个口的标准网格?

Léo*_* 준영 9 geometry mesh convex-optimization finite-element-analysis non-convex

我正在计划通过带两个嘴的凹形双对称六边形流动的可视化.

边d1的长度等于边d2的另一长度的示例:

在此输入图像描述

我在这里首先讨论的关于不规则六边形的命名.

有标准的网格工具,你可以绘制自己的网格,但我想有一些标准库,以便我可以与其他人更好地合作,以后的流程模拟.我没有找到任何网库在MathCentral文件交换六边形这里.

是否有任何标准的网格库用于不规则的六边形形状?我也对任何其他语言开放,因为我可以阅读代码并将这些标准转换为Matlab库.

Léo*_* 준영 0

我和我的大学讨论过这个问题。他鼓励创建三角形网络,但也指出了非凸多边形的通用算法。

通过自己的算法创建Mesh

  1. 用虚线将六边形分成两个梯形,如问题正文所示
  2. 将梯形分成三角形:assemmbly并通过以下方式构造修剪网格结构inittri
  3. 负载向量f是由bilin_assembly(因为这之前有效但不一定是最佳选择)构建的

将有两个口的六边形分成两个梯形

  1. 取六个节点中索引差为三且距离最小的两个节点。
  2. 形成两个梯形,一个梯形的编号为 1-4,另一个梯形的编号为 1,6,5,4。

以下语法基于我 2013 年的代码版本,但主要基于Claes Johnson 所著的《利用有限元法对偏微分方程的数值解》一书的描述。

为了简单起见,现在考虑泊松问题的汇编语法(稍后必须在此处进行细化)

% [S,f]=assemblyGlobal(loadfunction,mesh)
%
%   loadfunction = function on the right-hand side of the Poisson equation
%   mesh         = mesh structure on which the assembly is done
%
%   S            = stiffness matrix of the Poisson problem
%   f            = load vector corresponding to loadfunction
Run Code Online (Sandbox Code Playgroud)

我们需要双线性汇编的语法

% function B=bilin_assembly(bilin,mesh)
%
%  bilin = function handle to integrand of the bilinear form
%          given as bilin(u,v,ux,uy,vx,vy,x,y), where
%          u  - values of function u
%          v  - values of function v
%          ux - x-derivative of function u
%          uy - y-derivative of function u
%          vx - x-derivative of function v
%          vy - y-derivative of function v
%          x  - global x-coordinate
%          y  - global y-coordinate
%  mesh  = mesh structure on which the matrix will be assembled
%
%  B     = matrix related to bilinear form bilin
Run Code Online (Sandbox Code Playgroud)

初始化三角形网格的语法

% function mesh = inittri(p,t)
%
%   p       = nodes
%   t       = triangles
%     
%   mesh    = trimesh structure corresponding to (p,t)
%
% TRIMESH STRUCTURE :
% 
%   p       = nodes in a 2xN-matrix
%
%   t       = triangles in a 3xN- matrix (nodes of the triangles as indeces to the p- matrix).
% 
%   edges   = a matrix of all edges in the mesh. Each column is an edge :
%             [n1 ; n2] where n1 < n2;
%
%   t2e     = a matrix connecting  triangle's and edges's. 
%             Each column corresponds to a triangle and has
%             triangle's edges in the order n1->n2, n2->n3,
%             n1->n3. 
%
%   e2t     = inverse of t2e.
Run Code Online (Sandbox Code Playgroud)

由于版权问题,我没有在这里发布完整的源代码,他们会让答案变得相当长。然而,所有算法都基于第一个来源,因此任何研究人员都可以创建。我认为这种有限元方法是找到最佳网格的唯一方法。

一般非凸多边形的算法

还有一些算法可以为一般非凸多边形创建网格。Margus 的答案提供的网格可能是由这样的算法生成的。

ANSYS

我正在体验关于可视化孔、不同几何形状和不同材料的不同产品。 Ansys在这里提供了有前景的解决方案。

来源

  1. Claes Johnson 采用有限元法对偏微分方程进行数值解
  2. 我大学有限元法课堂笔记,2013-2014