template <int> class FEValuesBase;
+namespace internal
+{
+ namespace DataOut
+ {
+ /**
+ * A data structure that holds
+ * all data needed in one thread
+ * when building patches in
+ * parallel. These data
+ * structures are created
+ * globally rather than on each
+ * cell to avoid allocation of
+ * memory in the threads.
+ *
+ * The #cell_to_patch_index_map is
+ * an array that stores for index
+ * <tt>[i][j]</tt> the number of the
+ * patch that associated with the
+ * cell with index @p j on level
+ * @p i. This information is set
+ * up prior to generation of the
+ * patches, and is needed to
+ * generate neighborship
+ * information.
+ *
+ * This structure is used by
+ * several of the DataOut*
+ * classes, not all of which use
+ * all fields.
+ */
+ template <int dim, int spacedim>
+ struct ParallelData
+ {
+ unsigned int n_threads;
+ unsigned int this_thread;
+ unsigned int n_components;
+ unsigned int n_datasets;
+ unsigned int n_subdivisions;
+ unsigned int n_patches_per_circle;
+ SmartPointer<const Mapping<dim> > mapping;
+ std::vector<double> patch_values;
+ std::vector<Vector<double> > patch_values_system;
+ std::vector<Tensor<1,spacedim> > patch_gradients;
+ std::vector<std::vector<Tensor<1,spacedim> > > patch_gradients_system;
+ std::vector<Tensor<2,spacedim> > patch_hessians;
+ std::vector<std::vector<Tensor<2,spacedim> > > patch_hessians_system;
+ std::vector<Point<spacedim> > dummy_normals;
+ std::vector<Point<dim> > patch_normals;
+ std::vector<std::vector<Vector<double> > > postprocessed_values;
+
+ std::vector<std::vector<unsigned int> > *cell_to_patch_index_map;
+ };
+ }
+}
+
+
//TODO: Most of the documentation of DataOut_DoFData applies to DataOut.
/**
<< ", is not valid.");
private:
- /**
- * All data needed in one thread
- * is gathered in the struct
- * Data. The data is handled
- * globally to avoid allocation
- * of memory in the threads.
- *
- * The #cell_to_patch_index_map is
- * an array that stores for index
- * <tt>[i][j]</tt> the number of the
- * patch that associated with the
- * cell with index @p j on level
- * @p i. This information is set
- * up prior to generation of the
- * patches, and is needed to
- * generate neighborship
- * information.
- */
- struct Data
- {
- unsigned int n_threads;
- unsigned int this_thread;
- unsigned int n_components;
- unsigned int n_datasets;
- unsigned int n_subdivisions;
- SmartPointer<const Mapping<DH::dimension> > mapping;
- std::vector<double> patch_values;
- std::vector<Vector<double> > patch_values_system;
- std::vector<Tensor<1,DH::dimension> > patch_gradients;
- std::vector<std::vector<Tensor<1,DH::dimension> > > patch_gradients_system;
- std::vector<Tensor<2,DH::dimension> > patch_hessians;
- std::vector<std::vector<Tensor<2,DH::dimension> > > patch_hessians_system;
- std::vector<Point<dim> > dummy_normals;
- std::vector<std::vector<Vector<double> > > postprocessed_values;
-
- std::vector<std::vector<unsigned int> > *cell_to_patch_index_map;
- };
+
/**
* Builds every @p n_threads's
* patch. This function may be
* used, the function is called
* once and generates all patches.
*/
- void build_some_patches (Data &data);
+ void build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data);
/**
* Store in which region cells shall be
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
DeclException0 (ExcCellNotActiveForCellData);
private:
- /**
- * All data needed in one thread
- * is gathered in the struct
- * Data.
- * The data is handled globally
- * to avoid allocation of memory
- * in the threads.
- */
- struct Data
- {
- unsigned int n_threads;
- unsigned int this_thread;
- unsigned int n_components;
- unsigned int n_datasets;
- unsigned int n_subdivisions;
- std::vector<double> patch_values;
- std::vector<Vector<double> > patch_values_system;
- std::vector<Tensor<1,dim> > patch_gradients;
- std::vector<std::vector<Tensor<1,dim> > > patch_gradients_system;
- std::vector<Tensor<2,dim> > patch_hessians;
- std::vector<std::vector<Tensor<2,dim> > > patch_hessians_system;
- std::vector<std::vector<Vector<double> > > postprocessed_values;
- std::vector<Point<dim> > patch_normals;
- Data ()
- {}
- };
/**
* Builds every @p n_threads's
* patch. This function may be
* used, the function is called
* once and generates all patches.
*/
- void build_some_patches (Data &data);
+ void build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data);
};
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
<< "The radial variable attains a negative value of " << arg1);
private:
- /**
- * All data needed in one thread
- * is gathered in the struct
- * Data.
- * The data is handled globally
- * to avoid allocation of memory
- * in the threads.
- */
- struct Data
- {
- unsigned int n_threads;
- unsigned int this_thread;
- unsigned int n_components;
- unsigned int n_datasets;
- unsigned int n_patches_per_circle;
- unsigned int n_subdivisions;
- std::vector<double> patch_values;
- std::vector<Vector<double> > patch_values_system;
- std::vector<Tensor<1,dim> > patch_gradients;
- std::vector<std::vector<Tensor<1,dim> > > patch_gradients_system;
- std::vector<Tensor<2,dim> > patch_hessians;
- std::vector<std::vector<Tensor<2,dim> > > patch_hessians_system;
- std::vector<std::vector<Vector<double> > > postprocessed_values;
- std::vector<Point<dim> > dummy_normals;
- Data ()
- {}
- };
/**
* Builds every @p n_threads's
* patch. This function may be
* used, the function is called
* once and generates all patches.
*/
- void build_some_patches (Data &data);
+ void build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data);
};
template <int dim, class DH>
-void DataOut<dim,DH>::build_some_patches (Data &data)
+void DataOut<dim,DH>::build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data)
{
// Check consistency of redundant
// template parameter
// init data for the threads
- std::vector<Data> thread_data(n_threads);
+ std::vector<internal::DataOut::ParallelData<DH::dimension, DH::dimension> > thread_data(n_threads);
for (unsigned int i=0;i<n_threads;++i)
{
thread_data[i].n_threads = n_threads;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template <int dim, class DH>
-void DataOutFaces<dim,DH>::build_some_patches (Data &data)
+void DataOutFaces<dim,DH>::build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data)
{
// Check consistency of redundant
// template parameter
face = next_face(face))
++n_patches;
- std::vector<Data> thread_data(n_threads);
+ std::vector<internal::DataOut::ParallelData<DH::dimension, DH::dimension> > thread_data(n_threads);
// init data for the threads
for (unsigned int i=0;i<n_threads;++i)
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#if deal_II_dimension < 3
template <int dim, class DH>
-void DataOutRotation<dim,DH>::build_some_patches (Data &data)
+void DataOutRotation<dim,DH>::build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &data)
{
QTrapez<1> q_trapez;
QIterated<DH::dimension> patch_points (q_trapez, data.n_subdivisions);
#else
template <int dim, class DH>
-void DataOutRotation<dim,DH>::build_some_patches (Data&)
+void DataOutRotation<dim,DH>::build_some_patches (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &)
{
// would this function make any
// sense after all? who would want
// rotation
n_patches *= n_patches_per_circle;
- std::vector<Data> thread_data(n_threads);
+ std::vector<internal::DataOut::ParallelData<DH::dimension, DH::dimension> > thread_data(n_threads);
// init data for the threads
for (unsigned int i=0;i<n_threads;++i)
if (DEAL_II_USE_MT)
{
- void (DataOutRotation<dim,DH>::*p) (Data &)
+ void (DataOutRotation<dim,DH>::*p) (internal::DataOut::ParallelData<DH::dimension, DH::dimension> &)
= &DataOutRotation<dim,DH>::build_some_patches;
Threads::ThreadGroup<> threads;