|
|
<!-- --- title: Developer Upgrade Guide (OpenFOAM-v1812) -->
|
|
|
|
|
|
[Back to Upgrade Guides](/guides/upgrade/upgrade)
|
|
|
|
|
|
## Coordinate systems
|
|
|
|
|
|
As described in the [release notes][v1812-notes], coordinate systems
|
|
|
received a significant overhaul. The potential code-breaking points
|
|
|
are listed here.
|
|
|
|
|
|
Cylindrical coordinate systems are now radians only.
|
|
|
|
|
|
The base-level rotation tensor and the transform/invTransform methods
|
|
|
are now directly located in the coordinate system.
|
|
|
|
|
|
Old code:
|
|
|
```
|
|
|
tensor rot = cs.R().R();
|
|
|
cs.R().transform(...);
|
|
|
```
|
|
|
|
|
|
New code:
|
|
|
```
|
|
|
tensor rot = cs.R();
|
|
|
cs.transform(...);
|
|
|
```
|
|
|
|
|
|
Some naming inconsistencies were eliminated in the coordinate systems
|
|
|
|
|
|
- `transformVector()` becomes `transformPrincipal()`
|
|
|
|
|
|
- `transformTensor()` is now simply `transform()`
|
|
|
|
|
|
|
|
|
The new methods transformPoint/invTransformPoint provide
|
|
|
transformations with an origin offset using Cartesian for both local
|
|
|
and global points. These can be used to determine the local position
|
|
|
based on the origin/rotation without interpreting it as a r-theta-z
|
|
|
value, for example.
|
|
|
|
|
|
|
|
|
### Coordinate system namespaces
|
|
|
|
|
|
For better code isolation, dedicated `Foam::coordSystem` and
|
|
|
`Foam::coordinateRotations` namespaces have been introduced.
|
|
|
For convenience and compatibility with older code, typedefs are also
|
|
|
provided. For example,
|
|
|
```
|
|
|
//- Compatibility typedef 1806
|
|
|
typedef coordSystem::cartesian cartesianCS;
|
|
|
|
|
|
//- Compatibility typedef 1806
|
|
|
typedef coordinateRotations::euler EulerCoordinateRotation;
|
|
|
```
|
|
|
|
|
|
[v1812-notes]: https://www.openfoam.com/releases/openfoam-v1812/ |