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

Small simplifications + Preparation for Formulation Independent FS +...

Small simplifications + Preparation for Formulation Independent FS + Preparation for multiple Formulations using same FS
parent da4cf592
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,23 @@ void FunctionSpace::insertDof(Dof& d,
}
}
*/
const Basis& FunctionSpace::getBasis(const MElement& element) const{
return *(*basis)[0];
}
const Basis& FunctionSpace::getBasis(size_t i) const{
return *(*basis)[0];
}
GroupOfElement& FunctionSpace::getSupport(void) const{
return *goe;
}
bool FunctionSpace::isScalar(void) const{
return scalar;
}
vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{
// Const_Cast //
MElement& element = const_cast<MElement&>(elem);
......@@ -162,8 +179,7 @@ vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{
// New Element
MElementFactory factory;
int parentTag = ElementType::ParentTypeFromTag(elem.getTypeForMSH());
int lowOrderTag = ElementType::getTag(parentTag, 1, false);
int lowOrderTag = ElementType::getTag(elem.getType(), 1, false);
MElement* permElement = factory.create(lowOrderTag, vertex);
......@@ -226,6 +242,14 @@ vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{
return myDof;
}
const vector<Dof> FunctionSpace::getAllDofs(void) const{
return vector<Dof>(dof->begin(), dof->end());
}
const vector<GroupOfDof*>& FunctionSpace::getAllGroups(void) const{
return *group;
}
const GroupOfDof& FunctionSpace::
getGoDFromElement(const MElement& element) const{
......@@ -240,3 +264,11 @@ getGoDFromElement(const MElement& element) const{
else
return *(it->second);
}
size_t FunctionSpace::dofNumber(void) const{
return dof->size();
}
size_t FunctionSpace::groupNumber(void) const{
return group->size();
}
......@@ -22,8 +22,7 @@
@interface FunctionSpace
@brief Common Interface of all Function Spaces
This is the common interface of
all Function Spaces.
This is the common interface of all Function Spaces.
A FunctionSpace is defined on a support,
which is a collection of MElement%s (GroupOfElement).
......@@ -68,9 +67,8 @@ class FunctionSpace{
public:
virtual ~FunctionSpace(void);
const std::vector<const Basis*>& getBasis(const MElement& element) const;
const Basis& getBasis(size_t i) const;
size_t getNBasis(void) const;
const Basis& getBasis(const MElement& element) const;
const Basis& getBasis(size_t i) const;
GroupOfElement& getSupport(void) const;
bool isScalar(void) const;
......@@ -114,9 +112,12 @@ class FunctionSpace{
Deletes this FunctionSpace
**
@fn FunctionSpace::getBasis
@param element A MElement
@return Returns the Basis associated to the given MElement
@fn FunctionSpace::getSupport
@return Returns the support of this
FunctionSpace
@return Returns the support of this FunctionSpace
**
@fn FunctionSpace::isScalar
......@@ -157,16 +158,14 @@ class FunctionSpace{
@fn FunctionSpace::getGoDFromElement
@param element An Element of the FunctionSpace Support
@return Returns the GroupOfDof%s associated to
the given Element
@return Returns the GroupOfDof%s associated to the given Element
If the given Element is not in the FunctionSpace Support,
an Exception is thrown
**
@fn FunctionSpace::dofNumber
@return Returns the number of Dof%s
given by FunctionSpace::getAllDofs()
@return Returns the number of Dof%s given by FunctionSpace::getAllDofs()
**
@fn FunctionSpace::groupNumber
......@@ -175,46 +174,4 @@ class FunctionSpace{
**
*/
//////////////////////
// Inline Functions //
//////////////////////
inline const std::vector<const Basis*>&
FunctionSpace::getBasis(const MElement& element) const{
return *basis;
}
inline const Basis& FunctionSpace::getBasis(size_t i) const{
return *(*basis)[i];
}
inline size_t FunctionSpace::getNBasis(void) const{
return nBasis;
}
inline GroupOfElement& FunctionSpace::getSupport(void) const{
return *goe;
}
inline bool FunctionSpace::isScalar(void) const{
return scalar;
}
inline size_t FunctionSpace::dofNumber(void) const{
return dof->size();
}
inline size_t FunctionSpace::groupNumber(void) const{
return group->size();
}
inline const std::vector<Dof> FunctionSpace::getAllDofs(void) const{
return std::vector<Dof>(dof->begin(), dof->end());
}
inline const std::vector<GroupOfDof*>& FunctionSpace::getAllGroups(void) const{
return *group;
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment