当前位置: 首页>>代码示例>>C++>>正文


C++ TransportMaterialStatus::giveField方法代码示例

本文整理汇总了C++中TransportMaterialStatus::giveField方法的典型用法代码示例。如果您正苦于以下问题:C++ TransportMaterialStatus::giveField方法的具体用法?C++ TransportMaterialStatus::giveField怎么用?C++ TransportMaterialStatus::giveField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TransportMaterialStatus的用法示例。


在下文中一共展示了TransportMaterialStatus::giveField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: inverse_sorption_isotherm

double
HeMoTKMaterial :: giveHumidity(GaussPoint *gp, ValueModeType mode)
{
    TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
    const FloatArray &tempState = ms->giveTempField();
    if ( tempState.giveSize() < 2 ) {
        OOFEM_ERROR("undefined moisture status!");
    }

    FloatArray state = ms->giveField();

    if ( mode == VM_Total ) {
        return inverse_sorption_isotherm( tempState.at(2) );
    } else if ( mode == VM_Incremental ) {
        return inverse_sorption_isotherm( tempState.at(2) ) - inverse_sorption_isotherm( state.at(2) );
    } else if ( mode == VM_Velocity ) { // VM_Previous
        return inverse_sorption_isotherm( state.at(2) );
    }

    return 1.;
}
开发者ID:JimBrouzoulis,项目名称:OOFEM_Jim,代码行数:21,代码来源:hemotkmat.C

示例2: giveHumidity

double
HeMoKunzelMaterial :: giveHumidity(GaussPoint *gp, ValueModeType mode)
{
    TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
    const FloatArray &tempState = ms->giveTempField();
    if ( tempState.giveSize() < 2 ) {
        OOFEM_ERROR("Undefined moisture status");
    }

    const FloatArray &state = ms->giveField();

    if ( mode == VM_Total ) {
        return tempState.at(2);
    } else if ( mode == VM_Incremental ) {
        return tempState.at(2) - state.at(2);
    } else if ( mode == VM_Velocity ) { // VM_Previous
        return state.at(2);
    } else {
        OOFEM_ERROR("Undefined moisture mode");
    }

    return 1.;
}
开发者ID:pcmagic,项目名称:oofem,代码行数:23,代码来源:hemokunzelmat.C

示例3: giveIPValue

int
TransportMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
// IST_Humidity must be overriden!
{
    TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
    if ( type == IST_Temperature || type == IST_MassConcentration_1 || type == IST_Humidity ) {
        FloatArray vec = ms->giveField();
        answer = FloatArray{vec.at( ( type == IST_Temperature ) ? 1 : 2 ) };
        return 1;
    } else if ( type == IST_TemperatureFlow ) {
        TransportElement *transpElem = static_cast< TransportElement * >( gp->giveElement() );
        transpElem->computeFlow(answer, gp, tStep);
        return 1;
    } else if ( type == IST_Velocity ) { ///@todo Shouldn't be named velocity.. instead, "MassFlow" or something suitable like that.
        answer = ms->giveFlux();
        answer.resizeWithValues(3);
        return 1;
    } else if ( type == IST_PressureGradient ) {
        answer = ms->giveGradient();
        answer.resizeWithValues(3);
        return 1;
    } else if ( type == IST_Density ) {
        answer = FloatArray{ this->give('d', gp) };
        return 1;
    } else if ( type == IST_HeatCapacity ) {
        answer = FloatArray{ this->give('c', gp) };
        return 1;
    } else if ( type == IST_ThermalConductivityIsotropic ) {
        answer = FloatArray{ this->give('k', gp) };
        return 1;
    } else if ( type == IST_Maturity ) {
        answer = FloatArray{ ms->giveMaturity() };
        return 1;
    }
    return Material :: giveIPValue(answer, gp, type, tStep);
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:36,代码来源:transportmaterial.C


注:本文中的TransportMaterialStatus::giveField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。