本文整理汇总了C++中FloatArray::addSubVector方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatArray::addSubVector方法的具体用法?C++ FloatArray::addSubVector怎么用?C++ FloatArray::addSubVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatArray
的用法示例。
在下文中一共展示了FloatArray::addSubVector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveFluxVector
void
HeMoTKMaterial :: giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
double w = field.at(2);
double t = field.at(1);
FloatArray ans_w, ans_t;
FloatArray grad_w, grad_t;
int size = grad.giveSize() / 2;
for ( int i = 1; i <= size; ++i ) {
grad_w.at(i) = grad.at(i);
}
for ( int i = size + 1; i <= size * 2; ++i ) {
grad_t.at(i) = grad.at(i);
}
ans_w.beScaled(perm_ww(w, t), grad_w);
ans_w.beScaled(perm_wt(w, t), grad_t);
ans_t.beScaled(perm_ww(w, t) * get_latent(w, t), grad_w);
ans_t.beScaled(get_chi(w, t) + get_latent(w, t) * perm_wt(w, t), grad_t);
answer.resize(size * 2);
answer.zero();
answer.addSubVector(ans_w, 1);
answer.addSubVector(ans_t, size + 1);
ms->setTempField(field);
ms->setTempGradient(grad);
ms->setTempFlux(answer);
}
示例2: computeContactForces
void
Node2NodeContactL :: computeContactForces(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode,
const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms)
{
//Loop through all the master objects and let them do their thing
FloatArray gap, C, Fc;
this->computeGap(gap, tStep);
GaussPoint *gp = this->integrationRule->getIntegrationPoint(0);
FloatArray t;
this->computeContactTractionAt(gp, t ,gap, tStep);
this->computeCmatrixAt(gp, C, tStep);
// compute load vector
// for Lagrange: fc = traction * C^T * A (traction = lambda)
FloatArray temp = t.at(1) *this->area * C;
answer.resize( C.giveSize() + 1);
answer.zero();
if( gap.at(1) < 0.0 ) {
answer.addSubVector(temp,1);
answer.at( C.giveSize() + 1 ) = -gap.at(1);
}
}
示例3: giveFluxVector
void
HeMoKunzelMaterial :: giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
{
TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
FloatArray s;
// s = ms->giveTempStateVector();
s = ms->giveTempField();
if ( s.isEmpty() ) {
OOFEM_ERROR("matcond1d: undefined state vector");
}
double h = s.at(2);
double t = s.at(1);
FloatArray ans_w, ans_t;
FloatArray grad_w, grad_t;
int size = grad.giveSize() / 2;
for ( int i = 1; i <= size; ++i ) {
grad_w.at(i) = grad.at(i);
}
for ( int i = size + 1; i <= size * 2; ++i ) {
grad_t.at(i) = grad.at(i);
}
ans_w.beScaled(perm_mm(h, t), grad_w);
ans_w.beScaled(perm_mh(h, t), grad_t);
ans_t.beScaled(perm_hm(h, t), grad_w);
ans_t.beScaled(perm_hh(h, t), grad_t);
answer.resize(size * 2);
answer.zero();
answer.addSubVector(ans_w, 1);
answer.addSubVector(ans_t, size + 1);
ms->setTempField(field);
ms->setTempGradient(grad);
ms->setTempFlux(answer);
}