本文整理汇总了C++中TimeStep::isIcApply方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStep::isIcApply方法的具体用法?C++ TimeStep::isIcApply怎么用?C++ TimeStep::isIcApply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeStep
的用法示例。
在下文中一共展示了TimeStep::isIcApply方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveUnknownComponent
double NLTransientTransportProblem :: giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
// returns unknown quantity like displacement, velocity of equation
// This function translates this request to numerical method language
{
if ( this->requiresUnknownsDictionaryUpdate() ) {
if ( mode == VM_Incremental ) { //get difference between current and previous time variable
return dof->giveUnknowns()->at(0) - dof->giveUnknowns()->at(1);
}
int hash = this->giveUnknownDictHashIndx(mode, tStep);
if ( dof->giveUnknowns()->includes(hash) ) {
return dof->giveUnknowns()->at(hash);
} else {
OOFEM_ERROR("Dof unknowns dictionary does not contain unknown of value mode (%s)", __ValueModeTypeToString(mode) );
}
}
double t = tStep->giveTargetTime();
TimeStep *previousStep = this->givePreviousStep(), *currentStep = this->giveCurrentStep();
if ( dof->__giveEquationNumber() == 0 ) {
OOFEM_ERROR("invalid equation number on DoF %d", dof->giveDofID() );
}
if ( ( t >= previousStep->giveTargetTime() ) && ( t <= currentStep->giveTargetTime() ) ) {
///@todo Shouldn't it be enough to just run this?
//UnknownsField->giveUnknownValue(dof, mode, currentStep);
double rtdt = UnknownsField->giveUnknownValue(dof, VM_Total, currentStep);
double rt = UnknownsField->giveUnknownValue(dof, VM_Total, previousStep);
double psi = ( t - previousStep->giveTargetTime() ) / currentStep->giveTimeIncrement();
if ( mode == VM_Velocity ) {
return ( rtdt - rt ) / currentStep->giveTimeIncrement();
} else if ( mode == VM_Total ) {
return psi * rtdt + ( 1. - psi ) * rt;
} else if ( mode == VM_Incremental ) {
if ( previousStep->isIcApply() ) {
return 0;
} else {
return ( rtdt - rt );
}
} else {
OOFEM_ERROR("Unknown mode %s is undefined for this problem", __ValueModeTypeToString(mode) );
}
} else {
OOFEM_ERROR("time value %f not within bounds %f and %f", t, previousStep->giveTargetTime(), currentStep->giveTargetTime() );
}
return 0.; // to make compiler happy;
}