50template<
class GeoField>
51void ReadAndRotateFields
81 ReadAndRotateFields<volVectorField>(
mesh, objects, rotT);
82 ReadAndRotateFields<volSphericalTensorField>(
mesh, objects, rotT);
83 ReadAndRotateFields<volSymmTensorField>(
mesh, objects, rotT);
84 ReadAndRotateFields<volTensorField>(
mesh, objects, rotT);
86 ReadAndRotateFields<surfaceVectorField>(
mesh, objects, rotT);
87 ReadAndRotateFields<surfaceSphericalTensorField>(
mesh, objects, rotT);
88 ReadAndRotateFields<surfaceSymmTensorField>(
mesh, objects, rotT);
89 ReadAndRotateFields<surfaceTensorField>(
mesh, objects, rotT);
95int main(
int argc,
char *argv[])
99 "Rotate mesh points and vector/tensor fields\n"
100 "Rotation from the <from> vector to the <to> vector"
145 runTime.findInstance(meshDir,
"points"),
159 Info<<
"Writing points into directory "
169 runTime.setTime(timeDirs[timei], timei);
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
@ NO_REGISTER
Do not request registration (bool: false).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static unsigned int minPrecision(unsigned int prec) noexcept
Set the minimum default precision.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir).
Tensor of scalars, i.e. Tensor<scalar>.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options and also set the runTime to the first i...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
messageStream Info
Information stream (stdout output on master, null elsewhere).
vectorIOField pointIOField
pointIOField is a vectorIOField.
List< instant > instantList
List of instants.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.