# Numerical Modeling Technique of Damage Behavior of
## 2 Introduction of XFEM
### Information Passing  
In FEAP, conventional information such as material parameters, element nodal solution parameters and element nodal coordinates is provided to the user element subroutine through data passed as arguments. For user-defined information such as crack geometry and enrichment types, FEAP also provides options for each user element to create and manage user data arrays through the common block.  
In XFEM, the crack propagation is completely independent of the finite element mesh. Naturally, we can represent cracks as contiguous piecewise linear segments, with new crack segments added as cracks propagate. That means a user array containing a series of vertex coordinates is needed to describe the crack geometry information. FEAP allows users to add allocation for their own arrays by calling a subprogram \"UALLOC\". However, it is not easy to determine the length of the data array since the number of vertices for each crack and number of cracks are constantly changing as cracks propagate and new cracks are initiated. In addition, some extra attention must be paid to the management of user-defined arrays. Therefore, an alternative approach is proposed in this study to describe the crack geometry information by utilizing element-history variables.  
In FEAP, element-history variables are provided for each element to manage additional variables that constantly change during the solving process. It is a user's choice to decide what is retained in each history-variable type. Generally, element history variables are set to store internal variables for constitutive relations. In this study, the coordinates of intersections between the crack and element edges as well as the vertices of the crack lying inside the current element are also recorded in the corresponding element history variables. With these data, plotting piecewise linear crack segments of each element will automatically form the distribution of all crack curves. In this method, it is easy to specify the amount of history variables associated with the crack geometry information, although it may waste some storage space due to the duplicate records of some intersects in adjacent elements. Meanwhile, this method also eases the implementation of element partitioning, the determination of integration points and the calculation of enrichment functions for integration points, since the intersection coordinates of the crack and element edges have been stored.  
In addition, nodal enrichment types for each element should be stored in element history variables, too. Because more than one enrichment may be included at the same node to deal with a multiple-cracks situation, five numbers (i.e., 0 for no enrichment, 1 for modified Heaviside enrichment, 2 for crack tip enrichment, 3 for two modified Heaviside enrichments, 6 for one modified Heaviside enrichment and one crack tip enrichment) have been defined to represent crack-enrichment information. It should be noted that the appropriate enrichment type indicates the associated enriched degrees of freedom, which further ensures the implementation of an appropriate assembly.