17#ifndef dealii_matrix_free_operators_h
18#define dealii_matrix_free_operators_h
46 template <
typename VectorType>
47 typename std::enable_if<IsBlockVector<VectorType>::value,
51 return vector.n_blocks();
54 template <
typename VectorType>
55 typename std::enable_if<!IsBlockVector<VectorType>::value,
62 template <
typename VectorType>
63 typename std::enable_if<IsBlockVector<VectorType>::value,
64 typename VectorType::BlockType &>::type
65 subblock(VectorType &vector,
unsigned int block_no)
67 return vector.block(block_no);
70 template <
typename VectorType>
71 typename std::enable_if<IsBlockVector<VectorType>::value,
72 const typename VectorType::BlockType &>::type
73 subblock(
const VectorType &vector,
unsigned int block_no)
76 return vector.block(block_no);
79 template <
typename VectorType>
80 typename std::enable_if<!IsBlockVector<VectorType>::value,
87 template <
typename VectorType>
88 typename std::enable_if<!IsBlockVector<VectorType>::value,
89 const VectorType &>::type
90 subblock(
const VectorType &vector,
unsigned int)
95 template <
typename VectorType>
96 typename std::enable_if<IsBlockVector<VectorType>::value,
void>::type
99 vector.collect_sizes();
102 template <
typename VectorType>
103 typename std::enable_if<!IsBlockVector<VectorType>::value,
void>::type
187 typename VectorizedArrayType =
238 const std::vector<unsigned int> &selected_row_blocks =
239 std::vector<unsigned int>(),
240 const std::vector<unsigned int> &selected_column_blocks =
241 std::vector<unsigned int>());
260 const unsigned int level,
261 const std::vector<unsigned int> &selected_row_blocks =
262 std::vector<unsigned int>());
281 const std::vector<MGConstrainedDoFs> &mg_constrained_dofs,
282 const unsigned int level,
283 const std::vector<unsigned int> & selected_row_blocks =
284 std::vector<unsigned int>());
314 vmult(VectorType &dst,
const VectorType &src)
const;
320 Tvmult(VectorType &dst,
const VectorType &src)
const;
326 vmult_add(VectorType &dst,
const VectorType &src)
const;
339 el(
const unsigned int row,
const unsigned int col)
const;
367 std::shared_ptr<const MatrixFree<dim, value_type, VectorizedArrayType>>
373 const std::shared_ptr<DiagonalMatrix<VectorType>> &
379 const std::shared_ptr<DiagonalMatrix<VectorType>> &
390 const VectorType &src,
419 apply_add(VectorType &dst,
const VectorType &src)
const = 0;
432 std::shared_ptr<const MatrixFree<dim, value_type, VectorizedArrayType>>
468 mutable std::vector<std::vector<std::pair<value_type, value_type>>>
483 const VectorType &src,
495 const bool is_row)
const;
534 template <
typename OperatorType>
568 template <
typename VectorType>
570 vmult(VectorType &dst,
const VectorType &src)
const;
575 template <
typename VectorType>
577 Tvmult(VectorType &dst,
const VectorType &src)
const;
582 template <
typename VectorType>
615 int n_components = 1,
616 typename Number = double,
621 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
622 "Type of Number and of VectorizedArrayType do not match.");
634 VectorizedArrayType> &
fe_eval);
646 const unsigned int n_actual_components,
647 const VectorizedArrayType * in_array,
648 VectorizedArrayType * out_array)
const;
662 apply(
const VectorizedArrayType *in_array,
663 VectorizedArrayType * out_array)
const;
700 const VectorizedArrayType *in_array,
701 VectorizedArrayType *out_array)
const;
734 int n_q_points_1d = fe_degree + 1,
735 int n_components = 1,
737 typename VectorizedArrayType =
773 apply_add(VectorType &dst,
const VectorType &src)
const override;
782 const VectorType & src,
783 const std::pair<unsigned int, unsigned int> & cell_range)
const;
800 int n_q_points_1d = fe_degree + 1,
801 int n_components = 1,
803 typename VectorizedArrayType =
901 std::shared_ptr<Table<2, VectorizedArrayType>>
911 apply_add(VectorType &dst,
const VectorType &src)
const override;
920 const VectorType & src,
921 const std::pair<unsigned int, unsigned int> & cell_range)
const;
931 const std::pair<unsigned int, unsigned int> &cell_range)
const;
940 const unsigned int cell)
const;
956 typename VectorizedArrayType>
961 VectorizedArrayType>::
962 CellwiseInverseMassMatrix(
967 VectorizedArrayType> &fe_eval)
977 typename VectorizedArrayType>
983 VectorizedArrayType>::
984 fill_inverse_JxW_values(
987 constexpr unsigned int dofs_per_component_on_cell =
990 inverse_jxw.
size() % dofs_per_component_on_cell == 0,
992 "Expected diagonal to be a multiple of scalar dof per cells"));
995 for (
unsigned int q = 0; q < dofs_per_component_on_cell; ++q)
996 inverse_jxw[q] = 1. / fe_eval.JxW(q);
998 for (
unsigned int q = dofs_per_component_on_cell; q < inverse_jxw.
size();)
999 for (
unsigned int i = 0; i < dofs_per_component_on_cell; ++i, ++q)
1000 inverse_jxw[q] = inverse_jxw[i];
1009 typename VectorizedArrayType>
1016 VectorizedArrayType>::apply(
const VectorizedArrayType *in_array,
1017 VectorizedArrayType * out_array)
const
1020 template run<fe_degree>(n_components, fe_eval, in_array, out_array);
1029 typename VectorizedArrayType>
1035 VectorizedArrayType>::
1037 const unsigned int n_actual_components,
1038 const VectorizedArrayType * in_array,
1039 VectorizedArrayType * out_array)
const
1042 template run<fe_degree>(
1043 n_actual_components,
1044 fe_eval.get_shape_info().data.front().inverse_shape_values_eo,
1045 inverse_coefficients,
1056 typename VectorizedArrayType>
1062 VectorizedArrayType>::
1063 transform_from_q_points_to_basis(
const unsigned int n_actual_components,
1064 const VectorizedArrayType *in_array,
1065 VectorizedArrayType * out_array)
const
1069 VectorizedArrayType>::template run<fe_degree>(n_actual_components,
1070 fe_eval.get_shape_info()
1072 .inverse_shape_values_eo,
1080 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1083 , have_interface_matrices(false)
1088 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1095 for (
const unsigned int selected_row : selected_rows)
1096 total_size += data->get_vector_partitioner(selected_row)->size();
1102 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1109 for (
const unsigned int selected_column : selected_columns)
1110 total_size += data->get_vector_partitioner(selected_column)->size();
1116 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1121 inverse_diagonal_entries.reset();
1126 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1129 const unsigned int col)
const
1133 Assert(inverse_diagonal_entries.get() !=
nullptr &&
1134 inverse_diagonal_entries->m() > 0,
1136 return 1.0 / (*inverse_diagonal_entries)(row, row);
1141 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1144 VectorType &vec)
const
1150 const unsigned int index = selected_rows[i];
1152 .partitioners_are_compatible(
1153 *data->get_dof_info(index).vector_partitioner))
1157 .partitioners_are_globally_compatible(
1158 *data->get_dof_info(index).vector_partitioner),
1166 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1171 const std::vector<unsigned int> &given_row_selection,
1172 const std::vector<unsigned int> &given_column_selection)
1176 selected_rows.clear();
1177 selected_columns.clear();
1178 if (given_row_selection.empty())
1179 for (
unsigned int i = 0; i < data_->n_components(); ++i)
1180 selected_rows.push_back(i);
1183 for (
unsigned int i = 0; i < given_row_selection.size(); ++i)
1186 for (
unsigned int j = 0; j < given_row_selection.size(); ++j)
1188 Assert(given_row_selection[j] != given_row_selection[i],
1189 ExcMessage(
"Given row indices must be unique"));
1191 selected_rows.push_back(given_row_selection[i]);
1194 if (given_column_selection.size() == 0)
1195 selected_columns = selected_rows;
1198 for (
unsigned int i = 0; i < given_column_selection.size(); ++i)
1201 for (
unsigned int j = 0; j < given_column_selection.size(); ++j)
1203 Assert(given_column_selection[j] != given_column_selection[i],
1204 ExcMessage(
"Given column indices must be unique"));
1206 selected_columns.push_back(given_column_selection[i]);
1210 edge_constrained_indices.clear();
1211 edge_constrained_indices.resize(selected_rows.size());
1212 edge_constrained_values.clear();
1213 edge_constrained_values.resize(selected_rows.size());
1214 have_interface_matrices =
false;
1219 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1225 const unsigned int level,
1226 const std::vector<unsigned int> &given_row_selection)
1228 std::vector<MGConstrainedDoFs> mg_constrained_dofs_vector(
1229 1, mg_constrained_dofs);
1230 initialize(data_, mg_constrained_dofs_vector,
level, given_row_selection);
1235 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1240 const std::vector<MGConstrainedDoFs> &mg_constrained_dofs,
1241 const unsigned int level,
1242 const std::vector<unsigned int> & given_row_selection)
1247 selected_rows.clear();
1248 selected_columns.clear();
1249 if (given_row_selection.empty())
1250 for (
unsigned int i = 0; i < data_->n_components(); ++i)
1251 selected_rows.push_back(i);
1254 for (
unsigned int i = 0; i < given_row_selection.size(); ++i)
1257 for (
unsigned int j = 0; j < given_row_selection.size(); ++j)
1259 Assert(given_row_selection[j] != given_row_selection[i],
1260 ExcMessage(
"Given row indices must be unique"));
1262 selected_rows.push_back(given_row_selection[i]);
1265 selected_columns = selected_rows;
1268 edge_constrained_indices.clear();
1269 edge_constrained_indices.resize(selected_rows.size());
1270 edge_constrained_values.clear();
1271 edge_constrained_values.resize(selected_rows.size());
1275 for (
unsigned int j = 0; j < selected_rows.size(); ++j)
1277 if (data_->n_cell_batches() > 0)
1283 std::vector<types::global_dof_index> interface_indices;
1284 mg_constrained_dofs[j]
1285 .get_refinement_edge_indices(
level)
1286 .fill_index_vector(interface_indices);
1287 edge_constrained_indices[j].clear();
1288 edge_constrained_indices[j].reserve(interface_indices.size());
1289 edge_constrained_values[j].resize(interface_indices.size());
1291 data->get_dof_handler(selected_rows[j]).locally_owned_mg_dofs(
level);
1292 for (
const auto interface_index : interface_indices)
1293 if (locally_owned.
is_element(interface_index))
1294 edge_constrained_indices[j].push_back(
1296 have_interface_matrices |=
1298 static_cast<unsigned int>(edge_constrained_indices[j].size()),
1299 data->get_vector_partitioner()->get_mpi_communicator()) > 0;
1305 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1308 VectorType &dst)
const
1312 const std::vector<unsigned int> &constrained_dofs =
1313 data->get_constrained_dofs(selected_rows[j]);
1314 for (
const auto constrained_dof : constrained_dofs)
1316 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1318 edge_constrained_indices[j][i]) = 1.;
1324 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1327 const VectorType &src)
const
1332 vmult_add(dst, src);
1337 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1341 const VectorType &src)
const
1343 mult_add(dst, src,
false);
1348 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1352 const VectorType &src)
const
1354 mult_add(dst, src,
true);
1359 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1362 const VectorType &src,
1363 const bool is_row)
const
1369 const unsigned int mf_component =
1370 is_row ? selected_rows[i] : selected_columns[i];
1373 data->get_dof_info(mf_component).vector_partitioner.get())
1380 ->locally_owned_size() ==
1381 data->get_dof_info(mf_component)
1382 .vector_partitioner->locally_owned_size(),
1384 "The vector passed to the vmult() function does not have "
1385 "the correct size for compatibility with MatrixFree."));
1391 this->data->initialize_dof_vector(
1395 .copy_locally_owned_data_from(copy_vec);
1401 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1405 const VectorType &src)
const
1409 adjust_ghost_range_if_necessary(src,
false);
1410 adjust_ghost_range_if_necessary(dst,
true);
1416 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1418 edge_constrained_values[j][i] = std::pair<Number, Number>(
1420 edge_constrained_indices[j][i]),
1422 edge_constrained_indices[j][i]));
1424 .local_element(edge_constrained_indices[j][i]) = 0.;
1431 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1435 const VectorType &src,
1441 preprocess_constraints(dst, src);
1443 Tapply_add(dst, src);
1445 apply_add(dst, src);
1446 postprocess_constraints(dst, src);
1451 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1455 const VectorType &src)
const
1459 const std::vector<unsigned int> &constrained_dofs =
1460 data->get_constrained_dofs(selected_rows[j]);
1461 for (
const auto constrained_dof : constrained_dofs)
1470 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1473 .local_element(edge_constrained_indices[j][i]) =
1474 edge_constrained_values[j][i].first;
1476 edge_constrained_indices[j][i]) =
1477 edge_constrained_values[j][i].second +
1478 edge_constrained_values[j][i].first;
1485 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1489 const VectorType &src)
const
1494 adjust_ghost_range_if_necessary(src,
false);
1495 adjust_ghost_range_if_necessary(dst,
true);
1499 if (!have_interface_matrices)
1505 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1507 edge_constrained_values[j][i] = std::pair<Number, Number>(
1509 edge_constrained_indices[j][i]),
1511 edge_constrained_indices[j][i]));
1513 .local_element(edge_constrained_indices[j][i]) = 0.;
1516 apply_add(dst, src);
1521 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1523 for (; c < edge_constrained_indices[j][i]; ++c)
1529 .local_element(edge_constrained_indices[j][i]) =
1530 edge_constrained_values[j][i].first;
1539 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1543 const VectorType &src)
const
1548 adjust_ghost_range_if_necessary(src,
false);
1549 adjust_ghost_range_if_necessary(dst,
true);
1553 if (!have_interface_matrices)
1556 VectorType src_cpy(src);
1560 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1562 for (; c < edge_constrained_indices[j][i]; ++c)
1570 apply_add(dst, src_cpy);
1573 for (
unsigned int i = 0; i < edge_constrained_indices[j].size(); ++i)
1575 edge_constrained_indices[j][i]) = 0.;
1580 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1584 const VectorType &src)
const
1589 Tvmult_add(dst, src);
1594 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1598 return inverse_diagonal_entries.get() !=
nullptr ?
1599 inverse_diagonal_entries->memory_consumption() :
1605 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1609 VectorizedArrayType>>
1617 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1618 const std::shared_ptr<DiagonalMatrix<VectorType>> &
1622 Assert(inverse_diagonal_entries.get() !=
nullptr &&
1623 inverse_diagonal_entries->m() > 0,
1625 return inverse_diagonal_entries;
1630 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1631 const std::shared_ptr<DiagonalMatrix<VectorType>> &
1634 Assert(diagonal_entries.get() !=
nullptr && diagonal_entries->m() > 0,
1636 return diagonal_entries;
1641 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1645 const VectorType &src)
const
1647 apply_add(dst, src);
1652 template <
int dim,
typename VectorType,
typename VectorizedArrayType>
1656 const VectorType & src,
1660 Assert(inverse_diagonal_entries.get() && inverse_diagonal_entries->m() > 0,
1662 inverse_diagonal_entries->vmult(dst, src);
1670 template <
typename OperatorType>
1673 , mf_base_operator(nullptr)
1678 template <
typename OperatorType>
1682 mf_base_operator =
nullptr;
1687 template <
typename OperatorType>
1691 mf_base_operator = &operator_in;
1696 template <
typename OperatorType>
1697 template <
typename VectorType>
1700 const VectorType &src)
const
1704 std::is_same<typename VectorType::value_type, value_type>::value,
1705 "The vector type must be based on the same value type as this "
1711 mf_base_operator->vmult_interface_down(dst, src);
1716 template <
typename OperatorType>
1717 template <
typename VectorType>
1720 const VectorType &src)
const
1724 std::is_same<typename VectorType::value_type, value_type>::value,
1725 "The vector type must be based on the same value type as this "
1731 mf_base_operator->vmult_interface_up(dst, src);
1736 template <
typename OperatorType>
1737 template <
typename VectorType>
1740 VectorType &vec)
const
1744 mf_base_operator->initialize_dof_vector(vec);
1755 typename VectorType,
1756 typename VectorizedArrayType>
1762 VectorizedArrayType>::MassOperator()
1763 :
Base<dim, VectorType, VectorizedArrayType>()
1772 typename VectorType,
1773 typename VectorizedArrayType>
1787 this->inverse_diagonal_entries =
1788 std::make_shared<DiagonalMatrix<VectorType>>();
1789 this->diagonal_entries = std::make_shared<DiagonalMatrix<VectorType>>();
1790 VectorType &inverse_diagonal_vector =
1791 this->inverse_diagonal_entries->get_vector();
1792 VectorType &diagonal_vector = this->diagonal_entries->get_vector();
1793 this->initialize_dof_vector(inverse_diagonal_vector);
1794 this->initialize_dof_vector(diagonal_vector);
1795 inverse_diagonal_vector = Number(1.);
1796 apply_add(diagonal_vector, inverse_diagonal_vector);
1798 this->set_constrained_entries_to_one(diagonal_vector);
1799 inverse_diagonal_vector = diagonal_vector;
1801 const unsigned int locally_owned_size =
1802 inverse_diagonal_vector.locally_owned_size();
1803 for (
unsigned int i = 0; i < locally_owned_size; ++i)
1804 inverse_diagonal_vector.local_element(i) =
1805 Number(1.) / inverse_diagonal_vector.local_element(i);
1807 inverse_diagonal_vector.update_ghost_values();
1808 diagonal_vector.update_ghost_values();
1817 typename VectorType,
1818 typename VectorizedArrayType>
1825 VectorizedArrayType>::apply_add(VectorType & dst,
1826 const VectorType &src)
const
1838 typename VectorType,
1839 typename VectorizedArrayType>
1846 VectorizedArrayType>::
1851 VectorizedArrayType> & data,
1853 const VectorType & src,
1854 const std::pair<unsigned int, unsigned int> &cell_range)
const
1863 VectorizedArrayType>
1864 phi(data, this->selected_rows[0]);
1865 for (
unsigned int cell = cell_range.first; cell < cell_range.second; ++cell)
1868 phi.read_dof_values(src);
1870 for (
unsigned int q = 0; q < phi.n_q_points; ++q)
1871 phi.submit_value(phi.get_value(q), q);
1873 phi.distribute_local_to_global(dst);
1884 typename VectorType,
1885 typename VectorizedArrayType>
1891 VectorizedArrayType>::LaplaceOperator()
1892 :
Base<dim, VectorType, VectorizedArrayType>()
1901 typename VectorType,
1902 typename VectorizedArrayType>
1909 VectorizedArrayType>::clear()
1912 scalar_coefficient.reset();
1921 typename VectorType,
1922 typename VectorizedArrayType>
1929 VectorizedArrayType>::
1933 scalar_coefficient = scalar_coefficient_;
1942 typename VectorType,
1943 typename VectorizedArrayType>
1944 std::shared_ptr<Table<2, VectorizedArrayType>>
1950 VectorizedArrayType>::get_coefficient()
1953 return scalar_coefficient;
1962 typename VectorType,
1963 typename VectorizedArrayType>
1977 this->inverse_diagonal_entries =
1978 std::make_shared<DiagonalMatrix<VectorType>>();
1979 this->diagonal_entries = std::make_shared<DiagonalMatrix<VectorType>>();
1980 VectorType &inverse_diagonal_vector =
1981 this->inverse_diagonal_entries->get_vector();
1982 VectorType &diagonal_vector = this->diagonal_entries->get_vector();
1983 this->initialize_dof_vector(inverse_diagonal_vector);
1984 this->initialize_dof_vector(diagonal_vector);
1990 this->set_constrained_entries_to_one(diagonal_vector);
1992 inverse_diagonal_vector = diagonal_vector;
1994 for (
unsigned int i = 0; i < inverse_diagonal_vector.locally_owned_size();
1996 if (
std::abs(inverse_diagonal_vector.local_element(i)) >
1998 inverse_diagonal_vector.local_element(i) =
1999 1. / inverse_diagonal_vector.local_element(i);
2001 inverse_diagonal_vector.local_element(i) = 1.;
2003 inverse_diagonal_vector.update_ghost_values();
2004 diagonal_vector.update_ghost_values();
2013 typename VectorType,
2014 typename VectorizedArrayType>
2021 VectorizedArrayType>::apply_add(VectorType & dst,
2022 const VectorType &src)
const
2028 namespace Implementation
2030 template <
typename VectorizedArrayType>
2034 for (
unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
2048 typename VectorType,
2049 typename VectorizedArrayType>
2051 LaplaceOperator<dim,
2056 VectorizedArrayType>::
2057 do_operation_on_cell(
2064 const unsigned int cell)
const
2067 if (scalar_coefficient.get())
2069 Assert(scalar_coefficient->size(1) == 1 ||
2070 scalar_coefficient->size(1) == phi.n_q_points,
2071 ExcMessage(
"The number of columns in the coefficient table must "
2072 "be either 1 or the number of quadrature points " +
2074 ", but the given value was " +
2076 if (scalar_coefficient->size(1) == phi.n_q_points)
2077 for (
unsigned int q = 0; q < phi.n_q_points; ++q)
2080 (*scalar_coefficient)(cell, q)),
2081 ExcMessage(
"Coefficient must be non-negative"));
2082 phi.submit_gradient((*scalar_coefficient)(cell, q) *
2083 phi.get_gradient(q),
2089 ExcMessage(
"Coefficient must be non-negative"));
2090 const VectorizedArrayType coefficient =
2091 (*scalar_coefficient)(cell, 0);
2092 for (
unsigned int q = 0; q < phi.n_q_points; ++q)
2093 phi.submit_gradient(coefficient * phi.get_gradient(q), q);
2098 for (
unsigned int q = 0; q < phi.n_q_points; ++q)
2100 phi.submit_gradient(phi.get_gradient(q), q);
2112 typename VectorType,
2113 typename VectorizedArrayType>
2120 VectorizedArrayType>::
2125 VectorizedArrayType> & data,
2127 const VectorType & src,
2128 const std::pair<unsigned int, unsigned int> &cell_range)
const
2133 data, this->selected_rows[0]);
2134 for (
unsigned int cell = cell_range.first; cell < cell_range.second; ++cell)
2138 do_operation_on_cell(phi, cell);
2148 typename VectorType,
2149 typename VectorizedArrayType>
2156 VectorizedArrayType>::
2157 local_diagonal_cell(
2161 VectorizedArrayType> &data,
2164 const std::pair<unsigned int, unsigned int> &cell_range)
const
2170 data, this->selected_rows[0]);
2171 for (
unsigned int cell = cell_range.first; cell < cell_range.second; ++cell)
2180 do_operation_on_cell(phi, cell);
2186 local_diagonal_vector[i];
void distribute_local_to_global(VectorType &dst, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip()) const
const VectorizedArrayType * begin_dof_values() const
void read_dof_values(const VectorType &src, const unsigned int first_index=0)
const unsigned int dofs_per_component
void reinit(const unsigned int cell_batch_index)
static constexpr unsigned int static_dofs_per_cell
static constexpr unsigned int n_components
size_type index_within_set(const size_type global_index) const
bool is_element(const size_type index) const
virtual ~Base() override=default
std::vector< unsigned int > selected_rows
void Tvmult_add(VectorType &dst, const VectorType &src) const
void set_constrained_entries_to_one(VectorType &dst) const
virtual void compute_diagonal()=0
void vmult_add(VectorType &dst, const VectorType &src) const
void vmult_interface_down(VectorType &dst, const VectorType &src) const
void preprocess_constraints(VectorType &dst, const VectorType &src) const
void mult_add(VectorType &dst, const VectorType &src, const bool transpose) const
std::vector< std::vector< unsigned int > > edge_constrained_indices
const std::shared_ptr< DiagonalMatrix< VectorType > > & get_matrix_diagonal() const
void Tvmult(VectorType &dst, const VectorType &src) const
std::vector< std::vector< std::pair< value_type, value_type > > > edge_constrained_values
void initialize(std::shared_ptr< const MatrixFree< dim, value_type, VectorizedArrayType > > data, const std::vector< unsigned int > &selected_row_blocks=std::vector< unsigned int >(), const std::vector< unsigned int > &selected_column_blocks=std::vector< unsigned int >())
bool have_interface_matrices
std::vector< unsigned int > selected_columns
std::shared_ptr< const MatrixFree< dim, value_type, VectorizedArrayType > > get_matrix_free() const
void initialize(std::shared_ptr< const MatrixFree< dim, value_type, VectorizedArrayType > > data_, const std::vector< MGConstrainedDoFs > &mg_constrained_dofs, const unsigned int level, const std::vector< unsigned int > &selected_row_blocks=std::vector< unsigned int >())
const std::shared_ptr< DiagonalMatrix< VectorType > > & get_matrix_diagonal_inverse() const
void initialize(std::shared_ptr< const MatrixFree< dim, value_type, VectorizedArrayType > > data, const MGConstrainedDoFs &mg_constrained_dofs, const unsigned int level, const std::vector< unsigned int > &selected_row_blocks=std::vector< unsigned int >())
void initialize_dof_vector(VectorType &vec) const
std::shared_ptr< DiagonalMatrix< VectorType > > diagonal_entries
virtual void Tapply_add(VectorType &dst, const VectorType &src) const
std::shared_ptr< const MatrixFree< dim, value_type, VectorizedArrayType > > data
void adjust_ghost_range_if_necessary(const VectorType &vec, const bool is_row) const
virtual std::size_t memory_consumption() const
std::shared_ptr< DiagonalMatrix< VectorType > > inverse_diagonal_entries
value_type el(const unsigned int row, const unsigned int col) const
virtual void apply_add(VectorType &dst, const VectorType &src) const =0
typename VectorType::size_type size_type
void precondition_Jacobi(VectorType &dst, const VectorType &src, const value_type omega) const
typename VectorType::value_type value_type
void vmult(VectorType &dst, const VectorType &src) const
void vmult_interface_up(VectorType &dst, const VectorType &src) const
void postprocess_constraints(VectorType &dst, const VectorType &src) const
const FEEvaluationBase< dim, n_components, Number, false, VectorizedArrayType > & fe_eval
void fill_inverse_JxW_values(AlignedVector< VectorizedArrayType > &inverse_jxw) const
CellwiseInverseMassMatrix(const FEEvaluationBase< dim, n_components, Number, false, VectorizedArrayType > &fe_eval)
void transform_from_q_points_to_basis(const unsigned int n_actual_components, const VectorizedArrayType *in_array, VectorizedArrayType *out_array) const
void apply(const AlignedVector< VectorizedArrayType > &inverse_coefficient, const unsigned int n_actual_components, const VectorizedArrayType *in_array, VectorizedArrayType *out_array) const
std::shared_ptr< Table< 2, VectorizedArrayType > > get_coefficient()
typename Base< dim, VectorType, VectorizedArrayType >::value_type value_type
virtual void compute_diagonal() override
std::shared_ptr< Table< 2, VectorizedArrayType > > scalar_coefficient
void local_diagonal_cell(const MatrixFree< dim, value_type, VectorizedArrayType > &data, VectorType &dst, const VectorType &, const std::pair< unsigned int, unsigned int > &cell_range) const
void do_operation_on_cell(FEEvaluation< dim, fe_degree, n_q_points_1d, n_components, value_type > &phi, const unsigned int cell) const
void local_apply_cell(const MatrixFree< dim, value_type, VectorizedArrayType > &data, VectorType &dst, const VectorType &src, const std::pair< unsigned int, unsigned int > &cell_range) const
virtual void apply_add(VectorType &dst, const VectorType &src) const override
typename Base< dim, VectorType, VectorizedArrayType >::size_type size_type
void set_coefficient(const std::shared_ptr< Table< 2, VectorizedArrayType > > &scalar_coefficient)
virtual void clear() override
typename OperatorType::value_type value_type
SmartPointer< const OperatorType > mf_base_operator
void vmult(VectorType &dst, const VectorType &src) const
void initialize(const OperatorType &operator_in)
void Tvmult(VectorType &dst, const VectorType &src) const
void initialize_dof_vector(VectorType &vec) const
typename OperatorType::size_type size_type
typename Base< dim, VectorType, VectorizedArrayType >::size_type size_type
virtual void apply_add(VectorType &dst, const VectorType &src) const override
void local_apply_cell(const MatrixFree< dim, value_type, VectorizedArrayType > &data, VectorType &dst, const VectorType &src, const std::pair< unsigned int, unsigned int > &cell_range) const
virtual void compute_diagonal() override
typename Base< dim, VectorType, VectorizedArrayType >::value_type value_type
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
std::string to_string(const T &t)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
types::global_dof_index size_type
std::enable_if< IsBlockVector< VectorType >::value, void >::type collect_sizes(VectorType &vector)
std::enable_if< IsBlockVector< VectorType >::value, unsignedint >::type n_blocks(const VectorType &vector)
std::enable_if< IsBlockVector< VectorType >::value, typenameVectorType::BlockType & >::type subblock(VectorType &vector, unsigned int block_no)
bool non_negative(const VectorizedArrayType &n)
SymmetricTensor< 2, dim, Number > epsilon(const Tensor< 2, dim, Number > &Grad_u)
T max(const T &t, const MPI_Comm &mpi_communicator)
constexpr T pow(const T base, const int iexp)
static const unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)