How to create multiple "Void" cuboids in Partial DE model geometry

13 views (last 30 days)
Richard Saumarez on 18 Mar 2023
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]);
end
pdegplot(g1,"FaceLabels","on","FaceAlpha",0.5)
Richard Saumarez on 2 Apr 2023
Many thanks

Piyush Patil on 31 Mar 2023
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)
%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]);
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).

Categories

Find more on Geometry and Mesh in Help Center and File Exchange

R2023a

Community Treasure Hunt

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

Start Hunting!