本文整理汇总了C++中Load::computeValueAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Load::computeValueAt方法的具体用法?C++ Load::computeValueAt怎么用?C++ Load::computeValueAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::computeValueAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deltaX
void
Lattice2d_mt :: computeInternalSourceRhsVectorAt(FloatArray &answer, TimeStep *atTime, ValueModeType mode)
{
int i, j, n, nLoads;
double dV;
bcGeomType ltype;
Load *load;
IntegrationRule *iRule = integrationRulesArray [ 0 ];
GaussPoint *gp;
Node *nodeA, *nodeB;
FloatArray deltaX(3), normalVector(3);
FloatArray val, helpLoadVector, globalIPcoords;
FloatMatrix nm;
double k;
answer.resize(0);
FloatArray gravityHelp(2);
nLoads = this->giveBodyLoadArray()->giveSize();
for ( i = 1; i <= nLoads; i++ ) {
n = bodyLoadArray.at(i);
load = ( Load * ) domain->giveLoad(n);
ltype = load->giveBCGeoType();
if ( ltype == GravityPressureBGT ) {
//Compute change of coordinates
nodeA = this->giveNode(1);
nodeB = this->giveNode(2);
deltaX.at(1) = nodeB->giveCoordinate(1) - nodeA->giveCoordinate(1);
deltaX.at(2) = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);
deltaX.at(3) = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);
//Compute the local coordinate system
gp = iRule->getIntegrationPoint(0);
gravityHelp.at(1) = 1.;
gravityHelp.at(2) = -1.;
dV = this->computeVolumeAround(gp);
load->computeValueAt(val, atTime, deltaX, mode);
k = static_cast< TransportMaterial * >( this->giveMaterial() )->giveCharacteristicValue(Conductivity_hh, gp, atTime);
double helpFactor = val.at(1) * k * dV;
helpFactor /= pow(this->giveLength(), 2.);
gravityHelp.times(helpFactor);
if ( helpLoadVector.isEmpty() ) {
helpLoadVector.resize( gravityHelp.giveSize() );
}
for ( j = 1; j <= gravityHelp.giveSize(); j++ ) {
helpLoadVector.at(j) += gravityHelp.at(j);
}
}
answer.add(helpLoadVector);
}
return;
}