コード例 #1
0
ファイル: KKSACBulkF.C プロジェクト: AhmedAly83/moose
Real
KKSACBulkF::computeQpOffDiagJacobian(unsigned int jvar)
{
  // get the coupled variable jvar is referring to
  unsigned int cvar;
  if (!mapJvarToCvar(jvar, cvar))
    return 0.0;

  // first get dependence of mobility _L on other variables using parent class
  // member function
  Real res = ACBulk::computeQpOffDiagJacobian(jvar);

  // Then add dependence of KKSACBulkF on other variables
  res -= _L[_qp] * _prop_dh[_qp] * (
           (*_derivatives_Fa[cvar])[_qp] - (*_derivatives_Fb[cvar])[_qp]
         ) * _phi[_j][_qp] * _test[_i][_qp];

  return res;
}
コード例 #2
0
ファイル: CHInterface.C プロジェクト: markr622/moose
Real
CHInterface::computeQpOffDiagJacobian(unsigned int jvar)
{
  // get the coupled variable jvar is referring to
  unsigned int cvar;
  if (!mapJvarToCvar(jvar, cvar))
    return 0.0;

  // Set the gradient derivative
  RealGradient dgrad_Mdarg =   (*_d2Mdcdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp]
                             + (*_dMdarg[cvar])[_qp] * _grad_phi[_j][_qp];

  for (unsigned int i = 0; i < _nvar; ++i)
    dgrad_Mdarg += (*_d2Mdargdarg[cvar][i])[_qp] * _phi[_j][_qp] * (*_coupled_grad_vars[cvar])[_qp];

  //Jacobian value using product rule
  Real value =   _kappa[_qp] * _second_u[_qp].tr()
               * (
                     (*_dMdarg[cvar])[_qp] * _phi[_j][_qp] * _second_test[_i][_qp].tr()
                   + dgrad_Mdarg * _grad_test[_i][_qp]
                 );

  return value;
}