Selected text from source code void MortarConstraintBase::computeResidual() { setNormals(); precalculateResidual(); if (_compute_primal_residuals) { // Compute the residual for the secondary interior primal dofs computeResidual(Moose::MortarType::Secondary); // Compute the residual for the primary interior primal dofs. computeResidual(Moose::MortarType::Primary); } if (_compute_lm_residuals) // Compute the residual for the lower dimensional LM dofs (if we even have an LM variable) computeResidual(Moose::MortarType::Lower); if (_compute_scalar_residuals) // Compute the residual for the scalar dofs computeResidualScalar(); } void VMNTPeriodicBase::computeResidualScalar() { DenseVector & re = _assembly.residualBlock(_kappa_var); for (_qp = 0; _qp < _qrule_msm->n_points(); _qp++) { precalculateMaterial(); for (_h = 0; _h < _k_order; _h++) { re(_h) += _JxW_msm[_qp] * _coord[_qp] * computeQpResidualScalar(); } } }