41 namespace DataOutFacesImplementation
43 template <
int dim,
int spacedim>
45 const unsigned int n_datasets,
46 const unsigned int n_subdivisions,
47 const std::vector<unsigned int> &n_postprocessor_outputs,
53 :
internal::DataOutImplementation::ParallelDataBase<dim, spacedim>(
56 n_postprocessor_outputs,
69 template <
int dim,
int spacedim>
75 patches.push_back(patch);
76 patches.back().patch_index = patches.size() - 1;
83 template <
int dim,
typename DoFHandlerType>
92 template <
int dim,
typename DoFHandlerType>
106 for (
unsigned int vertex = 0;
107 vertex <
GeometryInfo<dimension - 1>::vertices_per_cell;
111 cell_and_face->first,
114 cell_and_face->second,
116 cell_and_face->first->face_orientation(cell_and_face->second),
117 cell_and_face->first->face_flip(cell_and_face->second),
118 cell_and_face->first->face_rotation(cell_and_face->second))));
123 cell_and_face->first,
124 cell_and_face->second);
132 const std::vector<Point<dimension>> &q_points =
141 for (
unsigned int i = 0; i < dimension; ++i)
142 for (
unsigned int q = 0; q < n_q_points; ++q)
143 patch.
data(patch.
data.
size(0) - dimension + i, q) = q_points[q][i];
146 unsigned int offset = 0;
149 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
154 this_fe_patch_values.
get_fe().n_components();
156 this->dof_data[dataset]->postprocessor;
157 if (postprocessor !=
nullptr)
169 this->dof_data[dataset]->get_function_values(
170 this_fe_patch_values,
175 this->dof_data[dataset]->get_function_gradients(
176 this_fe_patch_values,
181 this->dof_data[dataset]->get_function_hessians(
182 this_fe_patch_values,
195 const typename DoFHandlerType::active_cell_iterator dh_cell(
196 &cell_and_face->first->get_triangulation(),
197 cell_and_face->first->level(),
198 cell_and_face->first->index(),
199 this->dof_data[dataset]->dof_handler);
213 this->dof_data[dataset]->get_function_values(
214 this_fe_patch_values,
219 this->dof_data[dataset]->get_function_gradients(
220 this_fe_patch_values,
225 this->dof_data[dataset]->get_function_hessians(
226 this_fe_patch_values,
239 const typename DoFHandlerType::active_cell_iterator dh_cell(
240 &cell_and_face->first->get_triangulation(),
241 cell_and_face->first->level(),
242 cell_and_face->first->index(),
243 this->dof_data[dataset]->dof_handler);
252 for (
unsigned int q = 0; q < n_q_points; ++q)
253 for (
unsigned int component = 0;
254 component < this->dof_data[dataset]->n_output_variables;
256 patch.
data(offset + component, q) =
265 this->dof_data[dataset]->get_function_values(
266 this_fe_patch_values,
269 for (
unsigned int q = 0; q < n_q_points; ++q)
270 patch.
data(offset, q) =
276 this->dof_data[dataset]->get_function_values(
277 this_fe_patch_values,
280 for (
unsigned int component = 0; component <
n_components;
282 for (
unsigned int q = 0; q < n_q_points; ++q)
283 patch.
data(offset + component, q) =
287 offset += this->dof_data[dataset]->n_output_variables;
291 for (
unsigned int dataset = 0; dataset < this->cell_data.size();
298 cell_and_face->first->is_active(),
300 "The current function is trying to generate cell-data output "
301 "for a face that does not belong to an active cell. This is "
303 const unsigned int cell_number =
306 active_cell_iterator(cell_and_face->first));
308 const double value = this->cell_data[dataset]->get_cell_data_value(
311 for (
unsigned int q = 0; q < n_q_points; ++q)
319 template <
int dim,
typename DoFHandlerType>
322 const unsigned int n_subdivisions_)
329 template <
int dim,
typename DoFHandlerType>
333 const unsigned int n_subdivisions_)
338 const unsigned int n_subdivisions =
339 (n_subdivisions_ != 0) ? n_subdivisions_ : this->default_subdivisions;
341 Assert(n_subdivisions >= 1,
348 this->validate_dataset_names();
350 unsigned int n_datasets = this->cell_data.size();
351 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
352 n_datasets += this->dof_data[i]->n_output_variables;
358 std::vector<FaceDescriptor> all_faces;
362 face = next_face(face))
363 all_faces.push_back(face);
366 this->patches.clear();
367 this->patches.reserve(all_faces.size());
371 std::vector<unsigned int> n_postprocessor_outputs(this->dof_data.size());
372 for (
unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
373 if (this->dof_data[dataset]->postprocessor)
374 n_postprocessor_outputs[dataset] =
375 this->dof_data[dataset]->n_output_variables;
377 n_postprocessor_outputs[dataset] = 0;
380 for (
unsigned int i = 0; i < this->dof_data.size(); ++i)
381 if (this->dof_data[i]->postprocessor)
383 this->dof_data[i]->postprocessor->get_needed_update_flags();
387 thread_data(n_datasets,
389 n_postprocessor_outputs,
395 sample_patch.data.reinit(
396 n_datasets, Utilities::fixed_power<dimension - 1>(n_subdivisions + 1));
401 all_faces.data() + all_faces.size(),
406 this->build_one_patch(cell_and_face, data, patch);
409 internal::DataOutFacesImplementation::
410 append_patch_to_list<dim, space_dimension>(patch, this->patches);
418 template <
int dim,
typename DoFHandlerType>
426 if (cell->is_locally_owned())
428 if (!surface_only || cell->face(f)->at_boundary())
439 template <
int dim,
typename DoFHandlerType>
448 for (
unsigned int f = face.second + 1;
451 if (!surface_only || face.first->face(f)->at_boundary())
463 active_cell = face.first;
473 if (active_cell->is_locally_owned())
475 if (!surface_only || active_cell->face(f)->at_boundary())
477 face.first = active_cell;
496 #include "data_out_faces.inst"