Adding face IDs to geometry

1 view (last 30 days)
Juan
Juan on 3 Mar 2022
Answered: Avni Agrawal on 6 Oct 2023
Hello,
I am trying to create unique face IDs for my geometry for meshing, but to no success. Only one face can be identified (F1), instead of four, when you run the code below:
thermalmodelS = createpde('thermal','transient');
%Geometry definition
r1 = [3 4 -.17 .17 .17 -.17 -.17 -.17 .17 .17];
r2 = [3 4 -.15 .15 .15 -.15 -.15 -.15 .15 .15];
gdm = [r1; r2]';
g = decsg(gdm,'r1-r2',['r1'; 'r2']');
r2 = [3 4 -.15 .15 .15 -.15 -.15 -.15 .15 .15];
r3 = [3 4 -.09 .09 .09 -.09 -.09 -.09 .09 .09];
gdm = [r2; r3]';
g = decsg(gdm,'r2-r3',['r2'; 'r3']');
r3 = [3 4 -.09 .09 .09 -.09 -.09 -.09 .09 .09];
r4 = [3 4 -.07 .07 .07 -.07 -.07 -.07 .07 .07];
gdm = [r3; r4]';
g = decsg(gdm,'r3-r4',['r3'; 'r4']');
geometryFromEdges(thermalmodelS,gd);
pdegplot(thermalmodelS,'EdgeLabels','on','FaceLabels','on')
xlim([-0.25 0.25])
ylim([-0.2 0.2])
axis equal
Please help.

Answers (1)

Avni Agrawal
Avni Agrawal on 6 Oct 2023
Hi,
I understand that you are trying to identify 4 face ids and label them. It seems there might be a bit of confusion regarding the number of faces in a 2D square. While it's understandable to think that a square has four faces, in reality, a square in a 2D geometry actually has only one face.
In two-dimensional space, a face refers to a flat surface that encloses a shape. In the case of a square, all four sides of the square are connected, forming a single continuous boundary. This means that there is only one face that encompasses the entire square.
It's important to note that the concept of faces becomes more relevant in three-dimensional geometry, where objects can have multiple distinct faces. But in the context of a 2D square, there is only one face, which is the entire square itself.
Take a look at this document for further assistance:

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!