3 #ifndef DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSTRANSFORMATION_HH 4 #define DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSTRANSFORMATION_HH 7 #include <unordered_map> 17 template<
typename DI,
typename CI,
typename F>
19 :
public std::unordered_map<CI,std::unordered_map<CI,F> >
22 typedef std::unordered_map<CI,std::unordered_map<CI,F> > BaseT;
30 :
public std::unordered_map<DI,std::unordered_map<DI,F> >
43 this->begin(), this->end(),
44 [] (
const std::pair<DI,RowType> & c)
45 ->
bool {
return (!c.second.empty()); });
51 typedef typename ConstraintsTransformation::mapped_type
RowType;
54 : _contains_non_dirichlet_constraints(false)
60 _contains_non_dirichlet_constraints =
false;
63 template<
typename IndexCache>
66 typedef typename IndexCache::ContainerIndex ContainerIndex;
67 typedef typename ConstraintsTransformation::iterator GlobalConstraintIterator;
68 typedef typename ConstraintsTransformation::mapped_type GlobalConstraint;
70 for (
const auto& local_constraint : local_transformation)
72 const ContainerIndex& ci = index_cache.containerIndex(local_constraint.first);
74 std::pair<GlobalConstraintIterator,bool> r =
75 this->insert(make_pair(ci,GlobalConstraint()));
77 GlobalConstraint& global_constraint = r.first->second;
80 if (!r.second && global_constraint.empty())
85 if (local_constraint.second.empty())
87 global_constraint.clear();
92 _contains_non_dirichlet_constraints =
true;
95 for (
const auto& local_entry : local_constraint.second)
96 global_constraint[index_cache.containerIndex(local_entry.first)] = local_entry.second;
102 return _contains_non_dirichlet_constraints;
107 bool _contains_non_dirichlet_constraints;
127 #endif // DUNE_PDELAB_CONSTRAINTS_COMMON_CONSTRAINTSTRANSFORMATION_HH bool containsNonDirichletConstraints() const
Definition: constraintstransformation.hh:100
bool containsNonDirichletConstraints() const
Definition: constraintstransformation.hh:116
ConstraintsTransformation()
Definition: constraintstransformation.hh:53
F Field
Definition: constraintstransformation.hh:36
bool containsNonDirichletConstraints() const
Definition: constraintstransformation.hh:40
F Field
Definition: constraintstransformation.hh:27
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
F ElementType
export ElementType
Definition: constraintstransformation.hh:26
void clear()
Definition: constraintstransformation.hh:57
void import_local_transformation(const LocalTransformation &local_transformation, const IndexCache &index_cache)
Definition: constraintstransformation.hh:64
Definition: constraintstransformation.hh:29
F ElementType
Definition: constraintstransformation.hh:35
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
std::unordered_map< DI, F > RowType
Definition: constraintstransformation.hh:38
ConstraintsTransformation::mapped_type RowType
export RowType
Definition: constraintstransformation.hh:51
Definition: constraintstransformation.hh:111