Tech Note

wxWidgetsのインストールは多くの場合は簡単です。Windows環境では、Visual Studio用のファイルが用意されており、所望のライブラリを作成することが出来ます。また、多くのLinux環境では、プレインストールされています。MacOS Xでも実はシステムにインストール済み(10.5で確認)ですが、古いバージョンでした。2012年10月現在、wxWidgetsは2.9がリリースされていますが、既に十分に枯れた2.8もまだ実用になります。

FreeFEM++は、フランスのパリ第6大学のJ.L.Lions研究所やINRIAで開発が進められている有限要素法のためのインタープリター環境とでも言うべきものである。日本では、広島国際大学の大塚厚二教授がプロジェクトに参加されていて、啓蒙活動を進められている。筆者も学会で隣に座られた教授に直接啓蒙されて、マニュアルまでいただいたという様な経緯がある。

1次元から3次元まで解くことが出来る環境であるが、2次元のマイクロストリップ線路の準TEMモード解析を例にして説明する。

wxWidgetsは、グラフィカルユーザインターフェースを構築するための多くのOSプラットフォームを対象としたC++のライブラリです。かなりアクティブに活動しており、ユーザコミュニティも活発です。日本語による解説はあまり見かけることはありませんが、英語でのサポートは、ボランティアベースですが、かなり手厚いです。バージョン2.6以降、ユニコードの実装も進んでおり、日本語などのマルチバイトコードにも不具合は見かけなくなっています。

wxWidgetsが活躍するのは、メニューを表示させてユーザに選択させたり、警告ダイアローグを表示させたりというコンピュータとユーザを橋渡しする部分の設計・開発の部分です。デザインをWYSWYGで作成し、プログラムコードを自動的に生成してくれる、いわゆるRADツールも開発され、無償・オープンソースで提供されています。最も良く使われているのは、wxFormBuilderというツールです。若干、不安定なところもありますが、素晴らしいツールです。

マルチプラットフォームライブラリなので、同じコードを異なるOS環境下で動作させることが出来ます。その時に困るのが、開発環境が全く異なることが多いと言うことです。wxWidgetsにはたくさんの機能の異なるライブラリが存在し、またコンパイルオプションやリンクオプションも少なくありません。手作業でこれらの設定を開発環境毎に作るのは大変です。そこで、おすすめしたいのが、Kitwave Inc.の提供している、cmakeというツールです。このツールを使うと、かなり作業が楽になります。各プラットフォームでのメジャーな開発環境のプロジェクトファイルも作成してくれます。

Electro Magnetica Numerica (EM) is a simulator using a Finite-Difference Time-Domain method in the broad sense. To be precise, discretization method of Maxwell equations is Finite Integral Technique (FIT) which is proposed by Thomas Weiland Professor (Technische Universität Darmstadt). The difference between EM and the other FDTD simulator is that EM is using the unstructured grid system. In this report, we will introduce the grid system of its own.


Needless to say, Yee grid is the grid system of FD-TD method. From its simple structure, the structured grids is a convenient grid easy to implement. However, because when the size of the phenomena to be captured among the discretized grids is significantly different in location, it is necessary to use fine grid in whole domain to match the smallest phenomena, large waste will occur . To solve this problem, unstructured grid was introduced and the grid is often used in finite element method (FEM).

The unstructured grid is very flexible to adapt to the complex shapes using tetrahedron element cells. While the orthogonal structure of hexagonal lattice of structured grids is not so flexible compared to the unstructured grid.

On the other hand, it can be said FEM is a drawback compared to FDM, the amount of calculation per grid (cell - element) is larger than that of FDM, but there is a reduction of the cell - element itself by adaptive grid. So FEM is to be in the practical level as a whole.

In the field of numerical electromagnetics, originally, FEM of form that was used with slight modification simulator of structural analysis was the mainstream , but in recent years , FD-TD method is becoming the mainstream with the improvement of computing power. Among them, as a method for adaptive grid basis , Subgrid method has been proposed. This is the technique that define the patch area in part requiring high resolution and overlay fine grid there . A number of techniques have been proposed, but many algorithms have been plagued by numerical instability.

Well, in recent years, a method called the Adaptive Cartesian Grid method has begun to attract attention in the field of computational fluid dynamics . This is how to adapt to where high resolution is required , the same as orthogonal hexagonal lattice structure. It is classified as an unstructured grid as the classification of the data structure.

