Which element types can I use to mesh areas in PyMAPDL?
So I have a short script, below, that creates 3 areas and I want to mesh the three with elements of size 0.04. However, I need to specify an element type to do so, and I can't find which ones work. Some won't work with amesh
at all, and some will say you can't use it with amesh
if the areas aren't parallel to the xyz axes. I've been looking for a comprehensive guide to the element types but I can't find anything.
Which element type will work here for me? Does one even exist?
Bonus question: Which element types can I use with amesh
?
from ansys.mapdl.core import launch_mapdl mapdl = launch_mapdl() mapdl.prep7() mapdl.k(1, 0, 0, 0) mapdl.k(2, 0, 1, 0) mapdl.k(3, 1, 1, 0) mapdl.k(4, 1, 0, 0) mapdl.k(5, 0, 0, 1) mapdl.k(6, 0, 1, 1) mapdl.k(7, 1, 1, 1) mapdl.k(8, 1, 0, 1) a0 = mapdl.a(1, 2, 3, 4) a1 = mapdl.a(5, 6, 7, 8) a2 = mapdl.a(3, 7, 8, 4) mapdl.esize(.04) mapdl.et(1, "PLANE183") mapdl.amesh('ALL') print(mapdl.mesh) print(mapdl.elist()) mapdl.eplot()
Answers
-
In general, AMESH command can be used to mesh any area. Coming to the element types, in MAPDL we have two categories of element types associated surface elements i.e. 2D element types & 3D element types
2D/Plane elements: Only those areas which are parallel to Global XY axes can be meshed with these element types. eg: PLANE182, PLANE183 etc
3D Surface/Shell elements: There is no restriction of the area to be parallel to any particular plane (or the requirement to be plane for that matter i.e. it can be curved as well) to be meshed with these element types. eg: SHELL181, SHELL281 etc
The complete list of elements categorized can be found in this link in help doc (check Plane elements and Shell elements).
For your script, since the areas 2 & 3 are not parallel to XY plane, we cannot use PLANE183 (2D plane element type) to mesh these areas. Replacing PLANE183 with SHELL181 (3D surface element type)/SHELL281 (same as SHELL181 but higher order) should work without any problem for your model.
mapdl.et(1, "SHELL181")
If you want to use PLANE183, please make sure your geometry is entirely in XY plane (i.e. Z co-ordinate is zero for all keypoints). For example, below script will work with PLANE183.
mapdl.prep7() mapdl.k(1, 0, 0, 0) mapdl.k(2, 0, 1, 0) mapdl.k(3, 1, 1, 0) mapdl.k(4, 1, 0, 0) #mapdl.k(5, 0, 0, 1) #mapdl.k(6, 0, 1, 1) #mapdl.k(7, 1, 1, 1) #mapdl.k(8, 1, 0, 1) a0 = mapdl.a(1, 2, 3, 4) #a1 = mapdl.a(5, 6, 7, 8) #a2 = mapdl.a(3, 7, 8, 4) mapdl.esize(.04) mapdl.et(1, "PLANE183") mapdl.amesh('ALL') print(mapdl.mesh) print(mapdl.elist()) mapdl.eplot()
Hope this clarifies.
2