本文整理汇总了C++中EngngModel::assembleVector方法的典型用法代码示例。如果您正苦于以下问题:C++ EngngModel::assembleVector方法的具体用法?C++ EngngModel::assembleVector怎么用?C++ EngngModel::assembleVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EngngModel
的用法示例。
在下文中一共展示了EngngModel::assembleVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pnum
void PrescribedGradientBCPeriodic :: computeField(FloatArray &sigma, TimeStep *tStep)
{
DofIDEquationNumbering pnum(true, strain_id);
EngngModel *emodel = this->giveDomain()->giveEngngModel();
FloatArray tmp, sig_tmp;
int npeq = strain_id.giveSize();
// sigma = residual (since we use the slave dofs) = f_ext - f_int
sig_tmp.resize(npeq);
sig_tmp.zero();
emodel->assembleVector(sig_tmp, tStep, InternalForceAssembler(), VM_Total, pnum, this->domain);
tmp.resize(npeq);
tmp.zero();
emodel->assembleVector(tmp, tStep, ExternalForceAssembler(), VM_Total, pnum, this->domain);
sig_tmp.subtract(tmp);
// Divide by the RVE-volume
sig_tmp.times(1.0 / ( this->domainSize(this->giveDomain(), this->set) + this->domainSize(this->giveDomain(), this->masterSet) ));
sigma.resize(sig_tmp.giveSize());
if ( sig_tmp.giveSize() == 9 ) {
sigma.assemble(sig_tmp, {1, 9, 8, 6, 2, 7, 5, 4, 3});
} else if ( sig_tmp.giveSize() == 4 ) {
sigma.assemble(sig_tmp, {1, 4, 3, 2});
} else {
sigma = sig_tmp;
}
}
示例2: pnum
void TransportGradientPeriodic :: computeField(FloatArray &flux, TimeStep *tStep)
{
DofIDEquationNumbering pnum(true, grad_ids);
EngngModel *emodel = this->giveDomain()->giveEngngModel();
FloatArray tmp;
int npeq = grad_ids.giveSize();
// sigma = residual (since we use the slave dofs) = f_ext - f_int
flux.resize(npeq);
flux.zero();
emodel->assembleVector(flux, tStep, InternalForceAssembler(), VM_Total, pnum, this->domain);
tmp.resize(npeq);
tmp.zero();
emodel->assembleVector(tmp, tStep, ExternalForceAssembler(), VM_Total, pnum, this->domain);
flux.subtract(tmp);
// Divide by the RVE-volume
flux.times(1.0 / ( this->domainSize(this->giveDomain(), this->set) + this->domainSize(this->giveDomain(), this->masterSet) ));
}