Skip to content
Snippets Groups Projects
Commit e1f94d76 authored by Hörl, Maximilian's avatar Hörl, Maximilian
Browse files

add quadrature order to problem, change gitignore

parent d74c68d2
No related branches found
No related tags found
No related merge requests found
build-cmake
.fuse_hidden*
......@@ -57,9 +57,6 @@ private:
//assemble stiffness matrix A and load vector b
void assembleSLE (const Scalar K, const Scalar mu)
{
//NOTE:
//const int order = 3; //order of the quadrature rule
//we use the basis
// phi_elem,0 (x) = indicator(elem);
// phi_elem,i (x) = x[i]*indicator(elem);
......@@ -79,27 +76,27 @@ private:
/* //TODO: can be done outside of the loop?
const Dune::QuadratureRule<double,dim>& rule =
Dune::QuadratureRules<double,dim>::rule(geo.type(),order);
Dune::QuadratureRules<double,dim>::rule(geo.type(), problem_.quadratureOrder());
Dune::FieldVector<double, dim+1> update(0.0);
//NOTE: how are quadrature rules in Dune applied correctly?
for (const auto& ip : rule)
{
const auto qp = ip.position();
const auto& qp = ip.position();
//NOTE: is the volume of the element taken into account
//automatically?
const auto weight = ip.weight();
const double weight = ip.weight();
//quadrature for int_elem q*phi_elem,0 dV
b[elemIdxSLE] += weight * q(qp);
b[elemIdxSLE] += weight * problem_.q(qp);
//quadrature for int_elem q*phi_elem,i dV
for (int i = 0; i < dim; i++)
{
b[elemIdxSLE + i + 1] += weight * qp[i] * q(qp);
b[elemIdxSLE + i + 1] += weight * qp[i] * problem_.q(qp);
}
}
*/
//NOTE: makeshift solution for source term q = -1
b[elemIdxSLE] += -elemVol;
for (int i = 0; i < dim; i++)
......
......@@ -33,6 +33,13 @@ class DGProblem
{
return Scalar(0.0);
}
//returns the recommended quadrature order to compute an integral
//over x * q(x)
virtual int quadratureOrder () const
{
return 1;
}
};
#endif
......@@ -23,6 +23,9 @@
#include <dune/mmdg/problems/dgproblem.hh>
#include <dune/mmdg/problems/poisson.hh>
//TODO: specify K in problem? exact solution depends on K!
int main(int argc, char** argv)
{
try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment