5
$\begingroup$

How can we know the unit of mesh or create a mesh in specified length units:

such as, for example I have:

    bmesh = ToBoundaryMesh[
   "Coordinates" -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1/6, 1/6}, {5/6,
       1/6}, {5/6, 5/6}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        1}}], LineElement[{{5, 6}, {6, 7}}]}];
bmesh["Wireframe"]

How can I specify the length of the mesh and/or boundaries in meter or mm or cm units:

 mesh = ToElementMesh[bmesh, MaxCellMeasure -> Infinity];
mesh["Wireframe"]

is there a way or am I missing some basics?

$\endgroup$

1 Answer 1

5
$\begingroup$

The numbers "Coordinates", without any unit, define your mesh.

One way to get a mm-mesh : Introduce pseudo units meter,mm

Needs["NDSolve`FEM`"]
meter=1; 
mm=meter/1000; 

bmesh = ToBoundaryMesh[
"Coordinates" -> mm {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1/6, 1/6}, {5/6, 1/6}, {5/6,5/6}}, "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3,4}, {4, 1}}], LineElement[{{5, 6}, {6, 7}}]}];
Show[bmesh["Wireframe"], Axes -> True]

enter image description here

mesh = ToElementMesh[bmesh, MaxCellMeasure -> mm^2/100];
mesh["Wireframe"]

enter image description here

Hope it helps!

$\endgroup$

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.