since this is one of the most often called functions.
-Use a correct strategy to output the reduction rate for adaptively
- refined grids in examples/error-estimation
-
-
In VectorTools::project_boundary_values, no condensation of sparsity
structures, matrices and right hand sides or distribution of
solution vectors is performed. This is ok for dim<3 because then
of the 3D library.
-I suppose the [mg_]get_dof_values really belongs to the
- [MG]Line/QuadAccessor classes, but now it is in the
- [MG]CellAccessor. Correct this some time.
-
-
No support points for non-Lagrangian elements? Check for Langrange in
interpolation?
catch the Error dof_index==-1 inside of this function
-Remove that pseudo-template clutter in the lower parts of
- dof_accessor.[templates.]cc marked by comments.
-
-
-Add support for MGTransferPrebuilt and MGSmoother if a user wants
- to solve exactly on another than the coarsest grid. In this case,
- some matrices and other arrays need not be computed.
-
-
Unify lots of code of the two Cuthill-McKee dof renumbering functions
in numerics/dof_renumbering.cc. This should be rather
straightforward, since all the unified code needs to get is a
Update documentation on Boundaries in Triangulation<dim> (Guido!)
+Add support for MGTransferPrebuilt and MGSmoother if a user wants
+ to solve exactly on another than the coarsest grid. In this case,
+ some matrices and other arrays need not be computed.
+
+
Fix MGTransferPrebuilt::build_matrices, think about diagonals in
square sparse matrices.
Move the TriaNumberCache into the Triangulation class once the
compiler supports this (gcc2.95 does not allow this at present)
+
+
+Use a correct strategy to output the reduction rate for adaptively
+ refined grids in examples/error-estimation
+
+
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class DoFAccessor {
+class DoFAccessor
+{
public:
/**
* Constructor
* Exception
*/
DeclException0 (ExcMatrixDoesNotMatch);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcNotActive);
protected:
/**
*/
void get_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the values of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. This
+ * function is only callable for active
+ * cells.
+ */
+ template <typename number>
+ void get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const;
+
+ /**
+ * This function is the counterpart to
+ * #get_dof_values#: it takes a vector
+ * of values for the degrees of freedom
+ * of the cell pointed to by this iterator
+ * and writes these values into the global
+ * data vector #values#. This function
+ * is only callable for active cells.
+ *
+ * Note that for continuous finite
+ * elements, calling this function affects
+ * the dof values on neighboring cells as
+ * well. It may also violate continuity
+ * requirements for hanging nodes, if
+ * neighboring cells are less refined than
+ * the present one. These requirements
+ * are not taken care of and must be
+ * enforced by the user afterwards.
+ *
+ * It is assumed that both vectors already
+ * have the right size beforehand.
+ */
+ template <typename number>
+ void set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const;
+
/**
* Return the #i#th child as a DoF line
* iterator. This function is needed since
*/
void get_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the values of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. This
+ * function is only callable for active
+ * cells.
+ */
+ template <typename number>
+ void get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const;
+
+ /**
+ * This function is the counterpart to
+ * #get_dof_values#: it takes a vector
+ * of values for the degrees of freedom
+ * of the cell pointed to by this iterator
+ * and writes these values into the global
+ * data vector #values#. This function
+ * is only callable for active cells.
+ *
+ * Note that for continuous finite
+ * elements, calling this function affects
+ * the dof values on neighboring cells as
+ * well. It may also violate continuity
+ * requirements for hanging nodes, if
+ * neighboring cells are less refined than
+ * the present one. These requirements
+ * are not taken care of and must be
+ * enforced by the user afterwards.
+ *
+ * It is assumed that both vectors already
+ * have the right size beforehand.
+ */
+ template <typename number>
+ void set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const;
+
/**
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
void get_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the values of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. This
+ * function is only callable for active
+ * cells.
+ */
+ template <typename number>
+ void get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const;
+
+ /**
+ * This function is the counterpart to
+ * #get_dof_values#: it takes a vector
+ * of values for the degrees of freedom
+ * of the cell pointed to by this iterator
+ * and writes these values into the global
+ * data vector #values#. This function
+ * is only callable for active cells.
+ *
+ * Note that for continuous finite
+ * elements, calling this function affects
+ * the dof values on neighboring cells as
+ * well. It may also violate continuity
+ * requirements for hanging nodes, if
+ * neighboring cells are less refined than
+ * the present one. These requirements
+ * are not taken care of and must be
+ * enforced by the user afterwards.
+ *
+ * It is assumed that both vectors already
+ * have the right size beforehand.
+ */
+ template <typename number>
+ void set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const;
+
/**
* Return a pointer to the #i#th line
* bounding this #Hex#.
TriaIterator<dim, DoFObjectAccessor<dim-1, dim> >
face (const unsigned int i) const;
- /**
- * Return the values of the given vector
- * restricted to the dofs of this
- * cell in the standard ordering: dofs
- * on vertex 0, dofs on vertex 1, etc,
- * dofs on line 0, dofs on line 1, etc,
- * dofs on quad 0, etc.
- *
- * It is assumed that the vector already
- * has the right size beforehand. This
- * function is only callable for active
- * cells.
- */
- template <typename number>
- void get_dof_values (const Vector<number> &values,
- Vector<number> &local_values) const;
-
/**
* Return the interpolation of the given
* finite element function to the present
* of each child. It is not yet decided
* what the this function does in these
* cases.
+ *
+ * Unlike the #get_dof_values#
+ * function, this function is
+ * associated to cells rather
+ * than to lines, quads, and
+ * hexes, since interpolation is
+ * presently only provided for
+ * cells by the finite element
+ * objects.
*/
template <typename number>
void get_interpolated_dof_values (const Vector<number> &values,
Vector<number> &interpolated_values) const;
- /**
- * This function is the counterpart to
- * #get_dof_values#: it takes a vector
- * of values for the degrees of freedom
- * of the cell pointed to by this iterator
- * and writes these values into the global
- * data vector #values#. This function
- * is only callable for active cells.
- *
- * Note that for continuous finite
- * elements, calling this function affects
- * the dof values on neighboring cells as
- * well. It may also violate continuity
- * requirements for hanging nodes, if
- * neighboring cells are less refined than
- * the present one. These requirements
- * are not taken care of and must be
- * enforced by the user afterwards.
- *
- * It is assumed that both vectors already
- * have the right size beforehand.
- */
- template <typename number>
- void set_dof_values (const Vector<number> &local_values,
- Vector<number> &values) const;
-
/**
* This, again, is the counterpart to
* #get_interpolated_dof_values#: you
* element class for a description of what
* the prolongation matrices represent in
* this case.
+ *
+ * Unlike the #set_dof_values#
+ * function, this function is
+ * associated to cells rather
+ * than to lines, quads, and
+ * hexes, since interpolation is
+ * presently only provided for
+ * cells by the finite element
+ * objects.
*/
template <typename number>
void set_dof_values_by_interpolation (const Vector<number> &local_values,
* Exception
*/
DeclException0 (ExcNotUsefulForThisDimension);
- /**
- * Exception
- */
- DeclException0 (ExcNotActive);
};
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
/**
* Return the #i#th child as a MGDoF line
* iterator. This function is needed since
* for the level this quad lives on.
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
-
+
/**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
+ /**
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
/**
* Return a pointer to the #i#th line
* bounding this #Hex#.
face_iterator
face (const unsigned int i) const;
- /**
- * Return the value of the given vector
- * restricted to the dofs of this
- * cell in the standard ordering: dofs
- * on vertex 0, dofs on vertex 1, etc,
- * dofs on line 0, dofs on line 1, etc,
- * dofs on quad 0, etc.
- *
- * It is assumed that the vector already
- * has the right size beforehand. The
- * indices refer to the multilevel
- * numbering local to the present
- * level of this cell. The vector shall
- * therefore have the same number of
- * entries as there are degrees of
- * freedom on this level.
- */
- void get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-
/**
* Exception
*/
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
/**
* Return the #i#th child as a MGDoF line
* iterator. This function is needed since
* for the level this quad lives on.
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
-
+
/**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
+ /**
* Return a pointer to the #i#th line
* bounding this #Quad#.
*/
*/
void get_mg_dof_indices (vector<int> &dof_indices) const;
+ /**
+ * Return the value of the given vector
+ * restricted to the dofs of this
+ * cell in the standard ordering: dofs
+ * on vertex 0, dofs on vertex 1, etc,
+ * dofs on line 0, dofs on line 1, etc,
+ * dofs on quad 0, etc.
+ *
+ * It is assumed that the vector already
+ * has the right size beforehand. The
+ * indices refer to the multilevel
+ * numbering local to the present
+ * level of this cell. The vector shall
+ * therefore have the same number of
+ * entries as there are degrees of
+ * freedom on this level.
+ */
+ template <typename number>
+ void get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const;
+
/**
* Return a pointer to the #i#th line
* bounding this #Hex#.
face_iterator
face (const unsigned int i) const;
- /**
- * Return the value of the given vector
- * restricted to the dofs of this
- * cell in the standard ordering: dofs
- * on vertex 0, dofs on vertex 1, etc,
- * dofs on line 0, dofs on line 1, etc,
- * dofs on quad 0, etc.
- *
- * It is assumed that the vector already
- * has the right size beforehand. The
- * indices refer to the multilevel
- * numbering local to the present
- * level of this cell. The vector shall
- * therefore have the same number of
- * entries as there are degrees of
- * freedom on this level.
- */
- void get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-
/**
* Exception
*/
+template <int dim>
+template <typename number>
+void
+DoFObjectAccessor<1,dim>::get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const
+{
+ Assert (dim==1, ExcInternalError());
+
+ Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (has_children() == false, ExcNotActive());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line;
+ typename vector<number>::iterator next_local_value=local_values.begin();
+ for (unsigned int vertex=0; vertex<2; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_local_value++ = values(vertex_dof_index(vertex,d));
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_local_value++ = values(dof_index(d));
+
+ Assert (next_local_value == local_values.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+DoFObjectAccessor<1,dim>::set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const {
+ Assert (dim==1, ExcInternalError());
+
+ Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (has_children() == false, ExcNotActive());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line;
+ typename vector<number>::const_iterator next_local_value=local_values.begin();
+ for (unsigned int vertex=0; vertex<2; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ values(vertex_dof_index(vertex,d)) = *next_local_value++;
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ values(dof_index(d)) = *next_local_value++;
+
+ Assert (next_local_value == local_values.end(),
+ ExcInternalError());
+};
+
+
+
+
/*------------------------- Functions: DoFQuadAccessor -----------------------*/
+template <int dim>
+template <typename number>
+void
+DoFObjectAccessor<2,dim>::get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const
+{
+ Assert (dim==2, ExcInternalError());
+
+ Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ Assert (has_children() == false, ExcNotActive());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
+ typename vector<number>::iterator next_local_value=local_values.begin();
+ for (unsigned int vertex=0; vertex<4; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_local_value++ = values(vertex_dof_index(vertex,d));
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_local_value++ = values(this->line(line)->dof_index(d));
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ *next_local_value++ = values(dof_index(d));
+
+ Assert (next_local_value == local_values.end(),
+ ExcInternalError());
+};
-/*------------------------- Functions: DoFObjectAccessor -----------------------*/
+
+
+template <int dim>
+template <typename number>
+void
+DoFObjectAccessor<2,dim>::set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const
+{
+ Assert (dim==2, ExcInternalError());
+
+ Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<dim>::ExcVectorDoesNotMatch());
+ Assert (has_children() == false, ExcNotActive());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
+ typename vector<number>::const_iterator next_local_value=local_values.begin();
+ for (unsigned int vertex=0; vertex<4; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ values(vertex_dof_index(vertex,d)) = *next_local_value++;
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ values(this->line(line)->dof_index(d)) = *next_local_value++;
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ values(dof_index(d)) = *next_local_value++;
+
+ Assert (next_local_value == local_values.end(),
+ ExcInternalError());
+};
+
+
+
+
+
+
+/*------------------------- Functions: DoFHexAccessor -----------------------*/
template <int dim>
template <int dim>
void DoFObjectAccessor<3, dim>::
distribute_local_to_global (const FullMatrix<double> &local_source,
- SparseMatrix<double> &global_destination) const {
+ SparseMatrix<double> &global_destination) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (local_source.m() == (8*dof_handler->get_fe().dofs_per_vertex +
-
-
-
-/*------------------------- Functions: DoFCellAccessor -----------------------*/
-
-
-
-#if deal_II_dimension == 1
-
-template <>
-TriaIterator<1, DoFObjectAccessor<0,1> >
-DoFCellAccessor<1>::face (const unsigned int) const
-{
- Assert (false, ExcNotUsefulForThisDimension());
- return TriaIterator<1, DoFObjectAccessor<0,1> >();
-};
-
-
-
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocessor and double check using an assertion in the function body.
-
-//TODO: correct the pseudo-template thing
-*/
-template <int dim>
-template <typename number>
-void
-DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
- Vector<number> &local_values) const {
- Assert (dim==1, ExcInternalError());
-
- Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line;
- typename vector<number>::iterator next_local_value=local_values.begin();
- for (unsigned int vertex=0; vertex<2; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_local_value++ = values(vertex_dof_index(vertex,d));
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_local_value++ = values(dof_index(d));
-
- Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
-};
-
-
-
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocecssor and double check using an assertion in the function body.
-*/
template <int dim>
template <typename number>
void
-DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
- Vector<number> &values) const {
- Assert (dim==1, ExcInternalError());
-
- Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- DoFAccessor<1>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line;
- typename vector<number>::const_iterator next_local_value=local_values.begin();
- for (unsigned int vertex=0; vertex<2; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- values(vertex_dof_index(vertex,d)) = *next_local_value++;
- for (unsigned int d=0; d<dofs_per_line; ++d)
- values(dof_index(d)) = *next_local_value++;
-
- Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
-};
-
-
-
-#endif
-
-
-
-#if deal_II_dimension == 2
-
-template <>
-TriaIterator<2, DoFObjectAccessor<1,2> >
-DoFCellAccessor<2>::face (const unsigned int i) const
-{
- return line(i);
-};
-
-
-
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocecssor and double check using an assertion in the function body.
-*/
-template <int dim>
-template <typename number>
-void
-DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
- Vector<number> &local_values) const
-{
- Assert (dim==2, ExcInternalError());
-
- Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<dim>::ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- DoFAccessor<dim>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
- typename vector<number>::iterator next_local_value=local_values.begin();
- for (unsigned int vertex=0; vertex<4; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_local_value++ = values(vertex_dof_index(vertex,d));
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_local_value++ = values(this->line(line)->dof_index(d));
- for (unsigned int d=0; d<dofs_per_quad; ++d)
- *next_local_value++ = values(dof_index(d));
-
- Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
-};
-
-
-
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocecssor and double check using an assertion in the function body.
-*/
-template <int dim>
-template <typename number>
-void
-DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
- Vector<number> &values) const {
- Assert (dim==2, ExcInternalError());
-
- Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<dim>::ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- DoFAccessor<dim>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
- typename vector<number>::const_iterator next_local_value=local_values.begin();
- for (unsigned int vertex=0; vertex<4; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- values(vertex_dof_index(vertex,d)) = *next_local_value++;
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int d=0; d<dofs_per_line; ++d)
- values(this->line(line)->dof_index(d)) = *next_local_value++;
- for (unsigned int d=0; d<dofs_per_quad; ++d)
- values(dof_index(d)) = *next_local_value++;
-
- Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
-};
-
-
-#endif
-
-
-
-#if deal_II_dimension == 3
-
-template <>
-TriaIterator<3, DoFObjectAccessor<2, 3> >
-DoFCellAccessor<3>::face (const unsigned int i) const
+DoFObjectAccessor<3,dim>::get_dof_values (const Vector<number> &values,
+ Vector<number> &local_values) const
{
- return quad(i);
-};
-
-
-
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocecssor and double check using an assertion in the function body.
-*/
-template <int dim>
-template <typename number>
-void
-DoFCellAccessor<dim>::get_dof_values (const Vector<number> &values,
- Vector<number> &local_values) const {
Assert (dim==3, ExcInternalError());
Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
DoFAccessor<3>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<3>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
+ Assert (has_children() == false, ExcNotActive());
const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = dof_handler->get_fe().dofs_per_line,
dofs_per_quad = dof_handler->get_fe().dofs_per_quad,
dofs_per_hex = dof_handler->get_fe().dofs_per_hex;
typename vector<number>::iterator next_local_value = local_values.begin();
- for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
+ for (unsigned int vertex=0; vertex<GeometryInfo<3>::vertices_per_cell; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next_local_value++ = values(vertex_dof_index(vertex,d));
- for (unsigned int line=0; line<GeometryInfo<dim>::lines_per_cell; ++line)
+ for (unsigned int line=0; line<GeometryInfo<3>::lines_per_cell; ++line)
for (unsigned int d=0; d<dofs_per_line; ++d)
*next_local_value++ = values(this->line(line)->dof_index(d));
- for (unsigned int quad=0; quad<GeometryInfo<dim>::quads_per_cell; ++quad)
+ for (unsigned int quad=0; quad<GeometryInfo<3>::quads_per_cell; ++quad)
for (unsigned int d=0; d<dofs_per_quad; ++d)
*next_local_value++ = values(this->quad(quad)->dof_index(d));
for (unsigned int d=0; d<dofs_per_hex; ++d)
*next_local_value++ = values(dof_index(d));
Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
+ ExcInternalError());
};
-/* this function looks like a template, but actually isn't one, it
- will only work for the dimension selected by the preprocessor
- guard above.
-
- the correct thing to do would be
-
- template <>
- template <typename number>
- void
- DoFCellAccessor<1>::get... (vector<number>...)
-
- but this does not work, at least not at present using egcs1.1.1. we therefore
- separate the different implementations for the different dimensions using
- the preprocecssor and double check using an assertion in the function body.
-*/
template <int dim>
template <typename number>
void
-DoFCellAccessor<dim>::set_dof_values (const Vector<number> &local_values,
- Vector<number> &values) const {
+DoFObjectAccessor<3,dim>::set_dof_values (const Vector<number> &local_values,
+ Vector<number> &values) const
+{
Assert (dim==3, ExcInternalError());
Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
DoFAccessor<3>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<3>::ExcVectorDoesNotMatch());
- Assert (active(), ExcNotActive());
+ Assert (has_children() == false, ExcNotActive());
const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = dof_handler->get_fe().dofs_per_line,
values(dof_index(d)) = *next_local_value++;
Assert (next_local_value == local_values.end(),
- ::ExcInternalError());
+ ExcInternalError());
+};
+
+
+
+
+
+/*------------------------- Functions: DoFCellAccessor -----------------------*/
+
+
+
+#if deal_II_dimension == 1
+
+template <>
+TriaIterator<1, DoFObjectAccessor<0,1> >
+DoFCellAccessor<1>::face (const unsigned int) const
+{
+ Assert (false, ExcNotUsefulForThisDimension());
+ return TriaIterator<1, DoFObjectAccessor<0,1> >();
+};
+
+#endif
+
+
+
+#if deal_II_dimension == 2
+
+template <>
+TriaIterator<2, DoFObjectAccessor<1,2> >
+DoFCellAccessor<2>::face (const unsigned int i) const
+{
+ return line(i);
};
+#endif
+
+
+#if deal_II_dimension == 3
+
+template <>
+TriaIterator<3, DoFObjectAccessor<2, 3> >
+DoFCellAccessor<3>::face (const unsigned int i) const
+{
+ return quad(i);
+};
#endif
template <typename number>
void
DoFCellAccessor<dim>::get_interpolated_dof_values (const Vector<number> &values,
- Vector<number> &interpolated_values) const {
+ Vector<number> &interpolated_values) const
+{
const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
template <typename number>
void
DoFCellAccessor<dim>::set_dof_values_by_interpolation (const Vector<number> &local_values,
- Vector<number> &values) const {
+ Vector<number> &values) const
+{
const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// for double
template
void
-DoFCellAccessor<deal_II_dimension>::get_dof_values (const Vector<double> &,
- Vector<double> &) const;
+DoFObjectAccessor<1,deal_II_dimension>::
+get_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
+template
+void
+DoFObjectAccessor<1,deal_II_dimension>::
+set_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
+
+// for float
+template
+void
+DoFObjectAccessor<1,deal_II_dimension>::
+get_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
+template
+void
+DoFObjectAccessor<1,deal_II_dimension>::
+set_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
+
+#if deal_II_dimension >= 2
+// for double
+template
+void
+DoFObjectAccessor<2,deal_II_dimension>::
+get_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
+template
+void
+DoFObjectAccessor<2,deal_II_dimension>::
+set_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
+// for float
+template
+void
+DoFObjectAccessor<2,deal_II_dimension>::
+get_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
template
void
-DoFCellAccessor<deal_II_dimension>::get_interpolated_dof_values (const Vector<double> &,
- Vector<double> &) const;
+DoFObjectAccessor<2,deal_II_dimension>::
+set_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
+#endif
+
+
+#if deal_II_dimension >= 3
+// for double
template
void
-DoFCellAccessor<deal_II_dimension>::set_dof_values (const Vector<double> &,
- Vector<double> &) const;
+DoFObjectAccessor<3,deal_II_dimension>::
+get_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
template
void
-DoFCellAccessor<deal_II_dimension>::set_dof_values_by_interpolation(const Vector<double> &,
- Vector<double> &) const;
+DoFObjectAccessor<3,deal_II_dimension>::
+set_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
// for float
template
void
-DoFCellAccessor<deal_II_dimension>::get_dof_values (const Vector<float> &,
- Vector<float> &) const;
+DoFObjectAccessor<3,deal_II_dimension>::
+get_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
+template
+void
+DoFObjectAccessor<3,deal_II_dimension>::
+set_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
+#endif
+
+
+template
+void
+DoFCellAccessor<deal_II_dimension>::
+get_interpolated_dof_values (const Vector<double> &,
+ Vector<double> &) const;
+
template
void
-DoFCellAccessor<deal_II_dimension>::get_interpolated_dof_values (const Vector<float> &,
- Vector<float> &) const;
+DoFCellAccessor<deal_II_dimension>::
+set_dof_values_by_interpolation(const Vector<double> &,
+ Vector<double> &) const;
+
+
template
void
-DoFCellAccessor<deal_II_dimension>::set_dof_values (const Vector<float> &,
- Vector<float> &) const;
+DoFCellAccessor<deal_II_dimension>::
+get_interpolated_dof_values (const Vector<float> &,
+ Vector<float> &) const;
+
template
void
-DoFCellAccessor<deal_II_dimension>::set_dof_values_by_interpolation(const Vector<float> &,
- Vector<float> &) const;
+DoFCellAccessor<deal_II_dimension>::
+set_dof_values_by_interpolation(const Vector<float> &,
+ Vector<float> &) const;
template <int dim>
MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
- const int level,
- const int index,
- const AccessorData *local_data) :
+ const int level,
+ const int index,
+ const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- MGDoFObjectAccessor_Inheritance<1,dim>::BaseClass(tria,level,index,local_data) {};
+ MGDoFObjectAccessor_Inheritance<1,dim>::BaseClass(tria,level,index,local_data)
+{};
template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = mg_vertex_dof_index(vertex,d);
for (unsigned int d=0; d<dofs_per_line; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<1,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<2; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(mg_dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
-MGDoFObjectAccessor<1, dim>::child (const unsigned int i) const {
+MGDoFObjectAccessor<1, dim>::child (const unsigned int i) const
+{
TriaIterator<dim,MGDoFObjectAccessor<1, dim> > q (tria,
- present_level+1,
- child_index (i),
- mg_dof_handler);
+ present_level+1,
+ child_index (i),
+ mg_dof_handler);
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
inline
-int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
inline
int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = this->line(line)->mg_dof_index(d);
for (unsigned int d=0; d<dofs_per_quad; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<2,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<2>::ExcVectorDoesNotMatch());
+ Assert (values.size() == mg_dof_handler->n_dofs(present_level),
+ DoFAccessor<2>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<4; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ *next_dof_value++ = values(mg_dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
-MGDoFObjectAccessor<2, dim>::line (const unsigned int i) const {
+MGDoFObjectAccessor<2, dim>::line (const unsigned int i) const
+{
Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<2, dim> >
-MGDoFObjectAccessor<2, dim>::child (const unsigned int i) const {
+MGDoFObjectAccessor<2, dim>::child (const unsigned int i) const
+{
TriaIterator<dim,MGDoFObjectAccessor<2, dim> > q (tria,
- present_level+1,
- child_index (i),
- mg_dof_handler);
+ present_level+1,
+ child_index (i),
+ mg_dof_handler);
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
void
-MGDoFObjectAccessor<2, dim>::copy_from (const MGDoFObjectAccessor<2, dim> &a) {
+MGDoFObjectAccessor<2, dim>::copy_from (const MGDoFObjectAccessor<2, dim> &a)
+{
DoFObjectAccessor<2, dim>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
template <int dim>
MGDoFObjectAccessor<3, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
- const int level,
- const int index,
- const AccessorData *local_data) :
+ const int level,
+ const int index,
+ const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- MGDoFObjectAccessor_Inheritance<3,dim>::BaseClass(tria,level,index,local_data) {};
+ MGDoFObjectAccessor_Inheritance<3,dim>::BaseClass(tria,level,index,local_data)
+{};
template <int dim>
inline
-int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
inline
int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = this->quad(quad)->mg_dof_index(d);
for (unsigned int d=0; d<dofs_per_hex; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<3,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<3>::ExcVectorDoesNotMatch());
+ Assert (values.size() == mg_dof_handler->n_dofs(present_level),
+ DoFAccessor<3>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad,
+ dofs_per_hex = dof_handler->get_fe().dofs_per_hex;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<8; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int line=0; line<12; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
+ for (unsigned int quad=0; quad<6; ++quad)
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ *next_dof_value++ = values(this->quad(quad)->mg_dof_index(d));
+ for (unsigned int d=0; d<dofs_per_hex; ++d)
+ *next_dof_value++ = values(dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
return face_iterator();
};
-
-
-template <>
-void
-MGDoFCellAccessor<1>::get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const {
- Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
- ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- ExcVectorDoesNotMatch());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line;
- vector<double>::iterator next_dof_value=dof_values.begin();
- for (unsigned int vertex=0; vertex<2; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_dof_value++ = values(mg_dof_index(d));
-};
-
#endif
return line(i);
};
+#endif
+
-template <>
+
+
+// explicit instantiations
+
+template
void
-MGDoFCellAccessor<2>::get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const {
- Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<2>::ExcVectorDoesNotMatch());
- Assert (values.size() == mg_dof_handler->n_dofs(present_level),
- DoFAccessor<2>::ExcVectorDoesNotMatch());
+MGDoFObjectAccessor<1,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
- vector<double>::iterator next_dof_value=dof_values.begin();
- for (unsigned int vertex=0; vertex<4; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
- for (unsigned int d=0; d<dofs_per_quad; ++d)
- *next_dof_value++ = values(mg_dof_index(d));
-};
+template
+void
+MGDoFObjectAccessor<1,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+
+
+#if deal_II_dimension >= 2
+
+template
+void
+MGDoFObjectAccessor<2,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+template
+void
+MGDoFObjectAccessor<2,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
#endif
+#if deal_II_dimension >= 3
+
+template
+void
+MGDoFObjectAccessor<3,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
+template
+void
+MGDoFObjectAccessor<3,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+#endif
-// explicit instantiations
#if deal_II_dimension == 1
template class MGDoFObjectAccessor<1, 1>;
template class MGDoFCellAccessor<1>;
template <int dim>
MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
- const int level,
- const int index,
- const AccessorData *local_data) :
+ const int level,
+ const int index,
+ const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- MGDoFObjectAccessor_Inheritance<1,dim>::BaseClass(tria,level,index,local_data) {};
+ MGDoFObjectAccessor_Inheritance<1,dim>::BaseClass(tria,level,index,local_data)
+{};
template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<1, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<1, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = mg_vertex_dof_index(vertex,d);
for (unsigned int d=0; d<dofs_per_line; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<1,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+ Assert (values.size() == dof_handler->n_dofs(),
+ DoFAccessor<1>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<2; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(mg_dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
-MGDoFObjectAccessor<1, dim>::child (const unsigned int i) const {
+MGDoFObjectAccessor<1, dim>::child (const unsigned int i) const
+{
TriaIterator<dim,MGDoFObjectAccessor<1, dim> > q (tria,
- present_level+1,
- child_index (i),
- mg_dof_handler);
+ present_level+1,
+ child_index (i),
+ mg_dof_handler);
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
inline
-int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
inline
int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<2, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<2, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = this->line(line)->mg_dof_index(d);
for (unsigned int d=0; d<dofs_per_quad; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<2,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<2>::ExcVectorDoesNotMatch());
+ Assert (values.size() == mg_dof_handler->n_dofs(present_level),
+ DoFAccessor<2>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<4; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int line=0; line<4; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ *next_dof_value++ = values(mg_dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
-MGDoFObjectAccessor<2, dim>::line (const unsigned int i) const {
+MGDoFObjectAccessor<2, dim>::line (const unsigned int i) const
+{
Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,MGDoFObjectAccessor<1, dim> >
template <int dim>
TriaIterator<dim,MGDoFObjectAccessor<2, dim> >
-MGDoFObjectAccessor<2, dim>::child (const unsigned int i) const {
+MGDoFObjectAccessor<2, dim>::child (const unsigned int i) const
+{
TriaIterator<dim,MGDoFObjectAccessor<2, dim> > q (tria,
- present_level+1,
- child_index (i),
- mg_dof_handler);
+ present_level+1,
+ child_index (i),
+ mg_dof_handler);
#ifdef DEBUG
if (q.state() != past_the_end)
template <int dim>
void
-MGDoFObjectAccessor<2, dim>::copy_from (const MGDoFObjectAccessor<2, dim> &a) {
+MGDoFObjectAccessor<2, dim>::copy_from (const MGDoFObjectAccessor<2, dim> &a)
+{
DoFObjectAccessor<2, dim>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
template <int dim>
MGDoFObjectAccessor<3, dim>::MGDoFObjectAccessor (Triangulation<dim> *tria,
- const int level,
- const int index,
- const AccessorData *local_data) :
+ const int level,
+ const int index,
+ const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- MGDoFObjectAccessor_Inheritance<3,dim>::BaseClass(tria,level,index,local_data) {};
+ MGDoFObjectAccessor_Inheritance<3,dim>::BaseClass(tria,level,index,local_data)
+{};
template <int dim>
inline
-int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const {
+int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const {
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
template <int dim>
inline
int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+ const unsigned int i) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void MGDoFObjectAccessor<3, dim>::set_mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+ const unsigned int i,
+ const int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
void
-MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const {
+MGDoFObjectAccessor<3, dim>::get_mg_dof_indices (vector<int> &dof_indices) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
*next++ = this->quad(quad)->mg_dof_index(d);
for (unsigned int d=0; d<dofs_per_hex; ++d)
*next++ = mg_dof_index(d);
+
+ Assert (next == dof_indices.end(),
+ ExcInternalError());
+};
+
+
+
+template <int dim>
+template <typename number>
+void
+MGDoFObjectAccessor<3,dim>::get_mg_dof_values (const Vector<number> &values,
+ Vector<number> &dof_values) const
+{
+ Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
+ DoFAccessor<3>::ExcVectorDoesNotMatch());
+ Assert (values.size() == mg_dof_handler->n_dofs(present_level),
+ DoFAccessor<3>::ExcVectorDoesNotMatch());
+
+ const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
+ dofs_per_line = dof_handler->get_fe().dofs_per_line,
+ dofs_per_quad = dof_handler->get_fe().dofs_per_quad,
+ dofs_per_hex = dof_handler->get_fe().dofs_per_hex;
+ vector<number>::iterator next_dof_value=dof_values.begin();
+ for (unsigned int vertex=0; vertex<8; ++vertex)
+ for (unsigned int d=0; d<dofs_per_vertex; ++d)
+ *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
+ for (unsigned int line=0; line<12; ++line)
+ for (unsigned int d=0; d<dofs_per_line; ++d)
+ *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
+ for (unsigned int quad=0; quad<6; ++quad)
+ for (unsigned int d=0; d<dofs_per_quad; ++d)
+ *next_dof_value++ = values(this->quad(quad)->mg_dof_index(d));
+ for (unsigned int d=0; d<dofs_per_hex; ++d)
+ *next_dof_value++ = values(dof_index(d));
+
+ Assert (next_dof_value == dof_values.end(),
+ ExcInternalError());
};
return face_iterator();
};
-
-
-template <>
-void
-MGDoFCellAccessor<1>::get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const {
- Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
- ExcVectorDoesNotMatch());
- Assert (values.size() == dof_handler->n_dofs(),
- ExcVectorDoesNotMatch());
-
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line;
- vector<double>::iterator next_dof_value=dof_values.begin();
- for (unsigned int vertex=0; vertex<2; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_dof_value++ = values(mg_dof_index(d));
-};
-
#endif
return line(i);
};
+#endif
+
-template <>
+
+
+// explicit instantiations
+
+template
void
-MGDoFCellAccessor<2>::get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const {
- Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
- DoFAccessor<2>::ExcVectorDoesNotMatch());
- Assert (values.size() == mg_dof_handler->n_dofs(present_level),
- DoFAccessor<2>::ExcVectorDoesNotMatch());
+MGDoFObjectAccessor<1,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
- const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
- dofs_per_line = dof_handler->get_fe().dofs_per_line,
- dofs_per_quad = dof_handler->get_fe().dofs_per_quad;
- vector<double>::iterator next_dof_value=dof_values.begin();
- for (unsigned int vertex=0; vertex<4; ++vertex)
- for (unsigned int d=0; d<dofs_per_vertex; ++d)
- *next_dof_value++ = values(mg_vertex_dof_index(vertex,d));
- for (unsigned int line=0; line<4; ++line)
- for (unsigned int d=0; d<dofs_per_line; ++d)
- *next_dof_value++ = values(this->line(line)->mg_dof_index(d));
- for (unsigned int d=0; d<dofs_per_quad; ++d)
- *next_dof_value++ = values(mg_dof_index(d));
-};
+template
+void
+MGDoFObjectAccessor<1,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+
+
+#if deal_II_dimension >= 2
+
+template
+void
+MGDoFObjectAccessor<2,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+template
+void
+MGDoFObjectAccessor<2,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
#endif
+#if deal_II_dimension >= 3
+
+template
+void
+MGDoFObjectAccessor<3,deal_II_dimension>::
+get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
+template
+void
+MGDoFObjectAccessor<3,deal_II_dimension>::
+get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+#endif
-// explicit instantiations
#if deal_II_dimension == 1
template class MGDoFObjectAccessor<1, 1>;
template class MGDoFCellAccessor<1>;