mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
surfMesh reworked
- treat 'ofs' IO just like any other format - dropped BasicMeshedSurface, since MeshedSurface can now also have zero or more zones - UnsortedMeshedSurface is a special type of MeshedSurface with zero zones, but with additional zoneId labels - use MeshedSurfaceProxy for writing surfaces with points/faces/zones and optional faceMap - provides output interface for MeshedSurface, UnsortedMeshedSurface and surfMesh. - simplify output to filenames only, I can't see that the Ostream is needed anywhere - surfMesh renaming now works, after the objectRegistry fix
This commit is contained in:
@ -271,13 +271,40 @@ int main(int argc, char *argv[])
|
||||
args.caseName()
|
||||
);
|
||||
|
||||
// start with "constant"
|
||||
runTime.setTime(instant(0, runTime.constant()), 0);
|
||||
|
||||
Info<< "runTime.instance() = " << runTime.instance() << endl;
|
||||
Info<< "runTime.timeName() = " << runTime.timeName() << endl;
|
||||
|
||||
|
||||
surfMesh surfIn
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"default",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "surfIn = " << surfIn.nFaces() << endl;
|
||||
|
||||
Info<< "runTime.instance() = " << runTime.instance() << endl;
|
||||
|
||||
surfMesh surfOut
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mySurf",
|
||||
runTime.instance(),
|
||||
runTime
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
surf.xfer()
|
||||
);
|
||||
@ -299,6 +326,25 @@ int main(int argc, char *argv[])
|
||||
dimless
|
||||
);
|
||||
|
||||
Info<<" surf name= " << surfOut.name() <<nl;
|
||||
Info<< "rename to anotherSurf" << endl;
|
||||
surfOut.rename("anotherSurf");
|
||||
|
||||
Info<<" surf name= " << surfOut.name() <<nl;
|
||||
|
||||
// advance time to 1
|
||||
runTime.setTime(instant(1), 1);
|
||||
surfOut.setInstance(runTime.timeName());
|
||||
|
||||
|
||||
|
||||
Info<< "writing surfMesh again well: " << surfOut.objectPath() << endl;
|
||||
surfOut.write();
|
||||
|
||||
// write directly
|
||||
surfOut.write("someName.ofs");
|
||||
|
||||
#if 1
|
||||
const surfZoneList& zones = surfOut.surfZones();
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
@ -318,9 +364,10 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pointIds",
|
||||
"zoneIds.",
|
||||
// "pointIds",
|
||||
surfOut.instance(),
|
||||
"pointFields",
|
||||
// "pointFields",
|
||||
surfOut,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -337,6 +384,10 @@ int main(int argc, char *argv[])
|
||||
Info<< "write pointIds (for testing only): "
|
||||
<< pointIds.objectPath() << endl;
|
||||
pointIds.write();
|
||||
|
||||
Info<<"surfMesh with these names: " << surfOut.names() << endl;
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user