function u = solveNodalESorMS(self,coefstruct,constCoeffsBCs)
% Internal only. Nodal element solution.

%   Copyright 2022 The MathWorks, Inc.

[p,e,t] = self.Mesh.meshToPet();
u0 = zeros(size(p,2),1);
femodel = pde.DiscretizedPDEModel(self,p,e,t,coefstruct,u0,constCoeffsBCs);
if startsWith(self.AnalysisType,'magnetostatic','IgnoreCase',true) && ...
        isfield(coefstruct.Coefficients,'fc')
    % compute magnetization if present
    curlF = addCurlComponent(self,p,t,coefstruct,u0);
    femodel.F = femodel.F + curlF;
end

if contains(self.AnalysisType,'magnetostatic-axisymmetric')
    femodel = self.imposeBCOnAxis(femodel);
end

u = self.solveStationary(femodel);

end