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

4 vues (au cours des 30 derniers jours)
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)

Réponse acceptée

Piyush Patil
Piyush Patil le 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)
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

Plus de réponses (0)

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by