Reduced Lagrange Multipliers
 
Loading...
Searching...
No Matches
vtk_utils.cc
Go to the documentation of this file.
1#include "vtk_utils.h"
2
3#include <string>
4#include <vector>
5
6#ifdef DEAL_II_WITH_VTK
8
10
11# include <deal.II/fe/fe.h>
12# include <deal.II/fe/fe_dgq.h>
14# include <deal.II/fe/fe_q.h>
15# include <deal.II/fe/fe_system.h>
16
17# include <deal.II/grid/grid_in.h>
20# include <deal.II/grid/tria.h>
24
25# include <vtkCellData.h>
26# include <vtkCleanUnstructuredGrid.h>
27# include <vtkDataArray.h>
28# include <vtkPointData.h>
29# include <vtkSmartPointer.h>
30# include <vtkUnstructuredGrid.h>
31# include <vtkUnstructuredGridReader.h>
32
33# include <stdexcept>
34
35namespace VTKUtils
36{
37 template <int dim, int spacedim>
38 void
39 read_vtk(const std::string &vtk_filename,
40 Triangulation<dim, spacedim> &tria,
41 const bool cleanup)
42 {
43 auto reader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
44 reader->SetFileName(vtk_filename.c_str());
45 reader->Update();
46 vtkUnstructuredGrid *grid = reader->GetOutput();
47 AssertThrow(grid, ExcMessage("Failed to read VTK file: " + vtk_filename));
48
49 auto cleaner = vtkSmartPointer<vtkCleanUnstructuredGrid>::New();
50
51 // Cleanup the triangulation if requested
52 if (cleanup)
53 {
54 cleaner->SetInputData(grid);
55 cleaner->Update();
56 grid = cleaner->GetOutput();
57 AssertThrow(grid,
58 ExcMessage("Failed to clean VTK file: " + vtk_filename));
59 }
60
61 // Read points
62 vtkPoints *vtk_points = grid->GetPoints();
63 const vtkIdType n_points = vtk_points->GetNumberOfPoints();
64 std::vector<Point<spacedim>> points(n_points);
65 for (vtkIdType i = 0; i < n_points; ++i)
66 {
67 std::array<double, 3> coords = {{0, 0, 0}};
68 vtk_points->GetPoint(i, coords.data());
69 for (unsigned int d = 0; d < spacedim; ++d)
70 points[i][d] = coords[d];
71 }
72
73 // Read cells
74 std::vector<CellData<dim>> cells;
75 const vtkIdType n_cells = grid->GetNumberOfCells();
76 for (vtkIdType i = 0; i < n_cells; ++i)
77 {
78 vtkCell *cell = grid->GetCell(i);
79 if constexpr (dim == 1)
80 {
81 if (cell->GetCellType() != VTK_LINE)
82 AssertThrow(false,
83 ExcMessage(
84 "Unsupported cell type in 1D VTK file: only "
85 "VTK_LINE is supported."));
86 AssertThrow(cell->GetNumberOfPoints() == 2,
87 ExcMessage(
88 "Only line cells with 2 points are supported."));
89 CellData<1> cell_data;
90 for (unsigned int j = 0; j < 2; ++j)
91 cell_data.vertices[j] = cell->GetPointId(j);
92 cell_data.material_id = 0;
93 cells.push_back(cell_data);
94 }
95 else if constexpr (dim == 2)
96 {
97 if (cell->GetCellType() == VTK_QUAD)
98 {
99 AssertThrow(cell->GetNumberOfPoints() == 4,
100 ExcMessage(
101 "Only quad cells with 4 points are supported."));
102 CellData<2> cell_data;
103 for (unsigned int j = 0; j < 4; ++j)
104 cell_data.vertices[j] = cell->GetPointId(j);
105 cell_data.material_id = 0;
106 cells.push_back(cell_data);
107 }
108 else if (cell->GetCellType() == VTK_TRIANGLE)
109 {
111 cell->GetNumberOfPoints() == 3,
112 ExcMessage(
113 "Only triangle cells with 3 points are supported."));
114 CellData<2> cell_data;
115 for (unsigned int j = 0; j < 3; ++j)
116 cell_data.vertices[j] = cell->GetPointId(j);
117 cell_data.material_id = 0;
118 cells.push_back(cell_data);
119 }
120 else
121 AssertThrow(false,
122 ExcMessage(
123 "Unsupported cell type in 2D VTK file: only "
124 "VTK_QUAD and VTK_TRIANGLE are supported."));
125 }
126 else if constexpr (dim == 3)
127 {
128 if (cell->GetCellType() == VTK_HEXAHEDRON)
129 {
130 AssertThrow(cell->GetNumberOfPoints() == 8,
131 ExcMessage(
132 "Only hex cells with 8 points are supported."));
133 CellData<3> cell_data;
134 for (unsigned int j = 0; j < 8; ++j)
135 cell_data.vertices[j] = cell->GetPointId(j);
136 cell_data.material_id = 0;
137 // Numbering of vertices in VTK files is different from deal.II
138 std::swap(cell_data.vertices[2], cell_data.vertices[3]);
139 std::swap(cell_data.vertices[6], cell_data.vertices[7]);
140 cells.push_back(cell_data);
141 }
142 else if (cell->GetCellType() == VTK_TETRA)
143 {
145 cell->GetNumberOfPoints() == 4,
146 ExcMessage(
147 "Only tetrahedron cells with 4 points are supported."));
148 CellData<3> cell_data;
149 for (unsigned int j = 0; j < 4; ++j)
150 cell_data.vertices[j] = cell->GetPointId(j);
151 cell_data.material_id = 0;
152 cells.push_back(cell_data);
153 }
154 else if (cell->GetCellType() == VTK_WEDGE)
155 {
156 AssertThrow(cell->GetNumberOfPoints() == 6,
157 ExcMessage(
158 "Only prism cells with 6 points are supported."));
159 CellData<3> cell_data;
160 for (unsigned int j = 0; j < 6; ++j)
161 cell_data.vertices[j] = cell->GetPointId(j);
162 cell_data.material_id = 0;
163 cells.push_back(cell_data);
164 }
165 else if (cell->GetCellType() == VTK_PYRAMID)
166 {
168 cell->GetNumberOfPoints() == 5,
169 ExcMessage(
170 "Only pyramid cells with 5 points are supported."));
171 CellData<3> cell_data;
172 for (unsigned int j = 0; j < 5; ++j)
173 cell_data.vertices[j] = cell->GetPointId(j);
174 cell_data.material_id = 0;
175 cells.push_back(cell_data);
176 }
177 else
179 false,
180 ExcMessage(
181 "Unsupported cell type in 3D VTK file: only "
182 "VTK_HEXAHEDRON, VTK_TETRA, VTK_WEDGE, and VTK_PYRAMID are supported."));
183 }
184 else
185 {
186 AssertThrow(false, ExcMessage("Unsupported dimension."));
187 }
188 }
189
190 // Create triangulation
191 tria.create_triangulation(points, cells, SubCellData());
192 }
193
194 void
195 read_cell_data(const std::string &vtk_filename,
196 const std::string &cell_data_name,
197 Vector<double> &output_vector)
198 {
199 auto reader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
200 reader->SetFileName(vtk_filename.c_str());
201 reader->Update();
202 vtkUnstructuredGrid *grid = reader->GetOutput();
203 AssertThrow(grid, ExcMessage("Failed to read VTK file: " + vtk_filename));
204 vtkDataArray *data_array =
205 grid->GetCellData()->GetArray(cell_data_name.c_str());
206 AssertThrow(data_array,
207 ExcMessage("Cell data array '" + cell_data_name +
208 "' not found in VTK file: " + vtk_filename));
209 vtkIdType n_tuples = data_array->GetNumberOfTuples();
210 int n_components = data_array->GetNumberOfComponents();
211 output_vector.reinit(n_tuples * n_components);
212 for (vtkIdType i = 0; i < n_tuples; ++i)
213 for (int j = 0; j < n_components; ++j)
214 output_vector[i * n_components + j] = data_array->GetComponent(i, j);
215 }
216
217 void
218 read_vertex_data(const std::string &vtk_filename,
219 const std::string &point_data_name,
220 Vector<double> &output_vector)
221 {
222 auto reader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
223 reader->SetFileName(vtk_filename.c_str());
224 reader->Update();
225 vtkUnstructuredGrid *grid = reader->GetOutput();
226 AssertThrow(grid, ExcMessage("Failed to read VTK file: " + vtk_filename));
227 vtkDataArray *data_array =
228 grid->GetPointData()->GetArray(point_data_name.c_str());
229 AssertThrow(data_array,
230 ExcMessage("Point data array '" + point_data_name +
231 "' not found in VTK file: " + vtk_filename));
232 vtkIdType n_tuples = data_array->GetNumberOfTuples();
233 int n_components = data_array->GetNumberOfComponents();
234 output_vector.reinit(n_tuples * n_components);
235 for (vtkIdType i = 0; i < n_tuples; ++i)
236 for (int j = 0; j < n_components; ++j)
237 output_vector[i * n_components + j] = data_array->GetComponent(i, j);
238 }
239
240 void
241 read_data(const std::string &vtk_filename, Vector<double> &output_vector)
242 {
243 auto reader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
244 reader->SetFileName(vtk_filename.c_str());
245 reader->Update();
246 vtkUnstructuredGrid *grid = reader->GetOutput();
247 AssertThrow(grid, ExcMessage("Failed to read VTK file: " + vtk_filename));
248
249 std::vector<double> data;
250
251 vtkPointData *point_data = grid->GetPointData();
252 if (point_data)
253 {
254 for (int i = 0; i < point_data->GetNumberOfArrays(); ++i)
255 {
256 vtkDataArray *data_array = point_data->GetArray(i);
257 if (!data_array)
258 continue;
259 vtkIdType n_tuples = data_array->GetNumberOfTuples();
260 int n_components = data_array->GetNumberOfComponents();
261 unsigned int current_size = data.size();
262 data.resize(current_size + n_tuples * n_components, 0.0);
263 for (vtkIdType tuple_idx = 0; tuple_idx < n_tuples; ++tuple_idx)
264 for (int comp_idx = 0; comp_idx < n_components; ++comp_idx)
265 data[current_size + tuple_idx * n_components + comp_idx] =
266 data_array->GetComponent(tuple_idx, comp_idx);
267 }
268 }
269
270 vtkCellData *cell_data = grid->GetCellData();
271 if (cell_data)
272 {
273 for (int i = 0; i < cell_data->GetNumberOfArrays(); ++i)
274 {
275 vtkDataArray *data_array = cell_data->GetArray(i);
276 if (!data_array)
277 continue;
278 vtkIdType n_tuples = data_array->GetNumberOfTuples();
279 int n_components = data_array->GetNumberOfComponents();
280 unsigned int current_size = data.size();
281 data.resize(current_size + n_tuples * n_components, true);
282 for (vtkIdType tuple_idx = 0; tuple_idx < n_tuples; ++tuple_idx)
283 for (int comp_idx = 0; comp_idx < n_components; ++comp_idx)
284 data[current_size + tuple_idx * n_components + comp_idx] =
285 data_array->GetComponent(tuple_idx, comp_idx);
286 }
287 }
288 output_vector.reinit(data.size());
289 std::copy(data.begin(), data.end(), output_vector.begin());
290 }
291
292 template <int dim, int spacedim>
293 std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
294 std::vector<std::string>>
295 vtk_to_finite_element(const std::string &vtk_filename)
296 {
297 std::vector<std::string> data_names;
298 auto reader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
299 reader->SetFileName(vtk_filename.c_str());
300 reader->Update();
301 vtkUnstructuredGrid *grid = reader->GetOutput();
302 AssertThrow(grid, ExcMessage("Failed to read VTK file: " + vtk_filename));
303
304 vtkCellData *cell_data = grid->GetCellData();
305 vtkPointData *point_data = grid->GetPointData();
306
307 std::vector<std::shared_ptr<FiniteElement<dim, spacedim>>> fe_collection;
308 std::vector<unsigned int> n_components_collection;
309
310 // Query point data fields
311 for (int i = 0; i < point_data->GetNumberOfArrays(); ++i)
312 {
313 vtkDataArray *arr = point_data->GetArray(i);
314 if (!arr)
315 continue;
316 std::string name = arr->GetName();
317 int n_comp = arr->GetNumberOfComponents();
318 if (n_comp == 1)
319 fe_collection.push_back(std::make_shared<FE_Q<dim, spacedim>>(1));
320 else
321 // Use FESystem for vector fields
322 fe_collection.push_back(
323 std::make_shared<FESystem<dim, spacedim>>(FE_Q<dim, spacedim>(1),
324 n_comp));
325 n_components_collection.push_back(n_comp);
326 data_names.push_back(name);
327 }
328
329 // Query cell data fields
330 for (int i = 0; i < cell_data->GetNumberOfArrays(); ++i)
331 {
332 vtkDataArray *arr = cell_data->GetArray(i);
333 if (!arr)
334 continue;
335 std::string name = arr->GetName();
336 int n_comp = arr->GetNumberOfComponents();
337 if (n_comp == 1)
338 fe_collection.push_back(std::make_shared<FE_DGQ<dim, spacedim>>(0));
339 else
340 // Use FESystem for vector fields
341 fe_collection.push_back(
342 std::make_shared<FESystem<dim, spacedim>>(FE_DGQ<dim, spacedim>(0),
343 n_comp));
344 n_components_collection.push_back(n_comp);
345 data_names.push_back(name);
346 }
347
348
349 // Build a FESystem with all fields
350 std::vector<const FiniteElement<dim, spacedim> *> fe_ptrs;
351 std::vector<unsigned int> multiplicities;
352 for (const auto &fe : fe_collection)
353 {
354 fe_ptrs.push_back(fe.get());
355 multiplicities.push_back(1);
356 }
357 if (fe_ptrs.empty())
358 return std::make_pair(std::make_unique<FE_Nothing<dim, spacedim>>(),
359 std::vector<std::string>());
360 else
361 {
362 return std::make_pair(
363 std::make_unique<FESystem<dim, spacedim>>(fe_ptrs, multiplicities),
364 data_names);
365 }
366 }
367
368
369
370 template <int dim, int spacedim>
371 void
372 read_vtk(const std::string &vtk_filename,
373 DoFHandler<dim, spacedim> &dof_handler,
374 Vector<double> &output_vector,
375 std::vector<std::string> &data_names)
376 {
377 // Get a non-const reference to the triangulation
378 auto &tria = const_cast<Triangulation<dim, spacedim> &>(
379 dof_handler.get_triangulation());
380
381 // Make sure the triangulation is actually a serial triangulation
382 auto parallel_tria =
383 dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(&tria);
384 AssertThrow(parallel_tria == nullptr,
385 ExcMessage(
386 "The input triangulation must be a serial triangulation."));
387
388 // Clear the triangulation to ensure it is empty before reading
389 tria.clear();
390 // Read the mesh from the VTK file
391 read_vtk(vtk_filename, tria, /*cleanup=*/true);
392
393 Vector<double> raw_data_vector;
394 read_data(vtk_filename, raw_data_vector);
395
396 auto [fe, data_names_from_fe] =
397 vtk_to_finite_element<dim, spacedim>(vtk_filename);
398
399 dof_handler.distribute_dofs(*fe);
400 output_vector.reinit(dof_handler.n_dofs());
401 data_to_dealii_vector(tria, raw_data_vector, dof_handler, output_vector);
402
403 AssertDimension(dof_handler.n_dofs(), output_vector.size());
404 AssertDimension(dof_handler.get_fe().n_blocks(), data_names_from_fe.size());
405 data_names = data_names_from_fe;
406 }
407
408 template <int dim, int spacedim>
409 void
410 serial_vector_to_distributed_vector(
411 const DoFHandler<dim, spacedim> &serial_dh,
412 const DoFHandler<dim, spacedim> &parallel_dh,
413 const Vector<double> &serial_vec,
414 LinearAlgebra::distributed::Vector<double> &parallel_vec)
415 {
416 AssertDimension(serial_vec.size(), serial_dh.n_dofs());
417 AssertDimension(parallel_vec.size(), parallel_dh.n_dofs());
418 AssertDimension(parallel_dh.n_dofs(), serial_dh.n_dofs());
419
420 // Check that the two fe are the same
421 AssertThrow(serial_dh.get_fe() == parallel_dh.get_fe(),
422 ExcMessage("The finite element systems of the serial and "
423 "parallel DoFHandlers must be the same."));
424
425 std::vector<types::global_dof_index> serial_dof_indices(
426 serial_dh.get_fe().n_dofs_per_cell());
427 std::vector<types::global_dof_index> parallel_dof_indices(
428 parallel_dh.get_fe().n_dofs_per_cell());
429
430 // Assumption: serial and parallel meshes have the same ordering of cells.
431 auto serial_cell = serial_dh.begin_active();
432 auto parallel_cell = parallel_dh.begin_active();
433 for (; parallel_cell != parallel_dh.end(); ++parallel_cell)
434 if (parallel_cell->is_locally_owned())
435 {
436 // Advanced serial cell until we reach the same cell index of the
437 // parallel cell
438 while (serial_cell->id() < parallel_cell->id())
439 ++serial_cell;
440 serial_cell->get_dof_indices(serial_dof_indices);
441 parallel_cell->get_dof_indices(parallel_dof_indices);
442 unsigned int serial_index = 0;
443 for (const auto &i : parallel_dof_indices)
444 {
445 if (parallel_vec.in_local_range(i))
446 {
447 parallel_vec[i] =
448 serial_vec[serial_dof_indices[serial_index]];
449 }
450 ++serial_index;
451 }
452 }
453 parallel_vec.compress(VectorOperation::insert);
454 }
455
456 template <int dim, int spacedim>
457 std::vector<types::global_vertex_index>
458 distributed_to_serial_vertex_indices(
459 const Triangulation<dim, spacedim> &serial_tria,
460 const Triangulation<dim, spacedim> &parallel_tria)
461 {
462 const auto locally_owned_indices =
464 std::vector<types::global_vertex_index>
465 distributed_to_serial_vertex_indices(parallel_tria.n_vertices(),
467
468 // Assumption: serial and parallel meshes have the same ordering of cells.
469 auto serial_cell = serial_tria.begin_active();
470 auto parallel_cell = parallel_tria.begin_active();
471 for (; parallel_cell != parallel_tria.end(); ++parallel_cell)
472 if (parallel_cell->is_locally_owned())
473 {
474 // Advanced serial cell until we reach the same cell index of the
475 // parallel cell
476 while (serial_cell->id() < parallel_cell->id())
477 ++serial_cell;
478 for (const unsigned int &v : serial_cell->vertex_indices())
479 {
480 const auto serial_index = serial_cell->vertex_index(v);
481 const auto parallel_index = parallel_cell->vertex_index(v);
482 if (locally_owned_indices[parallel_index])
483 distributed_to_serial_vertex_indices[parallel_index] =
484 serial_index;
485 }
486 }
487 return distributed_to_serial_vertex_indices;
488 }
489} // namespace VTKUtils
490
491
492// Explicit instantiation for 1D, 2D and 3D
493
494template void
495VTKUtils::read_vtk(const std::string &, Triangulation<1, 1> &, const bool);
496template void
497VTKUtils::read_vtk(const std::string &, Triangulation<1, 2> &, const bool);
498template void
499VTKUtils::read_vtk(const std::string &, Triangulation<1, 3> &, const bool);
500template void
501VTKUtils::read_vtk(const std::string &, Triangulation<2, 2> &, const bool);
502template void
503VTKUtils::read_vtk(const std::string &, Triangulation<2, 3> &, const bool);
504template void
505VTKUtils::read_vtk(const std::string &, Triangulation<3, 3> &, const bool);
506
507template std::pair<std::unique_ptr<FiniteElement<1, 1>>,
508 std::vector<std::string>>
509VTKUtils::vtk_to_finite_element(const std::string &);
510template std::pair<std::unique_ptr<FiniteElement<1, 2>>,
511 std::vector<std::string>>
512VTKUtils::vtk_to_finite_element(const std::string &);
513template std::pair<std::unique_ptr<FiniteElement<1, 3>>,
514 std::vector<std::string>>
515VTKUtils::vtk_to_finite_element(const std::string &);
516template std::pair<std::unique_ptr<FiniteElement<2, 2>>,
517 std::vector<std::string>>
518VTKUtils::vtk_to_finite_element(const std::string &);
519template std::pair<std::unique_ptr<FiniteElement<2, 3>>,
520 std::vector<std::string>>
521VTKUtils::vtk_to_finite_element(const std::string &);
522template std::pair<std::unique_ptr<FiniteElement<3, 3>>,
523 std::vector<std::string>>
524VTKUtils::vtk_to_finite_element(const std::string &);
525
526template void
527VTKUtils::read_vtk(const std::string &,
530 std::vector<std::string> &);
531template void
532VTKUtils::read_vtk(const std::string &,
535 std::vector<std::string> &);
536template void
537VTKUtils::read_vtk(const std::string &,
540 std::vector<std::string> &);
541template void
542VTKUtils::read_vtk(const std::string &,
545 std::vector<std::string> &);
546template void
547VTKUtils::read_vtk(const std::string &,
550 std::vector<std::string> &);
551template void
552VTKUtils::read_vtk(const std::string &,
555 std::vector<std::string> &);
556
557template void
558VTKUtils::serial_vector_to_distributed_vector(
559 const DoFHandler<1, 1> &,
560 const DoFHandler<1, 1> &,
561 const Vector<double> &,
563template void
564VTKUtils::serial_vector_to_distributed_vector(
565 const DoFHandler<1, 2> &,
566 const DoFHandler<1, 2> &,
567 const Vector<double> &,
569template void
570VTKUtils::serial_vector_to_distributed_vector(
571 const DoFHandler<1, 3> &,
572 const DoFHandler<1, 3> &,
573 const Vector<double> &,
575template void
576VTKUtils::serial_vector_to_distributed_vector(
577 const DoFHandler<2, 2> &,
578 const DoFHandler<2, 2> &,
579 const Vector<double> &,
581template void
582VTKUtils::serial_vector_to_distributed_vector(
583 const DoFHandler<2, 3> &,
584 const DoFHandler<2, 3> &,
585 const Vector<double> &,
587template void
588VTKUtils::serial_vector_to_distributed_vector(
589 const DoFHandler<3, 3> &,
590 const DoFHandler<3, 3> &,
591 const Vector<double> &,
593
594template std::vector<types::global_vertex_index>
595VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<1, 1> &,
596 const Triangulation<1, 1> &);
597template std::vector<types::global_vertex_index>
598VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<1, 2> &,
599 const Triangulation<1, 2> &);
600template std::vector<types::global_vertex_index>
601VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<1, 3> &,
602 const Triangulation<1, 3> &);
603template std::vector<types::global_vertex_index>
604VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<2, 2> &,
605 const Triangulation<2, 2> &);
606template std::vector<types::global_vertex_index>
607VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<2, 3> &,
608 const Triangulation<2, 3> &);
609template std::vector<types::global_vertex_index>
610VTKUtils::distributed_to_serial_vertex_indices(const Triangulation<3, 3> &,
611 const Triangulation<3, 3> &);
612
613
614#endif // DEAL_II_WITH_VTK
cell_iterator end() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
void distribute_dofs(const FiniteElement< dim, spacedim > &fe)
const Triangulation< dim, spacedim > & get_triangulation() const
active_cell_iterator begin_active(const unsigned int level=0) const
types::global_dof_index n_dofs() const
unsigned int n_dofs_per_cell() const
unsigned int n_blocks() const
void compress(VectorOperation::values operation)
virtual size_type size() const override
bool in_local_range(const size_type global_index) const
virtual void clear()
virtual void create_triangulation(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata)
cell_iterator end() const
unsigned int n_vertices() const
active_cell_iterator begin_active(const unsigned int level=0) const
virtual size_type size() const override
virtual void reinit(const size_type N, const bool omit_zeroing_entries=false)
iterator begin()
#define AssertDimension(dim1, dim2)
#define AssertThrow(cond, exc)
std::vector< index_type > data
std::vector< bool > get_locally_owned_vertices(const Triangulation< dim, spacedim > &triangulation)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
constexpr unsigned int invalid_unsigned_int
std::vector< unsigned int > vertices
types::material_id material_id