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

Doc and cleaning of FunctionSpace

parent e4b7bba8
No related branches found
No related tags found
No related merge requests found
...@@ -86,9 +86,6 @@ void FunctionSpace::buildDof(void){ ...@@ -86,9 +86,6 @@ void FunctionSpace::buildDof(void){
const size_t nElement = goe->getNumber(); const size_t nElement = goe->getNumber();
const vector<const MElement*>& element = goe->getAll(); const vector<const MElement*>& element = goe->getAll();
// Init Struct //
group.resize(nElement);
// Create Dofs // // Create Dofs //
for(size_t i = 0; i < nElement; i++){ for(size_t i = 0; i < nElement; i++){
// Get Dof for this Element // Get Dof for this Element
...@@ -98,9 +95,6 @@ void FunctionSpace::buildDof(void){ ...@@ -98,9 +95,6 @@ void FunctionSpace::buildDof(void){
// Add Dofs // Add Dofs
for(size_t j = 0; j < nDof; j++) for(size_t j = 0; j < nDof; j++)
dof.insert(myDof[j]); dof.insert(myDof[j]);
// Save vector
group[i] = myDof;
} }
} }
......
...@@ -62,30 +62,27 @@ class FunctionSpace{ ...@@ -62,30 +62,27 @@ class FunctionSpace{
public: public:
virtual ~FunctionSpace(void); virtual ~FunctionSpace(void);
const Basis& getBasis(const MElement& element) const;
const Basis& getBasis(size_t i) const;
const GroupOfElement& getSupport(void) const;
bool isScalar(void) const; bool isScalar(void) const;
size_t getForm(void) const; size_t getForm(void) const;
size_t getOrder(void) const; size_t getOrder(void) const;
std::vector<Dof> getUnorderedKeys(const MElement& element) const; const Basis& getBasis(const MElement& element) const;
std::vector<Dof> getKeys(const MElement& element) const; const Basis& getBasis(size_t eType) const;
const GroupOfElement& getSupport(void) const;
void getKeys(const GroupOfElement& goe, std::set<Dof>& dof) const; const std::set<Dof>& getAllDofs(void) const;
void getKeys(const GroupOfElement& goe,
std::vector<std::vector<Dof> >& dof) const;
const std::set<Dof>& getAllDofs(void) const; std::vector<Dof> getKeys(const MElement& element) const;
const std::vector<std::vector<Dof> >& getAllGroups(void) const; void getKeys(const GroupOfElement& goe, std::set<Dof>& dof) const;
void getKeys(const GroupOfElement& goe,
std::vector<std::vector<Dof> >& dof) const;
protected: protected:
FunctionSpace(void); FunctionSpace(void);
void build(const GroupOfElement& goe, std::string family); void build(const GroupOfElement& goe, std::string family);
void buildDof(void); void buildDof(void);
std::vector<Dof> getUnorderedKeys(const MElement& element) const;
}; };
...@@ -100,45 +97,57 @@ class FunctionSpace{ ...@@ -100,45 +97,57 @@ class FunctionSpace{
Deletes this FunctionSpace Deletes this FunctionSpace
** **
@fn FunctionSpace::getSupport
@return Returns the support of this
FunctionSpace
**
@fn FunctionSpace::isScalar @fn FunctionSpace::isScalar
@return Returns: @return Returns:
@li true, if this FunstionSpace is scalar @li true, if this FunstionSpace is scalar
@li flase, otherwise @li flase, otherwise
** **
@fn vector<Dof> FunctionSpace::getKeys(const MElement& element) const @fn FunctionSpace::getForm
@param element A MElement @return Returns this FunctionSpace differential form (0, 1, 2 or 3)
@return Returns all the Dof%s associated to the given MElement **
@fn FunctionSpace::getOrder
@return Returns this FunctionSpace order
** **
@fn vector<Dof> FunctionSpace::getKeys(const MVertex& vertex) const @fn FunctionSpace::getBasis(const MElement& element) const
@param vertex A MVertex @param element A MElement
@return Returns all the Dof%s associated to the given MVertex @return Returns the Basis associated to the given element
** **
@fn vector<Dof> FunctionSpace::getKeys(const MEdge& edge) const @fn FunctionSpace::getBasis(size_t eType) const
@param edge A MEdge @param eType A geomtrical element type tag
@return Returns all the Dof%s associated to the given MEdge @return Returns the Basis associated to the given geomtrical element type tag
** **
@fn vector<Dof> FunctionSpace::getKeys(const MFace& face) const @fn FunctionSpace::getSupport
@param face A MFace @return Returns the support of this FunctionSpace
@return Returns all the Dof%s associated to the given MFace
** **
@fn FunctionSpace::getAllDofs @fn FunctionSpace::getAllDofs
@return Returns all the Dof%s associated to every Element%s @return Returns the set of all the Dof%s associated to this FunctionSpace
of this FunctionSpace support **
@fn std::vector<Dof> FunctionSpace::getKeys(const MElement&) const
@param element A MElement
@return Returns all the Dof%s associated to the given MElement
**
@fn void FunctionSpace::getKeys(const GroupOfElement&, std::set<Dof>&) const
@param goe A GroupOfElement
@param dof A set of Dof%s
Populates the given set with the Dof%s associated to the MElement%s
of the given GroupOfElement
** **
@fn FunctionSpace::getAllGroups @fn void FunctionSpace::getKeys(const GroupOfElement&, std::vector<std::vector<Dof> >&) const
@return Returns all the Dof%s associated to every Element%s @param goe A GroupOfElement
of this FunctionSpace support @param dof A vector of vector of Dof%s
Populates the given vector such that:
dof[i][j] is the jth Dof of the ith element of the given GroupOfElement
*/ */
...@@ -146,18 +155,6 @@ class FunctionSpace{ ...@@ -146,18 +155,6 @@ class FunctionSpace{
// Inline Functions // // Inline Functions //
////////////////////// //////////////////////
inline const Basis& FunctionSpace::getBasis(const MElement& element) const{
return *basis[element.getType()];
}
inline const Basis& FunctionSpace::getBasis(size_t i) const{
return *basis[i];
}
inline const GroupOfElement& FunctionSpace::getSupport(void) const{
return *goe;
}
inline bool FunctionSpace::isScalar(void) const{ inline bool FunctionSpace::isScalar(void) const{
return scalar; return scalar;
} }
...@@ -170,13 +167,20 @@ inline size_t FunctionSpace::getOrder(void) const{ ...@@ -170,13 +167,20 @@ inline size_t FunctionSpace::getOrder(void) const{
return order; return order;
} }
inline const std::set<Dof>& FunctionSpace::getAllDofs(void) const{ inline const Basis& FunctionSpace::getBasis(const MElement& element) const{
return dof; return *basis[element.getType()];
} }
inline const std::vector<std::vector<Dof> >& inline const Basis& FunctionSpace::getBasis(size_t eType) const{
FunctionSpace::getAllGroups(void) const{ return *basis[eType];
return group; }
inline const GroupOfElement& FunctionSpace::getSupport(void) const{
return *goe;
}
inline const std::set<Dof>& FunctionSpace::getAllDofs(void) const{
return dof;
} }
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment