16#ifndef dealii_meshworker_copy_data_h
17#define dealii_meshworker_copy_data_h
50 template <
int n_matrices = 1,
51 int n_vectors = n_matrices,
52 int n_dof_indices = n_matrices,
53 typename ScalarType =
double>
74 const std::array<unsigned int, n_vectors> & vector_sizes,
75 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes);
107 reinit(
const unsigned int index,
const unsigned int size);
124 const unsigned int size_rows,
125 const unsigned int size_columns);
130 std::array<FullMatrix<ScalarType>, n_matrices>
matrices;
135 std::array<Vector<ScalarType>, n_vectors>
vectors;
140 std::array<std::vector<types::global_dof_index>, n_dof_indices>
149 template <
int n_matrices,
154 const unsigned int size)
161 template <
int n_matrices,
167 const std::array<unsigned int, n_vectors> & vector_sizes,
168 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes)
170 for (
unsigned int i = 0; i < n_matrices; ++i)
171 matrices[i].reinit(matrix_sizes[i++]);
173 for (
unsigned int i = 0; i < n_vectors; ++i)
174 vectors[i].reinit(vector_sizes[i++]);
176 for (
unsigned int i = 0; i < n_dof_indices; ++i)
177 local_dof_indices[i].resize(dof_indices_sizes[i++]);
182 template <
int n_matrices,
188 const unsigned int size)
190 for (
auto &m : matrices)
192 for (
auto &v : vectors)
194 for (
auto &d : local_dof_indices)
200 template <
int n_matrices,
206 const unsigned int index,
207 const unsigned int size)
209 reinit(index, size, size);
214 template <
int n_matrices,
220 const unsigned int index,
221 const unsigned int size_rows,
222 const unsigned int size_columns)
226 constexpr const int max_index =
231 if (index < n_matrices)
232 matrices[
index].reinit({size_rows, size_columns});
234 if (index < n_vectors)
235 vectors[
index].reinit(size_columns);
237 if (index < n_dof_indices)
238 local_dof_indices[
index].resize(size_columns);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
typename internal::ndarray::HelperArray< T, Ns... >::type ndarray
CopyData(const CopyData &other)=default
void reinit(const unsigned int index, const unsigned int size_rows, const unsigned int size_columns)
CopyData & operator=(const CopyData &other)=default
std::array< FullMatrix< ScalarType >, n_matrices > matrices
CopyData(const unsigned int size)
std::array< Vector< ScalarType >, n_vectors > vectors
void reinit(const unsigned int size)
void reinit(const unsigned int index, const unsigned int size)
CopyData(const ndarray< unsigned int, n_matrices, 2 > &matrix_sizes, const std::array< unsigned int, n_vectors > &vector_sizes, const std::array< unsigned int, n_dof_indices > &dof_indices_sizes)
std::array< std::vector< types::global_dof_index >, n_dof_indices > local_dof_indices