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

編集の要約なし
 
41行目: 41行目:
ラグランジュ関数オブジェクトクラスWeberNumberReactingは、新しいラグランジュ雲関数オブジェクトKinematicWeberNumberとの整合性を確保するため、ReactingWeberNumberと改名された。
ラグランジュ関数オブジェクトクラスWeberNumberReactingは、新しいラグランジュ雲関数オブジェクトKinematicWeberNumberとの整合性を確保するため、ReactingWeberNumberと改名された。


=== v2312 Developer Upgrade Guide ===
=== v2312開発者アップグレードガイド ===


=== Deprecation and Removal ===
=== 非推奨と削除 ===


==== Removed Items ====
==== 削除された項目 ====


* The <code>faMesh::operator()</code> has been removed in favour of <code>mesh()</code> or <code>thisDb()</code> instead.
* faMesh::operator()が削除され、代わりにmesh()またはthisDb()が使われるようになりました。
* 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>
* typeGlobal() グローバル関数が is_globalIOobject<Type> traits 構造体に置き換えられました。IOobject::typeHeaderOk との一貫性を保つために、補助的な typeFilePath() グローバル関数が IOobject::typeFilePath のメンバとしてのグローバル関数に取って代わられました。


=== 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.
* ReadFieldsは、格納されたオブジェクトを処理するためのLIFOを実装するためにDynamicListを使用するようになりました。古いLIFOStackインターフェースは、より多くの割り当てとオーバーヘッドを必要とするため、非推奨とマークされています。
* 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.
* いくつかの IOobjectList::sorted() const-access メソッドを非推奨とし、新しい csorted() メソッドを採用した。これにより、HashTableとのメソッド名の一貫性が保たれ、戻り値の型が明確になります。
* 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.
* 内部辞書の区切り文字が'.'から'/'に変更され、(fileNameのような)内部処理が簡素化され、辞書名を明確なアドレッシングで使用できるようになった。この変更による副作用は、生の辞書名がコード内で直接解析された場合を除き、特に期待されません。


=== 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!
fvMeshで使われていたデータクラスは、polyMeshレベルのメンバーデータに置き換えられました。開発者にとっては、これは以下の(壊れやすく醜い)コードが確実に壊れることを意味する!
  <code>obr.lookupObject<fvMesh>("data")  // This was never a good idea</code>
  <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.
ListOps::identityをFoam::identityに昇格させる。int32とint64の両方のバージョンを処理します。


=== 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.
多くのリリースがそうであるように、基礎となるOpenFOAMコンテナは、様々な方法でアップグレードされ、調整されている。いくつかの焦点は、より多くの場所でC++アルゴリズムを利用することによって、内部のコピー、充填、データ移動を近代化することです。一般的なコード削減とは別に、アルゴリズムへの移行は、将来的に異なる実行モデル(例えば、std::execution::parallel_unsequenced_policy)を提供するのに役立ちます。


==== 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.
HashTableとHashSetのデフォルトのコンストラクタは、本当にゼロ・サイズのコンストラクタに対応するようになり(つまり、割り当てを必要としない)、noexceptでもある。これは、ハッシュセットのリストなどを管理するときに特に便利で役立ちます。移動コンストラクタも同様にnoexceptになった。


* removed unused <code>HashTable(Istream&, label)</code> constructor.
* 未使用の HashTable(Istream&, label) コンストラクタが削除されました。


==== HashTable sizing improvements ====
==== HashTableのサイズ改良 ====


* 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.
* サイズ変更時に、未入力のHashTableをより早く削除する:テーブルが既にクリアされている(つまり、エントリがない)場合、新しいサイズのテーブルを再割り当てする前に、古い内部テーブルを即座に削除することができます。
* 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.
* メソッド: std::unordered_mapに準じた命名と一般的な動作。resize()メソッドと似たような動作をしますが、容量ではなく要素数が渡されます。さらに、reserve()は、DynamicListやstd::vector、std::stringなどに似た振る舞いをするテーブルの容量を増やすだけです。
<syntaxhighlight>
// old:
    labelHashSet set;
    set.resize(2*nElems);


// now:
    labelHashSet set;
    set.reserve(nElems);
</syntaxhighlight>


==== リスト作成/割り当て ====
SLList(単一リンクリスト)からListまたはFixedListの構築または代入は削除されました。moveコンストラクトや代入はまだ残されていますが、次のバージョンまでにはその有用性が失われることが予想されます。


==== リストの読み書き ====
入力サイズが既知でないリストを読み込む場合、これらのブラケット・リストは、単一リンク・リストを使用する代わりに、チャンク単位で読み込まれるようになった。積分型やベクトル空間型(スカラー、ベクトルなど)では、各要素に対する中間アロケーションを避けることができる。


