// vertices, so do this on a separate task and when wanting to write out the
// data, we wait for that task to finish
Table<2, double> data_vectors(n_data_sets, n_nodes);
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, double> &) =
- &write_gmv_reorder_data_vectors<dim, spacedim>;
- Threads::Task<> reorder_task =
- Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::Task<> reorder_task =
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
//-----------------------------
// first make up a list of used vertices along with their coordinates
// data, we wait for that task to finish
Table<2, double> data_vectors(n_data_sets, n_nodes);
-
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, double> &) =
- &write_gmv_reorder_data_vectors<dim, spacedim>;
- Threads::Task<> reorder_task =
- Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::Task<> reorder_task =
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
//-----------------------------
// first make up a list of used vertices along with their coordinates
// vertices, so do this on a separate task and when wanting to write out the
// data, we wait for that task to finish
Table<2, double> data_vectors(n_data_sets, n_nodes);
-
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, double> &) =
- &write_gmv_reorder_data_vectors<dim, spacedim>;
- Threads::Task<> reorder_task =
- Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::Task<> reorder_task =
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
//-----------------------------
// first make up a list of used vertices along with their coordinates
// vertices, so do this on a separate task and when wanting to write out the
// data, we wait for that task to finish
Table<2, double> data_vectors(n_data_sets, n_nodes);
-
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, double> &) =
- &write_gmv_reorder_data_vectors<dim, spacedim>;
- Threads::Task<> reorder_task =
- Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::Task<> reorder_task =
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
//-----------------------------
// first make up a list of used vertices along with their coordinates
// data, we wait for that task to finish
Table<2, float> data_vectors(n_data_sets, n_nodes);
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, float> &) =
- &write_gmv_reorder_data_vectors<dim, spacedim, float>;
Threads::Task<> reorder_task =
- Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
//-----------------------------
// first make up a list of used vertices along with their coordinates
#endif
} // namespace
+
+
template <int dim, int spacedim>
void
DataOutBase::write_filtered_data(
{
const unsigned int n_data_sets = data_names.size();
Table<2, double> data_vectors;
- Threads::Task<> reorder_task;
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the times,
std::tie(n_nodes, std::ignore) = count_nodes_and_cells(patches);
data_vectors = Table<2, double>(n_data_sets, n_nodes);
- void (*fun_ptr)(const std::vector<Patch<dim, spacedim>> &,
- Table<2, double> &) =
- &DataOutBase::template write_gmv_reorder_data_vectors<dim, spacedim>;
- reorder_task = Threads::new_task(fun_ptr, patches, data_vectors);
+ Threads::Task<> reorder_task =
+ Threads::new_task([&patches, &data_vectors]() mutable {
+ write_gmv_reorder_data_vectors(patches, data_vectors);
+ });
// Write the nodes/cells to the DataOutFilter object.
write_nodes(patches, filtered_data);