16#ifndef dealii_packaged_operation_for_mg_h
17#define dealii_packaged_operation_for_mg_h
31template <
typename Number>
33template <
typename Range,
typename Domain,
typename Payload>
35template <
typename Range = Vector<
double>>
104template <
typename Range>
115 apply = [](Range &) {
118 "Uninitialized PackagedOperationMG<Range>::apply called"));
124 "Uninitialized PackagedOperationMG<Range>::apply_add called"));
130 "Uninitialized PackagedOperationMG<Range>::reinit_vector "
172 apply = [&u](Range &v) { v = u; };
177 v.reinit(u, omit_zeroing_entries);
189 operator Range()
const
194 apply(result_vector);
196 return result_vector;
210 *
this = *
this + second_comp;
221 *
this = *
this - second_comp;
253 *
this = *
this * number;
262 std::function<void(Range &v)>
apply;
294template <
typename Range>
306 return_comp.
apply = [first_comp, second_comp](Range &v) {
311 return_comp.
apply_add = [first_comp, second_comp](Range &v) {
327template <
typename Range>
339 return_comp.
apply = [first_comp, second_comp](Range &v) {
340 second_comp.
apply(v);
345 return_comp.
apply_add = [first_comp, second_comp](Range &v) {
363template <
typename Range>
366 typename Range::value_type number)
375 return_comp.
apply = [](Range &v) { v = 0.; };
381 return_comp.
apply = [comp, number](Range &v) {
386 return_comp.
apply_add = [comp, number](Range &v) {
404template <
typename Range>
406operator*(
typename Range::value_type number,
409 return comp * number;
420template <
typename Range>
435template <
typename Range>
450template <
typename Range>
467template <
typename Range>
484 namespace PackagedOperationImplementation
490 template <
typename T>
491 class has_vector_interface
493 template <
typename C>
494 static std::false_type
497 template <
typename C>
498 static std::true_type
499 test(
decltype(&C::operator+=),
500 decltype(&C::operator-=),
501 decltype(&C::l2_norm));
507 using type =
decltype(
test<T>(
nullptr,
nullptr,
nullptr));
527template <
typename Range,
528 typename =
typename std::enable_if<
530 Range>::type::value>::type>
539 return_comp.
reinit_vector = [&u](Range &x,
bool omit_zeroing_entries) {
540 x.reinit(u, omit_zeroing_entries);
543 return_comp.
apply = [&u, &v](Range &x) {
548 return_comp.
apply_add = [&u, &v](Range &x) {
572template <
typename Range,
573 typename =
typename std::enable_if<
575 Range>::type::value>::type>
584 return_comp.
reinit_vector = [&u](Range &x,
bool omit_zeroing_entries) {
585 x.reinit(u, omit_zeroing_entries);
588 return_comp.
apply = [&u, &v](Range &x) {
593 return_comp.
apply_add = [&u, &v](Range &x) {
616template <
typename Range,
617 typename =
typename std::enable_if<
619 Range>::type::value>::type>
621operator*(
const Range &u,
typename Range::value_type number)
641template <
typename Range,
642 typename =
typename std::enable_if<
644 Range>::type::value>::type>
646operator*(
typename Range::value_type number,
const Range &u)
669template <
typename Range,
typename Domain,
typename Payload>
680 return_comp.
apply = [op, &u](Range &v) { op.
vmult(v, u); };
705template <
typename Range,
typename Domain,
typename Payload>
716 return_comp.
apply = [op, &u](Domain &v) { op.
Tvmult(v, u); };
732template <
typename Range,
typename Domain,
typename Payload>
744 return_comp.
apply = [op, comp](Domain &v) {
754 return_comp.
apply_add = [op, comp](Domain &v) {
776template <
typename Range,
typename Domain,
typename Payload>
788 return_comp.
apply = [op, comp](Domain &v) {
798 return_comp.
apply_add = [op, comp](Domain &v) {
std::function< void(Range &v, bool omit_zeroing_entries)> reinit_range_vector
std::function< void(Range &v, const Domain &u)> vmult_add
std::function< void(Domain &v, const Range &u)> Tvmult_add
std::function< void(Domain &v, bool omit_zeroing_entries)> reinit_domain_vector
std::function< void(Domain &v, const Range &u)> Tvmult
std::function< void(Range &v, const Domain &u)> vmult
std::function< void(Range &v, bool omit_zeroing_entries)> reinit_vector
PackagedOperationMG< Range > & operator=(const PackagedOperationMG< Range > &)=default
PackagedOperationMG< Range > & operator-=(const PackagedOperationMG< Range > &second_comp)
PackagedOperationMG< Range > & operator-=(const Range &offset)
PackagedOperationMG(const Range &u)
PackagedOperationMG< Range > & operator+=(const PackagedOperationMG< Range > &second_comp)
PackagedOperationMG(const PackagedOperationMG< Range > &)=default
PackagedOperationMG< Range > & operator+=(const Range &offset)
std::function< void(Range &v)> apply_add
PackagedOperationMG< Range > & operator*=(typename Range::value_type number)
std::function< void(Range &v)> apply
PackagedOperationMG< Range > & operator=(const Range &u)
static std::false_type test(...)
decltype(test< T >(nullptr, nullptr, nullptr)) type
std::enable_if_t< std::is_floating_point_v< T > &&std::is_floating_point_v< U >, typename ProductType< std::complex< T >, std::complex< U > >::type > operator*(const std::complex< T > &left, const std::complex< U > &right)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
BarycentricPolynomial< dim, Number1 > operator-(const Number2 &a, const BarycentricPolynomial< dim, Number1 > &bp)
BarycentricPolynomial< dim, Number1 > operator+(const Number2 &a, const BarycentricPolynomial< dim, Number1 > &bp)