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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user