Hey,
Element with singularity need info about edges adjacent to crack front, and then you push operators to it. The problem does not matter, terminal, or mechanical if it has the right type of singularity, i.e. O(r^-2).
Implementation if not very generic, all is done for fracture module, easy way to adopt it is to follow this
Note that:
// Create elastic element finite element instance for residuals. Note that
// this element approx. singularity at crack front.
feRhs = boost::make_shared<CrackFrontElement>(
mField, setSingularCoordinates, crackFrontNodes, crackFrontNodesEdges,
crackFrontElements, addSingularity);
// Create finite element instance for assembly of tangent matrix
feLhs = boost::make_shared<CrackFrontElement>(
mField, setSingularCoordinates, crackFrontNodes, crackFrontNodesEdges,
crackFrontElements, addSingularity);
`
which data in constructor about
crackFrontNodes, crackFrontNodesEdges, crackFrontElements
what is self-explanatory,
then you push OPs to this element in a standard way, and singularity will be automatically handled, with one exception, you have to calculate gradients in the right way, and this is done by pushing OP OpGetCrackFrontDataGradientAtGaussPts at the front which modifies base functions,
see