|
|
|
<!-- --- title: Developer Upgrade Guide (OpenFOAM-v2306) -->
|
|
|
|
|
|
|
|
[](/home)
|
|
|
|
[](/upgrade/v2306-User-Upgrade-Guide)
|
|
|
|
[][upgrade-guide]
|
|
|
|
[][code-patterns]
|
|
|
|
|
| ... | ... | @@ -55,7 +56,7 @@ properly detected. Since the initialised state also has an empty |
|
|
|
states is no longer necessary.
|
|
|
|
|
|
|
|
For further convenience, the new `IOobject::resetHeader()` method can
|
|
|
|
be used for repeated read operations. It also it enforces resetting of
|
|
|
|
be used for repeated read operations. It also enforces resetting of
|
|
|
|
headerClassName, scalar/label sizes etc prior to reading. For example,
|
|
|
|
```
|
|
|
|
IOobject rio("none", ..., IOobject::LAZY_READ);
|
| ... | ... | @@ -64,7 +65,7 @@ rio.resetHeader("U") |
|
|
|
if (returnReduceOr(rio.typeHeaderOk<volVectorField>(false)))
|
|
|
|
...
|
|
|
|
|
|
|
|
io.resetHeader("p")
|
|
|
|
rio.resetHeader("p")
|
|
|
|
if (returnReduceOr(rio.typeHeaderOk<volScalarField>(false)))
|
|
|
|
...
|
|
|
|
```
|
| ... | ... | @@ -150,7 +151,7 @@ confusing code. For example, |
|
|
|
geofield.clamp_min(lower);
|
|
|
|
|
|
|
|
// Old: retains the max of field value and the given value
|
|
|
|
// (ie, sets the lower bound)
|
|
|
|
// (ie, imposes a min bound)
|
|
|
|
geofield.max(lower);
|
|
|
|
```
|
|
|
|
In some case, the updated naming helps avoid coding errors.
|
| ... | ... | @@ -177,7 +178,7 @@ improvement. |
|
|
|
### GeometricField construction
|
|
|
|
|
|
|
|
It is now possible to construct a GeometricField from separate
|
|
|
|
value/dimensions, which can be easier that copying into a dimensioned
|
|
|
|
value/dimensions, which can be easier than copying into a dimensioned
|
|
|
|
type (especially when using derived field types). For example,
|
|
|
|
|
|
|
|
```
|
| ... | ... | |