function [nip,niph]=NrOfIntegrationPoints(CtrlVar)

[nip,niph,BoundaryEdge]=NrOfIntegrationPoints(CtrlVar) defines nr of integration points for diagnostic (nip) and prognostic (nihp) equations

    % very important for the h and the implicit uvh cases to have one higher order of integration!!!!
    % nip must be above lin/quadradic for correct results! Why?
    % and for 6 and 10 nodes tri elements I need for the diagnostic equation one order higher integration than
    % expected
    switch CtrlVar.TriNodes
        case 3 % minimum of 1 needed
            nip=3;
            %niph=3;
            %niph=4; % for some odd reason niph=4 causes convergence problems, when using niph=3 or niph=6 does not
            niph=6;

        case 6   % minimum of 4 needed

            nip=6;
            %nip=6;   %  for GL problems overintegrating leads to impoved rates of convergence
            %nip=12;

            niph=7;
            %niph=12;
            %niph=16;



        case 10 % minimum of 7 needed
            nip=7;
            %nip=12;
            %nip=16;

            niph=12;

        otherwise
            error(' case not recognised, TriNodes value incorrect')
    end

    if CtrlVar.Implicituvh ; nip=niph ; end
Error using NrOfIntegrationPoints (line 12)
Not enough input arguments.
end