mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added zoneSets
This commit is contained in:
@ -37,37 +37,6 @@ using namespace Foam;
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const topoSet& fromSet,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Info<< "Backing up " << fromName << " into " << toName << endl;
|
|
||||||
|
|
||||||
topoSet backupSet(mesh, toName, fromSet);
|
|
||||||
|
|
||||||
backupSet.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Read and copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
topoSet fromSet(mesh, fromName, IOobject::READ_IF_PRESENT);
|
|
||||||
|
|
||||||
backup(mesh, fromName, fromSet, toName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -114,8 +83,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
r = IOobject::NO_READ;
|
r = IOobject::NO_READ;
|
||||||
|
|
||||||
backup(mesh, setName, setName + "_old");
|
|
||||||
|
|
||||||
currentSetPtr.reset
|
currentSetPtr.reset
|
||||||
(
|
(
|
||||||
new cellSet
|
new cellSet
|
||||||
@ -151,7 +118,7 @@ int main(int argc, char *argv[])
|
|||||||
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
||||||
{
|
{
|
||||||
// currentSet has been read so can make copy.
|
// currentSet has been read so can make copy.
|
||||||
backup(mesh, setName, currentSet, setName + "_old");
|
//backup(mesh, setName, currentSet, setName + "_old");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == topoSetSource::CLEAR)
|
if (action == topoSetSource::CLEAR)
|
||||||
@ -173,7 +140,16 @@ int main(int argc, char *argv[])
|
|||||||
forAll(topoSetSources, topoSetSourceI)
|
forAll(topoSetSources, topoSetSourceI)
|
||||||
{
|
{
|
||||||
// Backup current set.
|
// Backup current set.
|
||||||
topoSet oldSet(mesh, currentSet.name() + "_old2", currentSet);
|
autoPtr<topoSet> oldSet
|
||||||
|
(
|
||||||
|
topoSet::New
|
||||||
|
(
|
||||||
|
currentSet.type(),
|
||||||
|
mesh,
|
||||||
|
currentSet.name() + "_old2",
|
||||||
|
currentSet
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
currentSet.clear();
|
currentSet.clear();
|
||||||
|
|
||||||
|
|||||||
@ -37,37 +37,6 @@ using namespace Foam;
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const topoSet& fromSet,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Info<< "Backing up " << fromName << " into " << toName << endl;
|
|
||||||
|
|
||||||
topoSet backupSet(mesh, toName, fromSet);
|
|
||||||
|
|
||||||
backupSet.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Read and copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
topoSet fromSet(mesh, fromName, IOobject::READ_IF_PRESENT);
|
|
||||||
|
|
||||||
backup(mesh, fromName, fromSet, toName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -114,8 +83,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
r = IOobject::NO_READ;
|
r = IOobject::NO_READ;
|
||||||
|
|
||||||
backup(mesh, setName, setName + "_old");
|
|
||||||
|
|
||||||
currentSetPtr.reset
|
currentSetPtr.reset
|
||||||
(
|
(
|
||||||
new faceSet
|
new faceSet
|
||||||
@ -151,7 +118,7 @@ int main(int argc, char *argv[])
|
|||||||
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
||||||
{
|
{
|
||||||
// currentSet has been read so can make copy.
|
// currentSet has been read so can make copy.
|
||||||
backup(mesh, setName, currentSet, setName + "_old");
|
//backup(mesh, setName, currentSet, setName + "_old");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == topoSetSource::CLEAR)
|
if (action == topoSetSource::CLEAR)
|
||||||
@ -173,7 +140,16 @@ int main(int argc, char *argv[])
|
|||||||
forAll(topoSetSources, topoSetSourceI)
|
forAll(topoSetSources, topoSetSourceI)
|
||||||
{
|
{
|
||||||
// Backup current set.
|
// Backup current set.
|
||||||
topoSet oldSet(mesh, currentSet.name() + "_old2", currentSet);
|
autoPtr<topoSet> oldSet
|
||||||
|
(
|
||||||
|
topoSet::New
|
||||||
|
(
|
||||||
|
currentSet.type(),
|
||||||
|
mesh,
|
||||||
|
currentSet.name() + "_old2",
|
||||||
|
currentSet
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
currentSet.clear();
|
currentSet.clear();
|
||||||
|
|
||||||
|
|||||||
@ -37,37 +37,6 @@ using namespace Foam;
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const topoSet& fromSet,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Info<< "Backing up " << fromName << " into " << toName << endl;
|
|
||||||
|
|
||||||
topoSet backupSet(mesh, toName, fromSet);
|
|
||||||
|
|
||||||
backupSet.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Read and copy set
|
|
||||||
void backup
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& fromName,
|
|
||||||
const word& toName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
topoSet fromSet(mesh, fromName, IOobject::READ_IF_PRESENT);
|
|
||||||
|
|
||||||
backup(mesh, fromName, fromSet, toName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -114,8 +83,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
r = IOobject::NO_READ;
|
r = IOobject::NO_READ;
|
||||||
|
|
||||||
backup(mesh, setName, setName + "_old");
|
|
||||||
|
|
||||||
currentSetPtr.reset
|
currentSetPtr.reset
|
||||||
(
|
(
|
||||||
new pointSet
|
new pointSet
|
||||||
@ -151,7 +118,7 @@ int main(int argc, char *argv[])
|
|||||||
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
|
||||||
{
|
{
|
||||||
// currentSet has been read so can make copy.
|
// currentSet has been read so can make copy.
|
||||||
backup(mesh, setName, currentSet, setName + "_old");
|
//backup(mesh, setName, currentSet, setName + "_old");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == topoSetSource::CLEAR)
|
if (action == topoSetSource::CLEAR)
|
||||||
@ -173,7 +140,16 @@ int main(int argc, char *argv[])
|
|||||||
forAll(topoSetSources, topoSetSourceI)
|
forAll(topoSetSources, topoSetSourceI)
|
||||||
{
|
{
|
||||||
// Backup current set.
|
// Backup current set.
|
||||||
topoSet oldSet(mesh, currentSet.name() + "_old2", currentSet);
|
autoPtr<topoSet> oldSet
|
||||||
|
(
|
||||||
|
topoSet::New
|
||||||
|
(
|
||||||
|
currentSet.type(),
|
||||||
|
mesh,
|
||||||
|
currentSet.name() + "_old2",
|
||||||
|
currentSet
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
currentSet.clear();
|
currentSet.clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user