Stitching sliding interfaces around corners. Zeljko Tukovic
This commit is contained in:
parent
56f871cfdb
commit
7832d77bf2
2 changed files with 54 additions and 12 deletions
|
@ -64,7 +64,6 @@ Description
|
|||
#include "IOobjectList.H"
|
||||
#include "ReadFields.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Checks whether patch present
|
||||
|
@ -101,7 +100,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
Foam::argList::validOptions.insert("partial", "");
|
||||
Foam::argList::validOptions.insert("perfect", "");
|
||||
|
||||
Foam::argList::validOptions.insert("clearUnusedFaces", "");
|
||||
Foam::argList::validOptions.insert("overwrite", "");
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
@ -116,6 +115,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
bool partialCover = args.optionFound("partial");
|
||||
bool perfectCover = args.optionFound("perfect");
|
||||
bool clearUnusedFaces = args.optionFound("clearUnusedFaces");
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
if (partialCover && perfectCover)
|
||||
|
@ -364,6 +364,45 @@ int main(int argc, char *argv[])
|
|||
|
||||
mesh.movePoints(morphMap->preMotionPoints());
|
||||
|
||||
if (clearUnusedFaces)
|
||||
{
|
||||
// Clear unused points and faces by manually resetting the list"
|
||||
Info << "Clear unused points and faces" << nl << endl;
|
||||
|
||||
pointField& p = const_cast<pointField&>(mesh.allPoints());
|
||||
p.setSize(mesh.nPoints());
|
||||
|
||||
faceList& f = const_cast<faceList&>(mesh.allFaces());
|
||||
f.setSize(mesh.nFaces());
|
||||
|
||||
Xfer<pointField> pXfer(p);
|
||||
Xfer<faceList> fXfer(f);
|
||||
Xfer<labelList> ownXfer(mesh.faceOwner());
|
||||
Xfer<labelList> neiXfer(mesh.faceNeighbour());
|
||||
|
||||
label nPatches = mesh.boundaryMesh().size();
|
||||
labelList patchSizes(nPatches, 0);
|
||||
labelList patchStarts(nPatches, -1);
|
||||
forAll(patchSizes, patchI)
|
||||
{
|
||||
patchSizes[patchI] = mesh.boundaryMesh()[patchI].size();
|
||||
patchStarts[patchI] = mesh.boundaryMesh()[patchI].start();
|
||||
}
|
||||
|
||||
mesh.removeZones();
|
||||
|
||||
mesh.resetPrimitives
|
||||
(
|
||||
pXfer,
|
||||
fXfer,
|
||||
ownXfer,
|
||||
neiXfer,
|
||||
patchSizes,
|
||||
patchStarts
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Write mesh
|
||||
if (overwrite)
|
||||
{
|
||||
|
|
|
@ -238,18 +238,21 @@ void Foam::enrichedPatch::calcCutFaces() const
|
|||
(magNewDir - magCorrNewDir)/magNewDir;
|
||||
// Pout << " corrected: " << corrNewDir << " mag: " << magCorrNewDir << " out of plane: " << outOfPlane << flush;
|
||||
|
||||
// Bug fix for cutting around corners
|
||||
// ZT, 5 May 2014
|
||||
if (magCorrNewDir < SMALL)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void enrichedPatch::"
|
||||
"calcCutFaces() const"
|
||||
) << "Zero length edge detected. Probable "
|
||||
<< "projection error: slave patch probably "
|
||||
<< "does not project onto master. "
|
||||
<< "Please switch on "
|
||||
<< "enriched patch debug for more info"
|
||||
<< abort(FatalError);
|
||||
continue;
|
||||
// FatalErrorIn
|
||||
// (
|
||||
// "void enrichedPatch::"
|
||||
// "calcCutFaces() const"
|
||||
// ) << "Zero length edge detected. Probable "
|
||||
// << "projection error: slave patch probably "
|
||||
// << "does not project onto master. "
|
||||
// << "Please switch on "
|
||||
// << "enriched patch debug for more info"
|
||||
// << abort(FatalError);
|
||||
}
|
||||
|
||||
corrNewDir /= magCorrNewDir;
|
||||
|
|
Reference in a new issue