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