The general mixed-boundary conditions for PDE systems of N equation (see Systems of PDEs) are
The notation means the N-by-1 matrix with (i,1)-component
where the outward normal vector of the boundary . For each edge segment, there are M Dirichlet conditions and the h-matrix is M-by-N, M ≥ 0. The generalized Neumann condition contains a source where the solver computes Lagrange multipliers µ such that the Dirichlet conditions are satisfied.
Boundary Conditions Overview describes a recommended approach for writing boundary conditions.