Skip to content

Commit

Permalink
bug-fixes for higher-order h-adaptivity with bernstein and szabab
Browse files Browse the repository at this point in the history
  • Loading branch information
manavbhatia committed Dec 6, 2013
1 parent 305c99d commit 3b32437
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 8 deletions.
17 changes: 17 additions & 0 deletions src/fe/fe_bernstein.C
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,23 @@ namespace libMesh
template <> bool FE<2,BERNSTEIN>::is_hierarchic() const { return false; }
template <> bool FE<3,BERNSTEIN>::is_hierarchic() const { return false; }

#ifdef LIBMESH_ENABLE_AMR
// compute_constraints() specializations are only needed for 2 and 3D
template <>
void FE<2,BERNSTEIN>::compute_constraints (DofConstraints &constraints,
DofMap &dof_map,
const unsigned int variable_number,
const Elem* elem)
{ compute_proj_constraints(constraints, dof_map, variable_number, elem); }

template <>
void FE<3,BERNSTEIN>::compute_constraints (DofConstraints &constraints,
DofMap &dof_map,
const unsigned int variable_number,
const Elem* elem)
{ compute_proj_constraints(constraints, dof_map, variable_number, elem); }
#endif // #ifdef LIBMESH_ENABLE_AMR

// Bernstein shapes need reinit only for approximation orders >= 3,
// but we might reach that with p refinement
template <> bool FE<0,BERNSTEIN>::shapes_need_reinit() const { return true; }
Expand Down
20 changes: 16 additions & 4 deletions src/fe/fe_interface.C
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,18 @@ void FEInterface::compute_constraints (DofConstraints &constraints,
dof_map,
variable_number,
elem); return;

case SZABAB:
FE<2,SZABAB>::compute_constraints (constraints,
dof_map,
variable_number,
elem); return;

case BERNSTEIN:
FE<2,BERNSTEIN>::compute_constraints (constraints,
dof_map,
variable_number,
elem); return;

case L2_HIERARCHIC:
FE<2,L2_HIERARCHIC>::compute_constraints (constraints,
Expand Down Expand Up @@ -1286,17 +1298,17 @@ bool FEInterface::extra_hanging_dofs(const FEType& fe_t)
case L2_LAGRANGE:
case MONOMIAL:
case L2_HIERARCHIC:
#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
case BERNSTEIN:
case SZABAB:
#endif
case XYZ:
case LAGRANGE_VEC:
case NEDELEC_ONE:
return false;
case CLOUGH:
case HERMITE:
case HIERARCHIC:
#ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
case BERNSTEIN:
case SZABAB:
#endif
default:
return true;
}
Expand Down
25 changes: 21 additions & 4 deletions src/fe/fe_szabab.C
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,27 @@ namespace libMesh
template <> FEContinuity FE<3,SZABAB>::get_continuity() const { return C_ZERO; }

// Szabab FEMs are not hierarchic
template <> bool FE<0,SZABAB>::is_hierarchic() const { return false; }
template <> bool FE<1,SZABAB>::is_hierarchic() const { return false; }
template <> bool FE<2,SZABAB>::is_hierarchic() const { return false; }
template <> bool FE<3,SZABAB>::is_hierarchic() const { return false; }
template <> bool FE<0,SZABAB>::is_hierarchic() const { return true; }
template <> bool FE<1,SZABAB>::is_hierarchic() const { return true; }
template <> bool FE<2,SZABAB>::is_hierarchic() const { return true; }
template <> bool FE<3,SZABAB>::is_hierarchic() const { return true; }

#ifdef LIBMESH_ENABLE_AMR
// compute_constraints() specializations are only needed for 2 and 3D
template <>
void FE<2,SZABAB>::compute_constraints (DofConstraints &constraints,
DofMap &dof_map,
const unsigned int variable_number,
const Elem* elem)
{ compute_proj_constraints(constraints, dof_map, variable_number, elem); }

template <>
void FE<3,SZABAB>::compute_constraints (DofConstraints &constraints,
DofMap &dof_map,
const unsigned int variable_number,
const Elem* elem)
{ compute_proj_constraints(constraints, dof_map, variable_number, elem); }
#endif // #ifdef LIBMESH_ENABLE_AMR

// Szabab shapes need reinit only for approximation orders >= 3,
// but we might reach that with p refinement
Expand Down

0 comments on commit 3b32437

Please sign in to comment.