// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1999 - 2013 by the deal.II authors
+// Copyright (C) 1999 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
* this pair of functions and they return a non-active cell, then an exception
* will be thrown.
*
+ * @precondition This class only makes sense if the first template
+ * argument, <code>dim</code> equals the dimension of the
+ * DoFHandler type given as the second template argument, i.e., if
+ * <code>dim == DH::dimension</code>. This redundancy is a historical
+ * relic from the time where the library had only a single DoFHandler
+ * class and this class consequently only a single template argument.
+ *
* @ingroup output
* @author Wolfgang Bangerth, 1999
*/
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2000 - 2013 by the deal.II authors
+// Copyright (C) 2000 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
* applications certainly exist, for which the author is not
* imaginative enough.
*
+ * @precondition This class only makes sense if the first template
+ * argument, <code>dim</code> equals the dimension of the
+ * DoFHandler type given as the second template argument, i.e., if
+ * <code>dim == DH::dimension</code>. This redundancy is a historical
+ * relic from the time where the library had only a single DoFHandler
+ * class and this class consequently only a single template argument.
+ *
* @todo Reimplement this whole class using actual FEFaceValues and MeshWorker.
*
* @ingroup output
DH::dimension>
{
public:
+ /**
+ * An abbreviation for the dimension of the DoFHandler object we work
+ * with. Faces are then <code>dimension-1</code> dimensional objects.
+ */
+ static const unsigned int dimension = DH::dimension;
+
+ /**
+ * An abbreviation for the spatial dimension within which the triangulation
+ * and DoFHandler are embedded in.
+ */
+ static const unsigned int space_dimension = DH::space_dimension;
+
/**
* Typedef to the iterator type
* of the dof handler class under
* consideration.
*/
- typedef typename DataOut_DoFData<DH,DH::dimension-1,
- DH::dimension>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<DH,dimension-1,
+ dimension>::cell_iterator cell_iterator;
/**
* Constructor determining
* replaced by a hp::MappingCollection in
* case of a hp::DoFHandler.
*/
- virtual void build_patches (const Mapping<DH::dimension> &mapping,
+ virtual void build_patches (const Mapping<dimension> &mapping,
const unsigned int n_subdivisions = 0);
/**
* context.
*/
void build_one_patch (const FaceDescriptor *cell_and_face,
- internal::DataOutFaces::ParallelData<DH::dimension, DH::dimension> &data,
- DataOutBase::Patch<DH::dimension-1,DH::space_dimension> &patch);
+ internal::DataOutFaces::ParallelData<dimension, dimension> &data,
+ DataOutBase::Patch<dimension-1,space_dimension> &patch);
};
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2000 - 2013 by the deal.II authors
+// Copyright (C) 2000 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
* It is in the responsibility of the user to make sure that the
* radial variable attains only non-negative values.
*
+ * @precondition This class only makes sense if the first template
+ * argument, <code>dim</code> equals the dimension of the
+ * DoFHandler type given as the second template argument, i.e., if
+ * <code>dim == DH::dimension</code>. This redundancy is a historical
+ * relic from the time where the library had only a single DoFHandler
+ * class and this class consequently only a single template argument.
+ *
* @ingroup output
* @author Wolfgang Bangerth, 2000
*/
class DataOutRotation : public DataOut_DoFData<DH,DH::dimension+1>
{
public:
+ /**
+ * An abbreviation for the dimension of the DoFHandler object we work
+ * with. Faces are then <code>dimension-1</code> dimensional objects.
+ */
+ static const unsigned int dimension = DH::dimension;
+
+ /**
+ * An abbreviation for the spatial dimension within which the triangulation
+ * and DoFHandler are embedded in.
+ */
+ static const unsigned int space_dimension = DH::space_dimension;
+
/**
* Typedef to the iterator type
* of the dof handler class under
* consideration.
*/
- typedef typename DataOut_DoFData<DH,DH::dimension+1>::cell_iterator cell_iterator;
+ typedef typename DataOut_DoFData<DH,dimension+1>::cell_iterator cell_iterator;
/**
* This is the central function
*/
void
build_one_patch (const cell_iterator *cell,
- internal::DataOutRotation::ParallelData<DH::dimension, DH::space_dimension> &data,
- std::vector<DataOutBase::Patch<DH::dimension+1,DH::space_dimension+1> > &patches);
+ internal::DataOutRotation::ParallelData<dimension, space_dimension> &data,
+ std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> > &patches);
};
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2000 - 2013 by the deal.II authors
+// Copyright (C) 2000 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
DataOutFaces<dim,DH>::DataOutFaces(const bool so)
:
surface_only(so)
-{}
+{
+ Assert (dim == DH::dimension,
+ ExcNotImplemented());
+}
void
DataOutFaces<dim,DH>::
build_one_patch (const FaceDescriptor *cell_and_face,
- internal::DataOutFaces::ParallelData<DH::dimension, DH::dimension> &data,
- DataOutBase::Patch<DH::dimension-1,DH::space_dimension> &patch)
+ internal::DataOutFaces::ParallelData<dimension, dimension> &data,
+ DataOutBase::Patch<dimension-1,space_dimension> &patch)
{
Assert (cell_and_face->first->is_locally_owned(),
ExcNotImplemented());
// on cells, not faces, so transform the face vertex to a cell vertex, that
// to a unit cell vertex and then, finally, that to the mapped vertex. In
// most cases this complicated procedure will be the identity.
- for (unsigned int vertex=0; vertex<GeometryInfo<DH::dimension-1>::vertices_per_cell; ++vertex)
+ for (unsigned int vertex=0; vertex<GeometryInfo<dimension-1>::vertices_per_cell; ++vertex)
patch.vertices[vertex] = data.mapping_collection[0].transform_unit_to_real_cell
(cell_and_face->first,
- GeometryInfo<DH::dimension>::unit_cell_vertex
+ GeometryInfo<dimension>::unit_cell_vertex
(GeometryInfo<dim>::face_to_cell_vertices
(cell_and_face->second,
vertex,
{
data.reinit_all_fe_values(this->dof_data, cell_and_face->first,
cell_and_face->second);
- const FEValuesBase<DH::dimension> &fe_patch_values
+ const FEValuesBase<dimension> &fe_patch_values
= data.get_present_fe_values (0);
const unsigned int n_q_points = fe_patch_values.n_quadrature_points;
// store the intermediate points
- Assert(patch.space_dim==DH::dimension, ExcInternalError());
- const std::vector<Point<DH::dimension> > &q_points=fe_patch_values.get_quadrature_points();
+ Assert(patch.space_dim==dimension, ExcInternalError());
+ const std::vector<Point<dimension> > &q_points=fe_patch_values.get_quadrature_points();
// resize the patch.data member in order to have enough memory for the
// quadrature points as well
- patch.data.reinit(data.n_datasets+DH::dimension,
+ patch.data.reinit(data.n_datasets+dimension,
patch.data.size(1));
// set the flag indicating that for this cell the points are explicitly
// given
patch.points_are_available=true;
// copy points to patch.data
- for (unsigned int i=0; i<DH::dimension; ++i)
+ for (unsigned int i=0; i<dimension; ++i)
for (unsigned int q=0; q<n_q_points; ++q)
- patch.data(patch.data.size(0)-DH::dimension+i,q)=q_points[q][i];
+ patch.data(patch.data.size(0)-dimension+i,q)=q_points[q][i];
// counter for data records
unsigned int offset=0;
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
{
- const FEValuesBase<DH::dimension> &fe_patch_values
+ const FEValuesBase<dimension> &fe_patch_values
= data.get_present_fe_values (dataset);
const unsigned int n_components
= fe_patch_values.get_fe().n_components();
Assert (cell_and_face->first->active(), ExcCellNotActiveForCellData());
const unsigned int cell_number
= std::distance (this->triangulation->begin_active(),
- typename Triangulation<DH::dimension,DH::space_dimension>::active_cell_iterator(cell_and_face->first));
+ typename Triangulation<dimension,space_dimension>::active_cell_iterator(cell_and_face->first));
const double value
= this->cell_data[dataset]->get_cell_data_value (cell_number);
template <int dim, class DH>
void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions_)
{
- build_patches (StaticMappingQ1<DH::dimension>::mapping, n_subdivisions_);
+ build_patches (StaticMappingQ1<dimension>::mapping, n_subdivisions_);
}
template <int dim, class DH>
-void DataOutFaces<dim,DH>::build_patches (const Mapping<DH::dimension> &mapping,
+void DataOutFaces<dim,DH>::build_patches (const Mapping<dimension> &mapping,
const unsigned int n_subdivisions_)
{
// Check consistency of redundant template parameter
- Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+ Assert (dim==dimension, ExcDimensionMismatch(dim, dimension));
const unsigned int n_subdivisions = (n_subdivisions_ != 0)
? n_subdivisions_
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
- typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
+ typedef DataOut_DoFData<DH,dimension+1> BaseClass;
Assert (this->triangulation != 0,
typename BaseClass::ExcNoTriangulationSelected());
update_flags |= this->dof_data[i]->postprocessor->get_needed_update_flags();
update_flags |= update_quadrature_points;
- internal::DataOutFaces::ParallelData<DH::dimension, DH::space_dimension>
+ internal::DataOutFaces::ParallelData<dimension, space_dimension>
thread_data (n_datasets,
n_subdivisions,
n_postprocessor_outputs,
mapping,
this->get_finite_elements(),
update_flags);
- DataOutBase::Patch<DH::dimension-1,DH::space_dimension> sample_patch;
+ DataOutBase::Patch<dimension-1,space_dimension> sample_patch;
sample_patch.n_subdivisions = n_subdivisions;
sample_patch.data.reinit (n_datasets,
- Utilities::fixed_power<DH::dimension-1>(n_subdivisions+1));
+ Utilities::fixed_power<dimension-1>(n_subdivisions+1));
// now build the patches in parallel
WorkStream::run (&all_faces[0],
std_cxx1x::bind(&DataOutFaces<dim,DH>::build_one_patch,
this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3),
std_cxx1x::bind(&internal::DataOutFaces::
- append_patch_to_list<dim,DH::space_dimension>,
+ append_patch_to_list<dim,space_dimension>,
std_cxx1x::_1, std_cxx1x::ref(this->patches)),
thread_data,
sample_patch);
{
// simply find first active cell
// with a face on the boundary
- typename Triangulation<DH::dimension,DH::space_dimension>::active_cell_iterator cell = this->triangulation->begin_active();
+ typename Triangulation<dimension,space_dimension>::active_cell_iterator cell = this->triangulation->begin_active();
for (; cell != this->triangulation->end(); ++cell)
- for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
+ for (unsigned int f=0; f<GeometryInfo<dimension>::faces_per_cell; ++f)
if (!surface_only || cell->face(f)->at_boundary())
return FaceDescriptor(cell, f);
FaceDescriptor face = old_face;
// first check whether the present cell has more faces on the boundary
- for (unsigned int f=face.second+1; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
+ for (unsigned int f=face.second+1; f<GeometryInfo<dimension>::faces_per_cell; ++f)
if (!surface_only || 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 Triangulation<DH::dimension,DH::space_dimension>::active_cell_iterator active_cell = face.first;
+ typename Triangulation<dimension,space_dimension>::active_cell_iterator active_cell = face.first;
// increase face pointer by one
++active_cell;
while (active_cell != this->triangulation->end())
{
// check all the faces of this active cell
- for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
+ for (unsigned int f=0; f<GeometryInfo<dimension>::faces_per_cell; ++f)
if (!surface_only || active_cell->face(f)->at_boundary())
{
face.first = active_cell;
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2000 - 2013 by the deal.II authors
+// Copyright (C) 2000 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
void
DataOutRotation<dim,DH>::
build_one_patch (const cell_iterator *cell,
- internal::DataOutRotation::ParallelData<DH::dimension, DH::space_dimension> &data,
- std::vector<DataOutBase::Patch<DH::dimension+1,DH::space_dimension+1> > &patches)
+ internal::DataOutRotation::ParallelData<dimension, space_dimension> &data,
+ std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> > &patches)
{
if (dim == 3)
{
// which we will put points in the whole domain (not the rotationally
// reduced one in which the computation took place. for simplicity add the
// initial direction at the end again
- std::vector<Point<DH::dimension+1> > angle_directions (n_patches_per_circle+1);
+ std::vector<Point<dimension+1> > angle_directions (n_patches_per_circle+1);
for (unsigned int i=0; i<=n_patches_per_circle; ++i)
{
- angle_directions[i][DH::dimension-1] = std::cos(2*numbers::PI *
+ angle_directions[i][dimension-1] = std::cos(2*numbers::PI *
i/n_patches_per_circle);
- angle_directions[i][DH::dimension] = std::sin(2*numbers::PI *
+ angle_directions[i][dimension] = std::sin(2*numbers::PI *
i/n_patches_per_circle);
}
// first compute the vertices of the patch. note that they will have to
// be computed from the vertices of the cell, which has one dimension
// less, however.
- switch (DH::dimension)
+ switch (dimension)
{
case 1:
{
case 2:
{
for (unsigned int vertex=0;
- vertex<GeometryInfo<DH::dimension>::vertices_per_cell;
+ vertex<GeometryInfo<dimension>::vertices_per_cell;
++vertex)
{
- const Point<DH::dimension> v = (*cell)->vertex(vertex);
+ const Point<dimension> v = (*cell)->vertex(vertex);
// make sure that the radial variable does attain negative
// values
patches[angle].vertices[vertex] = v(0) * angle_directions[angle];
patches[angle].vertices[vertex][0] = v(1);
- patches[angle].vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell]
+ patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell]
= v(0) * angle_directions[angle+1];
- patches[angle].vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell][0]
+ patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell][0]
= v(1);
};
// first fill dof_data
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
{
- const FEValuesBase<DH::dimension> &fe_patch_values
+ const FEValuesBase<dimension> &fe_patch_values
= data.get_present_fe_values(dataset);
const unsigned int n_components
= fe_patch_values.get_fe().n_components();
if (update_flags & update_quadrature_points)
data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
- std::vector<Point<DH::space_dimension> > dummy_normals;
+ std::vector<Point<space_dimension> > dummy_normals;
postprocessor->
compute_derived_quantities_scalar(data.patch_values,
data.patch_gradients,
if (update_flags & update_quadrature_points)
data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
- std::vector<Point<DH::space_dimension> > dummy_normals;
+ std::vector<Point<space_dimension> > dummy_normals;
postprocessor->
compute_derived_quantities_vector(data.patch_values_system,
data.patch_gradients_system,
component<this->dof_data[dataset]->n_output_variables;
++component)
{
- switch (DH::dimension)
+ switch (dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
this->dof_data[dataset]->get_function_values (fe_patch_values,
data.patch_values);
- switch (DH::dimension)
+ switch (dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int component=0; component<n_components;
++component)
{
- switch (DH::dimension)
+ switch (dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
ExcMessage("Cell must be active for cell data"));
const unsigned int cell_number
= std::distance (this->triangulation->begin_active(),
- typename Triangulation<DH::dimension,DH::space_dimension>::active_cell_iterator(*cell));
+ typename Triangulation<dimension,space_dimension>::active_cell_iterator(*cell));
const double value
= this->cell_data[dataset]->get_cell_data_value (cell_number);
- switch (DH::dimension)
+ switch (dimension)
{
case 1:
for (unsigned int x=0; x<n_points; ++x)
{
// Check consistency of redundant
// template parameter
- Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
- typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
+ Assert (dim==dimension, ExcDimensionMismatch(dim, dimension));
+ typedef DataOut_DoFData<DH,dimension+1> BaseClass;
Assert (this->triangulation != 0,
typename BaseClass::ExcNoTriangulationSelected());
else
n_postprocessor_outputs[dataset] = 0;
- const MappingQ1<DH::dimension, DH::space_dimension> mapping;
- internal::DataOutRotation::ParallelData<DH::dimension, DH::space_dimension>
+ const MappingQ1<dimension, space_dimension> mapping;
+ internal::DataOutRotation::ParallelData<dimension, space_dimension>
thread_data (n_datasets,
n_subdivisions, n_patches_per_circle,
n_postprocessor_outputs, mapping, this->get_finite_elements(),
update_flags);
- std::vector<DataOutBase::Patch<DH::dimension+1,DH::space_dimension+1> >
+ std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> >
new_patches (n_patches_per_circle);
for (unsigned int i=0; i<new_patches.size(); ++i)
{
new_patches[i].n_subdivisions = n_subdivisions;
new_patches[i].data.reinit (n_datasets,
- Utilities::fixed_power<DH::dimension+1>(n_subdivisions+1));
+ Utilities::fixed_power<dimension+1>(n_subdivisions+1));
}
// now build the patches in parallel
std_cxx1x::bind(&DataOutRotation<dim,DH>::build_one_patch,
this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3),
std_cxx1x::bind(&internal::DataOutRotation
- ::append_patch_to_list<dim,DH::space_dimension>,
+ ::append_patch_to_list<dim,space_dimension>,
std_cxx1x::_1, std_cxx1x::ref(this->patches)),
thread_data,
new_patches);
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename Triangulation<DH::dimension,DH::space_dimension>::active_cell_iterator active_cell = cell;
+ typename Triangulation<dimension,space_dimension>::active_cell_iterator active_cell = cell;
++active_cell;
return active_cell;
}
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998 - 2013 by the deal.II authors
+// Copyright (C) 1998 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
*/
template <class FE>
ParallelData (const FE &fe,
- const dealii::hp::QCollection<DH::dimension-1> &face_quadratures,
- const dealii::hp::MappingCollection<DH::dimension, DH::space_dimension> &mapping,
+ const dealii::hp::QCollection<dim-1> &face_quadratures,
+ const dealii::hp::MappingCollection<dim,spacedim> &mapping,
const bool need_quadrature_points,
const unsigned int n_solution_vectors,
const types::subdomain_id subdomain_id,
template <class FE>
ParallelData<DH>::
ParallelData (const FE &fe,
- const dealii::hp::QCollection<DH::dimension-1> &face_quadratures,
- const dealii::hp::MappingCollection<DH::dimension, DH::space_dimension> &mapping,
+ const dealii::hp::QCollection<dim-1> &face_quadratures,
+ const dealii::hp::MappingCollection<dim, spacedim> &mapping,
const bool need_quadrature_points,
const unsigned int n_solution_vectors,
const types::subdomain_id subdomain_id,