#include <boost/shared_ptr.hpp>
-template <int> class FEValuesBase;
+template <int> class FEValuesBase;
//TODO: Most of the documentation of DataOut_DoFData applies to DataOut.
* @ingroup output
* @author Wolfgang Bangerth, 1999
*/
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim=patch_dim>
+template <class DH, int patch_dim, int patch_space_dim=patch_dim>
class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
{
+//TODO: Do we still need this after changing the template argument?
#ifdef DEAL_II_TEMPLATE_TEMPLATE_TYPEDEF_BUG
// helper class
- struct DH_dim : public DH<dof_handler_dim>
+ struct DH_dim : public DH
{
// constructor. will
// not be implemented,
* Declare iterator type, for
* access from outside.
*/
- typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
- typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+ typedef typename DH::cell_iterator cell_iterator;
+ typedef typename DH::active_cell_iterator active_cell_iterator;
};
public:
* of the dof handler class under
* consideration.
*/
- typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
- typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+ typedef typename DH::cell_iterator cell_iterator;
+ typedef typename DH::active_cell_iterator active_cell_iterator;
#endif
public:
* and the mapping between nodes
* and node values.
*/
- void attach_dof_handler (const DH<dof_handler_dim> &);
+ void attach_dof_handler (const DH &);
/**
* Add a data vector together
* object did not yet set up any
* patches.
*/
- template <int dof_handler_dim2>
- void merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
+ template <class DH2>
+ void merge_patches (const DataOut_DoFData<DH2,patch_dim,patch_space_dim> &source,
const Point<patch_space_dim> &shift = Point<patch_space_dim>());
/**
*/
virtual
void
- get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+ get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<double> &patch_values) const = 0;
/**
*/
virtual
void
- get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+ get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<Vector<double> > &patch_values_system) const = 0;
/**
*/
virtual
void
- get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+ get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<double> &patch_values) const;
/**
*/
virtual
void
- get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+ get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<Vector<double> > &patch_values_system) const;
/**
/**
* Pointer to the dof handler object.
*/
- SmartPointer<const DH<dof_handler_dim> > dofs;
+ SmartPointer<const DH> dofs;
/**
* List of data elements with vectors of
* friends. Needed for the
* merge_patches() function.
*/
- template <int,template <int> class, int,int>
+ template <class, int, int>
friend class DataOut_DoFData;
#ifdef DEAL_II_NESTED_CLASS_FRIEND_BUG
# else
template <int N1, template <int> class DH1, int N2, int N3>
template <typename>
- friend class DataOut_DoFData<N1,DH1,N2,N3>::DataEntry;
+ friend class DataOut_DoFData<DH1,N2,N3>::DataEntry;
# endif
#endif
};
* @ingroup output
* @author Wolfgang Bangerth, 1999
*/
-template <int dim, template <int> class DH = DoFHandler>
-class DataOut : public DataOut_DoFData<dim,DH,dim>
+template <int dim, class DH=DoFHandler<dim> >
+class DataOut : public DataOut_DoFData<DH, DH::dimension>
{
public:
/**
* of the dof handler class under
* consideration.
*/
- typedef typename DataOut_DoFData<dim,DH,dim>::cell_iterator cell_iterator;
- typedef typename DataOut_DoFData<dim,DH,dim>::active_cell_iterator active_cell_iterator;
+ typedef typename DataOut_DoFData<DH,DH::dimension>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<DH,DH::dimension>::active_cell_iterator active_cell_iterator;
/**
* This is the central function
* vector that holds the
* deformation of each vertex.
*/
- virtual void build_patches (const Mapping<dim> &mapping,
+ virtual void build_patches (const Mapping<DH::dimension> &mapping,
const unsigned int n_subdivisions = 1,
const unsigned int n_threads = multithread_info.n_default_threads);
unsigned int n_components;
unsigned int n_datasets;
unsigned int n_subdivisions;
- SmartPointer<const Mapping<dim> > mapping;
+ SmartPointer<const Mapping<DH::dimension> > mapping;
std::vector<double> patch_values;
std::vector<Vector<double> > patch_values_system;
// -------------------- template and inline functions ------------------------
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
-template <int dof_handler_dim2>
+template <class DH, int patch_dim, int patch_space_dim>
+template <class DH2>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
-merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
+merge_patches (const DataOut_DoFData<DH2,patch_dim,patch_space_dim> &source,
const Point<patch_space_dim> &shift)
{
const std::vector<Patch> source_patches = source.get_patches ();
#include <string>
#include <vector>
-template <int dim> class DoFHandler;
/**
* @ingroup output
* @author Wolfgang Bangerth, 2000
*/
-template <int dim, template <int> class DH = DoFHandler>
-class DataOutFaces : public DataOut_DoFData<dim,DH,dim-1,dim>
+template <int dim, class DH=DoFHandler<dim> >
+class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
+ DH::dimension>
{
public:
/**
* of the dof handler class under
* consideration.
*/
- typedef typename DataOut_DoFData<dim,DH,dim-1,dim>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<DH,DH::dimension-1,
+ DH::dimension>::cell_iterator cell_iterator;
/**
* This is the central function
#include <string>
#include <vector>
-template <int dim> class DoFHandler;
/**
* @ingroup output
* @author Wolfgang Bangerth, 2000
*/
-template <int dim, template <int> class DH = DoFHandler>
-class DataOutRotation : public DataOut_DoFData<dim,DH,dim+1>
+template <int dim, class DH=DoFHandler<dim> >
+class DataOutRotation : public DataOut_DoFData<DH,DH::dimension+1>
{
public:
/**
* of the dof handler class under
* consideration.
*/
- typedef typename DataOut_DoFData<dim,DH,dim+1>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<DH,DH::dimension+1>::cell_iterator cell_iterator;
/**
* This is the central function
};
-/* -------------- declaration of explicit specializations ------------- */
-
-template <> void DataOutRotation<3,DoFHandler>::build_some_patches (Data &);
-
-
#endif
* @ingroup output
* @author Wolfgang Bangerth, 1999
*/
-template <int dim, template <int> class DH = DoFHandler>
+template <int dim, class DH = DoFHandler<dim> >
class DataOutStack : public DataOutInterface<dim+1>
{
public:
* data vectors for the present
* parameter value.
*/
- void attach_dof_handler (const DH<dim> &dof_handler);
+ void attach_dof_handler (const DH& dof_handler);
/**
* Declare a data vector. The @p vector_type
* corresponding to the present parameter
* value.
*/
- SmartPointer<const DH<dim> > dof_handler;
+ SmartPointer<const DH> dof_handler;
/**
* List of patches of all past and
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntryBase::DataEntryBase (const std::vector<std::string> &names)
:
names(names)
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntryBase::~DataEntryBase ()
{}
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
template <typename VectorType>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
DataEntry (const VectorType *data,
const std::vector<std::string> &names)
{}
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
template <typename VectorType>
double
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
get_cell_data_value (const unsigned int cell_number) const
{
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
-get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<Vector<double> > &patch_values_system) const
{
fe_patch_values.get_function_values (*vector, patch_values_system);
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::
-get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
std::vector<double> &patch_values) const
{
fe_patch_values.get_function_values (*vector, patch_values);
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
template <typename VectorType>
unsigned int
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::memory_consumption () const
{
return (sizeof (vector) +
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
template <typename VectorType>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
DataEntry<VectorType>::clear ()
{
vector = 0;
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::DataOut_DoFData ()
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::DataOut_DoFData ()
:
dofs(0,typeid(*this).name())
{}
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::~DataOut_DoFData ()
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::~DataOut_DoFData ()
{
clear ();
}
-template <int dof_handler_dim, template <int> class DH,
- int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
-attach_dof_handler (const DH<dof_handler_dim> &d)
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
+attach_dof_handler (const DH &d)
{
Assert (dof_data.size() == 0, ExcOldDataStillPresent());
Assert (cell_data.size() == 0, ExcOldDataStillPresent());
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
template <class VECTOR>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
add_data_vector (const VECTOR &vec,
const std::vector<std::string> &names,
const DataVectorType type)
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
template <class VECTOR>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
add_data_vector (const VECTOR &vec,
const std::string &name,
const DataVectorType type)
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
-void DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear_data_vectors ()
+void DataOut_DoFData<DH,patch_dim,patch_space_dim>::clear_data_vectors ()
{
dof_data.erase (dof_data.begin(), dof_data.end());
cell_data.erase (cell_data.begin(), cell_data.end());
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
clear_input_data_references ()
{
for (unsigned int i=0; i<dof_data.size(); ++i)
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear ()
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::clear ()
{
dof_data.erase (dof_data.begin(), dof_data.end());
cell_data.erase (cell_data.begin(), cell_data.end());
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
std::vector<std::string>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
get_dataset_names () const
{
std::vector<std::string> names;
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
const std::vector< ::DataOutBase::Patch<patch_dim, patch_space_dim> > &
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::get_patches () const
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::get_patches () const
{
return patches;
}
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
int patch_dim, int patch_space_dim>
unsigned int
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::memory_consumption () const
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::memory_consumption () const
{
return (DataOutInterface<patch_dim,patch_space_dim>::memory_consumption () +
MemoryConsumption::memory_consumption (dofs) +
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOut<dim,DH>::build_some_patches (Data &data)
{
+ // Check consistency of redundant
+ // template parameter
+ Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+
QTrapez<1> q_trapez;
- QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
+ QIterated<DH::dimension> patch_points (q_trapez, data.n_subdivisions);
//TODO[?]: This is strange -- Data has a member 'mapping' that should
//be used here, but it isn't. Rather, up until version 1.94, we were
// dof_handler.get_fe() returns a
// collection of which we do a
// shallow copy instead
- const hp::QCollection<dim> q_collection (patch_points);
- const hp::FECollection<dim> fe_collection(this->dofs->get_fe());
+ const hp::QCollection<DH::dimension> q_collection (patch_points);
+ const hp::FECollection<DH::dimension> fe_collection(this->dofs->get_fe());
- hp::FEValues<dim> x_fe_patch_values (fe_collection, q_collection,
+ hp::FEValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
- typename std::vector< ::DataOutBase::Patch<dim> >::iterator patch = this->patches.begin();
+ typename std::vector< ::DataOutBase::Patch<DH::dimension> >::iterator patch = this->patches.begin();
cell_iterator cell=first_cell();
// get first cell in this thread
// use ucd_to_deal map as patch
// vertices are in the old,
// unnatural ordering
- for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
+ for (unsigned int vertex=0; vertex<GeometryInfo<DH::dimension>::vertices_per_cell; ++vertex)
patch->vertices[vertex] = data.mapping->transform_unit_to_real_cell
- (cell, GeometryInfo<dim>::unit_cell_vertex (vertex));
+ (cell, GeometryInfo<DH::dimension>::unit_cell_vertex (vertex));
if (data.n_datasets > 0)
{
x_fe_patch_values.reinit (cell);
- const FEValues<dim> &fe_patch_values
+ const FEValues<DH::dimension> &fe_patch_values
= x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
}
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
{
// let's look up whether
// the neighbor behind that
||
((*data.cell_to_patch_index_map)[neighbor->level()][neighbor->index()]
==
- ::DataOutBase::Patch<dim>::no_neighbor))
+ ::DataOutBase::Patch<DH::dimension>::no_neighbor))
continue;
// now, there is a
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOut<dim,DH>::build_patches (const unsigned int n_subdivisions,
const unsigned int n_threads_)
{
- build_patches (StaticMappingQ1<dim>::mapping, n_subdivisions, n_threads_);
+ build_patches (StaticMappingQ1<DH::dimension>::mapping, n_subdivisions, n_threads_);
}
-template <int dim, template <int> class DH>
-void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
+template <int dim, class DH>
+void DataOut<dim,DH>::build_patches (const Mapping<DH::dimension> &mapping,
const unsigned int n_subdivisions,
const unsigned int n_threads_)
{
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,DH,dim> BaseClass;
+ typedef DataOut_DoFData<DH, DH::dimension> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
// actually has the points on this
// patch
QTrapez<1> q_trapez;
- QIterated<dim> patch_points (q_trapez, n_subdivisions);
+ QIterated<DH::dimension> patch_points (q_trapez, n_subdivisions);
const unsigned int n_q_points = patch_points.n_quadrature_points;
const unsigned int n_components = this->dofs->get_fe().n_components();
// clear the patches array
if (true)
{
- std::vector< ::DataOutBase::Patch<dim> > dummy;
+ std::vector< ::DataOutBase::Patch<DH::dimension> > dummy;
this->patches.swap (dummy);
};
static_cast<unsigned int>(cell->index()));
cell_to_patch_index_map[l].resize (max_index+1,
- ::DataOutBase::Patch<dim>::no_neighbor);
+ ::DataOutBase::Patch<DH::dimension>::no_neighbor);
};
unsigned int n_patches = 0;
//
// then number the patches
// consecutively
- ::DataOutBase::Patch<dim> default_patch;
+ ::DataOutBase::Patch<DH::dimension> default_patch;
default_patch.n_subdivisions = n_subdivisions;
default_patch.data.reinit (n_datasets, n_q_points);
this->patches.insert (this->patches.end(), n_patches, default_patch);
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOut<dim,DH>::cell_iterator
DataOut<dim,DH>::first_cell ()
{
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOut<dim,DH>::cell_iterator
DataOut<dim,DH>::next_cell (const typename DataOut<dim,DH>::cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DH<dim>::active_cell_iterator active_cell = cell;
+ typename DH::active_cell_iterator active_cell = cell;
++active_cell;
return active_cell;
}
// explicit instantiations
-#define INSTANTIATE(D1,DH,D2,D3,V) \
+#define INSTANTIATE(DH,D2,D3,V) \
template void \
-DataOut_DoFData<D1,DH,D2,D3>:: \
+DataOut_DoFData<DH,D2,D3>:: \
add_data_vector<V > (const V &, \
const std::string &, \
const DataVectorType); \
\
template void \
-DataOut_DoFData<D1,DH,D2,D3>:: \
+DataOut_DoFData<DH,D2,D3>:: \
add_data_vector<V > (const V &, \
const std::vector<std::string> &, \
const DataVectorType)
#ifndef DEAL_II_USE_PETSC
-# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
- INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
- INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
- INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
- INSTANTIATE(D1,DH,D2,D3,BlockVector<float>)
+# define INSTANTIATE_VECTORS(DH,D2,D3) \
+ INSTANTIATE(DH,D2,D3,Vector<double>); \
+ INSTANTIATE(DH,D2,D3,Vector<float>); \
+ INSTANTIATE(DH,D2,D3,BlockVector<double>) ; \
+ INSTANTIATE(DH,D2,D3,BlockVector<float>)
#else
-# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
- INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
- INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
- INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
- INSTANTIATE(D1,DH,D2,D3,BlockVector<float>); \
- INSTANTIATE(D1,DH,D2,D3,PETScWrappers::Vector); \
- INSTANTIATE(D1,DH,D2,D3,PETScWrappers::BlockVector)
+# define INSTANTIATE_VECTORS(DH,D2,D3) \
+ INSTANTIATE(DH,D2,D3,Vector<double>); \
+ INSTANTIATE(DH,D2,D3,Vector<float>); \
+ INSTANTIATE(DH,D2,D3,BlockVector<double>) ; \
+ INSTANTIATE(DH,D2,D3,BlockVector<float>); \
+ INSTANTIATE(DH,D2,D3,PETScWrappers::Vector); \
+ INSTANTIATE(DH,D2,D3,PETScWrappers::BlockVector)
#endif
// now do actual instantiations, first for DoFHandler...
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension>;
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension+1>;
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension,deal_II_dimension);
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension+1,deal_II_dimension+1);
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension>;
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1);
// for 3d, also generate an extra class
#if deal_II_dimension >= 2
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,
- deal_II_dimension-1,deal_II_dimension>;
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension-1,deal_II_dimension);
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension);
#endif
-template class DataOut<deal_II_dimension,DoFHandler>;
+template class DataOut<deal_II_dimension, DoFHandler<deal_II_dimension> >;
// ...and now for hp::DoFHandler
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,deal_II_dimension>;
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,deal_II_dimension+1>;
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension,deal_II_dimension);
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension+1,deal_II_dimension+1);
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension>;
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1);
#if deal_II_dimension >= 2
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,
- deal_II_dimension-1,deal_II_dimension>;
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension-1,deal_II_dimension);
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension);
#endif
-template class DataOut<deal_II_dimension,hp::DoFHandler>;
+template class DataOut<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutFaces<dim,DH>::build_some_patches (Data &data)
{
+ // Check consistency of redundant
+ // template parameter
+ Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+
QTrapez<1> q_trapez;
- QIterated<dim-1> patch_points (q_trapez, data.n_subdivisions);
+ QIterated<DH::dimension-1> patch_points (q_trapez, data.n_subdivisions);
//TODO[?]: This is strange -- Data has a member 'mapping' that should
//be used here, but it isn't. Rather, up until version 1.94, we were
// dof_handler.get_fe() returns a
// collection of which we do a
// shallow copy instead
- const hp::QCollection<dim-1> q_collection (patch_points);
- const hp::FECollection<dim> fe_collection(this->dofs->get_fe());
+ const hp::QCollection<DH::dimension-1> q_collection (patch_points);
+ const hp::FECollection<DH::dimension> fe_collection(this->dofs->get_fe());
- hp::FEFaceValues<dim> x_fe_patch_values (fe_collection, q_collection,
+ hp::FEFaceValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
update_values);
const unsigned int n_q_points = patch_points.n_quadrature_points;
- typename std::vector< ::DataOutBase::Patch<dim-1,dim> >::iterator patch = this->patches.begin();
+ typename std::vector< ::DataOutBase::Patch<DH::dimension-1,DH::dimension> >::iterator patch = this->patches.begin();
FaceDescriptor face=first_face();
// get first face in this thread
{
Assert (patch != this->patches.end(), ExcInternalError());
- for (unsigned int vertex=0; vertex<GeometryInfo<dim-1>::vertices_per_cell; ++vertex)
+ for (unsigned int vertex=0; vertex<GeometryInfo<DH::dimension-1>::vertices_per_cell; ++vertex)
patch->vertices[vertex] = face.first->face(face.second)->vertex(vertex);
if (data.n_datasets > 0)
{
x_fe_patch_values.reinit (face.first, face.second);
- const FEFaceValues<dim> &fe_patch_values
+ const FEFaceValues<DH::dimension> &fe_patch_values
= x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
Assert (face.first->active(), ExcCellNotActiveForCellData());
const unsigned int cell_number
= std::distance (this->dofs->begin_active(),
- typename DH<dim>::active_cell_iterator(face.first));
+ typename DH::active_cell_iterator(face.first));
const double value
= this->cell_data[dataset]->get_cell_data_value (cell_number);
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
const unsigned int n_threads_)
{
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
+ typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
// actually has the points on this
// patch
QTrapez<1> q_trapez;
- QIterated<dim-1> patch_points (q_trapez, n_subdivisions);
+ QIterated<DH::dimension-1> patch_points (q_trapez, n_subdivisions);
const unsigned int n_q_points = patch_points.n_quadrature_points;
const unsigned int n_components = this->dofs->get_fe().n_components();
// clear the patches array
if (true)
{
- std::vector< ::DataOutBase::Patch<dim-1,dim> > dummy;
+ std::vector< ::DataOutBase::Patch<DH::dimension-1,DH::dimension> > dummy;
this->patches.swap (dummy);
};
// values. note that the evaluation
// points on the face have to be
// repeated in angular direction
- ::DataOutBase::Patch<dim-1,dim> default_patch;
+ ::DataOutBase::Patch<DH::dimension-1,DH::dimension> default_patch;
default_patch.n_subdivisions = n_subdivisions;
default_patch.data.reinit (n_datasets, n_q_points);
this->patches.insert (this->patches.end(), n_patches, default_patch);
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOutFaces<dim,DH>::FaceDescriptor
DataOutFaces<dim,DH>::first_face ()
{
// simply find first active cell
// with a face on the boundary
- typename DH<dim>::active_cell_iterator cell = this->dofs->begin_active();
+ typename DH::active_cell_iterator cell = this->dofs->begin_active();
for (; cell != this->dofs->end(); ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
if (cell->face(f)->at_boundary())
return FaceDescriptor(cell, f);
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOutFaces<dim,DH>::FaceDescriptor
DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
{
// first check whether the present
// cell has more faces on the
// boundary
- for (unsigned int f=face.second+1; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ for (unsigned int f=face.second+1; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
if (face.first->face(f)->at_boundary())
// yup, that is so, so return it
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DH<dim>::active_cell_iterator active_cell = face.first;
+ typename DH::active_cell_iterator active_cell = face.first;
// increase face pointer by one
++active_cell;
{
// check all the faces of this
// active cell
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
if (active_cell->face(f)->at_boundary())
{
face.first = active_cell;
// explicit instantiations
// don't instantiate anything for the 1d and 2d cases
#if deal_II_dimension >=2
-template class DataOutFaces<deal_II_dimension,DoFHandler>;
-template class DataOutFaces<deal_II_dimension,hp::DoFHandler>;
+template class DataOutFaces<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+template class DataOutFaces<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
#endif
//TODO: Update documentation
//TODO: Unify code for dimensions
-template <int dim, template <int> class DH>
+// Not implemented for 3D
+
+#if deal_II_dimension < 3
+template <int dim, class DH>
void DataOutRotation<dim,DH>::build_some_patches (Data &data)
{
QTrapez<1> q_trapez;
- QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
+ QIterated<DH::dimension> patch_points (q_trapez, data.n_subdivisions);
// create collection objects from
// single quadratures,
// transformed using a Q1 mapping,
// we don't support anything else
// as well
- const hp::QCollection<dim> q_collection (patch_points);
- const hp::FECollection<dim> fe_collection(this->dofs->get_fe());
+ const hp::QCollection<DH::dimension> q_collection (patch_points);
+ const hp::FECollection<DH::dimension> fe_collection(this->dofs->get_fe());
- hp::FEValues<dim> x_fe_patch_values (fe_collection, q_collection,
+ hp::FEValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
update_values);
const unsigned int n_patches_per_circle = data.n_patches_per_circle;
// place. for simplicity add the
// initial direction at the end
// again
- std::vector<Point<dim+1> > angle_directions (n_patches_per_circle+1);
+ std::vector<Point<DH::dimension+1> > angle_directions (n_patches_per_circle+1);
for (unsigned int i=0; i<=n_patches_per_circle; ++i)
{
- angle_directions[i][dim-1] = std::cos(2*deal_II_numbers::PI *
+ angle_directions[i][DH::dimension-1] = std::cos(2*deal_II_numbers::PI *
i/n_patches_per_circle);
- angle_directions[i][dim] = std::sin(2*deal_II_numbers::PI *
+ angle_directions[i][DH::dimension] = std::sin(2*deal_II_numbers::PI *
i/n_patches_per_circle);
};
unsigned int cell_number = 0;
- typename std::vector< ::DataOutBase::Patch<dim+1> >::iterator
+ typename std::vector< ::DataOutBase::Patch<DH::dimension+1> >::iterator
patch = this->patches.begin();
cell_iterator cell=first_cell();
// from the vertices of the
// cell, which has one
// dimension less, however.
- switch (dim)
+ switch (DH::dimension)
{
case 1:
{
case 2:
{
for (unsigned int vertex=0;
- vertex<GeometryInfo<dim>::vertices_per_cell;
+ vertex<GeometryInfo<DH::dimension>::vertices_per_cell;
++vertex)
{
- const Point<dim> v = cell->vertex(vertex);
+ const Point<DH::dimension> v = cell->vertex(vertex);
// make sure that the
// radial variable does
patch->vertices[vertex] = v(0) * angle_directions[angle];
patch->vertices[vertex][0] = v(1);
- patch->vertices[vertex+GeometryInfo<dim>::vertices_per_cell]
+ patch->vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell]
= v(0) * angle_directions[angle+1];
- patch->vertices[vertex+GeometryInfo<dim>::vertices_per_cell][0]
+ patch->vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell][0]
= v(1);
};
if (data.n_datasets > 0)
{
x_fe_patch_values.reinit (cell);
- const FEValues<dim> &fe_patch_values
+ const FEValues<DH::dimension> &fe_patch_values
= x_fe_patch_values.get_present_fe_values ();
// first fill dof_data
this->dof_data[dataset]->get_function_values (fe_patch_values,
data.patch_values);
- switch (dim)
+ switch (DH::dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int component=0; component<data.n_components;
++component)
{
- switch (dim)
+ switch (DH::dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
{
const double value
= this->cell_data[dataset]->get_cell_data_value (cell_number);
- switch (dim)
+ switch (DH::dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
-#if deal_II_dimension == 3
+#else
-template <>
-void DataOutRotation<3,DoFHandler>::build_some_patches (Data &)
+template <int dim, class DH>
+void DataOutRotation<dim,DH>::build_some_patches (Data&)
{
// would this function make any
// sense after all? who would want
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_circle,
const unsigned int n_subdivisions,
const unsigned int n_threads_)
{
+ // Check consistency of redundant
+ // template parameter
+ Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
+ typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
// actually has the points on this
// patch
QTrapez<1> q_trapez;
- QIterated<dim> patch_points (q_trapez, n_subdivisions);
+ QIterated<DH::dimension> patch_points (q_trapez, n_subdivisions);
const unsigned int n_q_points = patch_points.n_quadrature_points;
const unsigned int n_components = this->dofs->get_fe().n_components();
// clear the patches array
if (true)
{
- std::vector< ::DataOutBase::Patch<dim+1> > dummy;
+ std::vector< ::DataOutBase::Patch<DH::dimension+1> > dummy;
this->patches.swap (dummy);
};
// values. note that the evaluation
// points on the cell have to be
// repeated in angular direction
- ::DataOutBase::Patch<dim+1> default_patch;
+ ::DataOutBase::Patch<DH::dimension+1> default_patch;
default_patch.n_subdivisions = n_subdivisions;
default_patch.data.reinit (n_datasets,
n_q_points * (n_subdivisions+1));
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOutRotation<dim,DH>::cell_iterator
DataOutRotation<dim,DH>::first_cell ()
{
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
typename DataOutRotation<dim,DH>::cell_iterator
DataOutRotation<dim,DH>::next_cell (const cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename DH<dim>::active_cell_iterator active_cell = cell;
+ typename DH::active_cell_iterator active_cell = cell;
++active_cell;
return active_cell;
}
// explicit instantiations
-template class DataOutRotation<deal_II_dimension,DoFHandler>;
+template class DataOutRotation<deal_II_dimension, DoFHandler<deal_II_dimension> >;
#include <sstream>
-template <int dim, template <int> class DH>
+template <int dim, class DH>
unsigned int
DataOutStack<dim,DH>::DataVector::memory_consumption () const
{
-template <int dim, template <int> class DH>
+template <int dim, class DH>
DataOutStack<dim,DH>::~DataOutStack ()
{}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutStack<dim,DH>::new_parameter_value (const double p,
const double dp)
{
}
-template <int dim, template <int> class DH>
-void DataOutStack<dim,DH>::attach_dof_handler (const DH<dim> &dof)
+template <int dim, class DH>
+void DataOutStack<dim,DH>::attach_dof_handler (const DH& dof)
{
+ // Check consistency of redundant
+ // template parameter
+ Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+
dof_handler = &dof;
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutStack<dim,DH>::declare_data_vector (const std::string &name,
const VectorType vector_type)
{
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutStack<dim,DH>::declare_data_vector (const std::vector<std::string> &names,
const VectorType vector_type)
{
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
template <typename number>
void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
const std::string &name)
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
template <typename number>
void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
const std::vector<std::string> &names)
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions)
{
// this is mostly copied from the
// create patches of and make sure
// there is enough memory for that
unsigned int n_patches = 0;
- for (typename DH<dim>::active_cell_iterator
+ for (typename DH::active_cell_iterator
cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell)
++n_patches;
typename std::vector< ::DataOutBase::Patch<dim+1,dim+1> >::iterator
patch = patches.begin() + (patches.size()-n_patches);
unsigned int cell_number = 0;
- for (typename DH<dim>::active_cell_iterator cell=dof_handler->begin_active();
+ for (typename DH::active_cell_iterator cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell, ++patch, ++cell_number)
{
Assert (patch != patches.end(), ExcInternalError());
}
-template <int dim, template <int> class DH>
+template <int dim, class DH>
void DataOutStack<dim,DH>::finish_parameter_value ()
{
// release lock on dof handler
-template <int dim, template <int> class DH>
+template <int dim, class DH>
unsigned int
DataOutStack<dim,DH>::memory_consumption () const
{
-template <int dim, template <int> class DH>
+template <int dim, class DH>
const std::vector< ::DataOutBase::Patch<dim+1,dim+1> > &
DataOutStack<dim,DH>::get_patches () const
{
-template <int dim, template <int> class DH>
+template <int dim, class DH>
std::vector<std::string> DataOutStack<dim,DH>::get_dataset_names () const
{
std::vector<std::string> names;
// explicit instantiations
-template class DataOutStack<deal_II_dimension,DoFHandler>;
+template class DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >;
-template void DataOutStack<deal_II_dimension,DoFHandler>::
+template void DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >::
add_data_vector<double> (const Vector<double> &vec,
const std::string &name);
-template void DataOutStack<deal_II_dimension,DoFHandler>::
+template void DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >::
add_data_vector<float> (const Vector<float> &vec,
const std::string &name);
-template class DataOutStack<deal_II_dimension,hp::DoFHandler>;
-template void DataOutStack<deal_II_dimension,hp::DoFHandler>::
+template class DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >;
+template void DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
add_data_vector<double> (const Vector<double> &vec,
const std::string &name);
-template void DataOutStack<deal_II_dimension,hp::DoFHandler>::
+template void DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
add_data_vector<float> (const Vector<float> &vec,
const std::string &name);
-
-template void DataOutStack<deal_II_dimension>::
-add_data_vector<float> (const Vector<float> &vec,
- const std::vector<std::string> &names);