mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added overwrite flag
This commit is contained in:
@ -312,7 +312,7 @@ label collapseHighAspectFaces
|
|||||||
if (lengths[1] > edgeRatio*lengths[0])
|
if (lengths[1] > edgeRatio*lengths[0])
|
||||||
{
|
{
|
||||||
edgeI = fEdges[lengths.indices()[0]];
|
edgeI = fEdges[lengths.indices()[0]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -456,6 +456,7 @@ label simplifyFaces
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
argList::validArgs.append("edge length [m]");
|
argList::validArgs.append("edge length [m]");
|
||||||
argList::validArgs.append("merge angle (degrees)");
|
argList::validArgs.append("merge angle (degrees)");
|
||||||
|
|
||||||
@ -465,6 +466,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
|
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi);
|
scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi);
|
||||||
|
|
||||||
@ -580,7 +582,10 @@ int main(int argc, char *argv[])
|
|||||||
if (meshChanged)
|
if (meshChanged)
|
||||||
{
|
{
|
||||||
// Write resulting mesh
|
// Write resulting mesh
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
|
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ void checkSnapMesh
|
|||||||
scalar relMinVol(readScalar(snapDict.lookup("minVol")));
|
scalar relMinVol(readScalar(snapDict.lookup("minVol")));
|
||||||
const scalar minCellVol = min(mesh.cellVolumes());
|
const scalar minCellVol = min(mesh.cellVolumes());
|
||||||
const scalar minPyrVol = relMinVol*minCellVol;
|
const scalar minPyrVol = relMinVol*minCellVol;
|
||||||
// Min area
|
// Min area
|
||||||
scalar minArea(readScalar(snapDict.lookup("minArea")));
|
scalar minArea(readScalar(snapDict.lookup("minArea")));
|
||||||
|
|
||||||
if (maxNonOrtho < 180.0-SMALL)
|
if (maxNonOrtho < 180.0-SMALL)
|
||||||
@ -435,6 +435,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::validArgs.append("feature angle [0..180]");
|
argList::validArgs.append("feature angle [0..180]");
|
||||||
argList::validOptions.insert("concaveAngle", "[0..180]");
|
argList::validOptions.insert("concaveAngle", "[0..180]");
|
||||||
argList::validOptions.insert("snapMesh", "");
|
argList::validOptions.insert("snapMesh", "");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -457,6 +458,7 @@ int main(int argc, char *argv[])
|
|||||||
scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0);
|
scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0);
|
||||||
|
|
||||||
bool snapMeshDict = args.options().found("snapMesh");
|
bool snapMeshDict = args.options().found("snapMesh");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
Info<< "Merging all faces of a cell" << nl
|
Info<< "Merging all faces of a cell" << nl
|
||||||
<< " - which are on the same patch" << nl
|
<< " - which are on the same patch" << nl
|
||||||
@ -468,7 +470,10 @@ int main(int argc, char *argv[])
|
|||||||
<< " (sin:" << concaveSin << ')' << nl
|
<< " (sin:" << concaveSin << ')' << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Merge faces on same patch
|
// Merge faces on same patch
|
||||||
label nChanged = mergePatchFaces
|
label nChanged = mergePatchFaces
|
||||||
|
|||||||
@ -328,10 +328,14 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
Info<< "Reading modifyMeshDict\n" << endl;
|
Info<< "Reading modifyMeshDict\n" << endl;
|
||||||
|
|
||||||
IOdictionary dict
|
IOdictionary dict
|
||||||
@ -366,7 +370,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
bool cellsToSplit = cellsToPyramidise.size() > 0;
|
bool cellsToSplit = cellsToPyramidise.size() > 0;
|
||||||
|
|
||||||
//List<Tuple<pointField,point> >
|
//List<Tuple<pointField,point> >
|
||||||
// cellsToCreate(dict.lookup("cellsToCreate"));
|
// cellsToCreate(dict.lookup("cellsToCreate"));
|
||||||
|
|
||||||
Info<< "Read from " << dict.name() << nl
|
Info<< "Read from " << dict.name() << nl
|
||||||
@ -541,7 +545,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cutter.updateMesh(morphMap());
|
cutter.updateMesh(morphMap());
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Write resulting mesh
|
// Write resulting mesh
|
||||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||||
@ -572,7 +579,7 @@ int main(int argc, char *argv[])
|
|||||||
// Topo change container
|
// Topo change container
|
||||||
polyTopoChange meshMod(mesh);
|
polyTopoChange meshMod(mesh);
|
||||||
|
|
||||||
// Insert
|
// Insert
|
||||||
cutter.setRefinement(meshMod);
|
cutter.setRefinement(meshMod);
|
||||||
|
|
||||||
// Do changes
|
// Do changes
|
||||||
@ -587,7 +594,10 @@ int main(int argc, char *argv[])
|
|||||||
//cutter.updateMesh(morphMap());
|
//cutter.updateMesh(morphMap());
|
||||||
|
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Write resulting mesh
|
// Write resulting mesh
|
||||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||||
@ -623,7 +633,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cutter.updateMesh(morphMap());
|
cutter.updateMesh(morphMap());
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Write resulting mesh
|
// Write resulting mesh
|
||||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||||
|
|||||||
@ -52,6 +52,7 @@ using namespace Foam;
|
|||||||
// Main program:
|
// Main program:
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
argList::validArgs.append("cellSet");
|
argList::validArgs.append("cellSet");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -59,6 +60,7 @@ int main(int argc, char *argv[])
|
|||||||
pointMesh pMesh(mesh);
|
pointMesh pMesh(mesh);
|
||||||
|
|
||||||
word cellSetName(args.args()[1]);
|
word cellSetName(args.args()[1]);
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
Info<< "Reading cells to refine from cellSet " << cellSetName
|
Info<< "Reading cells to refine from cellSet " << cellSetName
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
@ -110,7 +112,7 @@ int main(int argc, char *argv[])
|
|||||||
// Read point fields
|
// Read point fields
|
||||||
PtrList<pointScalarField> psFlds;
|
PtrList<pointScalarField> psFlds;
|
||||||
ReadFields(pMesh, objects, psFlds);
|
ReadFields(pMesh, objects, psFlds);
|
||||||
|
|
||||||
PtrList<pointVectorField> pvFlds;
|
PtrList<pointVectorField> pvFlds;
|
||||||
ReadFields(pMesh, objects, pvFlds);
|
ReadFields(pMesh, objects, pvFlds);
|
||||||
|
|
||||||
@ -149,7 +151,10 @@ int main(int argc, char *argv[])
|
|||||||
// Play refinement commands into mesh changer.
|
// Play refinement commands into mesh changer.
|
||||||
meshCutter.setRefinement(newCellsToRefine, meshMod);
|
meshCutter.setRefinement(newCellsToRefine, meshMod);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Create mesh, return map from old to new mesh.
|
// Create mesh, return map from old to new mesh.
|
||||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||||
|
|||||||
@ -50,6 +50,7 @@ int main(int argc, char *argv[])
|
|||||||
Foam::argList::validArgs.append("patchName");
|
Foam::argList::validArgs.append("patchName");
|
||||||
Foam::argList::validArgs.append("edgeWeight");
|
Foam::argList::validArgs.append("edgeWeight");
|
||||||
Foam::argList::validOptions.insert("useSet", "cellSet");
|
Foam::argList::validOptions.insert("useSet", "cellSet");
|
||||||
|
Foam::argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -57,7 +58,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
word patchName(args.additionalArgs()[0]);
|
word patchName(args.additionalArgs()[0]);
|
||||||
|
|
||||||
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
|
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
label patchID = mesh.boundaryMesh().findPatchID(patchName);
|
label patchID = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
@ -212,7 +214,10 @@ int main(int argc, char *argv[])
|
|||||||
// Do all changes
|
// Do all changes
|
||||||
Info<< "Morphing ..." << endl;
|
Info<< "Morphing ..." << endl;
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||||
|
|
||||||
|
|||||||
@ -48,12 +48,15 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Foam::argList::validOptions.insert("overwrite", "");
|
||||||
Foam::argList::validArgs.append("faceSet");
|
Foam::argList::validArgs.append("faceSet");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
word setName(args.additionalArgs()[0]);
|
word setName(args.additionalArgs()[0]);
|
||||||
|
|
||||||
// Read faces
|
// Read faces
|
||||||
@ -159,7 +162,10 @@ int main(int argc, char *argv[])
|
|||||||
// Update numbering of cells/vertices.
|
// Update numbering of cells/vertices.
|
||||||
faceRemover.updateMesh(morphMap);
|
faceRemover.updateMesh(morphMap);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Take over refinement levels and write to new time directory.
|
// Take over refinement levels and write to new time directory.
|
||||||
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
|
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
|
||||||
|
|||||||
@ -527,6 +527,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::validOptions.insert("set", "cellSet name");
|
argList::validOptions.insert("set", "cellSet name");
|
||||||
argList::validOptions.insert("geometry", "");
|
argList::validOptions.insert("geometry", "");
|
||||||
argList::validOptions.insert("tol", "edge snap tolerance");
|
argList::validOptions.insert("tol", "edge snap tolerance");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
argList::validArgs.append("edge angle [0..360]");
|
argList::validArgs.append("edge angle [0..360]");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
@ -541,6 +542,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
bool readSet = args.options().found("set");
|
bool readSet = args.options().found("set");
|
||||||
bool geometry = args.options().found("geometry");
|
bool geometry = args.options().found("geometry");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
scalar edgeTol = 0.2;
|
scalar edgeTol = 0.2;
|
||||||
|
|
||||||
@ -574,7 +576,7 @@ int main(int argc, char *argv[])
|
|||||||
// Cell circumference cutter
|
// Cell circumference cutter
|
||||||
geomCellLooper cellCutter(mesh);
|
geomCellLooper cellCutter(mesh);
|
||||||
// Snap all edge cuts close to endpoints to vertices.
|
// Snap all edge cuts close to endpoints to vertices.
|
||||||
geomCellLooper::setSnapTol(edgeTol);
|
geomCellLooper::setSnapTol(edgeTol);
|
||||||
|
|
||||||
// Candidate cells to cut
|
// Candidate cells to cut
|
||||||
cellSet cellsToCut(mesh, "cellsToCut", mesh.nCells()/100);
|
cellSet cellsToCut(mesh, "cellsToCut", mesh.nCells()/100);
|
||||||
@ -612,7 +614,7 @@ int main(int argc, char *argv[])
|
|||||||
minCos,
|
minCos,
|
||||||
minSin,
|
minSin,
|
||||||
cellsToCut,
|
cellsToCut,
|
||||||
|
|
||||||
cutCells,
|
cutCells,
|
||||||
cellLoops,
|
cellLoops,
|
||||||
cellEdgeWeights
|
cellEdgeWeights
|
||||||
@ -669,7 +671,10 @@ int main(int argc, char *argv[])
|
|||||||
// Do all changes
|
// Do all changes
|
||||||
Info<< "Morphing ..." << endl;
|
Info<< "Morphing ..." << endl;
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
|
||||||
|
|
||||||
|
|||||||
@ -89,11 +89,13 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validArgs.append("Neutral file");
|
argList::validArgs.append("Neutral file");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
fileName neuFile(args.additionalArgs()[0]);
|
fileName neuFile(args.additionalArgs()[0]);
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
IFstream str(neuFile);
|
IFstream str(neuFile);
|
||||||
@ -298,7 +300,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
polyMesh mesh
|
polyMesh mesh
|
||||||
(
|
(
|
||||||
@ -321,7 +326,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
||||||
|
|
||||||
mesh.write();
|
mesh.write();
|
||||||
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -43,12 +43,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("feature angle[0-180]");
|
argList::validArgs.append("feature angle[0-180]");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0);
|
scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0);
|
||||||
|
|
||||||
@ -58,7 +60,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
polyDualMesh dualMesh(mesh, minCos);
|
polyDualMesh dualMesh(mesh, minCos);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Pout<< "Writing dualMesh to " << runTime.timeName() << endl;
|
Pout<< "Writing dualMesh to " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -75,12 +75,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.append("file prefix");
|
argList::validArgs.append("file prefix");
|
||||||
argList::validOptions.insert("noFaceFile", "");
|
argList::validOptions.insert("noFaceFile", "");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
|
|
||||||
bool readFaceFile = !args.options().found("noFaceFile");
|
bool readFaceFile = !args.options().found("noFaceFile");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
fileName prefix(args.additionalArgs()[0]);
|
fileName prefix(args.additionalArgs()[0]);
|
||||||
|
|
||||||
@ -244,7 +246,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "Element attributes (third elemenent in .ele header)"
|
<< "Element attributes (third elemenent in .ele header)"
|
||||||
<< " not used" << endl;
|
<< " not used" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const cellModel& tet = *(cellModeller::lookup("tet"));
|
const cellModel& tet = *(cellModeller::lookup("tet"));
|
||||||
@ -438,7 +440,7 @@ int main(int argc, char *argv[])
|
|||||||
word defaultFacesType = polyPatch::typeName;
|
word defaultFacesType = polyPatch::typeName;
|
||||||
wordList patchPhysicalTypes(nPatches, polyPatch::typeName);
|
wordList patchPhysicalTypes(nPatches, polyPatch::typeName);
|
||||||
|
|
||||||
|
|
||||||
if (readFaceFile)
|
if (readFaceFile)
|
||||||
{
|
{
|
||||||
// Sort boundaryFaces by patch using boundaryPatch.
|
// Sort boundaryFaces by patch using boundaryPatch.
|
||||||
@ -464,7 +466,10 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
polyMesh mesh
|
polyMesh mesh
|
||||||
(
|
(
|
||||||
@ -487,7 +492,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
||||||
|
|
||||||
mesh.write();
|
mesh.write();
|
||||||
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -58,11 +58,13 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validArgs.append("thickness");
|
argList::validArgs.append("thickness");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
|
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
// Check that mesh is 2D
|
// Check that mesh is 2D
|
||||||
@ -164,7 +166,7 @@ int main(int argc, char *argv[])
|
|||||||
// Insert changes into meshMod
|
// Insert changes into meshMod
|
||||||
extruder.setRefinement
|
extruder.setRefinement
|
||||||
(
|
(
|
||||||
extrudeDir,
|
extrudeDir,
|
||||||
thickness,
|
thickness,
|
||||||
frontPatchI,
|
frontPatchI,
|
||||||
meshMod
|
meshMod
|
||||||
@ -175,7 +177,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mesh.updateMesh(morphMap);
|
mesh.updateMesh(morphMap);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Take over refinement levels and write to new time directory.
|
// Take over refinement levels and write to new time directory.
|
||||||
Pout<< "Writing extruded mesh to time " << runTime.timeName() << nl
|
Pout<< "Writing extruded mesh to time " << runTime.timeName() << nl
|
||||||
|
|||||||
@ -42,12 +42,18 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
# include "setRootCase.H"
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
runTime++;
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl
|
Info<< "Time = " << runTime.timeName() << nl
|
||||||
<< "Attaching sliding interface" << endl;
|
<< "Attaching sliding interface" << endl;
|
||||||
|
|||||||
@ -71,6 +71,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("feature angle[0-180]");
|
argList::validArgs.append("feature angle[0-180]");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -88,6 +89,7 @@ int main(int argc, char *argv[])
|
|||||||
boundaryMesh bMesh;
|
boundaryMesh bMesh;
|
||||||
|
|
||||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0);
|
scalar minCos = Foam::cos(featureAngle * mathematicalConstant::pi/180.0);
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
collectFeatureEdges(bMesh, markedEdges);
|
collectFeatureEdges(bMesh, markedEdges);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// (new) patch ID for every face in mesh.
|
// (new) patch ID for every face in mesh.
|
||||||
labelList patchIDs(bMesh.mesh().size(), -1);
|
labelList patchIDs(bMesh.mesh().size(), -1);
|
||||||
|
|
||||||
@ -209,15 +211,18 @@ int main(int argc, char *argv[])
|
|||||||
newPatchI,
|
newPatchI,
|
||||||
mesh.boundaryMesh()
|
mesh.boundaryMesh()
|
||||||
).ptr();
|
).ptr();
|
||||||
|
|
||||||
newPatchI++;
|
newPatchI++;
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change patches
|
// Change patches
|
||||||
repatchPolyTopoChanger polyMeshRepatcher(mesh);
|
repatchPolyTopoChanger polyMeshRepatcher(mesh);
|
||||||
polyMeshRepatcher.changePatches(newPatchPtrList);
|
polyMeshRepatcher.changePatches(newPatchPtrList);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.append("set");
|
argList::validArgs.append("set");
|
||||||
argList::validArgs.append("patch");
|
argList::validArgs.append("patch");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -81,6 +82,8 @@ int main(int argc, char *argv[])
|
|||||||
<< "Cannot find patch " << patchName << exit(FatalError);
|
<< "Cannot find patch " << patchName << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
// Read objects in time directory
|
// Read objects in time directory
|
||||||
IOobjectList objects(mesh, runTime.timeName());
|
IOobjectList objects(mesh, runTime.timeName());
|
||||||
|
|
||||||
@ -226,7 +229,10 @@ int main(int argc, char *argv[])
|
|||||||
Pout<< "Converted locally " << nBaffled
|
Pout<< "Converted locally " << nBaffled
|
||||||
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
<< " faces into boundary faces on patch " << patchName << nl << endl;
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Change the mesh. Change points directly (no inflation).
|
// Change the mesh. Change points directly (no inflation).
|
||||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||||
|
|||||||
@ -154,11 +154,13 @@ void filterPatches(polyMesh& mesh)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
Info<< "Reading createPatchDict\n" << endl;
|
Info<< "Reading createPatchDict\n" << endl;
|
||||||
|
|
||||||
@ -355,7 +357,10 @@ int main(int argc, char *argv[])
|
|||||||
// Set the precision of the points data to 10
|
// Set the precision of the points data to 10
|
||||||
IOstream::defaultPrecision(10);
|
IOstream::defaultPrecision(10);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Write resulting mesh
|
// Write resulting mesh
|
||||||
Info<< "Writing repatched mesh to " << runTime.timeName() << endl;
|
Info<< "Writing repatched mesh to " << runTime.timeName() << endl;
|
||||||
|
|||||||
@ -251,11 +251,13 @@ labelList getAllNonManifoldPoints
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("split", "");
|
argList::validOptions.insert("split", "");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
bool split = args.options().found("split");
|
bool split = args.options().found("split");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
// Collect all boundary faces
|
// Collect all boundary faces
|
||||||
labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces());
|
labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces());
|
||||||
@ -402,7 +404,10 @@ int main(int argc, char *argv[])
|
|||||||
insertDuplicateMerge(mesh, duplicates, meshMod);
|
insertDuplicateMerge(mesh, duplicates, meshMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Change the mesh. No inflation.
|
// Change the mesh. No inflation.
|
||||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
|
||||||
|
|||||||
@ -294,6 +294,7 @@ label twoDNess(const polyMesh& mesh)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Foam::argList::validOptions.insert("dict", "");
|
Foam::argList::validOptions.insert("dict", "");
|
||||||
|
Foam::argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -307,6 +308,7 @@ int main(int argc, char *argv[])
|
|||||||
//
|
//
|
||||||
|
|
||||||
bool readDict = args.options().found("dict");
|
bool readDict = args.options().found("dict");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
// List of cells to refine
|
// List of cells to refine
|
||||||
labelList refCells;
|
labelList refCells;
|
||||||
@ -413,7 +415,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
string oldTimeName(runTime.timeName());
|
string oldTimeName(runTime.timeName());
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Multi-directional refinement (does multiple iterations)
|
// Multi-directional refinement (does multiple iterations)
|
||||||
@ -431,7 +436,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Create cellSet with added cells for easy inspection
|
// Create cellSet with added cells for easy inspection
|
||||||
cellSet newCells(mesh, "refinedCells", refCells.size());
|
cellSet newCells(mesh, "refinedCells", refCells.size());
|
||||||
|
|
||||||
forAll(oldToNew, oldCellI)
|
forAll(oldToNew, oldCellI)
|
||||||
{
|
{
|
||||||
const labelList& added = oldToNew[oldCellI];
|
const labelList& added = oldToNew[oldCellI];
|
||||||
@ -445,7 +450,7 @@ int main(int argc, char *argv[])
|
|||||||
Pout<< "Writing refined cells (" << newCells.size() << ") to cellSet "
|
Pout<< "Writing refined cells (" << newCells.size() << ") to cellSet "
|
||||||
<< newCells.instance()/newCells.local()/newCells.name()
|
<< newCells.instance()/newCells.local()/newCells.name()
|
||||||
<< endl << endl;
|
<< endl << endl;
|
||||||
|
|
||||||
newCells.write();
|
newCells.write();
|
||||||
|
|
||||||
|
|
||||||
@ -473,7 +478,7 @@ int main(int argc, char *argv[])
|
|||||||
+ runTime.timeName()
|
+ runTime.timeName()
|
||||||
+ " to cells in mesh at "
|
+ " to cells in mesh at "
|
||||||
+ oldTimeName;
|
+ oldTimeName;
|
||||||
|
|
||||||
|
|
||||||
forAll(oldToNew, oldCellI)
|
forAll(oldToNew, oldCellI)
|
||||||
{
|
{
|
||||||
@ -500,7 +505,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Some statistics.
|
// Some statistics.
|
||||||
|
|
||||||
printEdgeStats(mesh);
|
printEdgeStats(mesh);
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|||||||
@ -228,7 +228,7 @@ labelList regionFaceOrder
|
|||||||
|
|
||||||
oldToNewFace[sortKey.indices()[i]] = newFaceI++;
|
oldToNewFace[sortKey.indices()[i]] = newFaceI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave patch faces intact.
|
// Leave patch faces intact.
|
||||||
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
||||||
@ -368,7 +368,8 @@ int main(int argc, char *argv[])
|
|||||||
argList::validOptions.insert("blockOrder", "");
|
argList::validOptions.insert("blockOrder", "");
|
||||||
argList::validOptions.insert("orderPoints", "");
|
argList::validOptions.insert("orderPoints", "");
|
||||||
argList::validOptions.insert("writeMaps", "");
|
argList::validOptions.insert("writeMaps", "");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "addTimeOptions.H"
|
# include "addTimeOptions.H"
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
@ -411,6 +412,7 @@ int main(int argc, char *argv[])
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
label band = getBand(mesh.faceOwner(), mesh.faceNeighbour());
|
label band = getBand(mesh.faceOwner(), mesh.faceNeighbour());
|
||||||
|
|
||||||
@ -503,7 +505,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(cellToRegion, cellI)
|
forAll(cellToRegion, cellI)
|
||||||
{
|
{
|
||||||
cellDist[cellI] = cellToRegion[cellI];
|
cellDist[cellI] = cellToRegion[cellI];
|
||||||
}
|
}
|
||||||
|
|
||||||
cellDist.write();
|
cellDist.write();
|
||||||
@ -528,7 +530,10 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Change the mesh.
|
// Change the mesh.
|
||||||
map = reorderMesh(mesh, cellOrder, faceOrder);
|
map = reorderMesh(mesh, cellOrder, faceOrder);
|
||||||
@ -539,7 +544,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
polyTopoChange meshMod(mesh);
|
polyTopoChange meshMod(mesh);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Change the mesh.
|
// Change the mesh.
|
||||||
map = meshMod.changeMesh
|
map = meshMod.changeMesh
|
||||||
|
|||||||
@ -118,6 +118,7 @@ int main(int argc, char *argv[])
|
|||||||
Foam::argList::validArgs.append("faceSet");
|
Foam::argList::validArgs.append("faceSet");
|
||||||
Foam::argList::validArgs.append("masterPatch");
|
Foam::argList::validArgs.append("masterPatch");
|
||||||
Foam::argList::validArgs.append("slavePatch");
|
Foam::argList::validArgs.append("slavePatch");
|
||||||
|
Foam::argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -126,6 +127,7 @@ int main(int argc, char *argv[])
|
|||||||
word setName(args.additionalArgs()[0]);
|
word setName(args.additionalArgs()[0]);
|
||||||
word masterPatch(args.additionalArgs()[1]);
|
word masterPatch(args.additionalArgs()[1]);
|
||||||
word slavePatch(args.additionalArgs()[2]);
|
word slavePatch(args.additionalArgs()[2]);
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
// List of faces to split
|
// List of faces to split
|
||||||
faceSet facesSet(mesh, setName);
|
faceSet facesSet(mesh, setName);
|
||||||
@ -252,7 +254,10 @@ int main(int argc, char *argv[])
|
|||||||
Info<< nl << "Constructed topologyModifier:" << endl;
|
Info<< nl << "Constructed topologyModifier:" << endl;
|
||||||
splitter[0].writeDict(Info);
|
splitter[0].writeDict(Info);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
splitter.attach();
|
splitter.attach();
|
||||||
|
|
||||||
|
|||||||
@ -720,7 +720,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
{
|
{
|
||||||
exposedPatchIDs[i] = interfaceToPatch[interface]+1;
|
exposedPatchIDs[i] = interfaceToPatch[interface]+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove faces
|
// Remove faces
|
||||||
@ -1118,6 +1118,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::validOptions.insert("makeCellZones", "");
|
argList::validOptions.insert("makeCellZones", "");
|
||||||
argList::validOptions.insert("largestOnly", "");
|
argList::validOptions.insert("largestOnly", "");
|
||||||
argList::validOptions.insert("insidePoint", "point");
|
argList::validOptions.insert("insidePoint", "point");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -1134,6 +1135,7 @@ int main(int argc, char *argv[])
|
|||||||
bool largestOnly = args.options().found("largestOnly");
|
bool largestOnly = args.options().found("largestOnly");
|
||||||
bool insidePoint = args.options().found("insidePoint");
|
bool insidePoint = args.options().found("insidePoint");
|
||||||
bool useCellZones = args.options().found("cellZones");
|
bool useCellZones = args.options().found("cellZones");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
if (insidePoint && largestOnly)
|
if (insidePoint && largestOnly)
|
||||||
{
|
{
|
||||||
@ -1469,7 +1471,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
|
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
|
||||||
runTime++;
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Writing cellZones as new mesh to time " << runTime.timeName()
|
Info<< "Writing cellZones as new mesh to time " << runTime.timeName()
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
@ -1510,7 +1516,10 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create regions
|
// Create regions
|
||||||
|
|||||||
@ -131,6 +131,8 @@ int main(int argc, char *argv[])
|
|||||||
Foam::argList::validOptions.insert("partial", "");
|
Foam::argList::validOptions.insert("partial", "");
|
||||||
Foam::argList::validOptions.insert("perfect", "");
|
Foam::argList::validOptions.insert("perfect", "");
|
||||||
|
|
||||||
|
Foam::argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
@ -141,6 +143,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
bool partialCover = args.options().found("partial");
|
bool partialCover = args.options().found("partial");
|
||||||
bool perfectCover = args.options().found("perfect");
|
bool perfectCover = args.options().found("perfect");
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
if (partialCover && perfectCover)
|
if (partialCover && perfectCover)
|
||||||
{
|
{
|
||||||
@ -349,7 +352,7 @@ int main(int argc, char *argv[])
|
|||||||
IOobjectList objects(mesh, runTime.timeName());
|
IOobjectList objects(mesh, runTime.timeName());
|
||||||
|
|
||||||
// Read all current fvFields so they will get mapped
|
// Read all current fvFields so they will get mapped
|
||||||
Info<< "Reading all current volfields" << endl;
|
Info<< "Reading all current volfields" << endl;
|
||||||
PtrList<volScalarField> volScalarFields;
|
PtrList<volScalarField> volScalarFields;
|
||||||
readFields(mesh, objects, volScalarFields);
|
readFields(mesh, objects, volScalarFields);
|
||||||
|
|
||||||
@ -366,7 +369,7 @@ int main(int argc, char *argv[])
|
|||||||
readFields(mesh, objects, volTensorFields);
|
readFields(mesh, objects, volTensorFields);
|
||||||
|
|
||||||
//- uncomment if you want to interpolate surface fields (usually bad idea)
|
//- uncomment if you want to interpolate surface fields (usually bad idea)
|
||||||
//Info<< "Reading all current surfaceFields" << endl;
|
//Info<< "Reading all current surfaceFields" << endl;
|
||||||
//PtrList<surfaceScalarField> surfaceScalarFields;
|
//PtrList<surfaceScalarField> surfaceScalarFields;
|
||||||
//readFields(mesh, objects, surfaceScalarFields);
|
//readFields(mesh, objects, surfaceScalarFields);
|
||||||
//
|
//
|
||||||
@ -376,7 +379,10 @@ int main(int argc, char *argv[])
|
|||||||
//PtrList<surfaceTensorField> surfaceTensorFields;
|
//PtrList<surfaceTensorField> surfaceTensorFields;
|
||||||
//readFields(mesh, objects, surfaceTensorFields);
|
//readFields(mesh, objects, surfaceTensorFields);
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Execute all polyMeshModifiers
|
// Execute all polyMeshModifiers
|
||||||
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
|
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
|
||||||
|
|||||||
@ -60,7 +60,7 @@ void subsetVolFields
|
|||||||
|
|
||||||
Info<< "Subsetting field " << fieldName << endl;
|
Info<< "Subsetting field " << fieldName << endl;
|
||||||
|
|
||||||
GeometricField<Type, fvPatchField, volMesh> fld
|
GeometricField<Type, fvPatchField, volMesh> fld
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -94,7 +94,7 @@ void subsetSurfaceFields
|
|||||||
|
|
||||||
Info<< "Subsetting field " << fieldName << endl;
|
Info<< "Subsetting field " << fieldName << endl;
|
||||||
|
|
||||||
GeometricField<Type, fvsPatchField, surfaceMesh> fld
|
GeometricField<Type, fvsPatchField, surfaceMesh> fld
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -129,7 +129,7 @@ void subsetPointFields
|
|||||||
|
|
||||||
Info<< "Subsetting field " << fieldName << endl;
|
Info<< "Subsetting field " << fieldName << endl;
|
||||||
|
|
||||||
GeometricField<Type, pointPatchField, pointMesh> fld
|
GeometricField<Type, pointPatchField, pointMesh> fld
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -153,12 +153,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.append("set");
|
argList::validArgs.append("set");
|
||||||
argList::validOptions.insert("patch", "patch name");
|
argList::validOptions.insert("patch", "patch name");
|
||||||
|
argList::validOptions.insert("overwrite", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
word setName(args.additionalArgs()[0]);
|
word setName(args.additionalArgs()[0]);
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
Info<< "Reading cell set from " << setName << endl << endl;
|
Info<< "Reading cell set from " << setName << endl << endl;
|
||||||
@ -324,14 +326,17 @@ int main(int argc, char *argv[])
|
|||||||
// Write mesh and fields to new time
|
// Write mesh and fields to new time
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
runTime++;
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Writing subsetted mesh and fields to time " << runTime.value()
|
Info<< "Writing subsetted mesh and fields to time " << runTime.value()
|
||||||
<< endl;
|
<< endl;
|
||||||
subsetter.subMesh().write();
|
subsetter.subMesh().write();
|
||||||
|
|
||||||
|
|
||||||
// Subsetting adds 'subset' prefix. Rename field to be like original.
|
// Subsetting adds 'subset' prefix. Rename field to be like original.
|
||||||
forAll(scalarFlds, i)
|
forAll(scalarFlds, i)
|
||||||
{
|
{
|
||||||
scalarFlds[i].rename(scalarNames[i]);
|
scalarFlds[i].rename(scalarNames[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user