Change Face Labels at geometryFromMesh

I want to solve a pde with solvepde. For that I create a geometry from a point cloud with geometryFromMesh. The next step is to create the boundary conditions and I need the face labels for that. The geometry is a simple cylinder. The problem is that every time I change the radius of the cylinder the face labels change. So sometimes the upper end is called F1 and sometimes the other end. This is the code:
r=1; %radius
l=200; %length
[x,y,z]=cylinder(r);
z(2,:)=l;
x=x(:);
y=y(:);
z=z(:);
P=[x y z];
shp=alphaShape(P(:,1),P(:,2),P(:,3),l+1);
[elements,nodes]=boundaryFacets(shp);
nodes=nodes';
elements=elements';
model=createpde();
geometryFromMesh(model,nodes,elements);
h=pdegplot(model,'FaceLabels','on');
h(1).FaceAlpha=0.5;
Is it possible to rename the faces so that the names are the same every time irrespective of the radius? Or maybe to define the names before creating the geometry is build?

Réponses (1)

Alan Weiss
Alan Weiss le 7 Fév 2017

0 votes

I am sorry, but I don't think that there is a way to keep the labels fixed when you generate a new geometry. I will enter an enhancement request into our tracking database.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!

Translated by