.. _xfem:

#####################################
eXtended Finite Element Method (XFEM)
#####################################

.. warning::

   This capability is in development, and its behavior may change considerably due to its status as an active research topic.

The ``XFEM`` command block may be used to introduce discontinuities in a finite element mesh via the eXtended Finite Element Method (XFEM). Use cases for XFEM include modeling stationary or propagating cracks in a finite element mesh, fast mesh generation via XFEM "carving," and adding or removing material layers to simulate, e.g., material wear or additive manufacturing processes. At its simplest, the XFEM provides a framework supporting duplication of mesh elements and subsequent partitioning and assignation of material on each side of the cut surface to each duplicate. This duplication procedure is illustrated in :numref:`xfem-femTheory`. Piecewise planar element cuts through both two-dimensional shell and three-dimensional mesh topologies are supported in the current XFEM implementation. When an element is cut, the necessary quantities on the duplicated elements are scaled by the volume fraction of the original cut element. The mass, volume, and the internal force contribution are all scaled by the volume fraction. All other element quantities are calculated as usual.  

.. _xfem-femTheory:

.. figure:: ../_static/figures/xfemTheory.png
   :align: center
   :scale: 15 %

   Example of XFEM element cutting and duplication.

The effective or cut volume of the domain is represented by the XFEM "submesh," a sub-element geometry which captures the discontinuity surface within each cut element duplicate.  Submesh topologies for various element types are illustrated in :numref:`xfem-submeshTopo`.  The submesh output block, named ``<block_name>_submesh``, will be created and output along with results for visualization purposes.  Visualization with the submesh block is recommended as it offers an accurate representation of crack surface and fragment geometries, as well as relevant element and nodal fields, whereas the XFEM computational elements themselves overlap and are therefore difficult to visualize.

.. _xfem-submeshTopo:

.. subfigure:: ABC
   :subcaptions: below
   :align: center

   .. image:: ../_static/figures/quadSubmesh.png
      :alt: Four-node quadrilateral.
      :scale: 10 %

   .. image:: ../_static/figures/tetSubmesh.png
      :alt: Four-node tetrahedral.
      :scale: 10 %

   .. image:: ../_static/figures/hexSubmesh.png
      :alt: Eight-node hexahedral.
      :scale: 10 %

   Illustration of XFEM submesh topology for various mesh element topologies.

.. toctree::
   :hidden:
   :maxdepth: 1

   xfem/general
   xfem/fracfrag
   xfem/carving
   xfem/use
