本文整理汇总了C++中TransportMaterialStatus::letTempStateVectorBe方法的典型用法代码示例。如果您正苦于以下问题:C++ TransportMaterialStatus::letTempStateVectorBe方法的具体用法?C++ TransportMaterialStatus::letTempStateVectorBe怎么用?C++ TransportMaterialStatus::letTempStateVectorBe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransportMaterialStatus
的用法示例。
在下文中一共展示了TransportMaterialStatus::letTempStateVectorBe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateInternalState
void
TransportMaterial :: updateInternalState(const FloatArray &stateVec, GaussPoint *gp, TimeStep *)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
if ( ms ) {
ms->letTempStateVectorBe(stateVec);
}
}
示例2: updateInternalState
void
HydratingHeMoMaterial :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray aux;
if ( ms ) {
ms->letTempStateVectorBe(vec);
if ( hydration ) {
/* OBSOLETE
* FloatArray s = ms->giveStateVector ();
* if (vec.isEmpty()) OOFEM_ERROR("empty new state vector");
* aux.resize(2);
* aux.at(1) = vec.at(1);
* if (s.isEmpty()||(tStep->giveTime()<=0)) aux.at(2) = initialHydrationDegree; // apply initial conditions
* else {
* aux.at(2) = s.at(2);
* if (!castAt || (tStep->giveTime()>=castAt)) aux.at(2) += hydrationModel->dksi (s.at(2), vec.at(1), tStep->giveTimeIncrement()); // compute hydration degree increment
* }
*/
// it is necessary to convert the passed state vector to relative humidity expected by the hydration model
//!!! might be cleaner to choose wc / h in hydration model, but it must be defined which one is passed anyway; so relative humidity was chosen
//!!! also, the humidity vector might be evaluated by a function (ensure 2 elements and set humidity)
FloatArray vech = vec;
if ( vech.giveSize() >= 2 ) {
vech.at(2) = inverse_sorption_isotherm( vec.at(2) ); // compute relative humidity
} else {
vech.resize(2);
vech.at(2) = 1.; // saturated if undefined
}
HydrationModelInterface :: updateInternalState(vech, gp, tStep);
// additional file output !!!
if ( teplotaOut && ( gp->giveNumber() == 1 ) && giveStatus(gp) ) {
FILE *vyst = fopen("teplota.out", "a");
computeInternalSourceVector(aux, gp, tStep, VM_Incremental);
if ( aux.isEmpty() ) {
aux.resize(1);
aux.zero();
}
aux.times( 1. / give('d', gp) );
fprintf( vyst, "Elem %.3d krok %.2d: t= %.0f, dt=%.0f, %ld. it, ksi= %.12f, T= %.8f, heat=%.8f\n", gp->giveElement()->giveNumber(), tStep->giveNumber(),
tStep->giveTargetTime(), tStep->giveTimeIncrement(), tStep->giveSolutionStateCounter(),
giveHydrationDegree(gp, tStep, VM_Total), vec.at(1), aux.at(1) * tStep->giveTimeIncrement() );
fclose(vyst);
}
}
}
}
示例3: updateInternalState
void
HydratingIsoHeatMaterial :: updateInternalState(const FloatArray &vec, GaussPoint *gp, TimeStep *tStep)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray aux;
if ( ms ) {
ms->letTempStateVectorBe(vec);
if ( hydration ) {
/* OBSOLETE
* FloatArray s = ms->giveStateVector ();
* if (vec.isEmpty()) OOFEM_ERROR("empty new state vector");
* aux.resize(2);
* aux.at(1) = vec.at(1);
* if (s.isEmpty()||(tStep->giveTime()<=0)) aux.at(2) = initialHydrationDegree; // apply initial conditions
* else {
* aux.at(2) = s.at(2);
* if (!castAt || (tStep->giveTime()>=castAt)) aux.at(2) += hydrationModel->dksi (s.at(2), vec.at(1), tStep->giveTimeIncrement()); // compute hydration degree increment
* }
*/
HydrationModelInterface :: updateInternalState(vec, gp, tStep);
// additional file output !!!
if ( ( gp->giveNumber() == 1 ) && giveStatus(gp) ) {
FILE *vyst = fopen("teplota.out", "a");
computeInternalSourceVector(aux, gp, tStep, VM_Incremental);
if ( aux.isEmpty() ) {
aux.resize(1);
aux.zero();
}
aux.times( 1. / give('d', gp, tStep) );
fprintf( vyst, "Elem %.3d krok %.2d: t= %.0f, dt=%.0f, %ld. it, ksi= %.12f, T= %.8f, heat=%.8f\n", gp->giveElement()->giveNumber(), tStep->giveNumber(),
tStep->giveTargetTime(), tStep->giveTimeIncrement(), tStep->giveSolutionStateCounter(),
giveHydrationDegree(gp, tStep, VM_Total), vec.at(1), aux.at(1) * tStep->giveTimeIncrement() );
fclose(vyst);
}
}
}
}