本文整理汇总了C++中TransportMaterialStatus::giveGradient方法的典型用法代码示例。如果您正苦于以下问题:C++ TransportMaterialStatus::giveGradient方法的具体用法?C++ TransportMaterialStatus::giveGradient怎么用?C++ TransportMaterialStatus::giveGradient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransportMaterialStatus
的用法示例。
在下文中一共展示了TransportMaterialStatus::giveGradient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveIPValue
int
NonlinearMassTransferMaterial :: giveIPValue(FloatArray &answer, GaussPoint *aGaussPoint, InternalStateType type, TimeStep *atTime)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(aGaussPoint) );
switch ( type ) {
case IST_Velocity:
answer = ms->giveFlux();
break;
case IST_PressureGradient:
answer = ms->giveGradient();
break;
default:
return TransportMaterial :: giveIPValue(answer, aGaussPoint, type, atTime);
}
return 1;
}
示例2: 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);
}