Should You Define Contacts Before or After Meshing in FEA?
In Finite Element Analysis (FEA), both meshing and contact definition play a critical role in ensuring simulation accuracy, solution convergence as well as solver run time. A common question—especially among engineers working with nonlinear FEA (When to run Non-Linear FEA) or large assemblies is:
Should contacts be defined before or after meshing?
The Short Answer
In most FEA software (such as ANSYS, Abaqus, etc.), contacts should typically be defined after meshing—or at least after generating a preliminary mesh. This is because contact detection and behavior are often mesh-dependent, particularly in surface-to-surface or node-to-surface contact formulations.
Why Define Contacts After Meshing?
The image below represents a typical FEA workflow. The first step is to prepare the geometry for the analysis, or more specifically, prepare it for meshing.

- Geometry and Mesh Iteration Comes First
CAD Geometry often requires significant cleanup (e.g., removing tiny gaps, merging overlapping surfaces, deleting features such as holes, threads, fillets, chamfers etc.) to generate a viable mesh. However, it is not always immediately obvious what parts of the geometry require “cleanup”. Sometimes, an analyst may perform some basic initial cleanup, and then attempt to generate a preliminary mesh. The first meshing attempt may produce warning messages, poor quality elements, error messages or a failed mesh. All of these give insight into where and how to refine the geometry – armed with this knowledge, one would refine the geometry and try to generate another mesh. This process (indicated by the circular arrow in the image above) could continue for several iterations before a satisfactory geometry as well as mesh is generated.
In FEA software, you typically define contacts by selecting surfaces – For this reason, it is essential that the geometry on which the contacts are defined is mature, since modifying the geometry after defining the contacts could invalidate the contacts, hence wasting time and effort. - Mesh-Based Contact Detection
Most solvers detect contact pairs based on surface proximity and node distribution. Without a mesh, the software cannot accurately identify interaction zones. - Contact Element Generation
Many solvers create contact and target elements (or their equivalents) alongside the main mesh. A mesh must exist first to properly place these elements. - Better Control Over Refinement
Meshing first allows targeted refinement near contact interfaces, which is often essential for nonlinear contact convergence. - Visual Verification
A preliminary mesh enables engineers to inspect contact surfaces, normal vectors, and potential penetration issues before finalizing settings.
When to Define Contacts Before Meshing
Some pre-processing tools allow users to set up contact regions or named selections before meshing. This approach can be useful when:
- Working with CAD models in a parametric workflow.
- Applying specific mesh refinements or contact settings to predefined regions (for example contact based mesh refinement).
- Using automated contact detection (though these features often still require at least a coarse mesh).
Even in these cases, the actual contact generation typically occurs after meshing.
Best Practice Workflow
- Prepare Geometry
- Clean up gaps, overlaps, and other flaws.
- Define named selections for critical contact regions.
- Iterate until the geometry is mesh-ready.
- Generate a Preliminary Mesh (at least a coarse mesh for contact surfaces).
- Define or Review Contact Pairs.
- Refine the Mesh in critical contact zones.
- Verify Contact Settings (normals, friction, stiffness).
- Finalize the Mesh.
- Run Contact Diagnostics (if available).
Conclusion
While some contact definitions can be initiated early, an accurate and reliable contact setup ultimately depends on the mesh—and the mesh depends on clean geometry. For optimal results:
- Resolve geometric issues iteratively.
- Generate a mesh (even a coarse one).
- Then finalize contacts.
This sequence ensures proper detection, avoids “garbage in, garbage out” scenarios, improves simulation robustness, accuracy and run-time.