void GeneralizedPlaneStrainOffDiag::computeDispOffDiagJacobianScalar(unsigned int component, unsigned int jvar) { if (jvar == _scalar_out_of_plane_strain_var) { DenseMatrix<Number> & ken = _assembly.jacobianBlock(_var.number(), jvar); DenseMatrix<Number> & kne = _assembly.jacobianBlock(jvar, _var.number()); MooseVariableScalar & jv = _sys.getScalarVariable(_tid, jvar); for (_i = 0; _i < _test.size(); ++_i) for (_j = 0; _j < jv.order(); ++_j) for (_qp = 0; _qp < _qrule->n_points(); ++_qp) { ken(_i, _j) += _JxW[_qp] * _coord[_qp] * _Jacobian_mult[_qp](_scalar_out_of_plane_strain_direction, _scalar_out_of_plane_strain_direction, component, component) * _grad_test[_i][_qp](component); kne(_j, _i) += _JxW[_qp] * _coord[_qp] * _Jacobian_mult[_qp](_scalar_out_of_plane_strain_direction, _scalar_out_of_plane_strain_direction, component, component) * _grad_test[_i][_qp](component); } } }
void NodalEqualValueConstraint::computeJacobian() { // do the diagonal block DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), _var.number()); // put zeroes on the diagonal (we have to do it, otherwise PETSc will complain!) for (unsigned int i = 0; i < ke.m(); i++) for (unsigned int j = 0; j < ke.n(); j++) ke(i, j) = 0.; for (unsigned int k = 0; k < _value.size(); k++) { DenseMatrix<Number> & ken = _assembly.jacobianBlock(_var.number(), _val_number[k]); ken(k, 0) = 1.; ken(k, 1) = -1.; } }