Skip to content
Snippets Groups Projects
Commit 766712de authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

FunctionSpace is able to remove keys

parent c43d936b
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
}
......@@ -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 //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment