How to create multiple "Void" cuboids in Partial DE model geometry
조회 수: 4 (최근 30일)
이전 댓글 표시
I want to create a geometry with muliple cuboids of different sizes which are VOID. It is easy to greate a geometry with non void cuboids but creating the geomety with "holes" (i,e,: void cuboids) defeats me.
g1 = multicuboid(30,30,8,"Zoffset",0);
for i=1:11
% Make a cuboid with dimensions dependent on loop index
g2=multicuboid(0.5,i*2,4-i/5); % HOW DOES ONE MAKE THIS VOID??
% Move it to its position in the main region
g3=translate(g2,[(i-6)*2 0 1+i/4]);
% Add it
g1=addCell(g1,g3);
end
pdegplot(g1,"FaceLabels","on","FaceAlpha",0.5)
채택된 답변
Piyush Patil
2023년 3월 31일
Hello Richard,
You can create multiple void cuboids in partial DE model geometry by using the “addVoid()” function.
Consider the following example -
g1 = multicuboid(2,2,2,"Zoffset",0)
%figure
pdegplot(g1,"CellLabels","on","FaceAlpha",0.5)
g2 = multicuboid(1,1,1,"Zoffset",0.5)
%figure
pdegplot(g2,"CellLabels","on","FaceAlpha",0.5)
g3 = addVoid(g1, g2)
%figure
pdegplot(g3,"CellLabels","on","FaceAlpha",0.5)
In this example, "addVoid(g1, g2)" creates void region inside "g1" using all cells of "g2".
You can modify your code as follows to insert multiple void regions -
g1 = multicuboid(30,30,8,"Zoffset",0);
for i=1:11
% Make a cuboid with dimensions dependent on loop index
g2=multicuboid(0.5,i*2,4-i/5); % HOW DOES ONE MAKE THIS VOID??
% Move it to its position in the main region
g3=translate(g2,[(i-6)*2 0 1+i/4]);
% Add it
g1=addVoid(g1,g3)
end
pdegplot(g1,"CellLabels","on","FaceAlpha",0.5)
So, instead of using "addCell()" function, use "addVoid()" function. You will see that the figure generated using "addCell()" function is having 12 cells (c1, c2, ...c12) whereas the figure generated using "addVoid()" function is only having one cell (c1).
You can also refer to the following link for additional information about "addVoid()" function - addVoid
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!