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 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
    21 hours ago
  • $\begingroup$ Looks good, thank you very much! $\endgroup$ 21 hours ago
  • $\begingroup$ Unfortunately ther are no linelements: Cases[boundaryMesh["BoundaryElements"], Line[p_] :> p, -1] (*{}*) $\endgroup$ 21 hours ago
  • 2
    $\begingroup$ I don't understand, Dirichlet conditions do not need some "LineElements" : Only PointElements are necessary $\endgroup$
    – andre314
    21 hours ago
  • $\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$ 21 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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