1
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
3
// See the LICENSE.txt file for license information. Please report all
4
// bugs and problems to <gmsh@geuz.org>.
7
#include "gmshAssembler.h"
8
#include "gmshLinearSystem.h"
10
void gmshAssembler::assemble(MVertex *vR, int iCompR, int iFieldR,
11
MVertex *vC, int iCompC, int iFieldC,
14
if (!lsys->isAllocated()){
15
lsys->allocate(numbering.size());
18
std::map<gmshDofKey, int>::iterator itR = numbering.find(gmshDofKey(vR, iCompR, iFieldR));
19
if (itR != numbering.end()){
20
std::map<gmshDofKey, int>::iterator itC = numbering.find(gmshDofKey(vC, iCompC, iFieldC));
21
if (itC != numbering.end()){
22
lsys->addToMatrix(itR->second, itC->second, val);
25
std::map<gmshDofKey, double>::iterator itF = fixed.find(gmshDofKey(vC, iCompC, iFieldC));
26
if (itF != fixed.end()){
27
lsys->addToRightHandSide(itR->second, -val*itF->second);
30
std::map<gmshDofKey, std::vector<std::pair<gmshDofKey, double> > >::iterator itConstrC =
31
constraints.find(gmshDofKey(vC, iCompC, iFieldC));
32
if (itConstrC != constraints.end()){
33
for (unsigned int i = 0; i < itConstrC->second.size(); i++){
34
gmshDofKey &dofKeyConstrC = itConstrC->second[i].first;
35
double valConstrC = itConstrC->second[i].second;
36
assemble(vR, iCompR, iFieldR,
37
dofKeyConstrC.v,dofKeyConstrC.comp, dofKeyConstrC.field,
45
std::map<gmshDofKey, std::vector<std::pair<gmshDofKey, double> > >::iterator itConstrR =
46
constraints.find(gmshDofKey(vR, iCompR, iFieldR));
47
if (itConstrR != constraints.end()){
48
for (unsigned int i = 0; i < itConstrR->second.size(); i++){
49
gmshDofKey &dofKeyConstrR = itConstrR->second[i].first;
50
double valConstrR = itConstrR->second[i].second;
51
assemble(dofKeyConstrR.v,dofKeyConstrR.comp, dofKeyConstrR.field,
59
void gmshAssembler::assemble(MVertex *vR, int iCompR, int iFieldR,
62
if (!lsys->isAllocated())lsys->allocate(numbering.size());
63
std::map<gmshDofKey, int>::iterator itR = numbering.find(gmshDofKey(vR, iCompR, iFieldR));
64
if (itR != numbering.end()){
65
lsys->addToRightHandSide(itR->second, val);