## Interpolation procedure

Interpolation in between an existing mesh is used in different places in CalculiX:

• Mesh refinement
• Determine the desired edge length in newly created nodes (newnodes.f, updategeodata.f)
• Determine the interpolation coefficients for the connection of a node in the unrefined mesh to the refined mesh (treatment of SPC's and MPC's: genmpc.f)
• Determine the interpolation coefficients for the connection of a node in the refined mesh to the unrefined mesh (treatment of temperatures: genratio.f)
• Crack propagation calculations
• For the crack length definition: find the intersection of a straight line of the external surface of the structure (cracklength.f)
• For the crack propagation: find the intersection of the crack front with the external surface of the structure (crackprop.f)
• Determine the nodes on the crack boundary which are inside the structure (interpolextnodes.f)
• Submodel calculations
• Interpolation of displacements, stresses... onto the boundary of the submodel (interpolsubmodel.f)

The input to the interpolation procedure is a master mesh consisting of volumetric elements (no 1d-elements such as beams or 2d-elements such as shells) and results at the nodes of the mesh, and a slave “mesh” consisting of one or more nodes in which the results are to be interpolated. Notice that the slave mesh does not have to contain elements. The interpolation consists of the following steps:

• Tetrangulation of the master mesh using linear tetrahedral elements. Calculation of the centers of gravity of these tetrahedrons and sorting these in global x-direction, global y-direction and global z-direction.
• For each slave location:
• find the set of the n=1 closest centers of gravity (the corresponding set of tetrahedra is called the n-closest-set)
• Check whether the slave location belongs to any of the tetrahedrons in the n-closest-set. If yes, take this tetrahedron for further analysis; if not, identify the tetrahedron in the n-closest-set to which the slave location is closest.
• Check whether the slave location belongs to the master element to which the tetrahedron belongs. If yes, interpolation is done within this master element; if not, check the master elements of all other tetrahedra in the n-closest-set. If this test is positive, perform interpolation in the identified master element. If negative, save the closest position to any of the master elements considered and repeat the exercise for this slave location for n=10 and n=100. If the latter is not successful, the slave location is considered to be outside the master mesh and the closest projection is saved.

In the next sections the different aspects of the procedure are analyzed in detail.

Subsections