Permalink
Browse files

Merge branch 'hdivdiv_bdelems' into 'master'

Hdivdiv quad elements

See merge request !254
  • Loading branch information...
JSchoeberl committed Oct 20, 2017
2 parents 3be8385 + 24861ab commit c638b1369ec979443d4fe6b91b354add0d18da5a
Showing with 424 additions and 19 deletions.
  1. +60 −7 comp/hdivdivfespace.cpp
  2. +364 −12 fem/hdivdivfe.hpp
@@ -525,19 +525,39 @@ namespace ngcomp
ndof += first_facet_dof[f+1] - first_facet_dof[f];
}
break;
case ET_QUAD:
//ndof += 2*(oi[0]+2)*(oi[0]+1) +1;
ndof += (oi[0]+1+HDivDivFE<ET_QUAD>::incsg)*(oi [0]+1+HDivDivFE<ET_QUAD>::incsg)
+ (oi[0]+2)*(oi[0])*2
+ 2*(oi[0]+1+HDivDivFE<ET_QUAD>::incsugv) +1;
if(discontinuous)
{
for (auto f : ma->GetElFacets(ei))
ndof += first_facet_dof[f+1] - first_facet_dof[f];
}
break;
case ET_PRISM:
ndof += 3*(oi[0]+1+incrorder_xx1)*(oi[0]+incrorder_xx1)*(oi[2]+1+incrorder_xx2)/2 +
(oi[0]+1+incrorder_zz1)*(oi[0]+2+incrorder_zz1)*(oi[2]-1+incrorder_zz2)/2 +
(oi[0]+1)*(oi[0]+2)*(oi[2]+1)/2*2;
if(discontinuous)
{
/*
auto fnums = ma->GetElFacets(ei);
for(int ii=0; ii<fnums.Size(); ii++)
{
ndof += first_facet_dof[fnums[ii]+1] - first_facet_dof[fnums[ii]];
}
*/
for (auto f : ma->GetElFacets(ei))
ndof += first_facet_dof[f+1] - first_facet_dof[f];
}
break;
case ET_HEX:
ndof += 3*(oi[0]+2)*(oi[0])*(oi[0]+2) + 3*(oi[0]+1)*(oi[0]+2)*(oi[0]+1);
if(discontinuous)
{
for (auto f : ma->GetElFacets(ei))
ndof += first_facet_dof[f+1] - first_facet_dof[f];
}
break;
case ET_TET:
ndof += (oi[0]+1)*(oi[0]+2)*(oi[0]+1);
if(discontinuous)
{
for (auto f : ma->GetElFacets(ei))
ndof += first_facet_dof[f+1] - first_facet_dof[f];
}
@@ -650,6 +670,17 @@ namespace ngcomp
fe->ComputeNDof();
return *fe;
}
case ET_QUAD:
{
auto fe = new (alloc) HDivDivFE<ET_QUAD> (order,plus);
fe->SetVertexNumbers (ngel.Vertices());
int ii = 0;
for(auto f : ngel.Facets())
fe->SetOrderFacet(ii++,order_facet[f]);
fe->SetOrderInner(order_inner[ei.Nr()]);
fe->ComputeNDof();
return *fe;
}
case ET_PRISM:
{
auto fe = new (alloc) HDivDivFE<ET_PRISM> (order,plus);
@@ -661,6 +692,28 @@ namespace ngcomp
fe->ComputeNDof();
return *fe;
}
case ET_HEX:
{
auto fe = new (alloc) HDivDivFE<ET_HEX> (order,plus);
fe->SetVertexNumbers (ngel.vertices);
int ii = 0;
for(auto f : ngel.Facets())
fe->SetOrderFacet(ii++,order_facet[f]);
fe->SetOrderInner(order_inner[ei.Nr()]);
fe->ComputeNDof();
return *fe;
}
case ET_TET:
{
auto fe = new (alloc) HDivDivFE<ET_TET> (order,plus);
fe->SetVertexNumbers (ngel.vertices);
int ii = 0;
for(auto f : ngel.Facets())
fe->SetOrderFacet(ii++,order_facet[f]);
fe->SetOrderInner(order_inner[ei.Nr()]);
fe->ComputeNDof();
return *fe;
}
default:
throw Exception(string("HDivDivFESpace::GetFE: element-type ") +
ToString(ngel.GetType()) + " not supported");
Oops, something went wrong.

0 comments on commit c638b13

Please sign in to comment.