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

Jacobian correction (??) + FunctionSpace & DofManager cooperation

parent b11b7fba
No related branches found
No related tags found
No related merge requests found
......@@ -5,14 +5,15 @@ using namespace std;
FunctionSpace::FunctionSpace(const GroupOfElement& goe, int basisType, int order){
// Save GroupOfElement //
this->goe = &goe;
this->goe = &goe;
// Look for 1st element to get element type //
// (We suppose only one type of Mesh !!) //
int elementType = goe.get(0).getType();
// Create Basis //
basis = BasisGenerator::generate(elementType, basisType, order);
// Init Struct //
basis = BasisGenerator::generate(elementType, basisType, order);
eToGoD = new map<const MElement*, const GroupOfDof*, ElementComparator>;
// Count Function per Entity //
int nVertex = goe.get(0).getNumVertices();
......@@ -37,5 +38,6 @@ FunctionSpace::FunctionSpace(const GroupOfElement& goe, int basisType, int order
FunctionSpace::~FunctionSpace(void){
delete basis;
delete eToGoD;
}
#ifndef _FUNCTIONSPACE_H_
#define _FUNCTIONSPACE_H_
#include <map>
#include "Dof.h"
#include "GroupOfDof.h"
#include "Basis.h"
#include "GroupOfElement.h"
#include "MElement.h"
......@@ -13,14 +18,19 @@
@todo
Hybrid Mesh@n
Put DofManager::dofFromElement here ??
*/
class ElementComparator;
class FunctionSpace{
private:
friend class DofManager;
const Basis* basis;
const GroupOfElement* goe;
std::map<const MElement*, const GroupOfDof*, ElementComparator>* eToGoD;
int fPerVertex;
int fPerEdge;
int fPerFace;
......@@ -39,6 +49,14 @@ class FunctionSpace{
int getNFunctionPerEdge(MElement& element) const;
int getNFunctionPerFace(MElement& element) const;
int getNFunctionPerCell(MElement& element) const;
private:
void associate(const MElement& element, const GroupOfDof& god);
};
class ElementComparator{
public:
bool operator()(const MElement* a, const MElement* b) const;
};
//////////////////////
......@@ -69,4 +87,12 @@ inline int FunctionSpace::getNFunctionPerCell(MElement& element) const{
return fPerCell;
}
inline void FunctionSpace::associate(const MElement& element, const GroupOfDof& god){
//return fPerCell;
}
inline bool ElementComparator::operator()(const MElement* a, const MElement* b) const{
return a->getNum() < b->getNum();
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment