function [gg2] = eval_gg2(~,g,~,model,gauss)
% function [gg2] = eval_gg2(x,g,v,model,whichgrid)
% computes gg2 = <gradpsi^2/R^2>/rhotor
% #codegen

if ~gauss
    gg2 = model.geom.LamG*g(model.geom.ind_gg2,:);
else
    gg2 = model.geom.LamGgauss*g(model.geom.ind_gg2,:);
end

return