function appRegion = applicationRegion(self, locations, faceNormals)
%APPLICATIONREGION Construct application region struct for user function
% This undocumented function may be changed or removed in a future release.

%       Copyright 2014-2020 The MathWorks, Inc.

appRegion.x = locations(1,:);
appRegion.y = locations(2,:);
appRegion.nx = faceNormals(1,:);
appRegion.ny = faceNormals(2,:);

if self.dim == 3
    appRegion.z = locations(3,:);
    appRegion.nz = faceNormals(3,:);
end

if (isprop(self.myPde,'AnalysisType') && ~isempty(self.myPde.AnalysisType) ...
        && contains(self.myPde.AnalysisType,'axisymmetric'))
    % Axisymmetric model should work with either r-z or x-y
    % coordinate frame of reference.
    appRegion.r = appRegion.x;
    appRegion.z = appRegion.y;
    appRegion.nr = appRegion.nx;
    appRegion.nz = appRegion.ny;
end


end

