36 namespace functionObjects
42 fieldCoordinateSystemTransform,
51 Foam::functionObjects::fieldCoordinateSystemTransform::
52 fieldCoordinateSystemTransform
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;
78 Foam::functionObjects::fieldCoordinateSystemTransform::transformFieldName
88 Foam::functionObjects::fieldCoordinateSystemTransform::srotTensor()
const
91 typedef surfaceTensorField::Boundary BoundaryType;
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_;
133 Foam::functionObjects::fieldCoordinateSystemTransform::vrotTensor()
const
136 typedef volTensorField::Boundary BoundaryType;
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_;
179 const dictionary&
dict
184 fieldSet_.read(
dict);
192 bool 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();
215 for (
const word& fieldName : fieldSet_.selectionNames())
217 writeObject(transformFieldName(fieldName));