model = createpde(3);
[x,y,z] = meshgrid([-3:0.25:3],[-2:0.25:2],[-1:0.25:1]);
x = x(:);
y = y(:);
z = z(:);
K = convhull(x,y,z);
nodes = [x';y';z'];
elements = K';
geometryFromMesh(model,nodes,elements);
figure
pdegplot(model,'FaceLabels','on')
title('Bracket with Face Labels')
generateMesh(model)
ufun = @(region,state)[region.x.^2;region.x.^2 + region.y.^2;region.x.^2 + region.y.^2 - region.z]
applyBoundaryCondition(model,'dirichlet','Face',6,'u',ufun,'Vectorized','on')
specifyCoefficients(model,'m',0,'d',0,'c',1,'a',0,'f',[1;2;3]);
results = solvepde(model);
pdeplot3D(model,'ColorMapData',results.NodalSolution(:,1))
Best Answer