void GRINS::BoundaryConditions::apply_neumann_normal_axisymmetric( libMesh::FEMContext& context,
                                                                     const CachedValues& cache,
                                                                     const bool request_jacobian,
                                                                     const GRINS::VariableIndex var,
                                                                     const libMesh::Real sign,
                                                                     const std::tr1::shared_ptr<GRINS::NeumannFuncObj> neumann_func ) const
  {
    // The number of local degrees of freedom
    const unsigned int n_var_dofs = context.dof_indices_var[var].size();
  
    // Element Jacobian * quadrature weight for side integration.
    const std::vector<libMesh::Real> &JxW_side = context.side_fe_var[var]->get_JxW();

    // The var shape functions at side quadrature points.
    const std::vector<std::vector<libMesh::Real> >& var_phi_side =
      context.side_fe_var[var]->get_phi();

    // Physical location of the quadrature points
    const std::vector<libMesh::Point>& var_qpoint =
      context.side_fe_var[var]->get_xyz();
    
    libMesh::DenseSubVector<libMesh::Number> &F_var = *context.elem_subresiduals[var]; // residual
    libMesh::DenseSubMatrix<libMesh::Number> &K_var = *context.elem_subjacobians[var][var]; // jacobian

    unsigned int n_qpoints = context.side_qrule->n_points();

    for (unsigned int qp=0; qp != n_qpoints; qp++)
      {
	const libMesh::Real bc_value = neumann_func->normal_value( context, cache, qp );
	const libMesh::Real jac_value = neumann_func->normal_derivative( context, cache, qp );

        const libMesh::Number r = var_qpoint[qp](0);

	for (unsigned int i=0; i != n_var_dofs; i++)
	  {
	    F_var(i) += sign*r*bc_value*var_phi_side[i][qp]*JxW_side[qp];

	    if (request_jacobian)
	      {
		for (unsigned int j=0; j != n_var_dofs; j++)
		  {
		    K_var(i,j) += sign*r*jac_value*
		      var_phi_side[i][qp]*var_phi_side[j][qp]*JxW_side[qp];
		  }
	      }
	  }
      } // End quadrature loop

    // Now must take care of the case that the boundary condition depends on variables
    // other than var.
    std::vector<GRINS::VariableIndex> other_jac_vars = neumann_func->get_other_jac_vars();

    if( (other_jac_vars.size() > 0) && request_jacobian )
      {
	for( std::vector<GRINS::VariableIndex>::const_iterator var2 = other_jac_vars.begin();
	     var2 != other_jac_vars.end();
	     var2++ )
	  {
            libMesh::DenseSubMatrix<libMesh::Number> &K_var2 = *context.elem_subjacobians[var][*var2]; // jacobian

	    const unsigned int n_var2_dofs = context.dof_indices_var[*var2].size();
	    const std::vector<std::vector<libMesh::Real> >& var2_phi_side =
	      context.side_fe_var[*var2]->get_phi();

	    for (unsigned int qp=0; qp != n_qpoints; qp++)
	      {
		const libMesh::Real jac_value = neumann_func->normal_derivative( context, cache, qp, *var2 );

                const libMesh::Number r = var_qpoint[qp](0);

		for (unsigned int i=0; i != n_var_dofs; i++)
		  {
		    for (unsigned int j=0; j != n_var2_dofs; j++)
		      {
			K_var2(i,j) += sign*r*jac_value*
			  var_phi_side[i][qp]*var2_phi_side[j][qp]*JxW_side[qp];
		      }
		  }
	      }
	  } // End loop over auxillary Jacobian variables
      }
    return;
  }