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:
@ -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
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
|
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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
|
||||||
@ -541,7 +545,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cutter.updateMesh(morphMap());
|
cutter.updateMesh(morphMap());
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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;
|
||||||
@ -587,7 +594,10 @@ int main(int argc, char *argv[])
|
|||||||
//cutter.updateMesh(morphMap());
|
//cutter.updateMesh(morphMap());
|
||||||
|
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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());
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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;
|
||||||
@ -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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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"
|
||||||
@ -58,6 +59,7 @@ 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;
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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;
|
||||||
|
|
||||||
@ -669,7 +671,10 @@ int main(int argc, char *argv[])
|
|||||||
// Do all changes
|
// Do all changes
|
||||||
Info<< "Morphing ..." << endl;
|
Info<< "Morphing ..." << endl;
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
polyMesh mesh
|
polyMesh mesh
|
||||||
(
|
(
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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]);
|
||||||
|
|
||||||
@ -464,7 +466,10 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
polyMesh mesh
|
polyMesh mesh
|
||||||
(
|
(
|
||||||
|
|||||||
@ -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
|
||||||
@ -175,7 +177,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mesh.updateMesh(morphMap);
|
mesh.updateMesh(morphMap);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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"
|
||||||
|
|
||||||
|
bool overwrite = args.options().found("overwrite");
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
|
|
||||||
@ -213,7 +215,10 @@ int main(int argc, char *argv[])
|
|||||||
newPatchI++;
|
newPatchI++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Change patches
|
// Change patches
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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());
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Multi-directional refinement (does multiple iterations)
|
// Multi-directional refinement (does multiple iterations)
|
||||||
|
|||||||
@ -368,6 +368,7 @@ 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"
|
||||||
|
|
||||||
@ -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());
|
||||||
|
|
||||||
@ -528,7 +530,10 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
splitter.attach();
|
splitter.attach();
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
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)
|
||||||
{
|
{
|
||||||
@ -376,7 +379,10 @@ int main(int argc, char *argv[])
|
|||||||
//PtrList<surfaceTensorField> surfaceTensorFields;
|
//PtrList<surfaceTensorField> surfaceTensorFields;
|
||||||
//readFields(mesh, objects, surfaceTensorFields);
|
//readFields(mesh, objects, surfaceTensorFields);
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
// Execute all polyMeshModifiers
|
// Execute all polyMeshModifiers
|
||||||
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
|
autoPtr<mapPolyMesh> morphMap = stitcher.changeMesh(true);
|
||||||
|
|||||||
@ -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,7 +326,10 @@ int main(int argc, char *argv[])
|
|||||||
// Write mesh and fields to new time
|
// Write mesh and fields to new time
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
runTime++;
|
runTime++;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Writing subsetted mesh and fields to time " << runTime.value()
|
Info<< "Writing subsetted mesh and fields to time " << runTime.value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user