function [R] = ApplyDirichletBndCondVec(R,value,BndNodesIndex)

  % applies Dirichlet boundary condition, 'value', to a vector 'R', for the
  % nodes defined in 'BndNodesIndex'. 
  % Note 'R' and 'BndNodesIndex' have the size of the corresponding state
  % variable vector (includes both inside and outside nodes). 
  % 
  R(BndNodesIndex) = value;    
  
end