diff --git a/FunctionSpace/FunctionSpace.cpp b/FunctionSpace/FunctionSpace.cpp index eab464d147954e049f1a7ca52df809f833b8048e..5e3aa7617897bda43d5888d823478d2f3ffc5e75 100644 --- a/FunctionSpace/FunctionSpace.cpp +++ b/FunctionSpace/FunctionSpace.cpp @@ -260,3 +260,28 @@ FunctionSpace::getKeys(const GroupOfElement& goe) const{ // Return vector // return it->second; } + +void FunctionSpace::delKeys(const GroupOfElement& goe, + std::set<Dof>& dof) const{ + // Get Dofs // + const vector<vector<Dof> >& allDofs = getKeys(goe); + + // Remove them from map // + const size_t size = allDofs.size(); + + set<Dof>::iterator end; + set<Dof>::iterator it; + size_t nDof; + + for(size_t i = 0; i < size; i++){ + nDof = allDofs[i].size(); + + for(size_t j = 0; j < nDof; j++){ + end = dof.end(); + it = dof.find(allDofs[i][j]); + + if(it != end) + dof.erase(it); + } + } +} diff --git a/FunctionSpace/FunctionSpace.h b/FunctionSpace/FunctionSpace.h index c7a42b7de324e293f7c41aca6e72d38b130f57dd..442bcb17aaad7db22645c29cd7a27d1c0d2f95ec 100644 --- a/FunctionSpace/FunctionSpace.h +++ b/FunctionSpace/FunctionSpace.h @@ -72,6 +72,8 @@ class FunctionSpace{ void getKeys(const GroupOfElement& goe, std::set<Dof>& dof) const; const std::vector<std::vector<Dof> >& getKeys(const GroupOfElement& goe)const; + void delKeys(const GroupOfElement& goe, std::set<Dof>& dof) const; + protected: FunctionSpace(void); void build(const GroupOfElement& goe, std::string family); @@ -136,8 +138,15 @@ class FunctionSpace{ @param goe A GroupOfElement @return Returns a vector of vector of Dof such that: dof[i][j] is the jth Dof of the ith element of the given GroupOfElement -*/ + ** + + @fn void FunctionSpace::delKeys(const GroupOfElement&, std::set<Dof>&) const + @param goe A GroupOfElement + @param dof A set of Dof%s + Removes from the given set the Dof%s associated to the MElement%s + of the given GroupOfElement +*/ ////////////////////// // Inline Functions //