Select Git revision
discreteDiskFace.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
solverAlgorithms.h 11.51 KiB
// Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
//
// Contributor(s):
// Eric Bechet
//
#ifndef _SOLVERALGORITHMS_H_
#define _SOLVERALGORITHMS_H_
#include "dofManager.h"
#include "terms.h"
#include "quadratureRules.h"
#include "MVertex.h"
template<class Iterator, class Assembler> void Assemble(BilinearTermBase &term, FunctionSpaceBase &space,
Iterator itbegin, Iterator itend,
QuadratureBase &integrator, Assembler &assembler)
// symmetric
{
fullMatrix<typename Assembler::dataMat> localMatrix;
std::vector<Dof> R;
for (Iterator it = itbegin; it != itend; ++it){
MElement *e = *it;
R.clear();
IntPt *GP;
int npts = integrator.getIntPoints(e, &GP);
term.get(e, npts, GP, localMatrix); //localMatrix.print();
space.getKeys(e, R);
assembler.assemble(R, localMatrix);
}
}
template<class Iterator, class Assembler> void Assemble(BilinearTermBase &term, FunctionSpaceBase &space,
Iterator itbegin, Iterator itend,
QuadratureBase &integrator, Assembler &assembler,
elementFilter& efilter)
// symmetric
{
fullMatrix<typename Assembler::dataMat> localMatrix;
std::vector<Dof> R;
for (Iterator it = itbegin; it != itend; ++it){
MElement *e = *it;
if (efilter(e)){
R.clear();
IntPt *GP;
int npts = integrator.getIntPoints(e, &GP);
term.get(e, npts, GP, localMatrix); //localMatrix.print();
space.getKeys(e, R);
assembler.assemble(R, localMatrix);
}
}
}
template<class Assembler> void Assemble(BilinearTermBase &term, FunctionSpaceBase &space, MElement *e,
QuadratureBase &integrator, Assembler &assembler) // symmetric
{
fullMatrix<typename Assembler::dataMat> localMatrix;
std::vector<Dof> R;
IntPt *GP;
int npts = integrator.getIntPoints(e, &GP);
term.get(e, npts, GP, localMatrix);
space.getKeys(e, R);
assembler.assemble(R, localMatrix);
}