5
$\begingroup$

In a meshed cylinder Cylinder[{{0,0,0},{0,0,1}},1] I need to specify DirichletConditions along x=y=0.

How to define such a 3D mesh with additional inner boundary?

Thanks!

$\endgroup$
2
  • 1
    $\begingroup$ Not sure whether this works in 3D, but this should answer your question if it does: mathematica.stackexchange.com/questions/207285/… $\endgroup$
    – Lukas Lang
    Mar 19, 2023 at 11:13
  • $\begingroup$ @LukasLang Thank you, I have to try it out. Unfortunately I'm not able to mesh the line in 3D: ToElementMesh[Line[...]] $\endgroup$ Mar 19, 2023 at 14:34

1 Answer 1

6
$\begingroup$

ToBoundaryMesh[..., "IncludePoints" -> myAdditionnalPoints] seems to be the solution :

myAdditionnalPoints = Table[{0, 0, h}, {h, 0, 1, 1/50}];

boundaryMesh = 
 ToBoundaryMesh[Cylinder[{{0, 0, 0}, {0, 0, 1}}, 1], 
  "IncludePoints" -> myAdditionnalPoints]

boundaryMesh["Wireframe"["MeshElement" -> "PointElements"]]

enter image description here

Checking that the points are still there after full-meshing :

fullMesh = ToElementMesh[boundaryMesh]
fullMesh["Wireframe"["MeshElement" -> "PointElements"]]  

enter image description here

$\endgroup$
6
  • $\begingroup$ The solution is simple but it took me hours to find it ! $\endgroup$
    – andre314
    Mar 19, 2023 at 16:00
  • $\begingroup$ Looks good, thank you very much! $\endgroup$ Mar 19, 2023 at 16:07
  • $\begingroup$ Unfortunately ther are no linelements: Cases[boundaryMesh["BoundaryElements"], Line[p_] :> p, -1] (*{}*) $\endgroup$ Mar 19, 2023 at 16:20
  • 2
    $\begingroup$ I don't understand, Dirichlet conditions do not need some "LineElements" : Only PointElements are necessary $\endgroup$
    – andre314
    Mar 19, 2023 at 16:23
  • $\begingroup$ Thanks , I expected a line for the inner bc and a set of triangles outside. I will test the DirichletCondition. By the wayCases[boundaryMesh["BoundaryElements"], Point[p_] :> p, -1] gives {} too $\endgroup$ Mar 19, 2023 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.