85 template<
class GeoField>
86 void readAndRotateFields
97 Info<<
"Transforming " << flds[i].name() <<
endl;
113 readAndRotateFields(vsFlds, mesh, T, objects);
115 readAndRotateFields(vvFlds, mesh, T, objects);
117 readAndRotateFields(vstFlds, mesh, T, objects);
119 readAndRotateFields(vsymtFlds, mesh, T, objects);
121 readAndRotateFields(vtFlds, mesh, T, objects);
125 readAndRotateFields(ssFlds, mesh, T, objects);
127 readAndRotateFields(svFlds, mesh, T, objects);
129 readAndRotateFields(sstFlds, mesh, T, objects);
131 readAndRotateFields(ssymtFlds, mesh, T, objects);
133 readAndRotateFields(stFlds, mesh, T, objects);
141 int main(
int argc,
char *argv[])
145 "Transforms a mesh by translation, rotation and/or scaling.\n" 146 "The <transformations> are listed comma-separated in a string " 147 "and executed in sequence.\n\n" 149 " translate=<vector> " 150 "translation by vector, e.g. (1 2 3)\n" 151 " rotate=(<n1> <n2>) " 152 "rotation from unit vector n1 to n2\n" 154 "rotation by given angle [deg], e.g. 90, about x-axis\n" 156 "rotation by given angle [deg] about y-axis\n" 158 "rotation by given angle [deg] about z-axis\n" 159 " Ra=<axis vector> <angle> " 160 "rotation by given angle [deg] about specified axis\n" 162 "scale by factors from vector in x, y, z directions,\n" 164 "e.g. (0.001 0.001 0.001) to scale from mm to m\n\n" 167 "\"translate=(1.2 0 0), Rx=90, translate=(-1.2 0 0)\"" 175 "transform vector and tensor fields" 182 "Point set to limit the transformation to" 190 const string transformationString(args[1]);
196 const bool doRotateFields = args.
optionFound(
"rotateFields");
201 if (doRotateFields && doPointSet)
204 <<
"Rotation of fields across the entire mesh, and limiting the " 205 <<
"transformation of points to a set, cannot be done " 209 forAll(regionNames, regioni)
211 const word& regionName = regionNames[regioni];
PtrList< surfaceSphericalTensorField > sstFlds
PtrList< volTensorField > vtFlds
PtrList< volSphericalTensorField > vstFlds
wordList ReadFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields, const bool syncPar=true)
Read all fields of the specified type.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A class for handling file names.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Unit conversion functions.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static unsigned int defaultPrecision()
Return the default precision.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Return the location of "dir" containing the file "name".
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Field reading functions for post-processing utilities.
Generic dimensioned Type class.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
PtrList< volVectorField > vvFlds
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
PtrList< volScalarField > vsFlds
const word & regionDir(const word ®ionName)
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
A class for handling words, derived from string.
Extract command arguments and options from the supplied argc and argv parameters. ...
PtrList< surfaceSymmTensorField > ssymtFlds
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static const word null
An empty word.
PtrList< volSymmTensorField > vsymtFlds
PtrList< surfaceTensorField > stFlds
PtrList< surfaceScalarField > ssFlds
PtrList< surfaceVectorField > svFlds
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
List< Key > toc() const
Return the table of contents.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A primitive field of type <T> with automated input and output.
wordList selectRegionNames(const argList &args, const Time &runTime)
dimensionSet transform(const dimensionSet &)