The overal boundary C I made with 4 lines.
The line which separates B (a different material) from the rest of the interior I made with a single line - is this the correct approach ?
i’m stuck on how to create A. If i simply create 4 more lines I get a lot of errors - not surprising but I figured I should try.
I’m wondering if I need to create something similar to this drawing, i.e. two lines across the center, and then two more vertical lines to bound the interior rectangle.
That approach would seem to make the meshing much more difficult as the number of mesh points needs to be tightly controlled based on the location.
Hello,
You must not double the lines. You can make your middle horizontal line with three pieces, and then the three remaining sides of A are three other pieces.
Then you build the mesh as in the example of https://doc.freefem.org/documentation/mesh-generation.html
code before figure 58.
The mesh will automatically have three regions. In order to get the region numbers,
You take the coordinate of a point (x_1,y_1) and then int n1=Th(x_1, y_1).region
gives you the region number (which (x_1,y_1) belongs to).
You can then create your variational formulation over this region by involving int2d(Th,n1)(...)
You do similarly with the two other regions.