「OpenFOAM v2312リリースノート」の版間の差分

編集の要約なし
42行目: 42行目:


=== v2312 Developer Upgrade Guide ===
=== v2312 Developer Upgrade Guide ===
=== Deprecation and Removal ===
==== Removed Items ====
* The <code>faMesh::operator()</code> has been removed in favour of <code>mesh()</code> or <code>thisDb()</code> instead.
* The <code>typeGlobal()</code> global function has been replaced with an <code>is_globalIOobject<Type></code> traits structure for more consistent and easier overriding. The ancillary <code>typeFilePath()</code> global function has been superseded by global function as a member of <code>IOobject::typeFilePath</code> for consistency with <code>IOobject::typeHeaderOk</code>
=== Changes in definition ===
* <code>ReadFields</code> now uses a <code>DynamicList</code> to implement its LIFO for handling stored objects. The older <code>LIFOStack</code> interface is marked as ''deprecated'' since it requires more allocations and overhead.
* Deprecate some <code>IOobjectList::sorted()</code> const-access methods in favour of the new <code>csorted()</code> methods. This provides method name consistency with <code>HashTable</code> and ensures an unambiguous return type.
* The internal dictionary separator has changed from <code>'.'</code> to <code>'/'</code>, which simplifies internal handling (like a fileName) and allows the dictionary name to be used with unambiguous addressing. No particular side-effects of this change are expected, except if the raw dictionary names have been directly reparsed within code.
=== Changes in inheritance ===
The <code>data</code> class used by <code>fvMesh</code> has been replaced by member data at the <code>polyMesh</code> level. For a developer, this means that the following (fragile and ugly) code will now most certainly break!
<code>obr.lookupObject<fvMesh>("data")  // This was never a good idea</code>
=== Relocated Methods ===
Promote <code>ListOps::identity</code> to <code>Foam::identity</code> this becoming more frequently used and there is no ambiguity in calling parameters. Handles both int32 and int64 versions.
=== Container improvements / changes ===
As with some many releases, the underlying OpenFOAM containers have been upgraded and tweaked in a variety of ways. Some of the focus has been on modernizing internal copying, filling, moving data by harnessing using C++ algorithms in more places. Apart from general code reduction, the shift to algorithms helps provision for different execution models (eg, <code>std::execution::parallel_unsequenced_policy</code>) in the future.
==== HashTable construct ====
The default constructors for <code>HashTable</code> and <code>HashSet</code> now truly correspond to a zero-size construct (ie, they invoke no allocations) and are also <code>noexcept</code>. This is particularly convenient and useful when managing lists of hash sets etc. The move constructors are also now noexcept as well.
* removed unused <code>HashTable(Istream&, label)</code> constructor.
==== HashTable sizing improvements ====
* earlier deletion of unpopulated HashTable on resizing:  If the table is already clear (ie, has no entries), can immediately remove the old internal table before reallocating the newly sized table, which may avoid a needless memory spike.
* reserve() method:  Naming and general behaviour as per <code>std::unordered_map</code>. It behaves similarly to the <code>resize()</code> method but is supplied the number of elements instead of the capacity, which can be a more natural way of specifying the storage requirements. Additionally, <code>reserve()</code> will only increase the table capacity for behaviour similar to <code>DynamicList</code> and <code>std::vector</code>, <code>std::string</code> etc.