New answers tagged

2

Thanks to those that responded. Applying the boundary in the pde as a formula is okay for simple geometries but for more complicated ones it is cumbersome. I have tried user21's first suggestion: bmesh = ToBoundaryMesh[DiscretizeGraphics[heatsink], "BoundaryMarkerFunction" -> (2 & /@ # &)]; emesh = ToElementMesh[bmesh]; ...


2

A bit long for a comment: What I'd do is split all polygons into quad elements and use those directly. Roughly like this: sidesback1 = Partition[Table[i, {i, 1, nodes}][[3 ;; -1]], 4]; sidesfront1 = Partition[Table[i, {i, nodes + 1, 2*nodes}][[3 ;; -1]], 4]; bmesh = ToBoundaryMesh["Coordinates" -> Join[face1, face2], "BoundaryElements" -> { ...


10

There are no surface element shape functions. There are, however, the normal shape functions. Load the package: Needs["NDSolve`FEM`"] This gives you the shape functions for implemented elements (see documentation) elementOrder = 1; ElementShapeFunction[TriangleElement, elementOrder][r, s] {1 - r - s, r, s} ElementShapeFunction[TriangleElement, 2][r, s] ...


1

It seems to me you can get the same result without invoking external packages or using an interpolation function, since you have a surface and you have a function defined at all points in space, Taking your region bdr, SliceContourPlot3D[ Sqrt[z^2 + y^2] Cos[ArcTan[y, z]] Sin[x π/2], bdr, {x, -2, 2}, {y, -1, 1}, {z, -1, 1}, ContourShading -> None, ...


5

I haven't done the upgrade to 10.4, this is still stuck in our IT department... Nevertheless, playing with different combinations of ToElementMesh, MeshRegion and RegionBoundary, I've come up with some reasonable results: For my still rather simple example I use a cylinder with a cut-out. reg1=Cylinder[{{-2,0,0},{2,0,0}},1]; ...


6

Since this question has a FEM tag, I assume that the mesh is for applying boundary conditions to a PDE. If that is the case, then the solution suggested by @RunnyKine can be improved. What you are looking for are the "PointMarkerFunction" and the "BoundaryMarkerFunction". Now, it is important to understand that markers can be applied to points for ...


11

Here is an approach using built-in functions: reg = DiscretizeRegion[Disk[{0, 0}, 0.5], MeshCellHighlight -> {{2, All} -> White}] Now, we obtain the outer points: int = MeshCellIndex[reg, {0, "Interior"}][[All,2]] (* interior points *) ext = Complement[MeshCellIndex[reg, 0][[All,2]], int] (* exterior points *) Finally, we set the properties of ...


10

If you don't mind using undocumented stuff, you can access lots of useful properties by converting the BoundaryMeshRegion to a MeshObject. In this case "VertexVertexConnectivityRules" is useful. Here I start at vertex 1 and go up to 4 steps out along the mesh edges: r = BoundaryDiscretizeRegion[Ball[]]; vvcr = ...


4

With addition to your SphericalPlot3D you can trnsform the equation and plot the boudary with ParametricPlot3D. Show[ (*your plot with fixed lighting*) SphericalPlot3D[{-16/(5 \[Pi]) (\[Theta] - 0.5 \[Pi])^2 + \[Pi]}, {\[Theta], 0, Pi}, {\[Phi], 0, 3.2 \[Pi]/2}, PlotStyle -> Directive[White, Opacity[1]], PlotPoints -> 30, Boxed -> ...



Top 50 recent answers are included