The technique is simple. We suppose one cell in the computational domain first. Let's call the root cell. It's going to split in half to suit your needs to this cell in order. For example, when it was a two-dimensional problem, one cell will be split into equal child four cells. It becomes the child eight cells when it was three -dimensional .

In general, the data structure is a tree structure. We use the octree for three-dimensional and use quadtree for two-dimensional . Of course, there can be used a data connection as a relationship between cells, which is used in unstructured grid system general.

Conceived by researchers in the United States, such an algorithm has been developed. From the fact that the fluid simulator Cart3D, development has been promoted by Mr. Aftosmis U.S. Langray National Laboratory, began to be licensed by Ansys, the high attention of the industry is suggesting.

The orthogonal adaptive grid which is used in Cart3D is not good consistency with the Leap-Frog discretization method, which is used in the FD-TD method.

Therefore, in the Three Wells Computing, we were focused on the Blocked Adaptive Cartesian Grid method which was proposed early in the adaptive Cartesian grid. This is a method that a lump of cells is in place of the one cell Cart3D. This approach, in recent years, actively research and is being developed by a group of NAKAHASHI at Tohoku University and his colleagues in Japan. By using this method, it is possible of FD-TD scheme to be applied to the lump of cells.

In EM, it is a simulator in the field of the world's first numerical electromagnetics , using the blocked adaptive Cartesian grid . In addition, there is not any numerical instability phenomenon that has been plagued by Subgrid method, nor to verification by the iteration of 100,000 has been confirmed.

Macで様々なUNIX系のオープンソースソフトウェア(OSS)をインストールするのは大変な事です。インストール作業が楽しい方は別として、様々必要なライブラリを集めてインストールするのはかなり時間がかかります。 商用UNIX系やLinux系では予めバイナリがメンテナンスサーバに用意されていて、簡単にインストールできる仕組みが出来ています。rpm, yum, zypperなどがそれです。MacがUNIX系になったので、このようなOSSを管理してくれるプログラムが幾つかボランティアの手によって作成されました。Finkはその内の一つになります。
Finkはとても便利です。いろいろなOSSアプリが様々なボランティアの手によってメンテされています。アプリの必要とされるライブラリなども用意されていて、依存するライブラリも自動的にサーバからダウンロードしてくれます。初期の頃は全てソースコードから自分のMac上でコンパイル・リンク(ビルド)作業がされていましたが、バイナリインストールも大分用意されるようになって、インストール時間が短縮されました。
便利なFinkですが、時々、自分の設定とは異なる場合があります。ソースコードからビルドする際、オプションはそのアプリのメンテナーの設定が反映されます。例えば、Open MPIパッケージは、2017年4月3日現在、1.10.4がインストールされますが、これはMPI_THREAD_MULTIPLEスイッチがオフの状態になっています。これをオンにしたい場合、自分でFinkとは別にインストールしなければならなくなってしまいます。
そこで、ここでは、そのオプションを変更する方法について、解説いたします。
Finkのパッケージは全て、ディレクトリ、

/sw

以下に存在します。様々なディレクトリが内包していますが、

/sw/fink/10.9-libcxx/stable/main/finkinfo/devel/openmpi.info

というファイルが存在します。この中には、このopenmpiというパッケージの依存情報や、configureのオプションが記述されています。この記述の内、

ConfigureParams: --preix=%p \
--datadir=%p/share/doc \
--sysconfdir=%p/etc/%n \
--sharedstatedir=%p/var/%n/shared \
--localstatedir=%p/var/%n/local \
--libdir=%p/lib/%n \
...

のブロックに、

--enable-mpi-thread-multiple

を追加します。その後、

%> fink rebuild openmpi

とすることで、新しく追加したオプションが反映されます。
確認のため、

%> ompi_info -c | grep -i thread
ConfigureParams: Thread support: posix (MPI_THREAD_MULTIPLE: yes, OPAL support: yes, OMPI progress: no, ORTE progress: yes, Event lib: yes) FT Checkpoint support: no (checkpoint thread: no)

となり、無事MPI_THREAD_MULTIPLEがyesになりました。

More Articles ...

Subcategories

FaLang translation system by Faboba