36namespace functionObjects
42 fieldCoordinateSystemTransform,
51Foam::functionObjects::fieldCoordinateSystemTransform::
52fieldCoordinateSystemTransform
56 const dictionary&
dict
63 coordinateSystem::New(mesh_,
dict, coordinateSystem::typeName_())
69 <<
" Applying " << (csysPtr_->uniform() ?
"" :
"non-")
70 <<
"uniform transformation from global Cartesian to local "
71 << *csysPtr_ <<
nl <<
endl;
78Foam::functionObjects::fieldCoordinateSystemTransform::transformFieldName
88Foam::functionObjects::fieldCoordinateSystemTransform::srotTensor()
const
93 if (!rotTensorSurface_)
95 tensorField rotations(csysPtr_->R(mesh_.faceCentres()));
97 rotTensorSurface_.reset
104 mesh_.objectRegistry::instance(),
105 mesh_.objectRegistry::db(),
117 auto& rot = *rotTensorSurface_;
120 BoundaryType& bf =
const_cast<BoundaryType&
>(rot.boundaryField());
124 bf[patchi] = csysPtr_->R(bf[patchi].
patch().
patch().faceCentres());
128 return *rotTensorSurface_;
133Foam::functionObjects::fieldCoordinateSystemTransform::vrotTensor()
const
138 if (!rotTensorVolume_)
140 tensorField rotations(csysPtr_->R(mesh_.cellCentres()));
142 rotTensorVolume_.reset
149 mesh_.objectRegistry::instance(),
150 mesh_.objectRegistry::db(),
162 auto& rot = *rotTensorVolume_;
165 BoundaryType& bf =
const_cast<BoundaryType&
>(rot.boundaryField());
169 bf[patchi] = csysPtr_->R(bf[patchi].
patch().
patch().faceCentres());
173 return *rotTensorVolume_;
177bool Foam::functionObjects::fieldCoordinateSystemTransform::read
179 const dictionary&
dict
182 if (fvMeshFunctionObject::read(
dict))
184 fieldSet_.read(
dict);
192bool Foam::functionObjects::fieldCoordinateSystemTransform::execute()
194 fieldSet_.updateSelection();
196 for (
const word& fieldName : fieldSet_.selectionNames())
198 transform<scalar>(fieldName);
199 transform<vector>(fieldName);
200 transform<sphericalTensor>(fieldName);
201 transform<symmTensor>(fieldName);
202 transform<tensor>(fieldName);
206 rotTensorSurface_.clear();
207 rotTensorVolume_.clear();
213bool Foam::functionObjects::fieldCoordinateSystemTransform::write()
215 for (
const word& fieldName : fieldSet_.selectionNames())
217 writeObject(transformFieldName(fieldName));
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const std::string patch
OpenFOAM patch number as a std::string.
const dimensionSet dimless
Dimensionless.
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.