mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added region option
This commit is contained in:
@ -93,9 +93,9 @@ void readAndRotateFields
|
||||
}
|
||||
|
||||
|
||||
void rotateFields(const Time& runTime, const tensor& T)
|
||||
void rotateFields(const argList& args, const Time& runTime, const tensor& T)
|
||||
{
|
||||
# include "createMesh.H"
|
||||
# include "createNamedMesh.H"
|
||||
|
||||
// Read objects in time directory
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
@ -142,6 +142,7 @@ void rotateFields(const Time& runTime, const tensor& T)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addRegionOption.H"
|
||||
argList::validOptions.insert("translate", "vector");
|
||||
argList::validOptions.insert("rotate", "(vector vector)");
|
||||
argList::validOptions.insert("rollPitchYaw", "(roll pitch yaw)");
|
||||
@ -152,13 +153,25 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
fileName meshDir;
|
||||
|
||||
if (args.optionReadIfPresent("region", regionName))
|
||||
{
|
||||
meshDir = regionName/polyMesh::meshSubDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
meshDir = polyMesh::meshSubDir;
|
||||
}
|
||||
|
||||
pointIOField points
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
runTime.findInstance(polyMesh::meshSubDir, "points"),
|
||||
polyMesh::meshSubDir,
|
||||
runTime.findInstance(meshDir, "points"),
|
||||
meshDir,
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -197,7 +210,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("rotateFields"))
|
||||
{
|
||||
rotateFields(runTime, T);
|
||||
rotateFields(args, runTime, T);
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("rollPitchYaw"))
|
||||
@ -220,7 +233,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("rotateFields"))
|
||||
{
|
||||
rotateFields(runTime, R.R());
|
||||
rotateFields(args, runTime, R.R());
|
||||
}
|
||||
}
|
||||
else if (args.optionFound("yawPitchRoll"))
|
||||
@ -249,7 +262,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("rotateFields"))
|
||||
{
|
||||
rotateFields(runTime, R.R());
|
||||
rotateFields(args, runTime, R.R());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user