function A = applyDirichletBoundaryConditionsMatrix(A, mesh, pGroup)

accessRow = mesh.BoundaryEdges(mesh.GBoundaryEdges == pGroup);
firstNode  = mesh.edges(accessRow ,1);
secondNode = mesh.edges(accessRow ,2);
allNodes = vertcat(firstNode, secondNode);
accessRow = unique(allNodes);

for i=accessRow'
A(i,find(A(i,:))) = 0;
A(i,i) = 1;
end