필터 지우기
필터 지우기

How do I mesh a matlab model

조회 수: 6 (최근 30일)
N G
N G 2024년 6월 11일
답변: sai charan sampara 2024년 6월 11일
I am trying to mesh a geometry. The geometry was modelled on matlab. Most meshing examples on matlab involve importing of the geometry. How do I mesh a model that was made in matlab. The model code as well as the mesh code has been given below.
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) - length(C1),1)];
C2 = [C2;zeros(length(rect1) - length(C2),1)];
gd = [C1,C2,rect1];
ns = (char('C1','C2','rect1'));
ns = ns';
sf='(C2)-(C1+rect1)';
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry="gd1");
model = generateMesh(model,Hmax=5,Hmin=1);
pdemesh(model)

채택된 답변

sai charan sampara
sai charan sampara 2024년 6월 11일
Hello
There need not be inverted commas over the geometry type in the line where "femodel" is defined. I have increased the "Hmax" value to decrease the run time of the code. The following code might help you:
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) - length(C1),1)];
C2 = [C2;zeros(length(rect1) - length(C2),1)];
gd = [C1,C2,rect1];
ns = (char('C1','C2','rect1'));
ns = ns';
sf='(C2)-(C1+rect1)';
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry=gd1);
model = generateMesh(model,Hmax=50,Hmin=1);
pdemesh(model)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Unified Modeling에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by