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

** Very simple way of handling more than one FunctionSpace:

     ++ Automatic offset for Dof::getType() of different FunctionSpace
          ## Need to be improved --> will add a lot of 'jumps' in DofManager

** Correction in SystemAbstract::assemble
     ++ Switching test function and field

** Lagrange Multipliers Formulations (Field tested by Lagrange and vice-versa)
     ++ Added a simulation to test that
          ## Same as FreeSpace but with constraint imposed by Lagrange

     ++ It works :-) !!
parent be72164c
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,11 @@
using namespace std;
const size_t FunctionSpace::nGeoType = 9;
size_t FunctionSpace::nxtOffset = 0;
FunctionSpace::FunctionSpace(void){
offset = nxtOffset;
nxtOffset += 21;
}
FunctionSpace::~FunctionSpace(void){
......@@ -143,7 +146,7 @@ vector<Dof> FunctionSpace::getUnorderedKeys(const MElement& elem) const{
// Add Vertex Based Dof //
for(size_t i = 0; i < nVertex; i++){
for(size_t j = 0; j < fPerVertex; j++){
myDof[it].setDof(mesh->getGlobalId(*vertex[i]), j);
myDof[it].setDof(mesh->getGlobalId(*vertex[i]), j + offset);
it++;
}
}
......@@ -151,7 +154,7 @@ vector<Dof> FunctionSpace::getUnorderedKeys(const MElement& elem) const{
// Add Edge Based Dof //
for(size_t i = 0; i < nEdge; i++){
for(size_t j = 0; j < fPerEdge; j++){
myDof[it].setDof(mesh->getGlobalId(edge[i]), j);
myDof[it].setDof(mesh->getGlobalId(edge[i]), j + offset);
it++;
}
}
......@@ -159,14 +162,14 @@ vector<Dof> FunctionSpace::getUnorderedKeys(const MElement& elem) const{
// Add Face Based Dof //
for(size_t i = 0; i < nFace; i++){
for(size_t j = 0; j < fPerFace; j++){
myDof[it].setDof(mesh->getGlobalId(face[i]), j);
myDof[it].setDof(mesh->getGlobalId(face[i]), j + offset);
it++;
}
}
// Add Cell Based Dof //
for(size_t j = 0; j < fPerCell; j++){
myDof[it].setDof(mesh->getGlobalId(element), j);
myDof[it].setDof(mesh->getGlobalId(element), j + offset);
it++;
}
......
......@@ -32,8 +32,12 @@ class FunctionSpace{
protected:
// Number of possible geomtrical topologies //
static const size_t nGeoType;
static size_t nxtOffset;
protected:
// Offset //
size_t offset;
// Geometry //
const Mesh* mesh;
const GroupOfElement* goe;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment