本文整理汇总了C++中Load::computeComponentArrayAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Load::computeComponentArrayAt方法的具体用法?C++ Load::computeComponentArrayAt怎么用?C++ Load::computeComponentArrayAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::computeComponentArrayAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
SUPGElement2 :: computeBCRhsTerm_MB(FloatArray &answer, TimeStep *tStep)
{
int nLoads;
answer.clear();
int rule = 0;
IntegrationRule *iRule = this->integrationRulesArray [ rule ];
FloatArray un, gVector, s, helpLoadVector;
FloatMatrix b, nu;
// add body load (gravity) termms
nLoads = this->giveBodyLoadArray()->giveSize();
for ( int i = 1; i <= nLoads; i++ ) {
Load *load = domain->giveLoad( bodyLoadArray.at(i) );
bcGeomType ltype = load->giveBCGeoType();
if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) {
load->computeComponentArrayAt(gVector, tStep, VM_Total);
if ( gVector.giveSize() ) {
for ( GaussPoint *gp: *iRule ) {
this->computeUDotGradUMatrix( b, gp, tStep->givePreviousStep() );
this->computeNuMatrix(nu, gp);
double dV = this->computeVolumeAround(gp);
double rho = this->giveMaterial()->give('d', gp);
answer.plusProduct(b, gVector, t_supg * rho * dV);
answer.plusProduct(nu, gVector, rho * dV);
}
}
}
}
// integrate tractions
// if no traction bc applied but side marked as with traction load
// then zero traction is assumed !!!
// loop over boundary load array
nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
for ( int i = 1; i <= nLoads; i++ ) {
int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
int id = boundaryLoadArray.at(i * 2);
Load *load = domain->giveLoad(n);
bcGeomType ltype = load->giveBCGeoType();
if ( ltype == EdgeLoadBGT ) {
this->computeEdgeLoadVector_MB(helpLoadVector, load, id, tStep);
if ( helpLoadVector.giveSize() ) {
answer.add(helpLoadVector);
}
} else if ( ltype == SurfaceLoadBGT ) {
this->computeSurfaceLoadVector_MB(helpLoadVector, load, id, tStep);
if ( helpLoadVector.giveSize() ) {
answer.add(helpLoadVector);
}
} else {
OOFEM_ERROR("unsupported load type class");
}
}
}
示例2: if
void
SUPGElement2 :: computeBCRhsTerm_MC(FloatArray &answer, TimeStep *tStep)
{
int nLoads;
FloatArray s, gVector, helpLoadVector;
FloatMatrix g;
int rule = 1;
answer.clear();
nLoads = this->giveBodyLoadArray()->giveSize();
for ( int i = 1; i <= nLoads; i++ ) {
Load *load = domain->giveLoad( bodyLoadArray.at(i) );
bcGeomType ltype = load->giveBCGeoType();
if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) {
load->computeComponentArrayAt(gVector, tStep, VM_Total);
if ( gVector.giveSize() ) {
for ( GaussPoint *gp: *this->integrationRulesArray [ rule ] ) {
this->computeGradPMatrix(g, gp);
double dV = this->computeVolumeAround(gp);
answer.plusProduct(g, gVector, t_pspg * dV);
}
}
}
}
// integrate tractions
// if no traction bc applied but side marked as with traction load
// then zero traction is assumed !!!
// loop over boundary load array
nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
for ( int i = 1; i <= nLoads; i++ ) {
int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
int id = boundaryLoadArray.at(i * 2);
Load *load = domain->giveLoad(n);
bcGeomType ltype = load->giveBCGeoType();
if ( ltype == EdgeLoadBGT ) {
this->computeEdgeLoadVector_MC(helpLoadVector, load, id, tStep);
if ( helpLoadVector.giveSize() ) {
answer.add(helpLoadVector);
}
} else if ( ltype == SurfaceLoadBGT ) {
this->computeSurfaceLoadVector_MC(helpLoadVector, load, id, tStep);
if ( helpLoadVector.giveSize() ) {
answer.add(helpLoadVector);
}
} else {
OOFEM_ERROR("unsupported load type class");
}
}
}