Describing a pde model geometry that can have multiple domains
Show older comments
Let's say I have a certain number of polygons (given by the coordinates of their points), which make up a geometry in which I want to solve a pde. The number of polygons, as well as their size, can be changed:
% Height and width of polygons
size_x = 0.5;
size_y = 3;
% Number of polygons
Npoly = 5;
figure;
hold on;
axis equal;
for i = 1:Npoly
% Getting coordinates of current polygon's points
p1_x(i) = (i-1)*size_x;
p1_y(i) = 0;
p2_x(i) = size_y + (i-1)*size_x;
p2_y(i) = size_y;
p3_x(i) = size_y + size_x + (i-1)*size_x;
p3_y(i) = size_y;
p4_x(i) = size_x + (i-1)*size_x;
p4_y(i) = 0;
points = [p1_x(i),p1_y(i); p2_x(i),p2_y(i); p3_x(i),p3_y(i); p4_x(i),p4_y(i)];
% Plotting polygon
pg = polyshape(points(:,1),points(:,2));
plot(pg);
end

Each polygon represents a separate domain, and some constant present in the pde can vary between them, so I need a way of labeling parts of the geometry.
Is it possible to somehow convert these polygons into a model geometry, so that they form separate domains?
1 Comment
Andrei Cheplakov
on 6 Dec 2023
Edited: Andrei Cheplakov
on 6 Dec 2023
Answers (1)
Jiexian Ma
on 5 Apr 2025
0 votes
Yes, it's possible to convert these polygons into a PDE model geometry.


You could check demo14 to demo17 in Im2mesh package. I provide a few examples.
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!