Skip to content
Snippets Groups Projects
Commit f6c43db0 authored by Jö Fahlke's avatar Jö Fahlke
Browse files

constraints(): predicate only gets intersection

parent a8d0d2ac
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,8 @@ namespace PPS {
{
if(intersection.boundary())
{
// center of face
auto testpoint = referenceElement(intersection.geometry()).position(0,0);
// skip if this isn't a Dirichlet boundary
if (!isDirichlet(intersection,testpoint))
if (!isDirichlet(intersection))
continue;
const int face = intersection.indexInInside();
......
......@@ -53,10 +53,12 @@ void driver (const GV& gv, Dune::ParameterTree& ptree)
using LFE = Dune::Q1LocalFiniteElement<DF, RF, dim>;
//== Exercise 2 {
#ifndef NITSCHE
auto blambda = [&](const auto& i, const auto& x)
{return problem.b(i,x);};
auto isDirichlet = [&](const auto& intersection) {
auto testpoint = referenceElement(intersection.geometry()).position(0,0);
return problem.b(intersection,testpoint);
};
std::set<std::size_t> cc;
PPS::constraints(blambda,gv,LFE{}, cc); // assemble constraints
PPS::constraints(isDirichlet,gv,LFE{}, cc); // assemble constraints
std::cout << "constrained dofs=" << cc.size() << " of "
<< gv.indexSet().size(gv.dimension) << std::endl;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment