#include <grid/tria.h>
-#include <dofs/dof_handler.h>
#include <grid/tria_accessor.h>
-#include <dofs/dof_accessor.h>
#include <grid/tria_iterator.h>
#include <grid/tria_boundary_lib.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
#include <dofs/dof_constraints.h>
+#include <dofs/dof_tools.h>
#include <grid/grid_generator.h>
#include <base/function.h>
#include <numerics/data_out.h>
Vector<double> linfty_error_per_dof(dof->n_dofs());
Vector<double> h1_seminorm_error_per_dof(dof->n_dofs());
Vector<double> h1_error_per_dof(dof->n_dofs());
- dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
- linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell,
- h1_seminorm_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
+ linfty_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell,
+ h1_seminorm_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
// Vector<double> projected_solution;
// ConstraintMatrix constraints;
// computing constraints
cout << " Computing constraints..." << endl;
ConstraintMatrix constraints;
- dof->make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
constraints.condense (sparsity);
/* Copyright W. Bangerth, University of Heidelberg, 1998 */
+#include <base/function.h>
+#include <base/parameter_handler.h>
+#include <base/quadrature_lib.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_out.h>
#include <grid/tria.h>
-#include <dofs/dof_handler.h>
#include <grid/tria_accessor.h>
-#include <dofs/dof_accessor.h>
-#include <grid/tria_iterator.h>
#include <grid/tria_boundary_lib.h>
+#include <grid/tria_iterator.h>
+#include <dofs/dof_accessor.h>
#include <dofs/dof_constraints.h>
-#include <grid/grid_generator.h>
-#include <base/function.h>
-#include <numerics/data_out.h>
-#include <grid/grid_out.h>
-#include <base/parameter_handler.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_tools.h>
#include <fe/fe_lib.lagrange.h>
-#include <base/quadrature_lib.h>
+#include <numerics/data_out.h>
#include <numerics/base.h>
#include <numerics/assembler.h>
#include <numerics/vectors.h>
Vector<double> l2_error_per_dof(dof->n_dofs()), linfty_error_per_dof(dof->n_dofs());
Vector<double> h1_error_per_dof(dof->n_dofs()), estimated_error_per_dof(dof->n_dofs());
Vector<double> error_ratio (dof->n_dofs());
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
- dof->distribute_cell_to_dof_vector (estimated_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, estimated_error_per_cell,
estimated_error_per_dof);
error_ratio.ratio (h1_error_per_dof, estimated_error_per_dof);
// make up sparsity pattern and
// compress with constraints
constraints.clear ();
- dof->DoFHandler<dim>::make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
DoFTools::make_sparsity_pattern (*dof, system_sparsity);
constraints.condense (system_sparsity);
Vector<double> linfty_error_per_dof (dof->DoFHandler<dim>::n_dofs());
Vector<double> h1_seminorm_error_per_dof (dof->DoFHandler<dim>::n_dofs());
Vector<double> h1_error_per_dof (dof->DoFHandler<dim>::n_dofs());
- dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell,
h1_seminorm_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
// Vector<double> projected_solution;
// ConstraintMatrix constraints;
* degrees of freedom only. The actual layout of storage of the indices
* is described in the \Ref{DoFLevel} class documentation.
*
- * Additionally, the DoFHandler is able to generate the condensation
- * matrix which connects constrained and unconstrained matrices and
- * vectors.
- *
* Finally it offers a starting point for the assemblage of the matrices
* by offering #begin()# and #end()# functions which return iterators
* to walk on the DoF structures as well as the triangulation data.
* according to the given distribution
* method.
*
- * The additional optional parameter #offset#
- * allows you to reserve space for a finite number
- * of additional vector entries in the beginning
- * of all discretization vectors.
+ * The additional optional
+ * parameter #offset# allows you
+ * to reserve space for a finite
+ * number of additional vector
+ * entries in the beginning of
+ * all discretization vectors, by
+ * starting the enumeration of
+ * degrees of freedom on the grid
+ * at a nonzero value. By
+ * default, this value is of
+ * course zero.
*
- * A pointer of the transferred finite
- * element is stored. Therefore, the
- * lifetime of the finite element object
- * shall be longer than that of this
- * object. If you don't want this
- * behaviour, you may want to call
- * the #clear# member function which also
- * releases the lock of this object to the
- * finite element.
+ * A pointer of the transferred
+ * finite element is
+ * stored. Therefore, the
+ * lifetime of the finite element
+ * object shall be longer than
+ * that of this object. If you
+ * don't want this behaviour, you
+ * may want to call the #clear#
+ * member function which also
+ * releases the lock of this
+ * object to the finite element.
*
- * This function uses the user flags of the
- * triangulation object, so make sure you
- * don't need them after calling this
+ * This function uses the user
+ * flags of the triangulation
+ * object, so make sure you don't
+ * need them after calling this
* function, or if so store them.
*/
- virtual void distribute_dofs (const FiniteElement<dim> &,
- unsigned int offset = 0);
+ virtual void distribute_dofs (const FiniteElement<dim> &fe,
+ const unsigned int offset = 0);
/**
* Clear all data of this object and
*/
void renumber_dofs (const vector<int> &new_numbers);
- /**
- * Make up the constraints which
- * is result from the use of hanging
- * nodes. The object into which these
- * are inserted is later
- * used to condensate the global
- * system matrices and to prolong
- * the solution vectors from the true
- * degrees of freedom also to the
- * constraint nodes.
- *
- * Since this method does not make sense in
- * one dimension, the function returns
- * immediately. The object is not cleared
- * before use, so you should make sure
- * it containts only constraints you still
- * want; otherwise call the #clear#
- * function.
- *
- * To condense a given sparsity pattern,
- * use #ConstraintMatrix::condense#.
- * Before doing so, you need to close
- * the constraint object, which must be
- * done after all constraints are entered.
- * This function does not close the object
- * since you may want to enter other
- * constraints later on yourself.
- *
- * This function uses the user flags for
- * the faces. If you need the user flags,
- * store them beforehand.
- */
- void make_hanging_node_constraints (ConstraintMatrix &) const;
-
-
-
-
/**
* Return the maximum number of
* degrees of freedom a degree of freedom
* dimension less.
*/
unsigned int max_couplings_between_boundary_dofs () const;
-
- /**
- * Take a vector of values which live on
- * cells (e.g. an error per cell) and
- * distribute it to the dofs in such a
- * way that a finite element field results,
- * which can then be further processed,
- * e.g. for output. You should note that
- * the resulting field will not be
- * continuous at hanging nodes. This can,
- * however, easily be arranged by calling
- * the appropraite #distribute# function
- * of a #ConstraintMatrix# object created
- * for this #DoFHandler# object.
- *
- * It is assumed that the number of
- * elements in #cell_data# equals the
- * number of active cells. The size of
- * #dof_data# is adjusted to the right
- * size.
- *
- * Note that the input vector may be
- * a vector of any data type as long
- * as it is convertible to #double#.
- * The output vector, being a data
- * vector on the grid, always consists
- * of elements of type #double#.
- *
- * In case the finite element used by
- * this DoFHandler consists of more than
- * one component, you should give which
- * component in the output vector should
- * be used to store the finite element
- * field in; the default is zero (no other
- * value is allowed if the finite element
- * consists only of one component). All
- * other components of the vector remain
- * untouched, i.e. their contents are
- * not changed.
- *
- * It is assumed that the output vector
- * #dof_data# already has the right size,
- * i.e. #n_dofs()# elements.
- */
- template <typename Number>
- void distribute_cell_to_dof_vector (const Vector<Number> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component = 0) const;
/**
* Create a mapping from degree of freedom
/**
* Exception
*/
- DeclException0 (ExcInternalError);
- /**
- * Exception
- */
DeclException1 (ExcMatrixHasWrongSize,
int,
<< "The matrix has the wrong dimension " << arg1);
/**
* Exception
*/
- DeclException2 (ExcWrongSize,
- int, int,
- << "The dimension " << arg1 << " of the vector is wrong. "
- << "It should be " << arg2);
- /**
- * Exception
- */
DeclException1 (ExcNewNumbersNotConsecutive,
int,
<< "The given list of new dof indices is not consecutive: "
<< "the index " << arg1 << " does not exist.");
- /**
- * Exception
- */
- DeclException2 (ExcInvalidComponent,
- int, int,
- << "The component you gave (" << arg1 << ") "
- << "is invalid with respect to the number "
- << "of components in the finite element "
- << "(" << arg2 << ")");
protected:
template <int dim>
inline
-const FiniteElement<dim> & DoFHandler<dim>::get_fe () const {
+unsigned int DoFHandler<dim>::n_dofs () const
+{
+ return used_dofs;
+};
+
+
+
+template <int dim>
+inline
+const FiniteElement<dim> & DoFHandler<dim>::get_fe () const
+{
return *selected_fe;
};
static void make_flux_sparsity_pattern (const DoFHandler<dim> &dof_handler,
SparseMatrixStruct &sparsity_pattern);
+ /**
+ * Make up the constraints which
+ * is result from the use of hanging
+ * nodes. The object into which these
+ * are inserted is later
+ * used to condensate the global
+ * system matrices and to prolong
+ * the solution vectors from the true
+ * degrees of freedom also to the
+ * constraint nodes.
+ *
+ * Since this method does not make sense in
+ * one dimension, the function returns
+ * immediately. The object is not cleared
+ * before use, so you should make sure
+ * it containts only constraints you still
+ * want; otherwise call the #clear#
+ * function.
+ *
+ * To condense a given sparsity pattern,
+ * use #ConstraintMatrix::condense#.
+ * Before doing so, you need to close
+ * the constraint object, which must be
+ * done after all constraints are entered.
+ * This function does not close the object
+ * since you may want to enter other
+ * constraints later on yourself.
+ *
+ * This function uses the user flags for
+ * the faces. If you need the user flags,
+ * store them beforehand.
+ */
+ template <int dim>
+ static void
+ make_hanging_node_constraints (const DoFHandler<dim> &dof_handler,
+ ConstraintMatrix &constraints);
+
+ /**
+ * Take a vector of values which live on
+ * cells (e.g. an error per cell) and
+ * distribute it to the dofs in such a
+ * way that a finite element field results,
+ * which can then be further processed,
+ * e.g. for output. You should note that
+ * the resulting field will not be
+ * continuous at hanging nodes. This can,
+ * however, easily be arranged by calling
+ * the appropraite #distribute# function
+ * of a #ConstraintMatrix# object created
+ * for this #DoFHandler# object.
+ *
+ * It is assumed that the number of
+ * elements in #cell_data# equals the
+ * number of active cells. The size of
+ * #dof_data# is adjusted to the right
+ * size.
+ *
+ * Note that the input vector may be
+ * a vector of any data type as long
+ * as it is convertible to #double#.
+ * The output vector, being a data
+ * vector on the grid, always consists
+ * of elements of type #double#.
+ *
+ * In case the finite element used by
+ * this DoFHandler consists of more than
+ * one component, you should give which
+ * component in the output vector should
+ * be used to store the finite element
+ * field in; the default is zero (no other
+ * value is allowed if the finite element
+ * consists only of one component). All
+ * other components of the vector remain
+ * untouched, i.e. their contents are
+ * not changed.
+ *
+ * It is assumed that the output vector
+ * #dof_data# already has the right size,
+ * i.e. #n_dofs()# elements.
+ */
+ template <int dim, typename Number>
+ static void
+ distribute_cell_to_dof_vector (const DoFHandler<dim> &dof_handler,
+ const Vector<Number> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component = 0);
+
/**
* Extract the indices of the degrees
* of freedom belonging to certain
const MGDoFHandler<dim> &dof,
const vector<bool> &select,
vector<bool> &selected_dofs);
+
+ /**
+ * Exception
+ */
+ DeclException2 (ExcWrongSize,
+ int, int,
+ << "The dimension " << arg1 << " of the vector is wrong. "
+ << "It should be " << arg2);
+ /**
+ * Exception
+ */
+ DeclException2 (ExcInvalidComponent,
+ int, int,
+ << "The component you gave (" << arg1 << ") "
+ << "is invalid with respect to the number "
+ << "of components in the finite element "
+ << "(" << arg2 << ")");
};
/* $Id$ */
-/* Copyright W. Bangerth, University of Heidelberg, 1998 */
+/* Copyright W. Bangerth, University of Heidelberg, 1998, 1999 */
#include <dofs/dof_handler.h>
#include <dofs/dof_levels.h>
#include <dofs/dof_accessor.h>
-#include <dofs/dof_constraints.h>
-#include <grid/tria_levels.h>
#include <grid/tria_accessor.h>
#include <grid/tria_iterator.h>
+#include <grid/tria_levels.h>
#include <grid/tria.h>
#include <grid/geometry_info.h>
#include <fe/fe.h>
-#include <lac/sparse_matrix.h>
-#include <lac/vector.h>
-#include <lac/vector.h>
#include <set>
#include <algorithm>
-
template <int dim>
DoFHandler<dim>::DoFHandler (Triangulation<dim> *tria) :
tria(tria),
-template <int dim>
-unsigned int DoFHandler<dim>::n_dofs () const {
- return used_dofs;
-};
-
-
-
#if deal_II_dimension == 1
template <>
template <int dim>
void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff,
- unsigned int offset)
+ const unsigned int offset)
{
Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
-#if deal_II_dimension == 1
-
-template <>
-void DoFHandler<1>::make_hanging_node_constraints (ConstraintMatrix &) const {};
-
-#endif
-
-
-
-#if deal_II_dimension == 2
-
-template <>
-void DoFHandler<2>::make_hanging_node_constraints (ConstraintMatrix &constraints) const {
- const unsigned int dim = 2;
-
- // first mark all faces which are subject
- // to constraints. We do so by looping
- // over all active cells and checking
- // whether any of the faces are refined
- // which can only be from the neighboring
- // cell because this one is active. In that
- // case, the face is subject to constraints
- tria->clear_user_flags ();
- Triangulation<dim>::active_cell_iterator cell = tria->begin_active(),
- endc = tria->end();
- for (; cell!=endc; ++cell)
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- if (cell->face(face)->has_children())
- cell->face(face)->set_user_flag();
-
-
-
-
- line_iterator line = begin_line(),
- endl = end_line();
- // loop over all lines; only on lines
- // there can be constraints.
- for (; line != endl; ++line)
- // if dofs on this line are subject
- // to constraints
- if (line->user_flag_set() == true)
- {
- // reserve space to gather
- // the dof numbers. We could
- // get them when we need them,
- // but it seems easier to gather
- // them only once.
- vector<int> dofs_on_mother;
- vector<int> dofs_on_children;
- dofs_on_mother.reserve (2*selected_fe->dofs_per_vertex+
- selected_fe->dofs_per_line);
- dofs_on_children.reserve (selected_fe->dofs_per_vertex+
- 2*selected_fe->dofs_per_line);
-
- Assert(2*selected_fe->dofs_per_vertex+selected_fe->dofs_per_line ==
- selected_fe->constraints().n(),
- ExcDimensionMismatch(2*selected_fe->dofs_per_vertex+
- selected_fe->dofs_per_line,
- selected_fe->constraints().n()));
- Assert(selected_fe->dofs_per_vertex+2*selected_fe->dofs_per_line ==
- selected_fe->constraints().m(),
- ExcDimensionMismatch(3*selected_fe->dofs_per_vertex+
- 2*selected_fe->dofs_per_line,
- selected_fe->constraints().m()));
-
- // fill the dofs indices. Use same
- // enumeration scheme as in
- // #FiniteElement::constraints()#
- for (unsigned int vertex=0; vertex<2; ++vertex)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof)
- dofs_on_mother.push_back (line->vertex_dof_index(vertex,dof));
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof)
- dofs_on_mother.push_back (line->dof_index(dof));
-
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof)
- dofs_on_children.push_back (line->child(0)->vertex_dof_index(1,dof));
- for (unsigned int child=0; child<2; ++child)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (line->child(child)->dof_index(dof));
-
- // for each row in the constraint
- // matrix for this line:
- for (unsigned int row=0; row!=dofs_on_children.size(); ++row)
- {
- constraints.add_line (dofs_on_children[row]);
- for (unsigned int i=0; i!=dofs_on_mother.size(); ++i)
- constraints.add_entry (dofs_on_children[row],
- dofs_on_mother[i],
- selected_fe->constraints()(row,i));
- };
- };
-};
-
-#endif
-
-
-
-#if deal_II_dimension == 3
-
-template <>
-void DoFHandler<3>::make_hanging_node_constraints (ConstraintMatrix &constraints) const {
- const unsigned int dim = 3;
-
- // first mark all faces which are subject
- // to constraints. We do so by looping
- // over all active cells and checking
- // whether any of the faces are refined
- // which can only be from the neighboring
- // cell because this one is active. In that
- // case, the face is subject to constraints
- tria->clear_user_flags ();
- Triangulation<dim>::active_cell_iterator cell = tria->begin_active(),
- endc = tria->end();
- for (; cell!=endc; ++cell)
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- if (cell->face(face)->has_children())
- cell->face(face)->set_user_flag();
-
-
-
-
- face_iterator face = begin_face(),
- endf = end_face();
- // loop over all faces; only on faces
- // there can be constraints.
- for (; face != endf; ++face)
- // if dofs on this line are subject
- // to constraints
- if (face->user_flag_set() == true)
- {
- // reserve space to gather
- // the dof numbers. We could
- // get them when we need them,
- // but it seems easier to gather
- // them only once.
- vector<int> dofs_on_mother;
- vector<int> dofs_on_children;
- dofs_on_mother.reserve (4*selected_fe->dofs_per_vertex+
- 4*selected_fe->dofs_per_line+
- selected_fe->dofs_per_quad);
- dofs_on_children.reserve (5*selected_fe->dofs_per_vertex+
- 12*selected_fe->dofs_per_line+
- 4*selected_fe->dofs_per_quad);
-
- Assert(4*selected_fe->dofs_per_vertex+
- 4*selected_fe->dofs_per_line+
- selected_fe->dofs_per_quad
- ==
- selected_fe->constraints().n(),
- ExcDimensionMismatch(4*selected_fe->dofs_per_vertex+
- 4*selected_fe->dofs_per_line+
- selected_fe->dofs_per_quad,
- selected_fe->constraints().n()));
- Assert(5*selected_fe->dofs_per_vertex+
- 12*selected_fe->dofs_per_line+
- 4*selected_fe->dofs_per_quad
- ==
- selected_fe->constraints().m(),
- ExcDimensionMismatch(5*selected_fe->dofs_per_vertex+
- 12*selected_fe->dofs_per_line+
- 4*selected_fe->dofs_per_quad,
- selected_fe->constraints().m()));
-
- // fill the dofs indices. Use same
- // enumeration scheme as in
- // #FiniteElement::constraints()#
- for (unsigned int vertex=0; vertex<4; ++vertex)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof)
- dofs_on_mother.push_back (face->vertex_dof_index(vertex,dof));
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof)
- dofs_on_mother.push_back (face->line(line)->dof_index(dof));
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_quad; ++dof)
- dofs_on_mother.push_back (face->dof_index(dof));
-
- // dof numbers on vertex at the center
- // of the face, which is vertex 2 of
- // child zero, or vertex 3 of child 1
- // or vertex 0 of child 2 or vertex 1
- // of child 3. We're a bit cautious and
- // check this (also an additional safety
- // check for the internal states of the
- // library)
- Assert ((face->child(0)->vertex_dof_index(2,0) ==
- face->child(1)->vertex_dof_index(3,0)) &&
- (face->child(0)->vertex_dof_index(2,0) ==
- face->child(2)->vertex_dof_index(0,0)) &&
- (face->child(0)->vertex_dof_index(2,0) ==
- face->child(3)->vertex_dof_index(1,0)),
- ExcInternalError());
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof)
- dofs_on_children.push_back (face->child(0)->vertex_dof_index(2,dof));
-
- // dof numbers on the centers of
- // the lines bounding this face
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof)
- dofs_on_children.push_back (face->line(line)->child(0)->vertex_dof_index(1,dof));
-
- // next the dofs on the lines interior
- // to the face; the order of these
- // lines is laid down in the
- // FiniteElement class documentation
- for (unsigned int dof=0; dof<selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (face->child(0)->line(1)->dof_index(dof));
- for (unsigned int dof=0; dof<selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (face->child(1)->line(2)->dof_index(dof));
- for (unsigned int dof=0; dof<selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (face->child(2)->line(3)->dof_index(dof));
- for (unsigned int dof=0; dof<selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (face->child(3)->line(0)->dof_index(dof));
-
- // dofs on the bordering lines
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int child=0; child<2; ++child)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof)
- dofs_on_children.push_back (face->line(line)->child(child)->dof_index(dof));
-
- // finally, for the dofs interior
- // to the four child faces
- for (unsigned int child=0; child<4; ++child)
- for (unsigned int dof=0; dof!=selected_fe->dofs_per_quad; ++dof)
- dofs_on_children.push_back (face->child(child)->dof_index(dof));
-
- Assert (dofs_on_children.size() ==
- selected_fe->constraints().m(),
- ExcDimensionMismatch(dofs_on_children.size(),
- selected_fe->constraints().m()));
- Assert (dofs_on_mother.size() ==
- selected_fe->constraints().n(),
- ExcDimensionMismatch(dofs_on_mother.size(),
- selected_fe->constraints().n()));
-
- // for each row in the constraint
- // matrix for this line:
- for (unsigned int row=0; row!=dofs_on_children.size(); ++row)
- {
- constraints.add_line (dofs_on_children[row]);
- for (unsigned int i=0; i!=dofs_on_mother.size(); ++i)
- constraints.add_entry (dofs_on_children[row],
- dofs_on_mother[i],
- selected_fe->constraints()(row,i));
- };
- };
-};
-
-#endif
-
#if deal_II_dimension == 1
-template <int dim>
-template <typename Number>
-void DoFHandler<dim>::distribute_cell_to_dof_vector (const Vector<Number> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component) const {
- Assert (cell_data.size()==tria->n_active_cells(),
- ExcWrongSize (cell_data.size(), tria->n_active_cells()));
- Assert (dof_data.size()==n_dofs(), ExcWrongSize (dof_data.size(), n_dofs()));
- Assert (component < selected_fe->n_components(),
- ExcInvalidComponent(component, selected_fe->n_components()));
-
- // store a flag whether we should care
- // about different components. this is
- // just a simplification, we could ask
- // for this at every single place
- // equally well
- const bool consider_components = (selected_fe->n_components() != 1);
-
- // count how often we have added a value
- // in the sum for each dof
- vector<unsigned char> touch_count (n_dofs(), 0);
-
- active_cell_iterator cell = begin_active(),
- endc = end();
- unsigned int present_cell = 0;
- const unsigned int dofs_per_cell = selected_fe->dofs_per_cell;
- vector<int> dof_indices (dofs_per_cell);
-
- for (; cell!=endc; ++cell, ++present_cell)
- {
- cell->get_dof_indices (dof_indices);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- // consider this dof only if it
- // is the right component. if there
- // is only one component, short cut
- // the test
- if (!consider_components ||
- (selected_fe->system_to_component_index(i).first == component))
- {
- // sum up contribution of the
- // present_cell to this dof
- dof_data(dof_indices[i]) += cell_data(present_cell);
- // note that we added another
- // summand
- ++touch_count[dof_indices[i]];
- };
- };
-
- // compute the mean value on all the
- // dofs by dividing with the number
- // of summands.
- for (unsigned int i=0; i<n_dofs(); ++i)
- {
- // assert that each dof was used
- // at least once. this needs not be
- // the case if the vector has more than
- // one component
- Assert (consider_components || (touch_count[i]!=0),
- ExcInternalError());
- if (touch_count[i] != 0)
- dof_data(i) /= touch_count[i];
- };
-};
-
-
#if deal_II_dimension == 1
/*-------------- Explicit Instantiations -------------------------------*/
template class DoFHandler<deal_II_dimension>;
-template
-void
-DoFHandler<deal_II_dimension>::distribute_cell_to_dof_vector (const Vector<float> &cell_data,
- Vector<double> &dof_data) const;
-
-template
-void
-DoFHandler<deal_II_dimension>::distribute_cell_to_dof_vector (const Vector<double> &cell_data,
- Vector<double> &dof_data) const;
-
-
-
if (use_constraints)
{
ConstraintMatrix constraints;
- dof_handler.make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (dof_handler, constraints);
constraints.close ();
constraints.condense (sparsity);
};
// $Id$
-// Copyright Guido Kanschat, 1999
+
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
#include <dofs/dof_handler.h>
#include <dofs/mg_dof_handler.h>
#include <dofs/dof_accessor.h>
#include <dofs/mg_dof_accessor.h>
-#include <grid/tria_iterator.h>
+#include <dofs/dof_constraints.h>
#include <fe/fe.h>
#include <fe/fe_system.h>
#include <dofs/dof_tools.h>
#include <lac/sparse_matrix.h>
+#include <lac/vector.h>
#include <algorithm>
+#if deal_II_dimension == 1
+
+template <>
+void DoFTools::make_hanging_node_constraints (const DoFHandler<1> &,
+ ConstraintMatrix &)
+{
+ // nothing to be done here
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 2
+
+template <>
+void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &dof_handler,
+ ConstraintMatrix &constraints)
+{
+ const unsigned int dim = 2;
+ const Triangulation<dim> &tria = dof_handler.get_tria();
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
+
+ // first mark all faces which are subject
+ // to constraints. We do so by looping
+ // over all active cells and checking
+ // whether any of the faces are refined
+ // which can only be from the neighboring
+ // cell because this one is active. In that
+ // case, the face is subject to constraints
+ DoFHandler<dim>::line_iterator line = dof_handler.begin_line(),
+ endl = dof_handler.end_line();
+ for (; line!=endl; ++line)
+ line->clear_user_flag ();
+
+ Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ if (cell->face(face)->has_children())
+ cell->face(face)->set_user_flag();
+
+
+
+
+ // loop over all lines; only on lines
+ // there can be constraints.
+ for (line = dof_handler.begin_line(); line != endl; ++line)
+ // if dofs on this line are subject
+ // to constraints
+ if (line->user_flag_set() == true)
+ {
+ // reserve space to gather
+ // the dof numbers. We could
+ // get them when we need them,
+ // but it seems easier to gather
+ // them only once.
+ vector<int> dofs_on_mother;
+ vector<int> dofs_on_children;
+ dofs_on_mother.reserve (2*fe.dofs_per_vertex+
+ fe.dofs_per_line);
+ dofs_on_children.reserve (fe.dofs_per_vertex+
+ 2*fe.dofs_per_line);
+
+ Assert(2*fe.dofs_per_vertex+fe.dofs_per_line ==
+ fe.constraints().n(),
+ ExcDimensionMismatch(2*fe.dofs_per_vertex+
+ fe.dofs_per_line,
+ fe.constraints().n()));
+ Assert(fe.dofs_per_vertex+2*fe.dofs_per_line ==
+ fe.constraints().m(),
+ ExcDimensionMismatch(3*fe.dofs_per_vertex+
+ 2*fe.dofs_per_line,
+ fe.constraints().m()));
+
+ // fill the dofs indices. Use same
+ // enumeration scheme as in
+ // #FiniteElement::constraints()#
+ for (unsigned int vertex=0; vertex<2; ++vertex)
+ for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof)
+ dofs_on_mother.push_back (line->vertex_dof_index(vertex,dof));
+ for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof)
+ dofs_on_mother.push_back (line->dof_index(dof));
+
+ for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof)
+ dofs_on_children.push_back (line->child(0)->vertex_dof_index(1,dof));
+ for (unsigned int child=0; child<2; ++child)
+ for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (line->child(child)->dof_index(dof));
+
+ // for each row in the constraint
+ // matrix for this line:
+ for (unsigned int row=0; row!=dofs_on_children.size(); ++row)
+ {
+ constraints.add_line (dofs_on_children[row]);
+ for (unsigned int i=0; i!=dofs_on_mother.size(); ++i)
+ constraints.add_entry (dofs_on_children[row],
+ dofs_on_mother[i],
+ fe.constraints()(row,i));
+ };
+ };
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 3
+
+template <>
+void DoFTools::make_hanging_node_constraints (const DoFHandler<3> &dof_handler,
+ ConstraintMatrix &constraints)
+{
+ const unsigned int dim = 3;
+ const Triangulation<dim> &tria = dof_handler.get_tria();
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
+
+ // first mark all faces which are subject
+ // to constraints. We do so by looping
+ // over all active cells and checking
+ // whether any of the faces are refined
+ // which can only be from the neighboring
+ // cell because this one is active. In that
+ // case, the face is subject to constraints
+ DoFHandler<dim>::face_iterator face = dof_handler.begin_face(),
+ endf = dof_handler.end_face();
+ for (; face!=endf; ++face)
+ face->clear_user_flag ();
+
+ Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
+ endc = tria.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ if (cell->face(face)->has_children())
+ cell->face(face)->set_user_flag();
+
+
+ // loop over all faces; only on faces
+ // there can be constraints.
+ for (face=dof_handler.begin_face(); face != endf; ++face)
+ // if dofs on this line are subject
+ // to constraints
+ if (face->user_flag_set() == true)
+ {
+ // reserve space to gather
+ // the dof numbers. We could
+ // get them when we need them,
+ // but it seems easier to gather
+ // them only once.
+ vector<int> dofs_on_mother;
+ vector<int> dofs_on_children;
+ dofs_on_mother.reserve (4*fe.dofs_per_vertex+
+ 4*fe.dofs_per_line+
+ fe.dofs_per_quad);
+ dofs_on_children.reserve (5*fe.dofs_per_vertex+
+ 12*fe.dofs_per_line+
+ 4*fe.dofs_per_quad);
+
+ Assert(4*fe.dofs_per_vertex+
+ 4*fe.dofs_per_line+
+ fe.dofs_per_quad
+ ==
+ fe.constraints().n(),
+ ExcDimensionMismatch(4*fe.dofs_per_vertex+
+ 4*fe.dofs_per_line+
+ fe.dofs_per_quad,
+ fe.constraints().n()));
+ Assert(5*fe.dofs_per_vertex+
+ 12*fe.dofs_per_line+
+ 4*fe.dofs_per_quad
+ ==
+ fe.constraints().m(),
+ ExcDimensionMismatch(5*fe.dofs_per_vertex+
+ 12*fe.dofs_per_line+
+ 4*fe.dofs_per_quad,
+ fe.constraints().m()));
+
+ // fill the dofs indices. Use same
+ // enumeration scheme as in
+ // #FiniteElement::constraints()#
+ for (unsigned int vertex=0; vertex<4; ++vertex)
+ for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof)
+ dofs_on_mother.push_back (face->vertex_dof_index(vertex,dof));
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof)
+ dofs_on_mother.push_back (face->line(line)->dof_index(dof));
+ for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof)
+ dofs_on_mother.push_back (face->dof_index(dof));
+
+ // dof numbers on vertex at the center
+ // of the face, which is vertex 2 of
+ // child zero, or vertex 3 of child 1
+ // or vertex 0 of child 2 or vertex 1
+ // of child 3. We're a bit cautious and
+ // check this (also an additional safety
+ // check for the internal states of the
+ // library)
+ Assert ((face->child(0)->vertex_dof_index(2,0) ==
+ face->child(1)->vertex_dof_index(3,0)) &&
+ (face->child(0)->vertex_dof_index(2,0) ==
+ face->child(2)->vertex_dof_index(0,0)) &&
+ (face->child(0)->vertex_dof_index(2,0) ==
+ face->child(3)->vertex_dof_index(1,0)),
+ ExcInternalError());
+ for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof)
+ dofs_on_children.push_back (face->child(0)->vertex_dof_index(2,dof));
+
+ // dof numbers on the centers of
+ // the lines bounding this face
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof)
+ dofs_on_children.push_back (face->line(line)->child(0)->vertex_dof_index(1,dof));
+
+ // next the dofs on the lines interior
+ // to the face; the order of these
+ // lines is laid down in the
+ // FiniteElement class documentation
+ for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (face->child(0)->line(1)->dof_index(dof));
+ for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (face->child(1)->line(2)->dof_index(dof));
+ for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (face->child(2)->line(3)->dof_index(dof));
+ for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (face->child(3)->line(0)->dof_index(dof));
+
+ // dofs on the bordering lines
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int child=0; child<2; ++child)
+ for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof)
+ dofs_on_children.push_back (face->line(line)->child(child)->dof_index(dof));
+
+ // finally, for the dofs interior
+ // to the four child faces
+ for (unsigned int child=0; child<4; ++child)
+ for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof)
+ dofs_on_children.push_back (face->child(child)->dof_index(dof));
+
+ Assert (dofs_on_children.size() ==
+ fe.constraints().m(),
+ ExcDimensionMismatch(dofs_on_children.size(),
+ fe.constraints().m()));
+ Assert (dofs_on_mother.size() ==
+ fe.constraints().n(),
+ ExcDimensionMismatch(dofs_on_mother.size(),
+ fe.constraints().n()));
+
+ // for each row in the constraint
+ // matrix for this line:
+ for (unsigned int row=0; row!=dofs_on_children.size(); ++row)
+ {
+ constraints.add_line (dofs_on_children[row]);
+ for (unsigned int i=0; i!=dofs_on_mother.size(); ++i)
+ constraints.add_entry (dofs_on_children[row],
+ dofs_on_mother[i],
+ fe.constraints()(row,i));
+ };
+ };
+};
+
+#endif
+
+
+
+
+template <int dim, typename Number>
+void DoFTools::distribute_cell_to_dof_vector (const DoFHandler<dim> &dof_handler,
+ const Vector<Number> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component)
+{
+ const Triangulation<dim> &tria = dof_handler.get_tria();
+ const FiniteElement<dim> &fe = dof_handler.get_fe();
+
+ Assert (cell_data.size()==tria.n_active_cells(),
+ ExcWrongSize (cell_data.size(), tria.n_active_cells()));
+ Assert (dof_data.size()==dof_handler.n_dofs(),
+ ExcWrongSize (dof_data.size(), dof_handler.n_dofs()));
+ Assert (component < fe.n_components(),
+ ExcInvalidComponent(component, fe.n_components()));
+
+ // store a flag whether we should care
+ // about different components. this is
+ // just a simplification, we could ask
+ // for this at every single place
+ // equally well
+ const bool consider_components = (fe.n_components() != 1);
+
+ // count how often we have added a value
+ // in the sum for each dof
+ vector<unsigned char> touch_count (dof_handler.n_dofs(), 0);
+
+ DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ unsigned int present_cell = 0;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ vector<int> dof_indices (dofs_per_cell);
+
+ for (; cell!=endc; ++cell, ++present_cell)
+ {
+ cell->get_dof_indices (dof_indices);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ // consider this dof only if it
+ // is the right component. if there
+ // is only one component, short cut
+ // the test
+ if (!consider_components ||
+ (fe.system_to_component_index(i).first == component))
+ {
+ // sum up contribution of the
+ // present_cell to this dof
+ dof_data(dof_indices[i]) += cell_data(present_cell);
+ // note that we added another
+ // summand
+ ++touch_count[dof_indices[i]];
+ };
+ };
+
+ // compute the mean value on all the
+ // dofs by dividing with the number
+ // of summands.
+ for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+ {
+ // assert that each dof was used
+ // at least once. this needs not be
+ // the case if the vector has more than
+ // one component
+ Assert (consider_components || (touch_count[i]!=0),
+ ExcInternalError());
+ if (touch_count[i] != 0)
+ dof_data(i) /= touch_count[i];
+ };
+};
+
+
+
template<int dim>
void
DoFTools::extract_dofs(const DoFHandler<dim> &dof,
const vector<vector<bool> > &mask,
SparseMatrixStruct &sparsity);
+template
+void
+DoFTools::distribute_cell_to_dof_vector (const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<float> &cell_data,
+ Vector<double> &dof_data) const;
+
+template
+void
+DoFTools::distribute_cell_to_dof_vector (const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<double> &cell_data,
+ Vector<double> &dof_data) const;
+
+
+
template void DoFTools::extract_dofs(const DoFHandler<deal_II_dimension>& dof,
const vector<bool>& local_select,
vector<bool>& selected_dofs);
// make up sparsity pattern and
// compress with constraints
constraints.clear ();
- dof_handler->make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof_handler, constraints);
constraints.close ();
DoFTools::make_sparsity_pattern (*dof_handler, system_sparsity);
constraints.condense (system_sparsity);
#include <grid/tria.h>
-#include <dofs/dof_handler.h>
#include <grid/tria_accessor.h>
-#include <dofs/dof_accessor.h>
#include <grid/tria_iterator.h>
#include <grid/tria_boundary_lib.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
#include <dofs/dof_constraints.h>
+#include <dofs/dof_tools.h>
#include <grid/grid_generator.h>
#include <base/function.h>
#include <numerics/data_out.h>
Vector<double> linfty_error_per_dof(dof->n_dofs());
Vector<double> h1_seminorm_error_per_dof(dof->n_dofs());
Vector<double> h1_error_per_dof(dof->n_dofs());
- dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
- linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell,
- h1_seminorm_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
+ linfty_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell,
+ h1_seminorm_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
// Vector<double> projected_solution;
// ConstraintMatrix constraints;
// computing constraints
cout << " Computing constraints..." << endl;
ConstraintMatrix constraints;
- dof->make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
constraints.condense (sparsity);
/* Copyright W. Bangerth, University of Heidelberg, 1998 */
+#include <base/function.h>
+#include <base/parameter_handler.h>
+#include <base/quadrature_lib.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_out.h>
#include <grid/tria.h>
-#include <dofs/dof_handler.h>
#include <grid/tria_accessor.h>
-#include <dofs/dof_accessor.h>
-#include <grid/tria_iterator.h>
#include <grid/tria_boundary_lib.h>
+#include <grid/tria_iterator.h>
+#include <dofs/dof_accessor.h>
#include <dofs/dof_constraints.h>
-#include <grid/grid_generator.h>
-#include <base/function.h>
-#include <numerics/data_out.h>
-#include <grid/grid_out.h>
-#include <base/parameter_handler.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_tools.h>
#include <fe/fe_lib.lagrange.h>
-#include <base/quadrature_lib.h>
+#include <numerics/data_out.h>
#include <numerics/base.h>
#include <numerics/assembler.h>
#include <numerics/vectors.h>
Vector<double> l2_error_per_dof(dof->n_dofs()), linfty_error_per_dof(dof->n_dofs());
Vector<double> h1_error_per_dof(dof->n_dofs()), estimated_error_per_dof(dof->n_dofs());
Vector<double> error_ratio (dof->n_dofs());
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
- dof->distribute_cell_to_dof_vector (estimated_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, estimated_error_per_cell,
estimated_error_per_dof);
error_ratio.ratio (h1_error_per_dof, estimated_error_per_dof);
// make up sparsity pattern and
// compress with constraints
constraints.clear ();
- dof->DoFHandler<dim>::make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
DoFTools::make_sparsity_pattern (*dof, system_sparsity);
constraints.condense (system_sparsity);
Vector<double> linfty_error_per_dof (dof->DoFHandler<dim>::n_dofs());
Vector<double> h1_seminorm_error_per_dof (dof->DoFHandler<dim>::n_dofs());
Vector<double> h1_error_per_dof (dof->DoFHandler<dim>::n_dofs());
- dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof);
- dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof);
- dof->distribute_cell_to_dof_vector (linfty_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell,
linfty_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell,
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell,
h1_seminorm_error_per_dof);
- dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof);
+ DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof);
// Vector<double> projected_solution;
// ConstraintMatrix constraints;
flags = $(CXXFLAGS.o) $(CXXFLAGS)
endif
+
+%.go : %.cc Makefile
+ @echo =====debug========= $<
+ @$(CXX) $(flags) -c $< -o $@
+%.o : %.cc Makefile
+ @echo =====optimized===== $<
+ @$(CXX) $(flags) -c $< -o $@
+
+
all: grid_test.check dof_test.check fe_tables.check gradients.check \
constraints.check mg.check mglocal.check wave-test-3.check second_derivatives.check
// computing constraints
deallog << " Computing constraints..." << endl;
ConstraintMatrix constraints;
- dof->make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof, constraints);
constraints.close ();
constraints.condense (sparsity);
constraints.clear ();
- dof_handler->make_hanging_node_constraints (constraints);
+ DoFTools::make_hanging_node_constraints (*dof_handler, constraints);
constraints.close ();
sweep_info->get_timers().grid_generation.stop();
else
{
estimated_error.reinit (get_timestep_primal().dof_handler->n_dofs());
- get_timestep_primal().dof_handler
- ->distribute_cell_to_dof_vector (estimated_error_per_cell,
- estimated_error);
+ DoFTools::distribute_cell_to_dof_vector (*get_timestep_primal().dof_handler,
+ estimated_error_per_cell,
+ estimated_error);
};
out.add_data_vector (estimated_error, "est_error");