Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Needs["NDSolve`FEM`"]
- mesh = ToElementMesh[
- "Coordinates" -> {{1.293, 0.228}, {1., 0.}, {0.94, 0.342}, {1.293,
- 0.}, {1.215, 0.442}, {2., 0.}, {1.879, 0.684}},
- "MeshElements" -> {TriangleElement[{{1, 3, 2}, {1, 2, 4}, {1, 4,
- 6}, {1, 6, 7}, {1, 7, 5}, {1, 5, 3}}, {66, 66, 66, 44, 44,
- 44}]},
- "BoundaryElements" -> {LineElement[{{3, 2}, {1, 3}, {2, 4}, {4,
- 6}, {6, 1}, {6, 7}, {7, 5}, {5, 3}}, {11, 22, 33, 33, 22, 44,
- 55, 55}]},
- "PointElements" -> {PointElement[{{1}, {2}, {3}, {4}, {5}, {6},
- {7}}, {1, 2, 2, 3, 3, 4, 4}]}]
- Show[mesh["Wireframe"],
- mesh["Wireframe"["MeshElement" -> "PointElements",
- "MeshElementIDStyle" -> Brown]]]
- Show[
- mesh["Wireframe"],
- mesh["Wireframe"["MeshElementMarkerStyle" -> Blue]],
- mesh["Wireframe"["MeshElement" -> "BoundaryElements",
- "MeshElementMarkerStyle" -> Red]],
- mesh["Wireframe"["MeshElement" -> "PointElements",
- "MeshElementMarkerStyle" -> Brown]]
- ]
- ufun = NDSolveValue[{Laplacian[u[x, y], {x, y}] ==
- If[ElementMarker == 44, 10, 1] +
- NeumannValue[-1, ElementMarker == 44],
- DirichletCondition[u[x, y] == 0, ElementMarker == 1]},
- u, {x, y} [Element] mesh]
- Plot3D[ufun[x, y], {x, y} [Element] mesh]
Add Comment
Please, Sign In to add comment