57inline bool ignoreOutputCoordType(
const std::string& modelType)
62 || modelType == Foam::coordSystem::cartesian::typeName
63 || modelType == Foam::coordinateSystem::typeName
84 && (
dict.dictName() == coordinateSystem::typeName)
96 const auto finder =
dict.csearchCompat
98 "rotation", {{
"coordinateRotation", 1806}},
113 const word rotationType(finder->get<
word>());
163 spec_(csys.spec_.clone()),
164 origin_(csys.origin_),
173 spec_(std::move(csys.spec_)),
174 origin_(std::move(csys.origin_)),
175 rot_(std::move(csys.rot_)),
176 name_(std::move(csys.name_)),
194 spec_.reset(
new coordinateRotations::identity());
202 const coordinateSystem& csys
205 spec_(csys.spec_.clone()),
206 origin_(csys.origin_),
289 readOrigin = IOobjectOption::lazierRead(readOrigin);
291 assign(dict.subDict(dictName), readOrigin);
295 assign(dict, readOrigin);
337 const point& localCart
415 spec_.reset(std::move(crot));
435 if (!ignoreOutputCoordType(
type()))
440 os <<
"origin: " << origin_ <<
' ';
458 const bool subDict = !keyword.empty();
462 os.beginBlock(keyword);
465 if (!ignoreOutputCoordType(
type()))
467 os.writeEntry<word>(
"type",
type());
511 name_ = std::move(csys.name_);
512 note_ = std::move(csys.note_);
513 spec_ = std::move(csys.spec_);
514 origin_ = csys.origin_;
#define R(A, B, C, D, E, F, K, M)
Macros for easy insertion into run-time selection tables.
static readOption lazierRead(readOption opt) noexcept
Downgrade readOption optional (LAZY_READ), leaves NO_READ intact.
static bool isReadRequired(readOption opt) noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
readOption
Enumeration defining read preferences.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
static const SphericalTensor I
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
User specification of a coordinate rotation.
static autoPtr< coordinateRotation > New(const word &modelType, const dictionary &dict)
Select construct the specified coordinate rotation type.
A coordinateRotation specified using global axes.
An identity coordinateRotation.
Base class for coordinate system specification, the default coordinate system type is cartesian .
virtual const word & name() const
Return the name.
virtual const coordinateRotation & rotation() const
The rotation specification.
coordinateSystem(std::nullptr_t)
Construct null, without allocating a coordinateRotation specification.
tmp< tensorField > rotationsImpl(const PointField &global) const
Implementation for R() methods.
string note_
An optional note describing the coordinate system.
void operator=(const coordinateSystem &csys)
Copy assignment.
virtual vector globalToLocal(const vector &global, bool translate) const
From global Cartesian system to the local coordinate system with optional translation for the origin.
point invTransformPoint(const point &global) const
Remove origin offset and inverse transform point.
virtual vector localToGlobal(const vector &local, bool translate) const
From local coordinate system to the global Cartesian system with optional translation for the origin.
word name_
The name of the coordinate system (optional).
static coordinateSystem dummy_
Dummy coordinate system for suppressed manipulation.
tensor rot_
The rotation tensor.
virtual const point & origin() const
Return origin.
virtual void write(Ostream &os) const
Write.
virtual bool good() const
Consider good if it has a specification.
autoPtr< coordinateRotation > spec_
User specification of the coordinate rotation.
virtual const tensor & R() const
Return const reference to the rotation tensor.
coordinateSystem()
Default construct. This is an identity coordinate system.
virtual void writeEntry(Ostream &os) const
Write 'coordinateSystem' dictionary entry.
void assign(const dictionary &dict, IOobjectOption::readOption readOrigin=IOobjectOption::MUST_READ)
Assign from dictionary content with specified read handling of the 'origin' entry.
virtual void clear()
Reset origin and rotation to an identity coordinateSystem.
virtual autoPtr< coordinateSystem > clone() const
Return clone.
point transformPoint(const point &localCart) const
Transform point and add origin offset.
point origin_
The coordinate system origin.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
Namespace for coordinate system rotations.
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
bool operator!=(const eddy &a, const eddy &b)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
static const Identity< scalar > I
UIndirectList< point > pointUIndList
UIndirectList of point.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.