mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
making overwrite work
This commit is contained in:
@ -464,6 +464,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||
@ -587,8 +588,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
|
||||
Info<< "Writing collapsed mesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
@ -441,6 +441,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
@ -502,6 +503,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (nChanged > 0)
|
||||
{
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing morphed mesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -334,6 +334,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
|
||||
@ -553,9 +554,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
else if (edgeToPos.size())
|
||||
@ -602,9 +607,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
else
|
||||
@ -641,9 +650,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.value() << endl;
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
|
||||
@ -58,6 +58,8 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
|
||||
word cellSetName(args.args()[1]);
|
||||
@ -177,6 +179,10 @@ int main(int argc, char *argv[])
|
||||
Pout<< "Refined from " << returnReduce(map().nOldCells(), sumOp<label>())
|
||||
<< " to " << mesh.globalData().nTotalCells() << " cells." << nl << endl;
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -56,6 +56,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word patchName(args.additionalArgs()[0]);
|
||||
|
||||
@ -226,8 +227,13 @@ int main(int argc, char *argv[])
|
||||
// Update stored labels on meshCutter.
|
||||
cutter.updateMesh(morphMap());
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing refined morphMesh to time " << runTime.value() << endl;
|
||||
Info << "Writing refined morphMesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
|
||||
@ -167,6 +168,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Take over refinement levels and write to new time directory.
|
||||
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
|
||||
|
||||
@ -534,6 +534,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
@ -693,7 +694,13 @@ int main(int argc, char *argv[])
|
||||
Info<< "Remaining:" << cellsToCut.size() << endl;
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing refined morphMesh to time " << runTime.value() << endl;
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing refined morphMesh to time " << runTime.timeName()
|
||||
<< endl;
|
||||
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
@ -354,6 +354,7 @@ int main(int argc, char *argv[])
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
// Mark boundary edges and points.
|
||||
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
||||
@ -499,7 +500,10 @@ int main(int argc, char *argv[])
|
||||
if (!overwrite)
|
||||
{
|
||||
runTime++;
|
||||
mesh.setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing dual mesh to " << runTime.timeName() << endl;
|
||||
|
||||
@ -63,6 +63,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
@ -182,6 +183,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Take over refinement levels and write to new time directory.
|
||||
Pout<< "Writing extruded mesh to time " << runTime.timeName() << nl
|
||||
|
||||
@ -48,6 +48,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
|
||||
@ -61,6 +62,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
attachPolyTopoChanger(mesh).attach();
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
mesh.write();
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -77,6 +77,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
Info<< "Mesh read in = "
|
||||
<< runTime.cpuTimeIncrement()
|
||||
@ -243,6 +244,10 @@ int main(int argc, char *argv[])
|
||||
polyMeshRepatcher.repatch();
|
||||
|
||||
// Write resulting mesh
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
mesh.write();
|
||||
|
||||
|
||||
|
||||
@ -74,19 +74,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
Info<< "Reading mesh for time = " << runTime.value() << endl;
|
||||
|
||||
Info<< "Create mesh\n" << endl;
|
||||
polyMesh mesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
)
|
||||
);
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
Info<< "Reading cellSetDict\n" << endl;
|
||||
|
||||
|
||||
@ -60,6 +60,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
@ -247,6 +248,10 @@ int main(int argc, char *argv[])
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
Pout<< "Writing mesh to " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -569,6 +569,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
@ -909,6 +910,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info<< "Writing repatched mesh to " << runTime.timeName() << nl << endl;
|
||||
|
||||
@ -74,19 +74,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
Info<< "Reading mesh for time = " << runTime.value() << endl;
|
||||
|
||||
Info<< "Create mesh\n" << endl;
|
||||
polyMesh mesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
)
|
||||
);
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
Info<< "Reading faceSetDict\n" << endl;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRoots.H"
|
||||
# include "createTimes.H"
|
||||
|
||||
Info<< "Reading master mesh for time = " << runTimeMaster.value() << endl;
|
||||
Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << endl;
|
||||
|
||||
Info<< "Create mesh\n" << endl;
|
||||
mergePolyMesh masterMesh
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading mesh to add for time = " << runTimeToAdd.value() << endl;
|
||||
Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << endl;
|
||||
|
||||
Info<< "Create mesh\n" << endl;
|
||||
polyMesh meshToAdd
|
||||
@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTimeMaster++;
|
||||
|
||||
Info<< "Writing combined mesh to " << runTimeMaster.value() << endl;
|
||||
Info<< "Writing combined mesh to " << runTimeMaster.timeName() << endl;
|
||||
|
||||
masterMesh.addMesh(meshToAdd);
|
||||
masterMesh.merge();
|
||||
|
||||
@ -229,6 +229,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool split = args.options().found("split");
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
@ -338,7 +339,10 @@ int main(int argc, char *argv[])
|
||||
mesh.movePoints(map().preMotionPoints());
|
||||
}
|
||||
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
|
||||
|
||||
@ -74,19 +74,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
Info<< "Reading mesh for time = " << runTime.value() << endl;
|
||||
|
||||
Info<< "Create mesh\n" << endl;
|
||||
polyMesh mesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
)
|
||||
);
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
Info<< "Reading pointSetDict\n" << endl;
|
||||
|
||||
|
||||
@ -300,6 +300,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
printEdgeStats(mesh);
|
||||
|
||||
@ -427,6 +428,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Write resulting mesh
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
mesh.write();
|
||||
|
||||
|
||||
|
||||
@ -383,9 +383,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
const bool blockOrder = args.options().found("blockOrder");
|
||||
|
||||
@ -631,6 +630,11 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -124,6 +124,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
word masterPatch(args.additionalArgs()[1]);
|
||||
@ -262,7 +263,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
splitter.attach();
|
||||
|
||||
Info << nl << "Writing polyMesh" << endl;
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing mesh to " << runTime.timeName() << endl;
|
||||
if (!mesh.write())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
|
||||
@ -763,7 +763,8 @@ void createAndWriteRegion
|
||||
const regionSplit& cellRegion,
|
||||
const wordList& regionNames,
|
||||
const EdgeMap<label>& interfaceToPatch,
|
||||
const label regionI
|
||||
const label regionI,
|
||||
const word& newMeshInstance
|
||||
)
|
||||
{
|
||||
Info<< "Creating mesh for region " << regionI
|
||||
@ -907,6 +908,7 @@ void createAndWriteRegion
|
||||
|
||||
Info<< "Writing new mesh" << endl;
|
||||
|
||||
newMesh().setInstance(newMeshInstance);
|
||||
newMesh().write();
|
||||
|
||||
// Write addressing files like decomposePar
|
||||
@ -1235,6 +1237,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word blockedFacesName;
|
||||
if (args.options().found("blockedFaces"))
|
||||
@ -1712,12 +1715,16 @@ int main(int argc, char *argv[])
|
||||
if (!overwrite)
|
||||
{
|
||||
runTime++;
|
||||
mesh.setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing cellZones as new mesh to time " << runTime.timeName()
|
||||
<< nl << endl;
|
||||
|
||||
mesh.setInstance(runTime.timeName());
|
||||
mesh.write();
|
||||
|
||||
|
||||
@ -1800,7 +1807,8 @@ int main(int argc, char *argv[])
|
||||
cellRegion,
|
||||
regionNames,
|
||||
interfaceToPatch,
|
||||
regionI
|
||||
regionI,
|
||||
(overwrite ? oldInstance : runTime.timeName())
|
||||
);
|
||||
}
|
||||
else if (largestOnly)
|
||||
@ -1817,7 +1825,8 @@ int main(int argc, char *argv[])
|
||||
cellRegion,
|
||||
regionNames,
|
||||
interfaceToPatch,
|
||||
regionI
|
||||
regionI,
|
||||
(overwrite ? oldInstance : runTime.timeName())
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -1835,7 +1844,8 @@ int main(int argc, char *argv[])
|
||||
cellRegion,
|
||||
regionNames,
|
||||
interfaceToPatch,
|
||||
regionI
|
||||
regionI,
|
||||
(overwrite ? oldInstance : runTime.timeName())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,6 +137,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
|
||||
word masterPatchName(args.additionalArgs()[0]);
|
||||
@ -391,6 +392,10 @@ int main(int argc, char *argv[])
|
||||
mesh.movePoints(morphMap->preMotionPoints());
|
||||
|
||||
// Write mesh
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
Info << nl << "Writing polyMesh to time " << runTime.timeName() << endl;
|
||||
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
@ -159,6 +159,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
bool overwrite = args.options().found("overwrite");
|
||||
@ -331,8 +332,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime++;
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
}
|
||||
|
||||
Info<< "Writing subsetted mesh and fields to time " << runTime.value()
|
||||
Info<< "Writing subsetted mesh and fields to time " << runTime.timeName()
|
||||
<< endl;
|
||||
subsetter.subMesh().write();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user