16 #ifndef dealii_meshworker_copy_data_h 17 #define dealii_meshworker_copy_data_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/types.h> 23 #include <deal.II/lac/full_matrix.h> 24 #include <deal.II/lac/vector.h> 28 DEAL_II_NAMESPACE_OPEN
49 template <
int n_matrices = 1,
50 int n_vectors = n_matrices,
51 int n_dof_indices = n_matrices>
64 const std::array<std::array<unsigned int, 2>, n_matrices> &matrix_sizes,
65 const std::array<unsigned int, n_vectors> & vector_sizes,
66 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes);
90 std::array<FullMatrix<double>, n_matrices>
matrices;
95 std::array<Vector<double>, n_vectors>
vectors;
100 std::array<std::vector<types::global_dof_index>, n_dof_indices>
109 template <
int n_matrices,
int n_vectors,
int n_dof_indices>
111 const unsigned int size)
113 for (
auto &m : matrices)
114 m.reinit({size, size});
115 for (
auto &v : vectors)
117 for (
auto &d : local_dof_indices)
123 template <
int n_matrices,
int n_vectors,
int n_dof_indices>
125 const std::array<std::array<unsigned int, 2>, n_matrices> &matrix_sizes,
126 const std::array<unsigned int, n_vectors> & vector_sizes,
127 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes)
129 for (
unsigned int i = 0; i < n_matrices; ++i)
130 matrices[i].reinit(matrix_sizes[i++]);
132 for (
unsigned int i = 0; i < n_vectors; ++i)
133 vectors[i].reinit(vector_sizes[i++]);
135 for (
unsigned int i = 0; i < n_dof_indices; ++i)
136 local_dof_indices[i].resize(dof_indices_sizes[i++]);
141 template <
int n_matrices,
int n_vectors,
int n_dof_indices>
147 ExcMessage(
"You should only call this method with " 150 for (
auto &m : matrices)
152 for (
auto &v : vectors)
154 for (
auto &d : local_dof_indices)
162 DEAL_II_NAMESPACE_CLOSE
CopyData(const unsigned int size)
std::array< FullMatrix< double >, n_matrices > matrices
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
void operator=(const double &number)
std::array< std::vector< types::global_dof_index >, n_dof_indices > local_dof_indices
const types::global_dof_index invalid_dof_index
std::array< Vector< double >, n_vectors > vectors