本文整理汇总了C++中MooseSharedPointer::computeJacobianBlockScalar方法的典型用法代码示例。如果您正苦于以下问题:C++ MooseSharedPointer::computeJacobianBlockScalar方法的具体用法?C++ MooseSharedPointer::computeJacobianBlockScalar怎么用?C++ MooseSharedPointer::computeJacobianBlockScalar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MooseSharedPointer
的用法示例。
在下文中一共展示了MooseSharedPointer::computeJacobianBlockScalar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ComputeFullJacobianThread::computeFaceJacobian(BoundaryID bnd_id)
{
std::vector<std::pair<MooseVariable *, MooseVariable *> > & ce = _fe_problem.couplingEntries(_tid);
for (std::vector<std::pair<MooseVariable *, MooseVariable *> >::iterator it = ce.begin(); it != ce.end(); ++it)
{
MooseVariable & ivar = *(*it).first;
MooseVariable & jvar = *(*it).second;
if (ivar.activeOnSubdomain(_subdomain) && jvar.activeOnSubdomain(_subdomain) && _integrated_bcs.hasActiveBoundaryObjects(bnd_id, _tid))
{
// only if there are dofs for j-variable (if it is subdomain restricted var, there may not be any)
const std::vector<MooseSharedPointer<IntegratedBC> > & bcs = _integrated_bcs.getBoundaryObjects(bnd_id, _tid);
for (std::vector<MooseSharedPointer<IntegratedBC> >::const_iterator jt = bcs.begin(); jt != bcs.end(); ++jt)
{
MooseSharedPointer<IntegratedBC> bc = *jt;
if (bc->shouldApply() && bc->variable().number() == ivar.number() && bc->isImplicit())
{
bc->subProblem().prepareFaceShapes(jvar.number(), _tid);
bc->computeJacobianBlock(jvar.number());
}
}
}
}
const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
if (scalar_vars.size() > 0)
{
// go over nl-variables (non-scalar)
const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
for (std::vector<MooseVariable *>::const_iterator it = vars.begin(); it != vars.end(); it++)
{
MooseVariable & ivar = *(*it);
if (ivar.activeOnSubdomain(_subdomain) > 0 && _integrated_bcs.hasActiveBoundaryObjects(bnd_id, _tid))
{
// for each variable get the list of active kernels
const std::vector<MooseSharedPointer<IntegratedBC> > & bcs = _integrated_bcs.getActiveBoundaryObjects(bnd_id, _tid);
for (std::vector<MooseSharedPointer<IntegratedBC> >::const_iterator kt = bcs.begin(); kt != bcs.end(); ++kt)
{
MooseSharedPointer<IntegratedBC> bc = *kt;
if (bc->variable().number() == ivar.number() && bc->isImplicit())
{
// now, get the list of coupled scalar vars and compute their off-diag jacobians
const std::vector<MooseVariableScalar *> coupled_scalar_vars = bc->getCoupledMooseScalarVars();
for (std::vector<MooseVariableScalar *>::const_iterator jt = coupled_scalar_vars.begin(); jt != coupled_scalar_vars.end(); jt++)
{
MooseVariableScalar & jvar = *(*jt);
// Do: dvar / dscalar_var
if (_sys.hasScalarVariable(jvar.name())) // want to process only nl-variables (not aux ones)
bc->computeJacobianBlockScalar(jvar.number());
}
}
}
}
}
}
}