While the other guys explained the theoretical framework behind meshing, the practice is markedly different and it is not at all automatic in industries where quality of mesh is of utmost importance given that finite element analysis results cover a great deal of the product development process.
Let's first understand how meshing is done:
Meshing for structural domains are of three types: 1D meshing, 2D meshing, and 3D meshing based on the type of elements used for meshing.
Which mesh to use i.e. 1D, 2D, or 3D is primarily dependent on the computational accuracy required, computational cost (time required to solve the problem), and aspect ratio of the domain. The highest aspect ratio should be more than 10 (as a thumbs rule in general) to neglect a dimension and go for a low-dimension mesh.
Let me explain.
A domain that is 100X50X80 has all comparable dimension and the highest aspect ratio is 100/50=3. Therefore, 3D elements will be used to mesh that part.
A domain that is 100X50X8 has one dimension negligible and the highest aspect ratio is 100/8=12. Therefore, 2D elements will be used. A sheet metal part is a perfect example of this.
A domain that is 100X5X8 has two dimensions negligible and the highest aspect ratio is 100/5=20. Therefore, 1D elements will be used. A truss assembly serves as an example.
Once you decide the type of elements to be used, element quality comes into picture. To maintain quality, meshing must be done manually.
All meshing software comes with an automesh option, which works only with mappable parts and straight faces/blocks. Most of the explanations in other answers (esp. @Wes's answer) are related to what is done in the background for automesh to work.
The idea then, is to divide your domain into multiple patches and automesh them patch by patch and continuously ensuring connection between the patches. Ensuring connectivity is mostly automatic based on a tolerance based check. 1D meshing is easier in these aspects.
The next thing is to maintain mesh flow and symmetry. Mesh flow indicates the transformation of element sizes. When you have to represent a complex feature, element size will change from bigger to smaller. This shouldn't happen in a flash and gradual change of size is to be maintained. Also, symmetrical parts should have symmetrical mesh to maintain integrity of results from FEA.
All the above points will help in maintaining mesh quality. However, meshing software usually have a provision to check the mesh quality using a few parameters which can be adjusted as per one's requirement. A final check on quality and connectivity is essential to ensure quality results from FEA.
Some qualities expected from a good mesh:
from 1D mesh
- No issue with connectivity of nodes
- No duplicate elements
- Maintain minimum and maximum length
from 2D/3D mesh
- Less than 5 degree warpage angle {calculated by splitting a quad into two trias and finding the angle between the two planes which the trias form}
- Aspect ratio less than 5 {dividing the maximum length side of an element by the minimum length side of the element.}
- Skew angle more than 60 degree {the minimum angle between the vector from each node to the opposing mid-side and the vector between the two adjacent mid-sides at each node of the element. Ninety degrees minus the minimum angle found is reported.}
- Jacobian more than 0.7 {The Jacobian ratio is a measure of the deviation of a given element from an ideally shaped element. The Jacobian value ranges
from -1.0 to 1.0, where 1.0 represents a perfectly shaped element. The ideal shape for an element depends on the element type.}
- Tria elements with angle between 20 and 120 degree
- Quad elements with angle between 45 and 135 degree
- Maintain minimum and maximum length
- Element connectivity
- Less than 10% tria elements in 2D mesh
- 2D element normals oriented in the same direction for a particular parts.
- Tet collapse for tetra elements {Defined as the distance of a node from the opposite face divided by the area of the face multiplied by 1.24}
from all mesh
- Numbering the nodes and elements properly in defined ranges
- Minimal deviation from geometry and deviation supported by sound engineering judgement.
- Special connections between different types (1D/2D/3D) of elements properly defined.
However, all these quality parameters can vary depending on the type of analysis, accuracy required, company guidelines, and computational cost.
Why these stuffs aren't automated:
Finite element analysis requires a correct mesh to give correct results. This correctness can't be defined with a few parameters and even then, they will be contradictory.
Again for different types of analyses, mesh quality definition may be different.
Material, geometric, and contact non-linearity complicate the requirements further while defining a good mesh.
One initial roadblock I have observed using automesh feature is the incorrect representation of geometry to maintain quality of the mesh in other aspects. Both of them are important. Also, representation of geometry can be simplified with good engineering judgements which is hard to automate as it varies case by case.
For example, Hypermesh is a very popular commercial meshing package from Altair Engineering which has a Batchmesher application that does the meshing for you. However, it fails to maintain proper geometry deviations and connections between elements for complex parts.
tl;dr:
This is how meshing is done professionally
- Decide what kind of mesh to be used
- Mesh the parts patch by patch and ensure proper connections
- Maintain mesh flow and symmetry
- Do all quality checks and ensure quality
- Ensure proper connectivity
- Check geometry deviations and finite element mass
- Deliver the model to analysts who may again re-mesh certain areas depending on the analysis requirements.
PS: I am new to this forum and this is one of my first few answers that I have put a lot of effort. I would really appreciate if I get some feedback. I have a few Quora answers on meshing and FEA where these points are explained in some detail with graphics. [Practical Finite Element Analysis]