DynamicList::readList()メソッドが完全に実装され、List::readList()にリダイレクトされるようになりました。
=== IOストリームの変化 ===
Ostreamの書き込みメソッド write(const string&) が write(const std::string&) に変更され、中間コピーなしでstd::stringを書き込めるようになった。これは、中間コピーなしで std::string を書き込むことを可能にする。しかし、これは Ostream から派生したクラスに調整が必要になることを意味する。
Ostreamクラスはまた、将来のスパンとstring_viewのサポートに役立つ新しいwriteQuoted(const char* str, std::streamsize len, bool)メソッドを受け取った。
==== メモリーストリームの更新と強化 ====
カバレッジを拡張して、すべての標準ストリームのバリアントを含むようにし、単純にOpenFOAM IOstreamタイプ用にリラップします。これにより、継承パターンが単純化され、icharstream/ocharstreamを他のラッパーでistringstream/ostringstreamのドロップイン置き換えとして再利用できるようになります。
* Classes
** icharstream / ICharStream  [old: none / IListStream]
** ocharstream / OCharStream  [old: none / OListStream]
** ispanstream / ISpanStream  [old: uiliststream / UIListStream]
** ospanstream / OSpanStream  [old: none / UOListStream]
ストリーム・バッファ・コンテンツのstd::string_view(c++17)またはspan view(古いc++)をサポート。これにより、フォーマットと再解析が簡単になります。
=== 並列(MPI)処理の変更 ===
==== 削除された機能 ====
実験的なフルNBX PstreamBuffersアルゴリズム(OpenFOAM-v2306で追加)は、ハイブリッドNBX/PEXアプローチと比較して利点が見られなかったため、削除されました。
同様に、実験的な "ダブルノンブロッキング "NBXバージョンも削除された。このアイデアは、非常に大きなデータ転送のための受信のブロッキングを避けることであったが、それは通常、PstreamBuffersが可能にするようなNBX/PEXのハイブリッドアプローチでよりよく達成される。
==== 新機能 ====
===== broadcastList =====
新しいPstream::broadcastList()メソッドは、2段階のプロセスとして連続したコンテンツをブロードキャストする:
# サイズをブロードキャストし、レシーバーリスト用にリサイズする。
# 連続した内容を放送する(空でない場合)
これにより、シリアライズ/デシリアライズのメモリ・オーバーヘッドを回避できるが、ブロードキャスト・コールが追加される。サイズの余分なブロードキャストのトレードオフは、連続した大きなメッシュデータのメモリピークを避けることよりも重要ではないでしょう。
===== mpiAllGather =====
mpiAllGather 関数が拡張され、char 型に限定されていたものが整数型と浮動小数点型も含むようになった。
===== allToAllConsensus =====
Mapを受け取るallToAllConsensus関数は、Mapも返すようになり、使い方が単純化され、送信/再送信パラメータの曖昧さが回避された。このバージョンでは、Mapにゼロ値のデータが存在する場合、そのデータも送信されるようになった。
===== PstreamBuffers =====
registered "センドをサポートし、減少した通信を適切に処理するだけでなく、投機的センドも処理できるようにした。これは、アルゴリズム内でプロセッサ-プロセッサ間の通信が発生する可能性があるが、センドがすべて必要になるかどうか事前にはわからない場合に発生する。この場合、センドは通常通り行われるが、登録されるのは「実際の」センドのみである。すべてのセンドが終了した後、実際にどの情報を(もしあれば)送信する必要があるかを判断することができる。
例えば、<syntaxhighlight>
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
pBufs.initRegisterSend();
for (const polyPatch& pp : patches)
{
    const auto* ppp = isA<processorPolyPatch>(pp);
    if (ppp)
    {
        const label nbrProci = ppp->neighbProcNo();
        // Gather some patch information...
        UOPstream toNbr(nbrProci, pBufs);
        toNbr << patchInfo;
        // The send is needed if patchInfo is non-empty
        pBufs.registerSend(nbrProci, !patchInfo.empty());
    }
}
pBufs.finishedSends();
</syntaxhighlight>
新しい PstreamBuffers::finishedSendsNBX() メソッドが追加され、デフォルトの設定パラメータに関係なく、all-to-all ではなくバッファサイズの NBX (ノンブロッキング転送) を指定できるようになった。
=== MPI ネイティブの bitOrOp を拡張する ===
* bitOrOpは複数の値も扱えるようになった。これは例えば、グローバルな状態を追跡するために使用できる:
<syntaxhighlight>
// Encode as 0:empty, 1:uniform, 2:nonuniform, 3:mixed
PackedList<2> uniformity(fields.size());
forAll(fields, i)
{
    uniformity.set(i, fields[i].whichUniformity());
}
reduce
(
    uniformity.data(),
    uniformity.size_data(),
    bitOrOp<unsigned>()
);
</syntaxhighlight>
=== MPIリクエスト処理の改善 ===
* UPstream::waitSomeRequests()のスライス/レンジのサポートにより、受信のポーリングが簡素化され、送信から分離できるようになった。
* UPstream::removeRequests(pos、len) を使用して、未処理のリクエストをキャンセル/解放し、未処理のリクエストの内部リストからセグメントを削除する。
* mapDistribute でのリクエスト処理の改善
** 受信してから送信
** 自己送信の受信バッファへの直接コピー
** 送信/再送バッファのPtrListを使った不要な再割り当てを無効にする。
=== グローバルインデックス ===
whichProcID() に代わる失敗しないメソッドとして、新しい findProc() メソッドを含む様々な改良。


C++の最低規格は、2024年にC++11からC++17に引き上げられる予定である。
C++の最低規格は、2024年にC++11からC++17に引き上げられる予定である。