Skip to content
Snippets Groups Projects
Commit 7a2269ec authored by mattijs's avatar mattijs
Browse files

ENH: setsToFaceZone: allow flipping

parent cfcd1ab3
Branches
Tags
No related merge requests found
......@@ -368,6 +368,8 @@ FoamFile
// {
// faceSet f0; // name of faceSet
// cellSet c0; // name of cellSet of slave side
// flip false; // optional: flip the faceZone (so now the cellSet
// // is the master side)
// }
//
// // Select based on surface. Orientation from normals on surface
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,12 +56,14 @@ Foam::setsToFaceZone::setsToFaceZone
(
const polyMesh& mesh,
const word& faceSetName,
const word& cellSetName
const word& cellSetName,
const Switch& flip
)
:
topoSetSource(mesh),
faceSetName_(faceSetName),
cellSetName_(cellSetName)
cellSetName_(cellSetName),
flip_(flip)
{}
......@@ -74,7 +76,8 @@ Foam::setsToFaceZone::setsToFaceZone
:
topoSetSource(mesh),
faceSetName_(dict.lookup("faceSet")),
cellSetName_(dict.lookup("cellSet"))
cellSetName_(dict.lookup("cellSet")),
flip_(dict.lookupOrDefault("flip", false))
{}
......@@ -87,7 +90,8 @@ Foam::setsToFaceZone::setsToFaceZone
:
topoSetSource(mesh),
faceSetName_(checkIs(is)),
cellSetName_(checkIs(is))
cellSetName_(checkIs(is)),
flip_(false)
{}
......@@ -136,7 +140,7 @@ void Foam::setsToFaceZone::applyToSet
if (!fzSet.found(faceI))
{
bool flip = false;
bool flipFace = false;
label own = mesh_.faceOwner()[faceI];
bool ownFound = cSet.found(own);
......@@ -148,11 +152,11 @@ void Foam::setsToFaceZone::applyToSet
if (ownFound && !neiFound)
{
flip = false;
flipFace = false;
}
else if (!ownFound && neiFound)
{
flip = true;
flipFace = true;
}
else
{
......@@ -174,11 +178,17 @@ void Foam::setsToFaceZone::applyToSet
}
else
{
flip = !ownFound;
flipFace = !ownFound;
}
if (flip_)
{
flipFace = !flipFace;
}
newAddressing.append(faceI);
newFlipMap.append(flip);
newFlipMap.append(flipFace);
}
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -36,6 +36,7 @@ SourceFiles
#define setsToFaceZone_H
#include "topoSetSource.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -56,10 +57,13 @@ class setsToFaceZone
static addToUsageTable usage_;
//- Name of set to use
word faceSetName_;
const word faceSetName_;
//- Name of set to use
word cellSetName_;
const word cellSetName_;
//- Whether cellSet is slave cells or master cells
const Switch flip_;
public:
......@@ -73,7 +77,8 @@ public:
(
const polyMesh& mesh,
const word& faceSetName,
const word& cellSetName
const word& cellSetName,
const Switch& flip
);
//- Construct from dictionary
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment