16#ifndef dealii_constrained_linear_operator_h
17#define dealii_constrained_linear_operator_h
63template <
typename Range,
typename Domain,
typename Payload>
71 return_op.vmult_add = [&constraints](Range &v,
const Domain &
u) {
73 ::ExcMessage(
"The domain and range vectors must be different "
74 "storage locations"));
80 const auto &locally_owned_elements = v.locally_owned_elements();
81 for (
const auto &line : constraints.get_lines())
83 const auto i = line.index;
84 if (locally_owned_elements.is_element(i))
87 const auto &entries = line.entries;
90 const auto pos = entries[
j].first;
91 v(i) +=
u(
pos) * entries[
j].second;
99 return_op.Tvmult_add = [&constraints](Domain &v,
const Range &
u) {
101 ::ExcMessage(
"The domain and range vectors must be different "
102 "storage locations"));
108 const auto &locally_owned_elements = v.locally_owned_elements();
109 for (
const auto &line : constraints.get_lines())
111 const auto i = line.index;
113 if (locally_owned_elements.is_element(i))
118 const auto &entries = line.entries;
121 const auto pos = entries[
j].first;
122 if (locally_owned_elements.is_element(
pos))
123 v(
pos) +=
u(i) * entries[
j].second;
156template <
typename Range,
typename Domain,
typename Payload>
164 return_op.vmult_add = [&constraints](Range &v,
const Domain &
u) {
165 const auto &locally_owned_elements = v.locally_owned_elements();
166 for (
const auto &line : constraints.get_lines())
168 const auto i = line.index;
169 if (locally_owned_elements.is_element(i))
178 return_op.Tvmult_add = [&constraints](Domain &v,
const Range &
u) {
179 const auto &locally_owned_elements = v.locally_owned_elements();
180 for (
const auto &line : constraints.get_lines())
182 const auto i = line.index;
183 if (locally_owned_elements.is_element(i))
244template <
typename Range,
typename Domain,
typename Payload>
290template <
typename Range,
typename Domain,
typename Payload>
307 linop.reinit_domain_vector(*
k,
false);
308 constraints.distribute(*
k);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
LinearOperator< Domain, Range, Payload > transpose_operator(const LinearOperator< Range, Domain, Payload > &op)
PackagedOperation< Range > constrained_right_hand_side(const AffineConstraints< typename Range::value_type > &constraints, const LinearOperator< Range, Domain, Payload > &linop, const Range &right_hand_side)
LinearOperator< Range, Domain, Payload > constrained_linear_operator(const AffineConstraints< typename Range::value_type > &constraints, const LinearOperator< Range, Domain, Payload > &linop)
LinearOperator< Range, Domain, Payload > project_to_constrained_linear_operator(const AffineConstraints< typename Range::value_type > &constraints, const LinearOperator< Range, Domain, Payload > &exemplar)
LinearOperator< Range, Domain, Payload > distribute_constraints_linear_operator(const AffineConstraints< typename Range::value_type > &constraints, const LinearOperator< Range, Domain, Payload > &exemplar)
static bool equal(const T *p1, const T *p2)