OHyMoS.NET Class Library

OhElement.calculateTimeStep メソッド 

タイムステップの計算を行ないます。

Calculation of a time step.
public abstract OhTime calculateTimeStep();

戻り値

a long value

解説

各派生クラスでモデルに応じて _timeStep [sec] を計算し、 戻り値として返すメソッドを定義して下さい。

つまり、_timeStep をどのような条件下で、どのような値にするかを定義します。

例えば、_timeStep を一定値 3600 [sec] に設定する場合、
public long calculateTimeStep() 
{
    return 3600;
}
と定義して下さい。

また、下記のようにメンバ変数 _k の値により _timeStep を変更することもできます。

public long calculateTimeStep() 
{
    return (_k > 0) ? 360 : 60;
}

public long calculateTimeStep() 
{
    return 360 * pow(10, _k);
}
_timeStep は、work() の中で設定されるので、
public long calculateTimeStep() 
{
    _timeStep = 1;
    return 1;
}
のように、このメソッドの中で変更しないでください。

抽象メソッドなので、派生クラスで必ず定義して下さい。

戻り値: 次回の計算のタイムステップ。[sec]

In classes derived from class Element, its definition should be given.

Please calculate "_timeStep" according to a model in each inherited class, and define the method which returns it as a return value. That is, it defines under what conditions "_timeStep" is made into what value.

例外

例外の種類条件
OhErrorif an error occurs

参照

OhElement クラス | OhymosNet 名前空間