📄 test9.di
字号:
17:27:01.5 27-Aug-1999-- >> % QMG test 9: an object like a hex nut with a triangular crack.
17:27:01.5 27-Aug-1999-- >> % Make the brep 'from scratch'.
17:27:01.5 27-Aug-1999-- >>
17:27:01.5 27-Aug-1999-- >> % get a 6-segment circle approximation.
17:27:01.5 27-Aug-1999-- >>
17:27:01.5 27-Aug-1999-- >> global GM_BREP_TYPE_CODE
17:27:01.5 27-Aug-1999-- >>
17:27:01.5 27-Aug-1999-- >> hexobj = zba({GM_BREP_TYPE_CODE; 3; 3; {}; zeros(3,75); ...
cell(5,15); cell(5,23); cell(5,10); cell(5,1)});17:27:01.5 27-Aug-1999-- >>
17:27:01.5 27-Aug-1999-- >> [nodes1, scrap] = gm_circ_approx(0, 2*pi, 6);
17:27:01.5 27-Aug-1999-- >>
17:27:01.5 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> % make a list of control points for the object.
17:27:01.6 27-Aug-1999-- >> % Control pts 0-17 are 18 control points for the inner circle
17:27:01.6 27-Aug-1999-- >> % of the bottom surface
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> nheight = .3;
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> hexobj{4}(:,0:17) = [nodes1(1:18,:)'; -nheight*ones(1,18)];
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> % Control pts 18-35 are 18 control points for the inner circle
17:27:01.6 27-Aug-1999-- >> % of the top surface
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> hexobj{4}(:,18:35) = [nodes1(1:18,:)'; nheight*ones(1,18)];
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> % Control pts 36-53 are 18 control points for the outer hexagon
17:27:01.6 27-Aug-1999-- >> % of the bottom surface
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> ow = 1.7;
17:27:01.6 27-Aug-1999-- >>
17:27:01.6 27-Aug-1999-- >> cos1 = ow * cos((0:5) * 2 * pi / 6);
17:27:01.6 27-Aug-1999-- >> sin1 = ow * sin((0:5) * 2 * pi / 6);
17:27:01.6 27-Aug-1999-- >> cos2 = ow * cos((1:6) * 2 * pi / 6);
17:27:01.7 27-Aug-1999-- >> sin2 = ow * sin((1:6) * 2 * pi / 6);
17:27:01.7 27-Aug-1999-- >>
17:27:01.7 27-Aug-1999-- >> hexobj{4}(:,36:3:53) = [cos1; sin1; -nheight*ones(1,6)];
17:27:01.7 27-Aug-1999-- >> hexobj{4}(:,37:3:53) = ...
[2*cos1/3 + cos2/3; 2*sin1/3 + sin2/3; -nheight*ones(1,6)];17:27:01.7 27-Aug-1999-- >> hexobj{4}(:,38:3:53) = ...
[cos1/3 + 2*cos2/3; sin1/3 + 2*sin2/3; -nheight*ones(1,6)];17:27:01.7 27-Aug-1999-- >>
17:27:01.7 27-Aug-1999-- >> % Control pts 54-71 are 18 control points for the outer hexagon
17:27:01.7 27-Aug-1999-- >> % of the top surface
17:27:01.7 27-Aug-1999-- >>
17:27:01.7 27-Aug-1999-- >> hexobj{4}(:,54:71) = ...
[double(hexobj{4}(0:1,36:53)); nheight*ones(1,18)];17:27:01.7 27-Aug-1999-- >>
17:27:01.7 27-Aug-1999-- >> % Control pts 72-74 are the control points bounding the crack.
17:27:01.7 27-Aug-1999-- >>
17:27:01.7 27-Aug-1999-- >> hexobj{4}(:,72:74) = [
-1.3, 0, 0 -1.1, 0.05, 0 -1.23, .17, .05]';17:27:01.8 27-Aug-1999-- >>
17:27:01.8 27-Aug-1999-- >> % Create the list of topological vertices -- 6 on top and 6 on the bottom
17:27:01.8 27-Aug-1999-- >> % to bound the two hexagons.
17:27:01.8 27-Aug-1999-- >>
17:27:01.8 27-Aug-1999-- >> for i = 0 : 11
if i < 6 hexobj{5}{0,i} = sprintf('vbottom%d',i); else hexobj{5}{0,i} = sprintf('vtop%d', i - 6); end hexobj{5}{1,i} = {}; hexobj{5}{2,i} = {}; hexobj{5}{3,i} = {}; hexobj{5}{4,i} = cell(3,1); hexobj{5}{4,i}{0} = 'vertex'; hexobj{5}{4,i}{1} = []; hexobj{5}{4,i}{2} = 36 + 3 * i;end17:27:02.0 27-Aug-1999-- >>
17:27:02.0 27-Aug-1999-- >>
17:27:02.0 27-Aug-1999-- >> % Topological vertices bounding the crack
17:27:02.0 27-Aug-1999-- >>
17:27:02.0 27-Aug-1999-- >> for i = 12 : 14
hexobj{5}{0,i} = sprintf('vcrk%d', i - 12); hexobj{5}{1,i} = {}; hexobj{5}{2,i} = {}; hexobj{5}{3,i} = {}; hexobj{5}{4,i} = cell(3,1); hexobj{5}{4,i}{0} = 'vertex'; hexobj{5}{4,i}{1} = []; hexobj{5}{4,i}{2} = i + 60;end17:27:02.1 27-Aug-1999-- >>
17:27:02.1 27-Aug-1999-- >>
17:27:02.1 27-Aug-1999-- >> % Create the list of topological edges -- 6 on top, 6 on the bottom,
17:27:02.1 27-Aug-1999-- >> % and 6 on the side to bound the two hexagons and side faces,
17:27:02.1 27-Aug-1999-- >> % plus two circular curves and three edges bounding the crack.
17:27:02.1 27-Aug-1999-- >>
17:27:02.1 27-Aug-1999-- >>
17:27:02.1 27-Aug-1999-- >> % edges for bottom and top hexes
17:27:02.1 27-Aug-1999-- >>
17:27:02.1 27-Aug-1999-- >> for i = 0 : 11
if i < 6 hexobj{6}{0,i} = sprintf('ebottom%d',i); else hexobj{6}{0,i} = sprintf('etop%d', i - 6); end nexti = i + 1; if rem(nexti,6) == 0 nexti = nexti - 6; end hexobj{6}{1,i} = {}; if (i < 6) hexobj{6}{2,i} = {sprintf('vbottom%d', i), sprintf('vbottom%d',nexti)}; else hexobj{6}{2,i} = {sprintf('vtop%d', i - 6), sprintf('vtop%d',nexti - 6)}; end hexobj{6}{3,i} = {}; hexobj{6}{4,i} = cell(3,1); hexobj{6}{4,i}{0} = 'bezier_curve'; hexobj{6}{4,i}{1} = 1; hexobj{6}{4,i}{2} = [36 + i*3, 36 + nexti*3];end17:27:02.4 27-Aug-1999-- >>
17:27:02.4 27-Aug-1999-- >> % edges connecting top and bottom hex
17:27:02.4 27-Aug-1999-- >>
17:27:02.4 27-Aug-1999-- >> for i = 12 : 17
hexobj{6}{0,i} = sprintf('eside%d', i - 12); hexobj{6}{1,i} = {}; hexobj{6}{2,i} = {sprintf('vbottom%d', i - 12), sprintf('vtop%d', i - 12)}; hexobj{6}{3,i} = {}; hexobj{6}{4,i} = cell(3,1); hexobj{6}{4,i}{0} = 'bezier_curve'; hexobj{6}{4,i}{1} = 1; hexobj{6}{4,i}{2} = [i*3,i*3+18];end17:27:02.5 27-Aug-1999-- >>
17:27:02.5 27-Aug-1999-- >> % two circular edges
17:27:02.5 27-Aug-1999-- >>
17:27:02.5 27-Aug-1999-- >>
17:27:02.5 27-Aug-1999-- >> for i = 18 : 19
if i == 18 hexobj{6}{0,i} = 'ebottomcirc'; b1 = 0; else hexobj{6}{0,i} = 'etopcirc'; b1 = 18; end hexobj{6}{1,i} = {}; hexobj{6}{2,i} = {}; hexobj{6}{3,i} = {}; hexobj{6}{4,i} = cell(3,6); for j = 0 : 5 nextj = rem(j + 1,6); hexobj{6}{4,i}{0,j} = 'bezier_curve'; hexobj{6}{4,i}{1,j} = 3; hexobj{6}{4,i}{2,j} = [3*j+b1,3*j+b1+1,3*j+b1+2,3*nextj+b1]; endend17:27:02.7 27-Aug-1999-- >>
17:27:02.7 27-Aug-1999-- >>
17:27:02.7 27-Aug-1999-- >> % crack
17:27:02.7 27-Aug-1999-- >>
17:27:02.7 27-Aug-1999-- >> for i = 20 : 22
hexobj{6}{0,i} = sprintf('ecrk%d', i - 20); hexobj{6}{1,i} = {}; hexobj{6}{2,i} = {sprintf('vcrk%d', i - 20), ... sprintf('vcrk%d', rem(i - 19,3))}; hexobj{6}{3,i} = {}; hexobj{6}{4,i} = cell(3,1); hexobj{6}{4,i}{0} = 'bezier_curve'; hexobj{6}{4,i}{1} = 1; hexobj{6}{4,i}{2} = [i + 52, rem(i - 19,3) + 72];end17:27:02.8 27-Aug-1999-- >>
17:27:02.8 27-Aug-1999-- >>
17:27:02.8 27-Aug-1999-- >> % Make the topological surfaces. There is one on bottom, one on top,
17:27:02.8 27-Aug-1999-- >> % one for the inside, six for the outside, and one for the crack.
17:27:02.8 27-Aug-1999-- >>
17:27:02.8 27-Aug-1999-- >>
17:27:02.8 27-Aug-1999-- >> % bottom and top surfaces
17:27:02.8 27-Aug-1999-- >>
17:27:02.8 27-Aug-1999-- >> for i = 0 : 1
if i == 0 word1 = 'bottom'; b1 = 0; else ,... word1 = 'top'; b1 = 18; end ,... hexobj{7}{0,i} = sprintf('s_%s', word1); hexobj{7}{1,i} = {}; hexobj{7}{2,i} = cell(1,7); hexobj{7}{2,i}{0} = sprintf('e%scirc', word1); for j = 1 : 6 hexobj{7}{2,i}{j} = sprintf('e%s%d', word1, j - 1); end hexobj{7}{3,i} = {}; hexobj{7}{4,i} = cell(3,6); for j = 0 : 5 nextj = rem(j + 1, 6); hexobj{7}{4,i}{0,j} = 'bezier_quad'; hexobj{7}{4,i}{1,j} = [3,1]; hexobj{7}{4,i}{2,j} = [... b1 + 36 + 3*j, b1 + 37 + 3*j, b1 + 38 + 3*j, b1 + 36 + 3*nextj, ... b1 + 3*j, b1 + 1 + 3*j, b1 + 2 + 3*j, b1 + 3*nextj]; endend17:27:03.1 27-Aug-1999-- >>
17:27:03.1 27-Aug-1999-- >> % inner surface
17:27:03.1 27-Aug-1999-- >>
17:27:03.1 27-Aug-1999-- >> hexobj{7}{0,2} = 's_inner';
17:27:03.1 27-Aug-1999-- >> hexobj{7}{1,2} = {};
17:27:03.1 27-Aug-1999-- >> hexobj{7}{2,2} = {'ebottomcirc', 'etopcirc'};
17:27:03.1 27-Aug-1999-- >> hexobj{7}{3,2} = {};
17:27:03.1 27-Aug-1999-- >> hexobj{7}{4,2} = cell(3,6);
17:27:03.1 27-Aug-1999-- >> for j = 0 : 5
nextj = rem(j+1,6); hexobj{7}{4,2}{0,j} = 'bezier_quad'; hexobj{7}{4,2}{1,j} = [3,1]; hexobj{7}{4,2}{2,j} = [... 3*j, 3*j+1, 3*j+2, 3*nextj, ... 3*j+18,3*j+19,3*j+20,3*nextj+18];end17:27:03.2 27-Aug-1999-- >>
17:27:03.2 27-Aug-1999-- >>
17:27:03.2 27-Aug-1999-- >> % six outer surfaces
17:27:03.2 27-Aug-1999-- >>
17:27:03.2 27-Aug-1999-- >> for i = 3 : 8
i0 = i - 3; i1 = rem(i - 2,6); hexobj{7}{0,i} = sprintf('s_outer%d', i0); hexobj{7}{1,i} = {}; hexobj{7}{2,i} = {sprintf('ebottom%d', i0), sprintf('etop%d', i0), ... sprintf('eside%d', i0), sprintf('eside%d', i1)}; hexobj{7}{3,i} = {}; hexobj{7}{4,i} = cell(3,1); hexobj{7}{4,i}{0} = 'bezier_quad'; hexobj{7}{4,i}{1} = [1,1]; hexobj{7}{4,i}{2} = [3*i0+36,3*i1+36,3*i0+54,3*i1+54];end17:27:03.3 27-Aug-1999-- >>
17:27:03.3 27-Aug-1999-- >>
17:27:03.3 27-Aug-1999-- >> % crack surface
17:27:03.4 27-Aug-1999-- >>
17:27:03.4 27-Aug-1999-- >> hexobj{7}(:,9) = {
'crack' {} {'ecrk0', 'ecrk1', 'ecrk2'} {} {'bezier_triangle'; 1; [72,73,74]}};17:27:03.4 27-Aug-1999-- >>
17:27:03.4 27-Aug-1999-- >> % chamber
17:27:03.4 27-Aug-1999-- >>
17:27:03.4 27-Aug-1999-- >> hexobj{8}(:,0) = {
'hexnutcrack' {} {'s_bottom', 's_top', 's_inner', 's_outer0', 's_outer1', ... 's_outer2', 's_outer3', 's_outer4', 's_outer5', 'crack', 'crack'} {} {}};17:27:03.4 27-Aug-1999-- >>
17:27:03.4 27-Aug-1999-- >> hexobj = gmrndcolor(hexobj);
17:27:03.5 27-Aug-1999-- >>
17:27:03.5 27-Aug-1999-- >> show = 0;
17:27:03.5 27-Aug-1999-- >> global interactive
17:27:03.5 27-Aug-1999-- >> if length(interactive) > 0
show = 1;end17:27:03.5 27-Aug-1999-- >>
17:27:03.5 27-Aug-1999-- >> mesh = gmmeshgen(hexobj, 'show', show, 'tol', 1e-12);
17:27:46.0 27-Aug-1999-- >>
17:27:46.0 27-Aug-1999-- >> [hexobj2, mesh2] = gmdouble(hexobj, {'*'}, mesh);
17:27:46.9 27-Aug-1999-- >> asp = gmchecktri(hexobj2, mesh2);
Maximum aspect ratio = 72.4505 achieved insimplex #1265 of topological entity hexnutcrack (3:0) which has vertices 3 349 487 490 Maximum global side length = 0.780871Minimum global altitude = 0.00196405Number of nodes = 803 number of elements = 333017:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >> [scrap, numvtx] = size(mesh2{4});
17:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >> global aspprod
17:27:47.9 27-Aug-1999-- >> global meshsizesum
17:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >> if length(aspprod) > 0, ...
aspprod = aspprod * asp;, ... meshsizesum = meshsizesum + numvtx;, ...end17:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >>
17:27:47.9 27-Aug-1999-- >> % ------------------------------------------------------------------
17:27:47.9 27-Aug-1999-- >> % Copyright (c) 1999 by Cornell University. All rights reserved
17:27:47.9 27-Aug-1999-- >> % See the accompanying file 'Copyright' for authorship information,
17:27:47.9 27-Aug-1999-- >> % the terms of the license governing this software, and disclaimers
17:27:47.9 27-Aug-1999-- >> % concerning this software.
17:27:48.0 27-Aug-1999-- >> % ------------------------------------------------------------------
17:27:48.0 27-Aug-1999-- >> % This file is part of the QMG software.
17:27:48.0 27-Aug-1999-- >> % Version 2.0 of QMG, release date RELDATE.
17:27:48.0 27-Aug-1999-- >> % ------------------------------------------------------------------
17:27:48.0 27-Aug-1999-- >>
17:27:48.0 27-Aug-1999-- >>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -