Merge commit 'origin/master' into splitCyclic

Conflicts:
	applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
	applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C
	src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.C
	src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.C
	src/dynamicMesh/motionSmoother/motionSmoother.C
	src/dynamicMesh/motionSmoother/motionSmoother.H
	src/dynamicMesh/motionSmoother/motionSmootherTemplates.C
This commit is contained in:
mattijs
2010-05-18 13:28:21 +01:00
480 changed files with 13145 additions and 5249 deletions

View File

@ -1,4 +0,0 @@
cellSet.C
EXE = $(FOAM_APPBIN)/cellSet

View File

@ -1,196 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Selects a cell set through a dictionary.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "topoSetSource.H"
#include "cellSet.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
Info<< "Reading cellSetDict\n" << endl;
IOdictionary cellSetDict
(
IOobject
(
"cellSetDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const word setName(cellSetDict.lookup("name"));
const word actionName(cellSetDict.lookup("action"));
topoSetSource::setAction action = topoSetSource::toAction(actionName);
// Create topoSetSources
PtrList<topoSetSource> topoSetSources
(
cellSetDict.lookup("topoSetSources"),
topoSetSource::iNew(mesh)
);
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))
{
r = IOobject::NO_READ;
currentSetPtr.reset
(
new cellSet
(
mesh,
setName,
mesh.nCells()/10+1 // Reasonable size estimate.
)
);
}
else
{
r = IOobject::MUST_READ;
currentSetPtr.reset
(
new cellSet
(
mesh,
setName,
r
)
);
}
topoSet& currentSet = currentSetPtr();
Info<< "Set:" << currentSet.name()
<< " Size:" << currentSet.size()
<< " Action:" << actionName
<< endl;
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
{
// currentSet has been read so can make copy.
//backup(mesh, setName, currentSet, setName + "_old");
}
if (action == topoSetSource::CLEAR)
{
// Already handled above by not reading
}
else if (action == topoSetSource::INVERT)
{
currentSet.invert(currentSet.maxSize(mesh));
}
else if (action == topoSetSource::LIST)
{
currentSet.writeDebug(Info, mesh, 100);
Info<< endl;
}
else if (action == topoSetSource::SUBSET)
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
// Backup current set.
autoPtr<topoSet> oldSet
(
topoSet::New
(
currentSet.type(),
mesh,
currentSet.name() + "_old2",
currentSet
)
);
currentSet.clear();
topoSetSources[topoSetSourceI].applyToSet
(
topoSetSource::NEW,
currentSet
);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
}
}
else
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
topoSetSources[topoSetSourceI].applyToSet(action, currentSet);
}
}
if (action != topoSetSource::LIST)
{
// Set has changed.
// Sync across coupled patches.
currentSet.sync(mesh);
Info<< "Writing " << currentSet.name()
<< " (size " << currentSet.size() << ") to "
<< currentSet.instance()/currentSet.local()
/currentSet.name()
<< endl << endl;
currentSet.write();
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,149 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object cellSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Name of set to operate on
name c0;
// One of clear/new/invert/add/delete|subset/list
action new;
// Actions to apply to cellSet. These are all the topoSetSource's ending
// in ..ToCell (see the meshTools library).
topoSetSources
(
// Select by explicitly providing cell labels
labelToCell
{
value (12 13 56); // labels of cells
}
// Copy elements from cellSet
cellToCell
{
set c1;
}
// Cells in cell zone
zoneToCell
{
name ".*Zone"; // Name of cellZone, regular expressions allowed
}
// Cells on master or slave side of faceZone
faceZoneToCell
{
name ".*Zone"; // Name of faceZone, regular expressions allowed
option master; // master/slave
}
// Select based on faceSet
faceToCell
{
set f0; // Name of faceSet
//option neighbour; // cell with neighbour in faceSet
//option owner; // ,, owner
option any; // cell with any face in faceSet
//option all; // cell with all faces in faceSet
}
// Select based on pointSet
pointToCell
{
set p0;
option any; // cell with any point in pointSet
//option all; // cell with all points in pointSet
}
// Select based on cellShape
shapeToCell
{
type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
}
// Cells with cell centre within box
boxToCell
{
box (0 0 0) (1 1 1);
}
// Cells with cell centre within box
// Is skewed, rotated box. Given as origin and three spanning vectors.
rotatedBoxToCell
{
origin (0.2 0.2 -10);
i (0.2 0.2 0);
j (-0.2 0.2 0);
k (10 10 10);
}
// Cells with centre within cylinder
cylinderToCell
{
p1 (0.2 0.2 -10); // start point on cylinder axis
p2 (0.2 0.2 0); // end point on cylinder axis
radius 5.0;
}
// Cells with centre within sphere
sphereToCell
{
centre (0.2 0.2 -10);
radius 5.0;
}
// Cells with cellCentre nearest to coordinates
nearestToCell
{
points ((0 0 0) (1 1 1)(2 2 2));
}
// Select based on surface
surfaceToCell
{
file "www.avl.com-geometry.stl";
outsidePoints ((-99 -99 -59)); // definition of outside
includeCut false; // cells cut by surface
includeInside false; // cells not on outside of surf
includeOutside false; // cells on outside of surf
nearDistance -1; // cells with centre near surf
// (set to -1 if not used)
curvature 0.9; // cells within nearDistance
// and near surf curvature
// (set to -100 if not used)
}
// values of field within certain range
fieldToCell
{
fieldName U; // Note: uses mag(U) since volVectorField
min 0.1;
max 0.5;
}
// Mesh region (non-face connected part of (subset of)mesh)
regionToCell
{
set c0; // name of cellSet giving mesh subset
insidePoint (1 2 3); // point inside region to select
}
);
// ************************************************************************* //

View File

@ -48,9 +48,21 @@ int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addRegionOption.H"
argList::addBoolOption("noTopology");
argList::addBoolOption("allGeometry");
argList::addBoolOption("allTopology");
argList::addBoolOption
(
"noTopology",
"skip checking the mesh topology"
);
argList::addBoolOption
(
"allGeometry",
"include bounding box checks"
);
argList::addBoolOption
(
"allTopology",
"include extra topology checks"
);
# include "setRootCase.H"
# include "createTime.H"

View File

@ -107,7 +107,7 @@ void modifyOrAddFace
label findPatchID(const polyMesh& mesh, const word& name)
{
label patchI = mesh.boundaryMesh().findPatchID(name);
const label patchI = mesh.boundaryMesh().findPatchID(name);
if (patchI == -1)
{
@ -124,8 +124,14 @@ label findPatchID(const polyMesh& mesh, const word& name)
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
# include "addRegionOption.H"
argList::addNote
(
"Makes internal faces into boundary faces.\n"
"Does not duplicate points, unlike mergeOrSplitBaffles."
);
#include "addOverwriteOption.H"
#include "addRegionOption.H"
argList::validArgs.append("faceZone");
argList::validArgs.append("(masterPatch slavePatch)");
@ -136,10 +142,23 @@ int main(int argc, char *argv[])
);
argList::addBoolOption("internalFacesOnly");
# include "setRootCase.H"
# include "createTime.H"
argList::addOption
(
"additionalPatches",
"(patch2 .. patchN)",
"specify additional patches for creating baffles"
);
argList::addBoolOption
(
"internalFacesOnly",
"do not convert boundary faces"
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createNamedMesh.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh();

View File

@ -672,17 +672,17 @@ int main(int argc, char *argv[])
{
const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name"));
const word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName);
if (destPatchI == -1)
{
FatalErrorIn(args.executable()) << "patch " << patchName
<< " not added. Problem." << abort(FatalError);
FatalErrorIn(args.executable())
<< "patch " << patchName << " not added. Problem."
<< abort(FatalError);
}
word sourceType(dict.lookup("constructFrom"));
const word sourceType(dict.lookup("constructFrom"));
if (sourceType == "patches")
{
@ -710,7 +710,7 @@ int main(int argc, char *argv[])
}
else if (sourceType == "set")
{
word setName(dict.lookup("set"));
const word setName(dict.lookup("set"));
faceSet faces(mesh, setName);

View File

@ -1,4 +0,0 @@
faceSet.C
EXE = $(FOAM_APPBIN)/faceSet

View File

@ -1,5 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools

View File

@ -1,196 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Selects a face set through a dictionary.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "topoSetSource.H"
#include "faceSet.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
Info<< "Reading faceSetDict\n" << endl;
IOdictionary faceSetDict
(
IOobject
(
"faceSetDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const word setName(faceSetDict.lookup("name"));
const word actionName(faceSetDict.lookup("action"));
topoSetSource::setAction action = topoSetSource::toAction(actionName);
// Create topoSetSources
PtrList<topoSetSource> topoSetSources
(
faceSetDict.lookup("topoSetSources"),
topoSetSource::iNew(mesh)
);
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))
{
r = IOobject::NO_READ;
currentSetPtr.reset
(
new faceSet
(
mesh,
setName,
mesh.nFaces()/10+1 // Reasonable size estimate.
)
);
}
else
{
r = IOobject::MUST_READ;
currentSetPtr.reset
(
new faceSet
(
mesh,
setName,
r
)
);
}
topoSet& currentSet = currentSetPtr();
Info<< "Set:" << currentSet.name()
<< " Size:" << currentSet.size()
<< " Action:" << actionName
<< endl;
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
{
// currentSet has been read so can make copy.
//backup(mesh, setName, currentSet, setName + "_old");
}
if (action == topoSetSource::CLEAR)
{
// Already handled above by not reading
}
else if (action == topoSetSource::INVERT)
{
currentSet.invert(currentSet.maxSize(mesh));
}
else if (action == topoSetSource::LIST)
{
currentSet.writeDebug(Info, mesh, 100);
Info<< endl;
}
else if (action == topoSetSource::SUBSET)
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
// Backup current set.
autoPtr<topoSet> oldSet
(
topoSet::New
(
currentSet.type(),
mesh,
currentSet.name() + "_old2",
currentSet
)
);
currentSet.clear();
topoSetSources[topoSetSourceI].applyToSet
(
topoSetSource::NEW,
currentSet
);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
}
}
else
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
topoSetSources[topoSetSourceI].applyToSet(action, currentSet);
}
}
if (action != topoSetSource::LIST)
{
// Set has changed.
// Sync across coupled patches.
currentSet.sync(mesh);
Info<< "Writing " << currentSet.name()
<< " (size " << currentSet.size() << ") to "
<< currentSet.instance()/currentSet.local()
/currentSet.name()
<< endl << endl;
currentSet.write();
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,82 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faceSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Name of set to operate on
name f0;
// One of clear/new/invert/add/delete|subset/list
action new;
// Actions to apply to pointSet. These are all the topoSetSource's ending
// in ..ToFace (see the meshTools library).
topoSetSources
(
// Copy elements from faceSet
faceToFace
{
set f1;
}
// Select based on cellSet
cellToFace
{
set c0;
option all; // All faces of cells
//option both; // Only faces whose owner&neighbour are in cellSet
}
// Select based on pointSet
pointToFace
{
set p0;
option any; // Faces using any point in pointSet
//option all // Faces with all points in pointSet
}
// Select by explicitly providing face labels
labelToFace
{
value (12 13 56); // labels of faces
}
// All faces of patch
patchToFace
{
name ".*Wall"; // Name of patch, regular expressions allowed
}
// All faces of faceZone
zoneToFace
{
name ".*Zone1"; // Name of faceZone, regular expressions allowed
}
// Faces with face centre within box
boxToFace
{
box (0 0 0) (1 1 1);
}
// Faces with normal to within certain angle aligned with vector.
normalToFace
{
normal (0 0 1); // Vector
cos 0.01; // Tolerance (max cos of angle)
}
);
// ************************************************************************* //

View File

@ -1,15 +1,22 @@
Info<< nl << "Create Times" << endl;
const fileName masterCasePath = masterCase.path();
const fileName masterCaseName = masterCase.name();
Time runTimeMaster
(
Time::controlDictName,
rootDirMaster,
caseDirMaster
masterCasePath,
masterCaseName
);
const fileName addCasePath = addCase.path();
const fileName addCaseName = addCase.name();
Time runTimeToAdd
(
Time::controlDictName,
rootDirToAdd,
caseDirToAdd
addCasePath,
addCaseName
);

View File

@ -32,16 +32,74 @@ Description
using namespace Foam;
void getRootCase(fileName& casePath)
{
casePath.clean();
if (casePath.empty() || casePath == ".")
{
// handle degenerate form and '.'
casePath = cwd();
}
else if (casePath[0] != '/' && casePath.name() == "..")
{
// avoid relative cases ending in '..' - makes for very ugly names
casePath = cwd()/casePath;
casePath.clean();
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
# include "setRoots.H"
# include "createTimes.H"
argList::addNote
(
"merge two meshes"
);
Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << endl;
argList::noParallel();
argList::validArgs.append("masterCase");
argList::addOption
(
"masterRegion",
"name",
"specify alternative mesh region for the master mesh"
);
argList::validArgs.append("addCase");
argList::addOption
(
"addRegion",
"name",
"specify alternative mesh region for the additional mesh"
);
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
fileName masterCase = args[1];
word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion);
fileName addCase = args[2];
word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion);
getRootCase(masterCase);
getRootCase(addCase);
Info<< "Master: " << masterCase << " region " << masterRegion << nl
<< "mesh to add: " << addCase << " region " << addRegion << endl;
#include "createTimes.H"
Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << nl;
Info<< "Create mesh\n" << endl;
mergePolyMesh masterMesh
@ -55,7 +113,7 @@ int main(int argc, char *argv[])
);
Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << endl;
Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << nl;
Info<< "Create mesh\n" << endl;
polyMesh meshToAdd

View File

@ -1,32 +0,0 @@
argList::validArgs.clear();
argList::validArgs.append("master root");
argList::validArgs.append("master case");
argList::addOption("masterRegion", "name");
argList::validArgs.append("root to add");
argList::validArgs.append("case to add");
argList::addOption("addRegion", "name");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
fileName rootDirMaster = args[1];
fileName caseDirMaster = args[2];
word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion);
fileName rootDirToAdd = args[3];
fileName caseDirToAdd = args[4];
word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion);
Info<< "Master: " << rootDirMaster << " " << caseDirMaster
<< " region " << masterRegion << nl
<< "mesh to add: " << rootDirToAdd << " " << caseDirToAdd
<< " region " << addRegion << endl;

View File

@ -221,15 +221,30 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
# include "addRegionOption.H"
argList::addBoolOption("split");
argList::addBoolOption("detectOnly");
argList::addNote
(
"Detect faces that share points (baffles).\n"
"Merge them or duplicate the points."
);
# include "setRootCase.H"
# include "createTime.H"
#include "addOverwriteOption.H"
#include "addRegionOption.H"
argList::addBoolOption
(
"detectOnly",
"find baffles only, but do not merge or split them"
);
argList::addBoolOption
(
"split",
"topologically split duplicate surfaces"
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createNamedMesh.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool split = args.optionFound("split");
@ -248,12 +263,10 @@ int main(int argc, char *argv[])
if (detectOnly)
{
findBaffles(mesh, boundaryFaces);
return 0;
}
// Read objects in time directory
IOobjectList objects(mesh, runTime.timeName());

View File

@ -110,7 +110,6 @@ labelList parseVertices(const string& line)
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("OBJ file");
argList::validArgs.append("output VTK file");
argList args(argc, argv);

View File

@ -1,4 +0,0 @@
pointSet.C
EXE = $(FOAM_APPBIN)/pointSet

View File

@ -1,5 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools

View File

@ -1,196 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Selects a point set through a dictionary.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "topoSetSource.H"
#include "pointSet.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
Info<< "Reading pointSetDict\n" << endl;
IOdictionary pointSetDict
(
IOobject
(
"pointSetDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const word setName(pointSetDict.lookup("name"));
const word actionName(pointSetDict.lookup("action"));
topoSetSource::setAction action = topoSetSource::toAction(actionName);
// Create topoSetSources
PtrList<topoSetSource> topoSetSources
(
pointSetDict.lookup("topoSetSources"),
topoSetSource::iNew(mesh)
);
// Load set to work
autoPtr<topoSet> currentSetPtr(NULL);
IOobject::readOption r;
if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR))
{
r = IOobject::NO_READ;
currentSetPtr.reset
(
new pointSet
(
mesh,
setName,
mesh.nPoints()/10+1 // Reasonable size estimate.
)
);
}
else
{
r = IOobject::MUST_READ;
currentSetPtr.reset
(
new pointSet
(
mesh,
setName,
r
)
);
}
topoSet& currentSet = currentSetPtr();
Info<< "Set:" << currentSet.name()
<< " Size:" << currentSet.size()
<< " Action:" << actionName
<< endl;
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
{
// currentSet has been read so can make copy.
//backup(mesh, setName, currentSet, setName + "_old");
}
if (action == topoSetSource::CLEAR)
{
// Already handled above by not reading
}
else if (action == topoSetSource::INVERT)
{
currentSet.invert(currentSet.maxSize(mesh));
}
else if (action == topoSetSource::LIST)
{
currentSet.writeDebug(Info, mesh, 100);
Info<< endl;
}
else if (action == topoSetSource::SUBSET)
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
// Backup current set.
autoPtr<topoSet> oldSet
(
topoSet::New
(
currentSet.type(),
mesh,
currentSet.name() + "_old2",
currentSet
)
);
currentSet.clear();
topoSetSources[topoSetSourceI].applyToSet
(
topoSetSource::NEW,
currentSet
);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
}
}
else
{
// Apply topoSetSources to it to handle new/add/delete
forAll(topoSetSources, topoSetSourceI)
{
topoSetSources[topoSetSourceI].applyToSet(action, currentSet);
}
}
if (action != topoSetSource::LIST)
{
// Set has changed.
// Sync across coupled patches.
currentSet.sync(mesh);
Info<< "Writing " << currentSet.name()
<< " (size " << currentSet.size() << ") to "
<< currentSet.instance()/currentSet.local()
/currentSet.name()
<< endl << endl;
currentSet.write();
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,84 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object pointSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Name of set to operate on
name p0;
// One of clear/new/invert/add/delete|subset/list
action new;
// Actions to apply to pointSet. These are all the topoSetSource's ending
// in ..ToPoint (see the meshTools library).
topoSetSources
(
// Copy elements from pointSet
pointToPoint
{
set p1;
}
// Select based on cellSet
cellToPoint
{
set c0;
option all; // all points of cell
}
// Select based on faceSet
faceToPoint
{
set f0; // name of faceSet
option all; // all points of face
}
// Select by explicitly providing point labels
labelToPoint
{
value (12 13 56); // labels of points
}
// All points in pointzone
zoneToPoint
{
name ".*Zone"; // name of pointZone, regular expressions allowed
}
// Points nearest to coordinates
nearestToPoint
{
points ((0 0 0) (1 1 1));
}
// Points with coordinate within box
boxToPoint
{
box (0 0 0) (1 1 1);
}
// Select based on surface
surfaceToPoint
{
file "www.avl.com-geometry.stl";
nearDistance 0.1; // points near to surface
includeInside false; // points on inside of surface
// (requires closed surface with consistent
// normals)
includeOutside false; // ,, outside ,,
}
);
// ************************************************************************* //

View File

@ -290,18 +290,26 @@ label twoDNess(const polyMesh& mesh)
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::addBoolOption("dict");
argList::addNote
(
"refine cells in multiple directions"
);
# include "setRootCase.H"
# include "createTime.H"
#include "addOverwriteOption.H"
argList::addBoolOption
(
"dict",
"refine according to system/refineMeshDict"
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createPolyMesh.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
printEdgeStats(mesh);
//
// Read/construct control dictionary
//

View File

@ -365,9 +365,21 @@ autoPtr<mapPolyMesh> reorderMesh
int main(int argc, char *argv[])
{
argList::addBoolOption("blockOrder");
argList::addBoolOption("orderPoints");
argList::addBoolOption("writeMaps");
argList::addBoolOption
(
"blockOrder",
"order cells into regions (using decomposition)"
);
argList::addBoolOption
(
"orderPoints",
"order points into internal and boundary points"
);
argList::addBoolOption
(
"writeMaps",
"write cellMap, faceMap, pointMap in polyMesh/"
);
# include "addOverwriteOption.H"
# include "addTimeOptions.H"

View File

@ -439,6 +439,7 @@ bool doCommand
const word& actionName,
const bool writeVTKFile,
const bool writeCurrentTime,
const bool noSync,
Istream& is
)
{
@ -581,7 +582,7 @@ bool doCommand
// Set will have been modified.
// Synchronize for coupled patches.
currentSet.sync(mesh);
if (!noSync) currentSet.sync(mesh);
// Write
if (writeVTKFile)
@ -828,7 +829,17 @@ int main(int argc, char *argv[])
# include "addRegionOption.H"
argList::addBoolOption("noVTK", "do not write VTK files");
argList::addBoolOption("loop", "execute batch commands for all timesteps");
argList::addOption("batch", "file");
argList::addOption
(
"batch",
"file",
"process in batch mode, using input from specified file"
);
argList::addBoolOption
(
"noSync",
"do not synchronise selection across coupled patches"
);
# include "setRootCase.H"
# include "createTime.H"
@ -837,6 +848,7 @@ int main(int argc, char *argv[])
const bool writeVTK = !args.optionFound("noVTK");
const bool loop = args.optionFound("loop");
const bool batch = args.optionFound("batch");
const bool noSync = args.optionFound("noSync");
if (loop && !batch)
{
@ -1003,7 +1015,8 @@ int main(int argc, char *argv[])
setName,
actionName,
writeVTK,
loop, // if in looping mode dump sets to time directory
loop, // if in looping mode dump sets to time directory
noSync,
is
);

View File

@ -57,14 +57,23 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addBoolOption("noFlipMap");
argList::addNote
(
"add point/face/cell Zones from similar named point/face/cell Sets"
);
# include "addRegionOption.H"
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
argList::addBoolOption
(
"noFlipMap",
"ignore orientation of faceSet"
);
bool noFlipMap = args.optionFound("noFlipMap");
#include "addRegionOption.H"
#include "addTimeOptions.H"
#include "setRootCase.H"
#include "createTime.H"
const bool noFlipMap = args.optionFound("noFlipMap");
// Get times list
instantList Times = runTime.times();
@ -73,11 +82,11 @@ int main(int argc, char *argv[])
label endTime = Times.size();
// check -time and -latestTime options
# include "checkTimeOption.H"
#include "checkTimeOption.H"
runTime.setTime(Times[startTime], startTime);
# include "createNamedPolyMesh.H"
#include "createNamedPolyMesh.H"
// Search for list of objects for the time of the mesh
word setsInstance = runTime.findInstance
@ -153,9 +162,19 @@ int main(int argc, char *argv[])
DynamicList<label> addressing(set.size());
DynamicList<bool> flipMap(set.size());
if (!noFlipMap)
if (noFlipMap)
{
word setName(set.name() + "SlaveCells");
// No flip map.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
addressing.append(faceI);
flipMap.append(false);
}
}
else
{
const word setName(set.name() + "SlaveCells");
Info<< "Trying to load cellSet " << setName
<< " to find out the slave side of the zone." << nl
@ -226,16 +245,6 @@ int main(int argc, char *argv[])
flipMap.append(flip);
}
}
else
{
// No flip map.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
addressing.append(faceI);
flipMap.append(false);
}
}
label zoneID = mesh.faceZones().findZoneID(set.name());
if (zoneID == -1)

View File

@ -85,12 +85,12 @@ label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
// Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{
label patchI = bMesh.findPatchID(name);
const label patchI = bMesh.findPatchID(name);
if (patchI == -1)
{
FatalErrorIn("checkPatch(const polyBoundaryMesh&, const word&)")
<< "Cannot find patch " << name << endl
<< "Cannot find patch " << name << nl
<< "It should be present but of zero size" << endl
<< "Valid patches are " << bMesh.names()
<< exit(FatalError);

View File

@ -1473,26 +1473,68 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
}
// Main program:
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::addBoolOption("cellZones");
argList::addBoolOption("cellZonesOnly");
argList::addOption("cellZonesFileOnly", "cellZonesName");
argList::addOption("blockedFaces", "faceSet");
argList::addBoolOption("makeCellZones");
argList::addBoolOption("largestOnly");
argList::addOption("insidePoint", "point");
argList::addBoolOption("detectOnly");
argList::addBoolOption("sloppyCellZones");
argList::addNote
(
"splits mesh into multiple regions (detected by walking across faces)"
);
#include "addOverwriteOption.H"
argList::addBoolOption
(
"cellZones",
"additionally split cellZones off into separate regions"
);
argList::addBoolOption
(
"cellZonesOnly",
"use cellZones only to split mesh into regions; do not use walking"
);
argList::addOption
(
"cellZonesFileOnly",
"file",
"like -cellZonesOnly, but use specified file"
);
argList::addOption
(
"blockedFaces",
"faceSet",
"specify additional region boundaries that walking does not cross"
);
argList::addBoolOption
(
"makeCellZones",
"place cells into cellZones instead of splitting mesh"
);
argList::addBoolOption
(
"largestOnly",
"only write largest region"
);
argList::addOption
(
"insidePoint",
"point",
"only write region containing point"
);
argList::addBoolOption
(
"detectOnly",
"do not write mesh"
);
argList::addBoolOption
(
"sloppyCellZones",
"try to match heuristically regions to existing cell zones"
);
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createMesh.H"
#include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
word blockedFacesName;
@ -1514,10 +1556,7 @@ int main(int argc, char *argv[])
if
(
(useCellZonesOnly || useCellZonesFile)
&& (
blockedFacesName != word::null
|| useCellZones
)
&& (useCellZones || blockedFacesName.size())
)
{
FatalErrorIn(args.executable())
@ -1529,7 +1568,6 @@ int main(int argc, char *argv[])
}
if (insidePoint && largestOnly)
{
FatalErrorIn(args.executable())
@ -1719,7 +1757,6 @@ int main(int argc, char *argv[])
writeCellToRegion(mesh, cellRegion);
// Sizes per region
// ~~~~~~~~~~~~~~~~

View File

@ -40,6 +40,7 @@ Description
Comparable to running a meshModifier of the form
(if masterPatch is called "M" and slavePatch "S"):
@verbatim
couple
{
type slidingInterface;
@ -51,6 +52,7 @@ Description
slavePatchName S;
typeOfMatch partial or integral
}
@endverbatim
\*---------------------------------------------------------------------------*/
@ -168,7 +170,7 @@ label addCellZone(const polyMesh& mesh, const word& name)
// Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{
label patchI = bMesh.findPatchID(name);
const label patchI = bMesh.findPatchID(name);
if (patchI == -1)
{
@ -192,22 +194,41 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
int main(int argc, char *argv[])
{
argList::addNote
(
"merge the faces on the specified patches (if geometrically possible)\n"
"so the faces become internal"
);
argList::noParallel();
# include "addOverwriteOption.H"
# include "addRegionOption.H"
#include "addOverwriteOption.H"
#include "addRegionOption.H"
argList::validArgs.append("masterPatch");
argList::validArgs.append("slavePatch");
argList::addBoolOption("partial");
argList::addBoolOption("perfect");
argList::addBoolOption
(
"partial",
"couple partially overlapping patches"
);
argList::addBoolOption
(
"perfect",
"couple perfectly aligned patches"
);
argList::addOption
(
"toleranceDict",
"file",
"dictionary file with tolerances"
);
argList::addOption("toleranceDict", "file with tolerances");
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createNamedMesh.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const word masterPatchName = args[1];
@ -220,7 +241,7 @@ int main(int argc, char *argv[])
if (partialCover && perfectCover)
{
FatalErrorIn(args.executable())
<< "Cannot both supply partial and perfect." << endl
<< "Cannot supply both partial and perfect." << endl
<< "Use perfect match option if the patches perfectly align"
<< " (both vertex positions and face centres)" << endl
<< exit(FatalError);
@ -291,11 +312,7 @@ int main(int argc, char *argv[])
// Create and add face zones and mesh modifiers
// Master patch
const polyPatch& masterPatch =
mesh.boundaryMesh()
[
mesh.boundaryMesh().findPatchID(masterPatchName)
];
const polyPatch& masterPatch = mesh.boundaryMesh()[masterPatchName];
// Make list of masterPatch faces
labelList isf(masterPatch.size());
@ -352,11 +369,7 @@ int main(int argc, char *argv[])
);
// Slave patch
const polyPatch& slavePatch =
mesh.boundaryMesh()
[
mesh.boundaryMesh().findPatchID(slavePatchName)
];
const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchName];
labelList osf(slavePatch.size());

View File

@ -150,14 +150,25 @@ void subsetPointFields
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::validArgs.append("set");
argList::addOption("patch", "patch name");
argList::addNote
(
"select a mesh subset based on a cellSet"
);
# include "setRootCase.H"
# include "createTime.H"
#include "addOverwriteOption.H"
argList::validArgs.append("cellSet");
argList::addOption
(
"patch",
"name",
"add exposed internal faces to specified patch instead of to "
"'oldInternalFaces'"
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
# include "createMesh.H"
#include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
@ -190,7 +201,7 @@ int main(int argc, char *argv[])
else
{
Info<< "Adding exposed internal faces to a patch called"
<< " \"oldInternalFaces\" (created if nessecary)" << endl
<< " \"oldInternalFaces\" (created if necessary)" << endl
<< endl;
}

View File

@ -0,0 +1,4 @@
topoSet.C
EXE = $(FOAM_APPBIN)/topoSet

View File

@ -0,0 +1,233 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Operates on cellSets/faceSets/pointSets through a dictionary.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "topoSetSource.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::addOption
(
"dict",
"file",
"specify an alternative dictionary for the topoSet dictionary"
);
# include "addRegionOption.H"
argList::addBoolOption
(
"noSync",
"do not synchronise selection across coupled patches"
);
# include "setRootCase.H"
# include "createTime.H"
# include "createNamedPolyMesh.H"
const bool noSync = args.optionFound("noSync");
const word dictName("topoSetDict");
fileName dictPath = dictName;
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
Info<< "Reading " << dictName << "\n" << endl;
IOdictionary topoSetDict
(
(
args.optionFound("dict")
? IOobject
(
dictPath,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
: IOobject
(
dictName,
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
)
);
// Read set construct info from dictionary
PtrList<dictionary> patchSources(topoSetDict.lookup("actions"));
forAll(patchSources, i)
{
const dictionary& dict = patchSources[i];
const word setName(dict.lookup("name"));
const word actionName(dict.lookup("action"));
const word setType(dict.lookup("type"));
topoSetSource::setAction action = topoSetSource::toAction(actionName);
autoPtr<topoSet> currentSet;
if
(
(action == topoSetSource::NEW)
|| (action == topoSetSource::CLEAR)
)
{
currentSet = topoSet::New(setType, mesh, setName, 10000);
Info<< "Created set " << setName << endl;
}
else if (action == topoSetSource::REMOVE)
{
//?
}
else
{
currentSet = topoSet::New
(
setType,
mesh,
setName,
IOobject::MUST_READ
);
Info<< "Read set " << setName << " with size "
<< currentSet().size() << endl;
}
// Handle special actions (clear, invert) locally, rest through sources.
switch (action)
{
case topoSetSource::NEW:
case topoSetSource::ADD:
case topoSetSource::DELETE:
{
Info<< " Applying source " << word(dict.lookup("source"))
<< endl;
autoPtr<topoSetSource> source = topoSetSource::New
(
dict.lookup("source"),
mesh,
dict.subDict("sourceInfo")
);
source().applyToSet(action, currentSet());
// Synchronize for coupled patches.
if (!noSync) currentSet().sync(mesh);
currentSet().write();
}
break;
case topoSetSource::SUBSET:
{
Info<< " Applying source " << word(dict.lookup("source"))
<< endl;
autoPtr<topoSetSource> source = topoSetSource::New
(
dict.lookup("source"),
mesh,
dict.subDict("sourceInfo")
);
// Backup current set.
autoPtr<topoSet> oldSet
(
topoSet::New
(
setType,
mesh,
currentSet().name() + "_old2",
currentSet()
)
);
currentSet().clear();
source().applyToSet(topoSetSource::NEW, currentSet());
// Combine new value of currentSet with old one.
currentSet().subset(oldSet());
// Synchronize for coupled patches.
if (!noSync) currentSet().sync(mesh);
currentSet().write();
}
break;
case topoSetSource::CLEAR:
Info<< " Clearing set" << endl;
currentSet().clear();
currentSet().write();
break;
case topoSetSource::INVERT:
Info<< " Inverting set" << endl;
currentSet().invert(currentSet().maxSize(mesh));
currentSet().write();
break;
default:
WarningIn(args.executable())
<< "Unhandled action " << action << endl;
break;
}
if (currentSet.valid())
{
Info<< " Set " << currentSet().name()
<< " now size " << currentSet().size()
<< endl;
}
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,363 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// List of actions. Each action is a dictionary with e.g.
// // name of set
// name c0;
//
// // type: pointSet/faceSet/cellSet/faceZoneSet/cellZoneSet
// type cellSet;
//
// // action to perform on set. Two types:
// // - require no source : clear/invert
// // - require source : new/add/delete/subset
// action new;
//
// The source entry varies according to the type of set:
//
// cellSet
// ~~~~~~~
//
// // Select by explicitly providing cell labels
// source labelToCell;
// {
// value (12 13 56); // labels of cells
// }
//
// // Copy elements from cellSet
// source cellToCell;
// {
// set c1;
// }
//
// // Cells in cell zone
// source zoneToCell;
// {
// name ".*Zone"; // Name of cellZone, regular expressions allowed
// }
//
// // Cells on master or slave side of faceZone
// source faceZoneToCell;
// {
// name ".*Zone"; // Name of faceZone, regular expressions allowed
// option master; // master/slave
// }
//
// // Select based on faceSet
// source faceToCell;
// {
// set f0; // Name of faceSet
//
// //option neighbour; // cell with neighbour in faceSet
// //option owner; // ,, owner
// option any; // cell with any face in faceSet
// //option all; // cell with all faces in faceSet
// }
//
// // Select based on pointSet
// source pointToCell;
// {
// set p0;
// option any; // cell with any point in pointSet
// //option all; // cell with all points in pointSet
// }
//
// // Select based on cellShape
// source shapeToCell;
// {
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
// }
//
// // Cells with cell centre within box
// source boxToCell;
// {
// box (0 0 0) (1 1 1);
// }
//
// // Cells with cell centre within box
// // Is skewed, rotated box. Given as origin and three spanning vectors.
// source rotatedBoxToCell;
// {
// origin (0.2 0.2 -10);
// i (0.2 0.2 0);
// j (-0.2 0.2 0);
// k (10 10 10);
// }
//
// // Cells with centre within cylinder
// source cylinderToCell;
// {
// p1 (0.2 0.2 -10); // start point on cylinder axis
// p2 (0.2 0.2 0); // end point on cylinder axis
// radius 5.0;
// }
//
// // Cells with centre within sphere
// source sphereToCell;
// {
// centre (0.2 0.2 -10);
// radius 5.0;
// }
//
// // Cells with cellCentre nearest to coordinates
// source nearestToCell;
// {
// points ((0 0 0) (1 1 1)(2 2 2));
// }
//
// // Select based on surface
// source surfaceToCell;
// {
// file "www.avl.com-geometry.stl";
// outsidePoints ((-99 -99 -59)); // definition of outside
// includeCut false; // cells cut by surface
// includeInside false; // cells not on outside of surf
// includeOutside false; // cells on outside of surf
// nearDistance -1; // cells with centre near surf
// // (set to -1 if not used)
// curvature 0.9; // cells within nearDistance
// // and near surf curvature
// // (set to -100 if not used)
// }
//
// // values of field within certain range
// source fieldToCell;
// {
// fieldName U; // Note: uses mag(U) since volVectorField
// min 0.1;
// max 0.5;
// }
//
// // Mesh region (non-face connected part of (subset of)mesh)
// source regionToCell;
// {
// set c0; // name of cellSet giving mesh subset
// insidePoint (1 2 3); // point inside region to select
// }
//
//
//
// faceSet
// ~~~~~~~
//
// // Copy elements from faceSet
// source faceToFace;
// {
// set f1;
// }
//
// // Select based on cellSet
// source cellToFace;
// {
// set c0;
// option all; // All faces of cells
// //option both; // Only faces whose owner&neighbour are in cellSet
// }
//
// // Select based on pointSet
// source pointToFace;
// {
// set p0;
// option any; // Faces using any point in pointSet
// //option all // Faces with all points in pointSet
// }
//
// // Select by explicitly providing face labels
// source labelToFace;
// {
// value (12 13 56); // labels of faces
// }
//
// // All faces of patch
// source patchToFace;
// {
// name ".*Wall"; // Name of patch, regular expressions allowed
// }
//
// // All faces of faceZone
// source zoneToFace;
// {
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
// }
//
// // Faces with face centre within box
// source boxToFace;
// {
// box (0 0 0) (1 1 1);
// }
//
// // Faces with normal to within certain angle aligned with vector.
// source normalToFace;
// {
// normal (0 0 1); // Vector
// cos 0.01; // Tolerance (max cos of angle)
// }
//
//
//
// pointSet
// ~~~~~~~
//
// // Copy elements from pointSet
// source pointToPoint;
// {
// set p1;
// }
//
// // Select based on cellSet
// source cellToPoint;
// {
// set c0;
// option all; // all points of cell
// }
//
// // Select based on faceSet
// source faceToPoint;
// {
// set f0; // name of faceSet
// option all; // all points of face
// }
//
// // Select by explicitly providing point labels
// source labelToPoint;
// {
// value (12 13 56); // labels of points
// }
//
// // All points in pointzone
// source zoneToPoint;
// {
// name ".*Zone"; // name of pointZone, regular expressions allowed
// }
//
// // Points nearest to coordinates
// source nearestToPoint;
// {
// points ((0 0 0) (1 1 1));
// }
//
// // Points with coordinate within box
// source boxToPoint;
// {
// box (0 0 0) (1 1 1);
// }
//
// // Select based on surface
// source surfaceToPoint;
// {
// file "www.avl.com-geometry.stl";
// nearDistance 0.1; // points near to surface
// includeInside false; // points on inside of surface
// // (requires closed surface with consistent
// // normals)
// includeOutside false; // ,, outside ,,
// }
//
//
//
//
// cellZoneSet
// ~~~~~~~~~~~
// (mirrors operations on a cellSet into a cellZone)
//
// // Select based on cellSet
// source setToCellZone;
// {
// set c0; // name of cellSet
// }
//
//
//
// faceZoneSet
// ~~~~~~~~~~~
// // Select based on faceSet without orientation
// source setToFaceZone;
// {
// set f0; // name of faceSet
// }
//
// // Select based on faceSet, using cellSet to determine orientation
// source setsToFaceZone;
// {
// faceSet f0; // name of faceSet
// cellSet c0; // name of cellSet of slave side
// }
actions
(
// Example:pick up internal faces on outside of cellSet
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Load initial cellSet
{
name c0;
type cellSet;
action new;
source labelToCell;
sourceInfo
{
value (12 13 56);
}
}
// Get all faces in cellSet
{
name f0;
type faceSet;
action new;
source cellToFace;
sourceInfo
{
set c0;
option all;
}
}
// Determine inverse cellSet
{
name c1;
type cellSet;
action new;
source cellToCell;
sourceInfo
{
set c0;
}
}
{
name c1;
type cellSet;
action invert;
}
// Keep in f0 all faces in c1
{
name f0;
type faceSet;
action subset;
source cellToFace;
sourceInfo
{
set c1;
option all;
}
}
);
// ************************************************************************* //

View File

@ -158,13 +158,13 @@ int main(int argc, char *argv[])
(
"rollPitchYaw",
"vector",
"transform in terms of '( roll pitch yaw )' in degrees"
"transform in terms of '(roll pitch yaw)' in degrees"
);
argList::addOption
(
"yawPitchRoll",
"vector",
"transform in terms of '( yaw pitch roll )' in degrees"
"transform in terms of '(yaw pitch roll)' in degrees"
);
argList::addBoolOption
(