3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_CONSTRAINTSTRANSFORMATION_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_CONSTRAINTSTRANSFORMATION_HH
6 #include <dune/common/tuples.hh>
17 template<
typename DI,
typename CI,
typename F>
44 typedef typename LocalTransformation::const_iterator It;
45 for (It it = this->begin(),
49 if (!it->second.empty())
57 typedef typename ConstraintsTransformation::mapped_type
RowType;
60 : _contains_non_dirichlet_constraints(false)
66 _contains_non_dirichlet_constraints =
false;
69 template<
typename IndexCache>
72 typedef typename IndexCache::ContainerIndex ContainerIndex;
73 typedef typename ConstraintsTransformation::iterator GlobalConstraintIterator;
74 typedef typename ConstraintsTransformation::mapped_type GlobalConstraint;
75 typedef typename LocalTransformation::const_iterator LocalConstraintIterator;
76 typedef typename LocalTransformation::mapped_type::const_iterator LocalEntryIterator;
78 for (LocalConstraintIterator lc_it = local_transformation.begin(),
79 lc_end = local_transformation.end();
83 const ContainerIndex& ci = index_cache.containerIndex(lc_it->first);
85 std::pair<GlobalConstraintIterator,bool> r =
86 this->insert(make_pair(ci,GlobalConstraint()));
88 GlobalConstraint& global_constraint = r.first->second;
91 if (!r.second && global_constraint.empty())
96 if (lc_it->second.empty())
98 global_constraint.clear();
103 _contains_non_dirichlet_constraints =
true;
106 for (LocalEntryIterator le_it = lc_it->second.begin(),
107 le_end = lc_it->second.end();
111 global_constraint[index_cache.containerIndex(le_it->first)] = le_it->second;
118 return _contains_non_dirichlet_constraints;
123 bool _contains_non_dirichlet_constraints;
143 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_CONSTRAINTSTRANSFORMATION_HH
Definition: common/constraintstransformation.hh:29
Provide common name for std::unordered_map and std::unordered_multimap classes in Dune::PDELab namesp...
bool containsNonDirichletConstraints() const
Definition: common/constraintstransformation.hh:132
bool containsNonDirichletConstraints() const
Definition: common/constraintstransformation.hh:116
Definition: common/constraintstransformation.hh:127
a class holding transformation for constrained spaces
Definition: common/constraintstransformation.hh:18
F ElementType
export ElementType
Definition: common/constraintstransformation.hh:26
ConstraintsTransformation()
Definition: common/constraintstransformation.hh:59
bool containsNonDirichletConstraints() const
Definition: common/constraintstransformation.hh:40
unordered_map< DI, F > RowType
Definition: common/constraintstransformation.hh:38
F Field
Definition: common/constraintstransformation.hh:27
ConstraintsTransformation::mapped_type RowType
export RowType
Definition: common/constraintstransformation.hh:57
void import_local_transformation(const LocalTransformation &local_transformation, const IndexCache &index_cache)
Definition: common/constraintstransformation.hh:70
F ElementType
Definition: common/constraintstransformation.hh:35
Definition: unordered_map.hh:46
void clear()
Definition: common/constraintstransformation.hh:63
F Field
Definition: common/constraintstransformation.hh:36