15#ifndef dealii_meshworker_copy_data_h
16#define dealii_meshworker_copy_data_h
49 template <
int n_matrices = 1,
50 int n_vectors = n_matrices,
51 int n_dof_indices = n_matrices,
52 typename ScalarType =
double>
73 const std::array<unsigned int, n_vectors> &vector_sizes,
74 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes);
106 reinit(
const unsigned int index,
const unsigned int size);
123 const unsigned int size_rows,
124 const unsigned int size_columns);
129 std::array<FullMatrix<ScalarType>, n_matrices>
matrices;
134 std::array<Vector<ScalarType>, n_vectors>
vectors;
139 std::array<std::vector<types::global_dof_index>, n_dof_indices>
148 template <
int n_matrices,
153 const unsigned int size)
160 template <
int n_matrices,
166 const std::array<unsigned int, n_vectors> &vector_sizes,
167 const std::array<unsigned int, n_dof_indices> &dof_indices_sizes)
169 for (
unsigned int i = 0; i < n_matrices; ++i)
170 matrices[i].reinit(matrix_sizes[i++]);
172 for (
unsigned int i = 0; i < n_vectors; ++i)
173 vectors[i].reinit(vector_sizes[i++]);
175 for (
unsigned int i = 0; i < n_dof_indices; ++i)
176 local_dof_indices[i].resize(dof_indices_sizes[i++]);
181 template <
int n_matrices,
187 const unsigned int size)
189 for (
auto &m : matrices)
191 for (
auto &v : vectors)
193 for (
auto &d : local_dof_indices)
199 template <
int n_matrices,
205 const unsigned int index,
206 const unsigned int size)
208 reinit(index, size, size);
213 template <
int n_matrices,
219 const unsigned int index,
220 const unsigned int size_rows,
221 const unsigned int size_columns)
225 constexpr const int max_index =
230 if (index < n_matrices)
231 matrices[
index].reinit({size_rows, size_columns});
233 if (index < n_vectors)
234 vectors[
index].reinit(size_columns);
236 if (index < n_dof_indices)
237 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