This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/updateCrackPropagationPatchesInternalFaces.H

88 lines
2.5 KiB
C++
Raw Normal View History

{
labelHashSet selectedFaces;
const labelListList& edgeFaces = mesh.edgeFaces();
const scalarField& cohesiveZoneI = cohesiveZone.internalField();
forAll (crackPropagationPatches, patchI)
{
label curPatchID = crackPropagationPatches[patchI];
const labelList& patchEdges =
mesh.boundaryMesh()[curPatchID].meshEdges();
forAll(patchEdges, edgeI)
{
label curEdge = patchEdges[edgeI];
const labelList& curFaces = edgeFaces[curEdge];
forAll(curFaces, faceI)
{
if (curFaces[faceI] < mesh.nInternalFaces())
{
if (cohesiveZoneI[curFaces[faceI]] > (1.0 - SMALL))
{
if (!selectedFaces.found(curFaces[faceI]))
{
selectedFaces.insert(curFaces[faceI]);
}
}
}
}
}
}
// if (notchPatchID != -1)
// {
// const labelList& notchPatchEdges =
// mesh.boundaryMesh()[notchPatchID].meshEdges();
// forAll(notchPatchEdges, edgeI)
// {
// label curEdge = notchPatchEdges[edgeI];
// const labelList& curFaces = edgeFaces[curEdge];
// forAll(curFaces, faceI)
// {
// if (curFaces[faceI] < mesh.nInternalFaces())
// {
// if (cohesiveZoneI[curFaces[faceI]] > (1.0 - SMALL))
// {
// selectedFaces.insert(curFaces[faceI]);
// }
// }
// }
// }
// }
// if (mesh.boundary()[cohesivePatchID].size())
// {
// const labelList& cohesivePatchEdges =
// mesh.boundaryMesh()[cohesivePatchID].meshEdges();
// forAll(cohesivePatchEdges, edgeI)
// {
// label curEdge = cohesivePatchEdges[edgeI];
// const labelList& curFaces = edgeFaces[curEdge];
// forAll(curFaces, faceI)
// {
// if (curFaces[faceI] < mesh.nInternalFaces())
// {
// if (cohesiveZoneI[curFaces[faceI]] > (1.0 - SMALL))
// {
// selectedFaces.insert(curFaces[faceI]);
// }
// }
// }
// }
// }
crackPropagationPatchesInternalFaces = labelList(selectedFaces.toc());
}