finite element method – FEM – Linear grid covering a circle
I have a disk and wish to define a grid of squared cells everywhere, except for the boundary where they should be right triangles or even better, trapezoids. In the following approach I get the disk shape but would like some advice to solve the boundary issue.
<< NDSolve`FEM`
x0 = MeshRegion[ToElementMesh[Rectangle[{0, 0}, {1, 1}], "MaxCellMeasure" -> 1/20^2]]["MakeLinear"]
Module[{remove = Flatten[Position[Positive[Norm /@ MeshCoordinates[x0] - 1], True]]},MeshRegion[MeshCoordinates[x0], Select[MeshCells[x0, 2] //. Thread[remove -> Nothing],Length @@ #1 == 4 & ]]]
(Here I only show a quarter)
Read more here: Source link