update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// FIX
- vector<double> coefficient_values (n_q_points, 1.0);
+ vector<double> coefficient_values (n_q_points, 1.0);
// not only active cells
MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
hanging_node_constraints.condense (global_system_matrix);
hanging_node_constraints.condense (system_rhs);
-// map<int,double> boundary_values;
+// map<unsigned int,double> boundary_values;
// VectorTools::interpolate_boundary_values (mg_dof_handler,
// 0,
// ZeroFunction<dim>(),
// `dofs_per_cell' and `n_q_points'
// are more or less standard names
// for these purposes.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
// Now, we said that we wanted to
// assemble the global matrix and
// for the right hand side vector,
// although access times are not so
// problematic for them.
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
// When assembling the
// contributions of each cell, we
// degrees of freedom. When we get
// them, we need a scratch array
// for these numbers:
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Now for th loop over all
// cells. You have seen before how
// mapping of DoF numbers to
// boundary values is done by the
// `map' class.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<2>(),
// all the necessary work for you
// and you don't have to care about
// the dimension dependent parts:
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Note here, that a cell is a
// quadrilateral in two space
// would like to use (i.e. the
// BoundaryValues class declared
// above):
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
BoundaryValues<dim>(),
update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Below, we will ask the
// Coefficient class to compute the
};
// Again use zero boundary values:
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(),
// per cell before: the following
// value will be set to 9 (in 2D)
// now, where it was 4 before.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
- vector<double> coefficient_values (n_q_points);
+ vector<double> coefficient_values (n_q_points);
// We can now go on with assembling
// the matrix and right hand
// from the system of equations
// happens *after* the elimination
// of hanging nodes.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(),
update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe->dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- RightHandSide<dim> right_hand_side;
- vector<double> rhs_values (n_q_points);
+ RightHandSide<dim> right_hand_side;
+ vector<double> rhs_values (n_q_points);
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
hanging_node_constraints.condense (system_matrix);
hanging_node_constraints.condense (system_rhs);
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
Solution<dim>(),
// degrees of freedom per cell of
// the Q1 element, but this is not
// something we need to care about.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// As was shown in previous
// examples as well, we need a
// we need to pass ``dim'' as
// number of components to the zero
// function as well.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(dim),
refined grids in examples/error-estimation
+Why is dof_renumbering.h in include/numerics, but dof_renumbering.cc
+ in source/dofs??
/**
- * Common template for line, quad, hex.
+ * Common template for access to the data on a line, quad, hex. Note
+ * that this class is only here for documentation purposes, the actual
+ * implementation of functions is in classes with specialized template
+ * parameters. In this class here, we only collect all functions which
+ * are in the specialized classes for simpler reference. Some
+ * functions, however, might be missing in the specialized classes,
+ * such as #quad# in the accessors for lines and quads, etc.
*
- * Access to the degrees of freedom located on lines.
* This class follows mainly the route laid out by the accessor library
* declared in the triangulation library (\Ref{TriaAccessor}). It enables
* the user to access the degrees of freedom on the lines (there are similar
*
* The \Ref{DoFDimensionInfo} classes inherited by the \Ref{DoFHandler} classes
* declare typedefs to iterators using the accessors declared in this class
- * hierarchy tree. Usage is best to happens through these typedefs, since they
+ * hierarchy tree. Usage is best to happen through these typedefs, since they
* are more secure to changes in the class naming and template interface as well
* as they provide easier typing (much less complicated names!).
*
*
* \subsection{Notes about the class hierarchy structure}
*
- * Inheritance from #DoFObjectAccessor_Inheritance<1,dim>::BaseClass# yields
- * inheritance from #CellAccessor<1># if #dim==1# and from
- * #TriaObjectAccessor<1,dim># for all other #dim# values. Thus, an object
- * of this class shares all features of cells in one dimension, but behaves
- * like an ordinary line in all other cases.
+ * See the report on this subject, which is available from the general
+ * documentation directory.
*
- * @author Wolfgang Bangerth, 1998
- * Internal: inheritance is necessary for the general template due to
- * a compiler error.
- * @author Guido Kanschat, 1999
+ *
+ * @author Wolfgang Bangerth, 1998; Guido Kanschat, 1999
+ *
+ * (Internal: inheritance is necessary for the general template due to
+ * a compiler error.)
*/
template<int celldim, int dim>
class DoFObjectAccessor : public DoFAccessor<dim>,
- public TriaObjectAccessor<celldim,dim>//DoFObjectAccessor_Inheritance<celldim,dim>::BaseClass
+ public TriaObjectAccessor<celldim,dim>
{ public:
/**
* Data type passed by the iterator class.
};
+
/**
* Access to the degrees of freedom located on lines.
* This class follows mainly the route laid out by the accessor library
* to a #DoFHandler<dim># object.
*/
DoFObjectAccessor (Triangulation<dim> *tria,
- const int level,
- const int index,
- const AccessorData *local_data) :
+ const int level,
+ const int index,
+ const AccessorData *local_data) :
DoFAccessor<dim> (local_data),
DoFObjectAccessor_Inheritance<1,dim>::BaseClass (tria,level,index) {};
* Return the index of the #i#th degree
* of freedom of this line.
*/
- int dof_index (const unsigned int i) const;
+ unsigned int dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this line to #index#.
*/
- void set_dof_index (const unsigned int i, const int index) const;
+ void set_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex.
*/
- int vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* It is assumed that the vector already
* has the right size beforehand.
*/
- void get_dof_indices (vector<int> &dof_indices) const;
+ void get_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the values of the given vector
* Return the index of the #i#th degree
* of freedom of this quad.
*/
- int dof_index (const unsigned int i) const;
+ unsigned int dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this quad to #index#.
*/
- void set_dof_index (const unsigned int i, const int index) const;
+ void set_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex.
*/
- int vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* It is assumed that the vector already
* has the right size beforehand.
*/
- void get_dof_indices (vector<int> &dof_indices) const;
+ void get_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the values of the given vector
* Return the index of the #i#th degree
* of freedom of this hex.
*/
- int dof_index (const unsigned int i) const;
+ unsigned int dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this hex to #index#.
*/
- void set_dof_index (const unsigned int i, const int index) const;
+ void set_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex.
*/
- int vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* It is assumed that the vector already
* has the right size beforehand.
*/
- void get_dof_indices (vector<int> &dof_indices) const;
+ void get_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the values of the given vector
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class DoFCellAccessor : public DoFObjectAccessor<dim, dim> {
+class DoFCellAccessor : public DoFObjectAccessor<dim, dim>
+{
public:
/**
* Declare the data type that this accessor
template <int dim>
inline
-int DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<1,dim>::dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
inline
-int DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<1,dim>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<2, ExcIndexRange (i,0,2));
template <int dim>
inline
void
-DoFObjectAccessor<1,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<1,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (dof_indices.size() == (2*dof_handler->get_fe().dofs_per_vertex +
const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = dof_handler->get_fe().dofs_per_line;
- vector<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = vertex_dof_index(vertex,d);
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<1,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<1,dim>::child (const unsigned int i) const
+{
TriaIterator<dim,DoFObjectAccessor<1,dim> > q (tria,
present_level+1,
child_index (i),
template <int dim>
inline
void
-DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a) {
+DoFObjectAccessor<1,dim>::copy_from (const DoFObjectAccessor<1,dim> &a)
+{
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
};
template <int dim>
inline
-int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const {
+unsigned int DoFObjectAccessor<2,dim>::dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
inline
-int DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<2,dim>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
template <int dim>
inline
void
-DoFObjectAccessor<2,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<2,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (dof_indices.size() == (4*dof_handler->get_fe().dofs_per_vertex +
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<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = vertex_dof_index(vertex,d);
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<2,dim>::line (const unsigned int i) const {
+DoFObjectAccessor<2,dim>::line (const unsigned int i) const
+{
Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,DoFObjectAccessor<1,dim> >
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<2,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<2,dim>::child (const unsigned int i) const
+{
TriaIterator<dim,DoFObjectAccessor<2,dim> > q (tria,
present_level+1,
child_index (i),
template <int dim>
inline
void
-DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a) {
+DoFObjectAccessor<2,dim>::copy_from (const DoFObjectAccessor<2,dim> &a)
+{
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
};
-/*------------------------- Functions: DoFObjectAccessor -----------------------*/
+/*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
template <int dim>
inline
-int DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<3,dim>::dof_index (const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
inline
-int DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const {
+unsigned int
+DoFObjectAccessor<3,dim>::vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (i,0,8));
template <int dim>
inline
void
-DoFObjectAccessor<3,dim>::get_dof_indices (vector<int> &dof_indices) const {
+DoFObjectAccessor<3,dim>::get_dof_indices (vector<unsigned int> &dof_indices) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (dof_indices.size() == (8*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<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<8; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = vertex_dof_index(vertex,d);
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<1,dim> >
-DoFObjectAccessor<3,dim>::line (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::line (const unsigned int i) const
+{
TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
return TriaIterator<dim,DoFObjectAccessor<1,dim> >
(
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<2,dim> >
-DoFObjectAccessor<3,dim>::quad (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::quad (const unsigned int i) const
+{
Assert (i<6, ExcIndexRange (i, 0, 6));
return TriaIterator<dim,DoFObjectAccessor<2,dim> >
template <int dim>
inline
TriaIterator<dim,DoFObjectAccessor<3,dim> >
-DoFObjectAccessor<3,dim>::child (const unsigned int i) const {
+DoFObjectAccessor<3,dim>::child (const unsigned int i) const
+{
TriaIterator<dim,DoFObjectAccessor<3,dim> > q (tria,
present_level+1,
child_index (i),
template <int dim>
-void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a) {
+void DoFObjectAccessor<3,dim>::copy_from (const DoFObjectAccessor<3,dim> &a)
+{
BaseClass::copy_from (a);
set_dof_handler (a.dof_handler);
};
template <int dim>
inline
TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::neighbor (const unsigned int i) const {
+DoFCellAccessor<dim>::neighbor (const unsigned int i) const
+{
TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
neighbor_level (i),
neighbor_index (i),
template <int dim>
inline
TriaIterator<dim,DoFCellAccessor<dim> >
-DoFCellAccessor<dim>::child (const unsigned int i) const {
+DoFCellAccessor<dim>::child (const unsigned int i) const
+{
TriaIterator<dim,DoFCellAccessor<dim> > q (tria,
present_level+1,
child_index (i),
* schemes like the Cuthill-McKey scheme. Basically, the function sets
* up an array in which for each degree of freedom the index is stored
* which is to be assigned by the renumbering. Using this array, the
- * #renumber_dofs(vector<int>)# function is called, which actually
+ * #renumber_dofs(vector<unsigned int>)# function is called, which actually
* does the change from old DoF indices to the ones given in the
* array. In some cases, however, a user may want to compute her own
* renumbering order; in this case, allocate an array with one element
* respective degree of freedom shall be assigned. This number may,
* for example, be obtained by sorting the support points of the
* degrees of freedom in downwind direction. Then call the
- * #renumber_dofs(vector<int>)# with the array, which converts old
+ * #renumber_dofs(vector<unsigned int>)# with the array, which converts old
* into new degree of freedom indices.
*
*
* boundary parts are continuous, i.e. the indices of degrees of freedom on
* different parts may be intermixed.
*
- * Degrees of freedom on the boundary but not on one of the specified boundary
- * parts are given the index #-1#, as if they were in the interior. If no
- * boundary indicator was given or if no face of a cell has a boundary indicator
- * contained in the given list, the vector of new indices consists solely of
- * #-1#s.
+ * Degrees of freedom on the boundary but not on one of the specified
+ * boundary parts are given the index #invalid_dof_index#, as if they
+ * were in the interior. If no boundary indicator was given or if no
+ * face of a cell has a boundary indicator contained in the given
+ * list, the vector of new indices consists solely of #invalid_dof_index#s.
*
* The question what a degree of freedom on the boundary is, is not so easy.
* It should really be a degree of freedom of which the respective basis
*/
typedef map<unsigned char,const Function<dim>*> FunctionMap;
+ /**
+ * When the arrays holding the
+ * DoF indices are set up, but
+ * before they are filled with
+ * actual values, they are set to
+ * an invalid value, in order to
+ * monitor possible
+ * problems. This invalid value
+ * is the constant defined here.
+ *
+ * Please note that you should
+ * not rely on it having a
+ * certain value, but rather take
+ * its symbolic name.
+ */
+ static const unsigned int invalid_dof_index = static_cast<unsigned int>(-1);
/**
* Constructor. Take #tria# as the
* wants to implement an ordering scheme
* herself, for example downwind numbering.
*/
- void renumber_dofs (const vector<int> &new_numbers);
+ void renumber_dofs (const vector<unsigned int> &new_numbers);
/**
* Return the maximum number of
unsigned int max_couplings_between_boundary_dofs () const;
/**
- * Create a mapping from degree of freedom
- * indices to the index of that degree
- * of freedom on the boundary. After this
- * operation, #mapping[dof]# gives the
- * index of the the degree of freedom with
- * global number #dof# in the list of
- * degrees of freedom on the boundary.
- * If the degree of freedom requested is
- * not on the boundary, the value of
- * #mapping[dof]# is #-1#. This function is
- * mainly used when setting up matrices and
- * vectors on the boundary from the trial
- * functions, which have global numbers,
- * while the matrices and vectors use
- * numbers of the trial functions local
- * to the boundary.
+ * Create a mapping from degree
+ * of freedom indices to the
+ * index of that degree of
+ * freedom on the boundary. After
+ * this operation, #mapping[dof]#
+ * gives the index of the the
+ * degree of freedom with global
+ * number #dof# in the list of
+ * degrees of freedom on the
+ * boundary. If the degree of
+ * freedom requested is not on
+ * the boundary, the value of
+ * #mapping[dof]# is
+ * #invalid_dof_index#. This
+ * function is mainly used when
+ * setting up matrices and
+ * vectors on the boundary from
+ * the trial functions, which
+ * have global numbers, while the
+ * matrices and vectors use
+ * numbers of the trial functions
+ * local to the boundary.
*
* Prior content of #mapping# is deleted.
*
* for more information on boundary
* treatment.
*/
- void map_dof_to_boundary_indices (vector<int> &mapping) const;
+ void map_dof_to_boundary_indices (vector<unsigned int> &mapping) const;
/**
* Same as the previous function, except
* See the general doc of this class for
* more information.
*/
- void map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
- vector<int> &mapping) const;
+ void map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
+ vector<unsigned int> &mapping) const;
/**
* @name Cell iterator functions
* Array to store the indices for degrees
* of freedom located at vertices.
*/
- vector<int> vertex_dofs;
+ vector<unsigned int> vertex_dofs;
#if (__GNUC__==2) && (__GNUC_MINOR__ < 95)
* other types than those explicitely instantiated.
*/
template <int N>
-class DoFLevel {
+class DoFLevel
+{
private:
/**
* Make the constructor private to avoid
* different treatment in multigrid environments. If no multigrid is used, the
* indices are stored in the #vertex_dofs# array of the #DoFHandler# class.
*/
-class DoFLevel<1> {
+class DoFLevel<1>
+{
public:
/**
* Store the global indices of the degrees
* of freedom. See \Ref{DoFLevel} for
* detailed information.
*/
- vector<int> line_dofs;
+ vector<unsigned int> line_dofs;
};
* of freedom. See \Ref{DoFLevel} for
* detailed information.
*/
- vector<int> quad_dofs;
+ vector<unsigned int> quad_dofs;
};
* of freedom. See \Ref{DoFLevel} for
* detailed information.
*/
- vector<int> hex_dofs;
+ vector<unsigned int> hex_dofs;
};
*/
template<int dim>
static void
- make_boundary_sparsity_pattern (const DoFHandler<dim> &dof,
- const vector<int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity_pattern);
+ make_boundary_sparsity_pattern (const DoFHandler<dim> &dof,
+ const vector<unsigned int> &dof_to_boundary_mapping,
+ SparsityPattern &sparsity_pattern);
/**
* Write the sparsity structure of the
static void
make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
const typename DoFHandler<dim>::FunctionMap &boundary_indicators,
- const vector<int> &dof_to_boundary_mapping,
+ const vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
/**
// the vector?
while (present_index
>=
- (int)tria->levels[present_level]->lines.lines.size())
+ static_cast<int>(tria->levels[present_level]->lines.lines.size()))
{
// no -> go one level up until we find
// one with more than zero cells
++present_level;
present_index = 0;
// highest level reached?
- if (present_level >= (int)tria->levels.size())
+ if (present_level >= static_cast<int>(tria->levels.size()))
{
// return with past the end pointer
present_level = present_index = -1;
// the vector?
while (present_index
>=
- (int)tria->levels[present_level]->quads.quads.size())
+ static_cast<int>(tria->levels[present_level]->quads.quads.size()))
{
// no -> go one level up
++present_level;
present_index = 0;
// highest level reached?
- if (present_level >= (int)tria->levels.size())
+ if (present_level >= static_cast<int>(tria->levels.size()))
{
// return with past the end pointer
present_level = present_index = -1;
// the vector?
while (present_index
>=
- (int)tria->levels[present_level]->hexes.hexes.size())
+ static_cast<int>(tria->levels[present_level]->hexes.hexes.size()))
{
// no -> go one level up
++present_level;
present_index = 0;
// highest level reached?
- if (present_level >= (int)tria->levels.size())
+ if (present_level >= static_cast<int>(tria->levels.size()))
{
// return with past the end pointer
present_level = present_index = -1;
// the vector?
while (present_index
>=
- (int)tria->levels[present_level]->hexes.hexes.size())
+ static_cast<int>(tria->levels[present_level]->hexes.hexes.size()))
{
// no -> go one level up
++present_level;
present_index = 0;
// highest level reached?
- if (present_level >= (int)tria->levels.size())
+ if (present_level >= static_cast<int>(tria->levels.size()))
{
// return with past the end pointer
present_level = present_index = -1;
* of freedom of this line on the level
* this line lives on.
*/
- int mg_dof_index (const unsigned int i) const;
+ unsigned int mg_dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this line on the
* level this line lives on to #index#.
*/
- void set_mg_dof_index (const unsigned int i, const int index) const;
+ void set_mg_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex for the
* level this line lives on.
*/
- int mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* indices refer to the local numbering
* for the level this line lives on.
*/
- void get_mg_dof_indices (vector<int> &dof_indices) const;
+ void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the value of the given vector
* of freedom of this quad on the level
* this quad lives on.
*/
- int mg_dof_index (const unsigned int i) const;
+ unsigned int mg_dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this quad on the
* level this quad lives on to #index#.
*/
- void set_mg_dof_index (const unsigned int i, const int index) const;
+ void set_mg_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex for the level
* this quad lives on.
*/
- int mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* indices refer to the local numbering
* for the level this quad lives on.
*/
- void get_mg_dof_indices (vector<int> &dof_indices) const;
+ void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the value of the given vector
* of freedom of this hex on the level
* this quad lives on.
*/
- int mg_dof_index (const unsigned int i) const;
+ unsigned int mg_dof_index (const unsigned int i) const;
/**
* Set the index of the #i#th degree
* of freedom of this hex on the
* level this hex lives on to #index#.
*/
- void set_mg_dof_index (const unsigned int i, const int index) const;
+ void set_mg_dof_index (const unsigned int i,
+ const unsigned int index) const;
/**
* Return the index of the #i#th degree
* on the #vertex#th vertex for the level
* this hex lives on.
*/
- int mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const;
+ unsigned int mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const;
/**
* Set the index of the #i#th degree
*/
void set_mg_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const;
+ const unsigned int index) const;
/**
* Return the indices of the dofs of this
* indices refer to the local numbering
* for the level this hex lives on.
*/
- void get_mg_dof_indices (vector<int> &dof_indices) const;
+ void get_mg_dof_indices (vector<unsigned int> &dof_indices) const;
/**
* Return the value of the given vector
* order of the old indices.
*/
void renumber_dofs (const unsigned int level,
- const vector<int> &new_numbers);
+ const vector<unsigned int> &new_numbers);
/*--------------------------------------*/
* The function is inline, so should
* be reasonably fast.
*/
- int get_index (const unsigned int level,
- const unsigned int dof_number,
- const unsigned int dofs_per_vertex) const;
+ unsigned int get_index (const unsigned int level,
+ const unsigned int dof_number,
+ const unsigned int dofs_per_vertex) const;
/**
* Return the index of the coarsest
/**
* Array holding the indices.
*/
- int *indices;
+ unsigned int *indices;
};
template <int dim>
inline
-int MGDoFHandler<dim>::MGVertexDoFs::get_index (const unsigned int level,
- const unsigned int dof_number,
- const unsigned int dofs_per_vertex) const {
+unsigned int
+MGDoFHandler<dim>::MGVertexDoFs::get_index (const unsigned int level,
+ const unsigned int dof_number,
+ const unsigned int dofs_per_vertex) const {
Assert ((level >= coarsest_level) && (level <= finest_level),
ExcInvalidLevel(level));
Assert (dof_number < dofs_per_vertex,
* These arrays are set by the constructor.
* The entries for each level are sorted ascendingly.
*/
- vector<vector<int> > interior_boundary_dofs;
+ vector<vector<unsigned int> > interior_boundary_dofs;
};
defect.clear();
// constraints->condense(src);
- vector<int> global_dof_indices (dofs_per_cell);
- vector<int> level_dof_indices (dofs_per_cell);
- vector<int> level_face_indices (dofs_per_face);
+ vector<unsigned int> global_dof_indices (dofs_per_cell);
+ vector<unsigned int> level_dof_indices (dofs_per_cell);
+ vector<unsigned int> level_face_indices (dofs_per_face);
// initialize the objects with
// their correct size
{
const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
- vector<int> global_dof_indices (dofs_per_cell);
- vector<int> level_dof_indices (dofs_per_cell);
+ vector<unsigned int> global_dof_indices (dofs_per_cell);
+ vector<unsigned int> level_dof_indices (dofs_per_cell);
DoFHandler<dim>::active_cell_iterator
global_cell = mg_dof_handler->DoFHandler<dim>::begin_active();
* different methods.
*/
template <int dim>
- static void Cuthill_McKee (DoFHandler<dim> &dof_handler,
- const bool reversed_numbering = false,
- const bool use_constraints = false,
- const vector<int> &starting_indices = vector<int>());
+ static void Cuthill_McKee (DoFHandler<dim> &dof_handler,
+ const bool reversed_numbering = false,
+ const bool use_constraints = false,
+ const vector<unsigned int> &starting_indices = vector<unsigned int>());
/**
* Renumber the degrees of freedom
* different methods.
*/
template <int dim>
- static void Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
- const unsigned int level,
- const bool reversed_numbering = false,
- const vector<int> &starting_indices = vector<int> ());
+ static void Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
+ const unsigned int level,
+ const bool reversed_numbering = false,
+ const vector<unsigned int> &starting_indices = vector<unsigned int> ());
/**
* Sort the degrees of freedom by
SparseMatrix<double> &matrix,
const FunctionMap &rhs,
Vector<double> &rhs_vector,
- vector<int> &vec_to_dof_mapping,
+ vector<unsigned int> &vec_to_dof_mapping,
const Function<dim> *a = 0);
/**
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class MatrixTools : public MatrixCreator<dim> {
+class MatrixTools : public MatrixCreator<dim>
+{
public:
/**
* Apply dirichlet boundary conditions
* as described in the general
* documentation.
*/
- static void apply_boundary_values (const map<int,double> &boundary_values,
+ static void apply_boundary_values (const map<unsigned int,double> &boundary_values,
SparseMatrix<double> &matrix,
Vector<double> &solution,
Vector<double> &right_hand_side);
* #vector<Vector<number> >vector all_in# includes
* all discrete functions to be interpolated onto the new grid.
*
- * As we need two different kinds of pointers (#vector<int> *# for the Dof
+ * As we need two different kinds of pointers (#vector<unsigned int> *# for the Dof
* indices and #vector<Vector<number> > *# for the interpolated DoF values)
* we use the #Pointerstruct# that includes both of these pointers and
* the #user_pointer# of each cell points to these #Pointerstructs#.
* On each cell only one of the two different pointers is used at one time
* hence we could use the
- * #void * user_pointer# as #vector<int> *# at one time and as
+ * #void * user_pointer# as #vector<unsigned int> *# at one time and as
* #vector<Vector<number> > *# at the other but using this #Pointerstruct#
* in between makes the use of these pointers more safe and gives better
* possibility to expand their usage.
* and stores all dof indices
* of the cells that'll be refined
*/
- vector<vector<int> > indices_on_cell;
+ vector<vector<unsigned int> > indices_on_cell;
/**
* All cell data (the dof indices and
* data need to be packetized in a structure.
* Note that in our case on each cell
* either the
- * #vector<int> indices# (if the cell
+ * #vector<unsigned int> indices# (if the cell
* will be refined) or the
* #vector<double> dof_values# (if the
* children of this cell will be deleted)
* 'multiplied' by this structure.
*/
struct Pointerstruct {
- vector<int> *indices_ptr;
+ vector<unsigned int> *indices_ptr;
vector<Vector<number> > *dof_values_ptr;
};
* information.
*/
template <int dim>
- static void interpolate_boundary_values (const DoFHandler<dim> &dof,
- const unsigned char boundary_component,
- const Function<dim> &boundary_function,
- map<int,double> &boundary_values,
- const vector<bool> &component_mask = vector<bool>());
+ static void interpolate_boundary_values (const DoFHandler<dim> &dof,
+ const unsigned char boundary_component,
+ const Function<dim> &boundary_function,
+ map<unsigned int,double> &boundary_values,
+ const vector<bool> &component_mask = vector<bool>());
//TODO: Update project_boundary_values for more components
//TODO: Replace FunctionMap
* class for further information.
*/
template <int dim>
- static void project_boundary_values (const DoFHandler<dim> &dof,
+ static void project_boundary_values (const DoFHandler<dim> &dof,
const map<unsigned char,const Function<dim>*> &boundary_function,
- const Quadrature<dim-1>&q,
- map<int,double> &boundary_values);
+ const Quadrature<dim-1> &q,
+ map<unsigned int,double> &boundary_values);
/**
* Compute the error of the finite element solution.
template <int dim>
void DoFObjectAccessor<1, dim>::set_dof_index (const unsigned int i,
- const int index) const {
+ const unsigned int index) const
+{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
void DoFObjectAccessor<1, dim>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const {
+ const unsigned int index) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<2, ExcIndexRange (i,0,2));
const unsigned int n_dofs = local_source.size();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell vector
const unsigned int n_dofs = local_source.m();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell matrix
template <int dim>
void DoFObjectAccessor<2, dim>::set_dof_index (const unsigned int i,
- const int index) const {
+ const unsigned int index) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
-void DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
- const unsigned int i,
- const int index) const {
+void
+DoFObjectAccessor<2, dim>::set_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i,
+ const unsigned int index) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<4, ExcIndexRange (i,0,4));
const unsigned int n_dofs = local_source.size();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell vector
const unsigned int n_dofs = local_source.m();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell matrix
template <int dim>
void DoFObjectAccessor<3, dim>::set_dof_index (const unsigned int i,
- const int index) const {
+ const unsigned int index) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
// make sure a FE has been selected
// and enough room was reserved
template <int dim>
void DoFObjectAccessor<3, dim>::set_vertex_dof_index (const unsigned int vertex,
const unsigned int i,
- const int index) const {
+ const unsigned int index) const
+{
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (vertex<8, ExcIndexRange (i,0,8));
const unsigned int n_dofs = local_source.size();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell vector
const unsigned int n_dofs = local_source.m();
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// distribute cell matrix
template <>
DoFHandler<1>::raw_hex_iterator
-DoFHandler<1>::begin_raw_hex (unsigned int) const {
+DoFHandler<1>::begin_raw_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
template <>
DoFHandler<1>::hex_iterator
-DoFHandler<1>::begin_hex (unsigned int) const {
+DoFHandler<1>::begin_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
template <>
DoFHandler<1>::active_hex_iterator
-DoFHandler<1>::begin_active_hex (unsigned int) const {
+DoFHandler<1>::begin_active_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
template <>
DoFHandler<2>::raw_hex_iterator
-DoFHandler<2>::begin_raw_hex (unsigned int) const {
+DoFHandler<2>::begin_raw_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
template <>
DoFHandler<2>::hex_iterator
-DoFHandler<2>::begin_hex (unsigned int) const {
+DoFHandler<2>::begin_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
template <>
DoFHandler<2>::active_hex_iterator
-DoFHandler<2>::begin_active_hex (unsigned int) const {
+DoFHandler<2>::begin_active_hex (const unsigned int) const {
Assert (false, ExcNotImplemented());
return 0;
};
set<int> boundary_dofs;
const unsigned int dofs_per_face = selected_fe->dofs_per_face;
- vector<int> dofs_on_face(dofs_per_face);
+ vector<unsigned int> dofs_on_face(dofs_per_face);
active_face_iterator face = begin_active_face (),
endf = end_face();
for (; face!=endf; ++face)
set<int> boundary_dofs;
const unsigned int dofs_per_face = selected_fe->dofs_per_face;
- vector<int> dofs_on_face(dofs_per_face);
+ vector<unsigned int> dofs_on_face(dofs_per_face);
active_face_iterator face = begin_active_face (),
endf = end_face();
for (; face!=endf; ++face)
// check whether dofs for this
// vertex have been distributed
// (only check the first dof)
- if (cell->vertex_dof_index(vertex, 0) == -1)
+ if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
cell->set_vertex_dof_index (vertex, d, next_free_dof++);
// distribute dofs if necessary:
// check whether line dof is already
// numbered (check only first dof)
- if (line->dof_index(0) == -1)
+ if (line->dof_index(0) == invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
line->set_dof_index (d, next_free_dof++);
// check whether dofs for this
// vertex have been distributed
// (only check the first dof)
- if (cell->vertex_dof_index(vertex, 0) == -1)
+ if (cell->vertex_dof_index(vertex, 0) == invalid_dof_index)
for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
cell->set_vertex_dof_index (vertex, d, next_free_dof++);
// distribute dofs if necessary:
// check whether line dof is already
// numbered (check only first dof)
- if (line->dof_index(0) == -1)
+ if (line->dof_index(0) == invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
line->set_dof_index (d, next_free_dof++);
// distribute dofs if necessary:
// check whether quad dof is already
// numbered (check only first dof)
- if (quad->dof_index(0) == -1)
+ if (quad->dof_index(0) == invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_quad; ++d)
quad->set_dof_index (d, next_free_dof++);
#if deal_II_dimension == 1
template <>
-void DoFHandler<1>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<1>::renumber_dofs (const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
#ifdef DEBUG
// assert that the new indices are
// consecutively numbered
if (true)
{
- vector<int> tmp(new_numbers);
+ vector<unsigned int> tmp(new_numbers);
sort (tmp.begin(), tmp.end());
- vector<int>::const_iterator p = tmp.begin();
- int i = 0;
+ vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
for (; p!=tmp.end(); ++p, ++i)
Assert (*p == i, ExcNewNumbersNotConsecutive(i));
};
// two cells more than once. Anyway, this
// way it's not only more correct but also
// faster; note, however, that dof numbers
- // may be -1, namely when the appropriate
+ // may be invalid_dof_index, namely when the appropriate
// vertex/line/etc is unused
- for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
- if (*i != -1)
+ for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
else
- // if index is -1: check if this one
+ // if index is invalid_dof_index: check if this one
// really is unused
Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
selected_fe->dofs_per_vertex] == false,
ExcInternalError ());
for (unsigned int level=0; level<levels.size(); ++level)
- for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
i!=levels[level]->line_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
};
#if deal_II_dimension == 2
template <>
-void DoFHandler<2>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<2>::renumber_dofs (const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
#ifdef DEBUG
// assert that the new indices are
// consecutively numbered
if (true)
{
- vector<int> tmp(new_numbers);
+ vector<unsigned int> tmp(new_numbers);
sort (tmp.begin(), tmp.end());
- vector<int>::const_iterator p = tmp.begin();
- int i = 0;
+ vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
for (; p!=tmp.end(); ++p, ++i)
Assert (*p == i, ExcNewNumbersNotConsecutive(i));
};
// two cells more than once. Anyway, this
// way it's not only more correct but also
// faster; note, however, that dof numbers
- // may be -1, namely when the appropriate
+ // may be invalid_dof_index, namely when the appropriate
// vertex/line/etc is unused
- for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
- if (*i != -1)
+ for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
else
- // if index is -1: check if this one
+ // if index is invalid_dof_index: check if this one
// really is unused
Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
selected_fe->dofs_per_vertex] == false,
for (unsigned int level=0; level<levels.size(); ++level)
{
- for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
i!=levels[level]->line_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
- for (vector<int>::iterator i=levels[level]->quad_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
i!=levels[level]->quad_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
};
};
#if deal_II_dimension == 3
template <>
-void DoFHandler<3>::renumber_dofs (const vector<int> &new_numbers) {
+void DoFHandler<3>::renumber_dofs (const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
#ifdef DEBUG
// assert that the new indices are
// consecutively numbered
if (true)
{
- vector<int> tmp(new_numbers);
+ vector<unsigned int> tmp(new_numbers);
sort (tmp.begin(), tmp.end());
- vector<int>::const_iterator p = tmp.begin();
- int i = 0;
+ vector<unsigned int>::const_iterator p = tmp.begin();
+ unsigned int i = 0;
for (; p!=tmp.end(); ++p, ++i)
Assert (*p == i, ExcNewNumbersNotConsecutive(i));
};
// two cells more than once. Anyway, this
// way it's not only more correct but also
// faster; note, however, that dof numbers
- // may be -1, namely when the appropriate
+ // may be invalid_dof_index, namely when the appropriate
// vertex/line/etc is unused
- for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
- if (*i != -1)
+ for (vector<unsigned int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
else
- // if index is -1: check if this one
+ // if index is invalid_dof_index: check if this one
// really is unused
Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
selected_fe->dofs_per_vertex] == false,
for (unsigned int level=0; level<levels.size(); ++level)
{
- for (vector<int>::iterator i=levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->line_dofs.begin();
i!=levels[level]->line_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
- for (vector<int>::iterator i=levels[level]->quad_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->quad_dofs.begin();
i!=levels[level]->quad_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
- for (vector<int>::iterator i=levels[level]->hex_dofs.begin();
+ for (vector<unsigned int>::iterator i=levels[level]->hex_dofs.begin();
i!=levels[level]->hex_dofs.end(); ++i)
- if (*i != -1)
+ if (*i != invalid_dof_index)
*i = new_numbers[*i];
};
};
#if deal_II_dimension == 1
template <>
-void DoFHandler<1>::map_dof_to_boundary_indices (vector<int> &) const {
+void DoFHandler<1>::map_dof_to_boundary_indices (vector<unsigned int> &) const {
Assert (selected_fe != 0, ExcNoFESelected());
Assert (false, ExcNotImplemented());
};
template <>
void DoFHandler<1>::map_dof_to_boundary_indices (const FunctionMap &,
- vector<int> &) const {
+ vector<unsigned int> &) const {
Assert (selected_fe != 0, ExcNoFESelected());
Assert (false, ExcNotImplemented());
};
template <int dim>
-void DoFHandler<dim>::map_dof_to_boundary_indices (vector<int> &mapping) const {
+void DoFHandler<dim>::map_dof_to_boundary_indices (vector<unsigned int> &mapping) const
+{
Assert (selected_fe != 0, ExcNoFESelected());
mapping.clear ();
- mapping.insert (mapping.end(), n_dofs(), -1);
+ mapping.insert (mapping.end(), n_dofs(), invalid_dof_index);
const unsigned int dofs_per_face = selected_fe->dofs_per_face;
- vector<int> dofs_on_face(dofs_per_face);
- int next_boundary_index = 0;
+ vector<unsigned int> dofs_on_face(dofs_per_face);
+ unsigned int next_boundary_index = 0;
active_face_iterator face = begin_active_face(),
endf = end_face();
{
face->get_dof_indices (dofs_on_face);
for (unsigned int i=0; i<dofs_per_face; ++i)
- if (mapping[dofs_on_face[i]] == -1)
+ if (mapping[dofs_on_face[i]] == invalid_dof_index)
mapping[dofs_on_face[i]] = next_boundary_index++;
};
- Assert (static_cast<unsigned int>(next_boundary_index) == n_boundary_dofs(),
+ Assert (next_boundary_index == n_boundary_dofs(),
ExcInternalError());
};
template <int dim>
-void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
- vector<int> &mapping) const {
+void DoFHandler<dim>::map_dof_to_boundary_indices (const FunctionMap &boundary_indicators,
+ vector<unsigned int> &mapping) const
+{
Assert (selected_fe != 0, ExcNoFESelected());
Assert (boundary_indicators.find(255) == boundary_indicators.end(),
ExcInvalidBoundaryIndicator());
mapping.clear ();
- mapping.insert (mapping.end(), n_dofs(), -1);
+ mapping.insert (mapping.end(), n_dofs(), invalid_dof_index);
// return if there is nothing to do
if (boundary_indicators.size() == 0)
return;
const unsigned int dofs_per_face = selected_fe->dofs_per_face;
- vector<int> dofs_on_face(dofs_per_face);
- int next_boundary_index = 0;
+ vector<unsigned int> dofs_on_face(dofs_per_face);
+ unsigned int next_boundary_index = 0;
active_face_iterator face = begin_active_face(),
endf = end_face();
{
face->get_dof_indices (dofs_on_face);
for (unsigned int i=0; i<dofs_per_face; ++i)
- if (mapping[dofs_on_face[i]] == -1)
+ if (mapping[dofs_on_face[i]] == invalid_dof_index)
mapping[dofs_on_face[i]] = next_boundary_index++;
};
- Assert (static_cast<unsigned int>(next_boundary_index)
- == n_boundary_dofs(boundary_indicators),
+ Assert (next_boundary_index == n_boundary_dofs(boundary_indicators),
ExcInternalError());
};
// their size
clear_space ();
- vertex_dofs = vector<int>(tria->vertices.size()*
- selected_fe->dofs_per_vertex,
- -1);
+ vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+ selected_fe->dofs_per_vertex,
+ invalid_dof_index);
for (unsigned int i=0; i<tria->n_levels(); ++i)
{
levels.push_back (new DoFLevel<1>);
- levels.back()->line_dofs = vector<int>(tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
+ levels.back()->line_dofs = vector<unsigned int>(tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ invalid_dof_index);
};
};
// their size
clear_space ();
- vertex_dofs = vector<int>(tria->vertices.size()*
- selected_fe->dofs_per_vertex,
- -1);
+ vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+ selected_fe->dofs_per_vertex,
+ invalid_dof_index);
for (unsigned int i=0; i<tria->n_levels(); ++i)
{
levels.push_back (new DoFLevel<2>);
- levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
- levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
- selected_fe->dofs_per_quad,
- -1);
+ levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ invalid_dof_index);
+ levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+ selected_fe->dofs_per_quad,
+ invalid_dof_index);
};
};
// their size
clear_space ();
- vertex_dofs = vector<int>(tria->vertices.size()*
- selected_fe->dofs_per_vertex,
- -1);
+ vertex_dofs = vector<unsigned int>(tria->vertices.size()*
+ selected_fe->dofs_per_vertex,
+ invalid_dof_index);
for (unsigned int i=0; i<tria->n_levels(); ++i)
{
levels.push_back (new DoFLevel<3>);
- levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
- levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
- selected_fe->dofs_per_quad,
- -1);
- levels.back()->hex_dofs = vector<int> (tria->levels[i]->hexes.hexes.size() *
- selected_fe->dofs_per_hex,
- -1);
+ levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ invalid_dof_index);
+ levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+ selected_fe->dofs_per_quad,
+ invalid_dof_index);
+ levels.back()->hex_dofs = vector<unsigned int> (tria->levels[i]->hexes.hexes.size() *
+ selected_fe->dofs_per_hex,
+ invalid_dof_index);
};
};
template <int dim>
-void DoFRenumbering::Cuthill_McKee (DoFHandler<dim> &dof_handler,
- const bool reversed_numbering,
- const bool use_constraints,
- const vector<int> &starting_indices) {
+void DoFRenumbering::Cuthill_McKee (DoFHandler<dim> &dof_handler,
+ const bool reversed_numbering,
+ const bool use_constraints,
+ const vector<unsigned int> &starting_indices)
+{
// make the connection graph
SparsityPattern sparsity (dof_handler.n_dofs(),
dof_handler.max_couplings_between_dofs());
constraints.condense (sparsity);
};
- const int n_dofs = sparsity.n_rows();
- // store the new dof numbers; -1 means
+ const unsigned int n_dofs = sparsity.n_rows();
+ // store the new dof numbers; invalid_dof_index means
// that no new number was chosen yet
- vector<int> new_number(sparsity.n_rows(), -1);
+ vector<unsigned int> new_number(sparsity.n_rows(), DoFHandler<dim>::invalid_dof_index);
// store the indices of the dofs renumbered
// in the last round. Default to starting
// points
- vector<int> last_round_dofs (starting_indices);
+ vector<unsigned int> last_round_dofs (starting_indices);
// delete disallowed elements
for (unsigned int i=0; i<last_round_dofs.size(); ++i)
- if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
- last_round_dofs[i] = -1;
+ if ((last_round_dofs[i]==DoFHandler<dim>::invalid_dof_index) ||
+ (last_round_dofs[i]>=n_dofs))
+ last_round_dofs[i] = DoFHandler<dim>::invalid_dof_index;
remove_if (last_round_dofs.begin(), last_round_dofs.end(),
- bind2nd(equal_to<int>(), -1));
+ bind2nd(equal_to<unsigned int>(), DoFHandler<dim>::invalid_dof_index));
// now if no valid points remain:
// find dof with lowest coordination
if (last_round_dofs.size() == 0)
{
- int starting_point = -1;
+ unsigned int starting_point = DoFHandler<dim>::invalid_dof_index;
unsigned int min_coordination = n_dofs;
- for (int row=0; row<n_dofs; ++row)
+ for (unsigned int row=0; row<n_dofs; ++row)
{
unsigned int j;
// if that should be the case, we can
// chose an arbitrary dof as starting
// point, e.g. the one with number zero
- if (starting_point == -1)
+ if (starting_point == DoFHandler<dim>::invalid_dof_index)
starting_point = 0;
// initialize the first dof
// store next free dof index
- int next_free_number = 0;
+ unsigned int next_free_number = 0;
// enumerate the first round dofs
for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
{
// store the indices of the dofs to be
// renumbered in the next round
- vector<int> next_round_dofs;
+ vector<unsigned int> next_round_dofs;
// find all neighbors of the
// dofs numbered in the last
sort (next_round_dofs.begin(), next_round_dofs.end());
// delete multiple entries
- vector<int>::iterator end_sorted;
+ vector<unsigned int>::iterator end_sorted;
end_sorted = unique (next_round_dofs.begin(), next_round_dofs.end());
next_round_dofs.erase (end_sorted, next_round_dofs.end());
// eliminate dofs which are
// already numbered
for (int s=next_round_dofs.size()-1; s>=0; --s)
- if (new_number[next_round_dofs[s]] != -1)
+ if (new_number[next_round_dofs[s]] != DoFHandler<dim>::invalid_dof_index)
next_round_dofs.erase (&next_round_dofs[s]);
// check whether there are any new
// find coordination number for
// each of these dofs
- for (vector<int>::iterator s=next_round_dofs.begin();
+ for (vector<unsigned int>::iterator s=next_round_dofs.begin();
s!=next_round_dofs.end(); ++s)
{
unsigned int coordination = 0;
#ifdef DEBUG
// test for all indices numbered
- if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
+ if (find (new_number.begin(), new_number.end(), DoFHandler<dim>::invalid_dof_index) != new_number.end())
Assert (false, ExcRenumberingIncomplete());
Assert (next_free_number == n_dofs,
ExcRenumberingIncomplete());
#endif
if (reversed_numbering)
- for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
+ for (vector<unsigned int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
*i = n_dofs-*i;
// actually perform renumbering;
template <int dim>
-void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
- const unsigned int level,
- const bool reversed_numbering,
- const vector<int> &starting_indices) {
+void DoFRenumbering::Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
+ const unsigned int level,
+ const bool reversed_numbering,
+ const vector<unsigned int> &starting_indices) {
// make the connection graph
SparsityPattern sparsity (dof_handler.n_dofs(level),
dof_handler.max_couplings_between_dofs());
MGDoFTools::make_sparsity_pattern (dof_handler, level, sparsity);
- const int n_dofs = sparsity.n_rows();
- // store the new dof numbers; -1 means
+ const unsigned int n_dofs = sparsity.n_rows();
+ // store the new dof numbers; invalid_dof_index means
// that no new number was chosen yet
- vector<int> new_number(n_dofs, -1);
+ vector<unsigned int> new_number(n_dofs, DoFHandler<dim>::invalid_dof_index);
// store the indices of the dofs renumbered
// in the last round. Default to starting
// points
- vector<int> last_round_dofs (starting_indices);
+ vector<unsigned int> last_round_dofs (starting_indices);
// delete disallowed elements
for (unsigned int i=0; i<last_round_dofs.size(); ++i)
- if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
- last_round_dofs[i] = -1;
+ if ((last_round_dofs[i]==DoFHandler<dim>::invalid_dof_index) ||
+ (last_round_dofs[i]>=n_dofs))
+ last_round_dofs[i] = DoFHandler<dim>::invalid_dof_index;
remove_if (last_round_dofs.begin(), last_round_dofs.end(),
- bind2nd(equal_to<int>(), -1));
+ bind2nd(equal_to<unsigned int>(), DoFHandler<dim>::invalid_dof_index));
// now if no valid points remain:
// find dof with lowest coordination
if (last_round_dofs.size() == 0)
{
- int starting_point = -1;
+ unsigned int starting_point = DoFHandler<dim>::invalid_dof_index;
unsigned int min_coordination = n_dofs;
- for (int row=0; row<n_dofs; ++row)
+ for (unsigned int row=0; row<n_dofs; ++row)
{
unsigned int j;
for (j=sparsity.get_rowstart_indices()[row];
// store next free dof index
- int next_free_number = 0;
+ unsigned int next_free_number = 0;
// enumerate the first round dofs
for (unsigned int i=0; i!=last_round_dofs.size(); ++i)
{
// store the indices of the dofs to be
// renumbered in the next round
- vector<int> next_round_dofs;
+ vector<unsigned int> next_round_dofs;
// find all neighbors of the
// dofs numbered in the last
sort (next_round_dofs.begin(), next_round_dofs.end());
// delete multiple entries
- vector<int>::iterator end_sorted;
+ vector<unsigned int>::iterator end_sorted;
end_sorted = unique (next_round_dofs.begin(), next_round_dofs.end());
next_round_dofs.erase (end_sorted, next_round_dofs.end());
// eliminate dofs which are
// already numbered
for (int s=next_round_dofs.size()-1; s>=0; --s)
- if (new_number[next_round_dofs[s]] != -1)
+ if (new_number[next_round_dofs[s]] != DoFHandler<dim>::invalid_dof_index)
next_round_dofs.erase (&next_round_dofs[s]);
// check whether there are any new
// find coordination number for
// each of these dofs
- for (vector<int>::iterator s=next_round_dofs.begin();
+ for (vector<unsigned int>::iterator s=next_round_dofs.begin();
s!=next_round_dofs.end(); ++s)
{
unsigned int coordination = 0;
#ifdef DEBUG
// test for all indices numbered
- if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
+ if (find (new_number.begin(), new_number.end(),
+ DoFHandler<dim>::invalid_dof_index)
+ !=
+ new_number.end())
Assert (false, ExcRenumberingIncomplete());
Assert (next_free_number == n_dofs,
ExcRenumberingIncomplete());
#endif
if (reversed_numbering)
- for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
+ for (vector<unsigned int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
*i = n_dofs-*i;
// actually perform renumbering;
// vector to hold the dof indices on
// the cell we visit at a time
- vector<int> local_dof_indices(dofs_per_cell);
+ vector<unsigned int> local_dof_indices(dofs_per_cell);
// prebuilt list to which component
// a given dof on a cell belongs
vector<unsigned int> component_list (dofs_per_cell);
// sorted by dof index. note also that some
// dof indices are entered multiply, so we
// will have to take care of that
- vector<vector<int> > component_to_dof_map (dof_handler.get_fe().n_components());
+ vector<vector<unsigned int> > component_to_dof_map (dof_handler.get_fe().n_components());
for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
cell!=dof_handler.end(); ++cell)
{
component_to_dof_map[component].end());
};
- int next_free_index = 0;
- vector<int> new_indices (dof_handler.n_dofs(), -1);
+ unsigned int next_free_index = 0;
+ vector<unsigned int> new_indices (dof_handler.n_dofs(), DoFHandler<dim>::invalid_dof_index);
for (unsigned int component=0; component<dof_handler.get_fe().n_components(); ++component)
{
- const typename vector<int>::const_iterator
+ const typename vector<unsigned int>::const_iterator
begin_of_component = component_to_dof_map[component].begin(),
end_of_component = component_to_dof_map[component].end();
- for (typename vector<int>::const_iterator dof_index = begin_of_component;
+ for (typename vector<unsigned int>::const_iterator dof_index = begin_of_component;
dof_index != end_of_component; ++dof_index)
new_indices[*dof_index] = next_free_index++;
};
- Assert (next_free_index == static_cast<int>(dof_handler.n_dofs()),
+ Assert (next_free_index == dof_handler.n_dofs(),
ExcInternalError());
dof_handler.renumber_dofs (new_indices);
void DoFRenumbering::Cuthill_McKee (DoFHandler<deal_II_dimension> &dof_handler,
const bool reversed_numbering,
const bool use_constraints,
- const vector<int> &starting_indices);
+ const vector<unsigned int> &starting_indices);
template
void DoFRenumbering::Cuthill_McKee (MGDoFHandler<deal_II_dimension> &dof_handler,
const unsigned int level,
const bool reversed_numbering,
- const vector<int> &starting_indices);
+ const vector<unsigned int> &starting_indices);
template
void DoFRenumbering::component_wise (DoFHandler<deal_II_dimension> &dof_handler,
ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- vector<int> dofs_on_this_cell(dofs_per_cell);
+ vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
+ endc = dof.end();
for (; cell!=endc; ++cell)
{
cell->get_dof_indices (dofs_on_this_cell);
[dof.get_fe().system_to_component_index(j).first];
- vector<int> dofs_on_this_cell(dofs_per_cell);
+ vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell!=endc; ++cell)
template <>
void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&,
- const vector<int> &,
+ const vector<unsigned int> &,
SparsityPattern &)
{
Assert (false, ExcInternalError());
void
DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1>&,
const DoFHandler<1>::FunctionMap &,
- const vector<int> &,
+ const vector<unsigned int> &,
SparsityPattern &)
{
Assert (false, ExcInternalError());
template <int dim>
void
DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
- const vector<int> &dof_to_boundary_mapping,
+ const vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
const unsigned int n_dofs = dof.n_dofs();
Assert (sparsity.n_cols() == dof.n_boundary_dofs(),
ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs()));
Assert (*max_element(dof_to_boundary_mapping.begin(),
- dof_to_boundary_mapping.end()) == (signed int)sparsity.n_rows()-1,
+ dof_to_boundary_mapping.end()) == sparsity.n_rows()-1,
ExcInternalError());
const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
- vector<int> dofs_on_this_face(dofs_per_face);
+ vector<unsigned int> dofs_on_this_face(dofs_per_face);
DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
endf = dof.end_face();
for (; face!=endf; ++face)
// make sure all dof indices have a
// boundary index
Assert (*min_element(dofs_on_this_face.begin(),
- dofs_on_this_face.end()) >=0,
+ dofs_on_this_face.end()) != DoFHandler<dim>::invalid_dof_index,
ExcInternalError());
// make sparsity pattern for this cell
template <int dim>
void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<dim>& dof,
const DoFHandler<dim>::FunctionMap &boundary_indicators,
- const vector<int> &dof_to_boundary_mapping,
+ const vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
const unsigned int n_dofs = dof.n_dofs();
ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs(boundary_indicators)));
Assert (sparsity.n_cols() == dof.n_boundary_dofs(boundary_indicators),
ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs(boundary_indicators)));
- Assert (*max_element(dof_to_boundary_mapping.begin(),
- dof_to_boundary_mapping.end()) == (signed int)sparsity.n_rows()-1,
- ExcInternalError());
+#ifdef DEBUG
+ if (true)
+ {
+ unsigned int max_element = 0;
+ for (vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+ i!=dof_to_boundary_mapping.end(); ++i)
+ if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+ (*i > max_element))
+ max_element = *i;
+ Assert (max_element == sparsity.n_rows()-1,
+ ExcInternalError());
+ };
+#endif
const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
- vector<int> dofs_on_this_face(dofs_per_face);
+ vector<unsigned int> dofs_on_this_face(dofs_per_face);
DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
endf = dof.end_face();
for (; face!=endf; ++face)
// make sure all dof indices have a
// boundary index
Assert (*min_element(dofs_on_this_face.begin(),
- dofs_on_this_face.end()) >=0,
+ dofs_on_this_face.end()) != DoFHandler<dim>::invalid_dof_index,
ExcInternalError());
// make sparsity pattern for this cell
for (unsigned int i=0; i<dofs_per_face; ++i)
ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
const unsigned int total_dofs = dof.get_fe().dofs_per_cell;
- vector<int> dofs_on_this_cell(total_dofs);
- vector<int> dofs_on_other_cell(total_dofs);
+ vector<unsigned int> dofs_on_this_cell(total_dofs);
+ vector<unsigned int> dofs_on_other_cell(total_dofs);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell!=endc; ++cell)
// 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;
+ vector<unsigned int> dofs_on_mother;
+ vector<unsigned 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+
// 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;
+ vector<unsigned int> dofs_on_mother;
+ vector<unsigned int> dofs_on_children;
dofs_on_mother.reserve (4*fe.dofs_per_vertex+
4*fe.dofs_per_line+
fe.dofs_per_quad);
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);
+ vector<unsigned int> dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell, ++present_cell)
{
// preset all values by false
fill_n (selected_dofs.begin(), dof.n_dofs(), false);
- vector<int> indices(fe.dofs_per_cell);
+ vector<unsigned int> indices(fe.dofs_per_cell);
DoFHandler<dim>::active_cell_iterator c;
for (c = dof.begin_active() ; c != dof.end() ; ++ c)
// preset all values by false
fill_n (selected_dofs.begin(), dof.n_dofs(level), false);
- vector<int> indices(fe.dofs_per_cell);
+ vector<unsigned int> indices(fe.dofs_per_cell);
MGDoFHandler<dim>::cell_iterator c;
for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
SparsityPattern &sparsity);
template void
DoFTools::make_boundary_sparsity_pattern (const DoFHandler<deal_II_dimension>& dof,
- const vector<int> &,
+ const vector<unsigned int> &,
SparsityPattern &);
template void
DoFTools::make_boundary_sparsity_pattern (const DoFHandler<deal_II_dimension>& dof,
const DoFHandler<deal_II_dimension>::FunctionMap &boundary_indicators,
- const vector<int> &dof_to_boundary_mapping,
+ const vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity);
#endif
template <>
TriaDimensionInfo<1>::raw_quad_iterator
-Triangulation<1>::begin_raw_quad (unsigned int) const {
+Triangulation<1>::begin_raw_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<1>::quad_iterator
-Triangulation<1>::begin_quad (unsigned int) const {
+Triangulation<1>::begin_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<1>::active_quad_iterator
-Triangulation<1>::begin_active_quad (unsigned int) const {
+Triangulation<1>::begin_active_quad (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<1>::raw_hex_iterator
-Triangulation<1>::begin_raw_hex (unsigned int) const {
+Triangulation<1>::begin_raw_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<1>::hex_iterator
-Triangulation<1>::begin_hex (unsigned int) const {
+Triangulation<1>::begin_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<1>::active_hex_iterator
-Triangulation<1>::begin_active_hex (unsigned int) const {
+Triangulation<1>::begin_active_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<2>::raw_hex_iterator
-Triangulation<2>::begin_raw_hex (unsigned int) const {
+Triangulation<2>::begin_raw_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<2>::hex_iterator
-Triangulation<2>::begin_hex (unsigned int) const {
+Triangulation<2>::begin_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <>
TriaDimensionInfo<2>::active_hex_iterator
-Triangulation<2>::begin_active_hex (unsigned int) const {
+Triangulation<2>::begin_active_hex (const unsigned int) const {
Assert (false, ExcFunctionNotUseful());
return 0;
};
template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
+unsigned 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());
template <int dim>
void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const
+ const unsigned int index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
-int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+unsigned int MGDoFObjectAccessor<1, dim>::mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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 index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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<unsigned int> &dof_indices) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
const unsigned int dofs_per_vertex = dof_handler->get_fe().dofs_per_vertex,
dofs_per_line = dof_handler->get_fe().dofs_per_line;
- vector<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<2; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = mg_vertex_dof_index(vertex,d);
template <int dim>
inline
-int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
+unsigned 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());
template <int dim>
void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const
+ const unsigned int index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
inline
-int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+unsigned int MGDoFObjectAccessor<2, dim>::mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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 index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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<unsigned int> &dof_indices) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
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<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<4; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = mg_vertex_dof_index(vertex,d);
template <int dim>
inline
-int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
+unsigned 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());
template <int dim>
void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
- const int index) const
+ const unsigned int index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
template <int dim>
inline
-int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
- const unsigned int i) const
+unsigned int MGDoFObjectAccessor<3, dim>::mg_vertex_dof_index (const unsigned int vertex,
+ const unsigned int i) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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 index) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 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<unsigned int> &dof_indices) const
{
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
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<int>::iterator next = dof_indices.begin();
+ vector<unsigned int>::iterator next = dof_indices.begin();
for (unsigned int vertex=0; vertex<8; ++vertex)
for (unsigned int d=0; d<dofs_per_vertex; ++d)
*next++ = mg_vertex_dof_index(vertex,d);
const unsigned int n_levels = finest_level-coarsest_level + 1;
- indices = new int[n_levels * dofs_per_vertex];
+ indices = new unsigned int[n_levels * dofs_per_vertex];
Assert (indices != 0, ExcNoMemory ());
for (unsigned int i=0; i<n_levels*dofs_per_vertex; ++i)
- indices[i] = -1;
+ indices[i] = DoFHandler<dim>::invalid_dof_index;
};
// check whether dofs for this
// vertex have been distributed
// (only check the first dof)
- if (cell->mg_vertex_dof_index(vertex, 0) == -1)
+ if (cell->mg_vertex_dof_index(vertex, 0) == DoFHandler<2>::invalid_dof_index)
for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
cell->set_mg_vertex_dof_index (vertex, d, next_free_dof++);
// distribute dofs if necessary:
// check whether line dof is already
// numbered (check only first dof)
- if (line->mg_dof_index(0) == -1)
+ if (line->mg_dof_index(0) == DoFHandler<2>::invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
line->set_mg_dof_index (d, next_free_dof++);
// check whether dofs for this
// vertex have been distributed
// (only check the first dof)
- if (cell->mg_vertex_dof_index(vertex, 0) == -1)
+ if (cell->mg_vertex_dof_index(vertex, 0) == DoFHandler<3>::invalid_dof_index)
for (unsigned int d=0; d<selected_fe->dofs_per_vertex; ++d)
cell->set_mg_vertex_dof_index (vertex, d, next_free_dof++);
// distribute dofs if necessary:
// check whether line dof is already
// numbered (check only first dof)
- if (line->mg_dof_index(0) == -1)
+ if (line->mg_dof_index(0) == DoFHandler<3>::invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
line->set_mg_dof_index (d, next_free_dof++);
// distribute dofs if necessary:
// check whether line dof is already
// numbered (check only first dof)
- if (quad->mg_dof_index(0) == -1)
+ if (quad->mg_dof_index(0) == DoFHandler<3>::invalid_dof_index)
// if not: distribute dofs
for (unsigned int d=0; d<selected_fe->dofs_per_line; ++d)
quad->set_mg_dof_index (d, next_free_dof++);
template <>
void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
- const vector<int> &new_numbers) {
+ const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
// note that we can not use cell iterators
new_numbers[i->get_index (level, d,
selected_fe->dofs_per_vertex)]);
- for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
i!=mg_levels[level]->line_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<1>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
};
template <>
void MGDoFHandler<2>::renumber_dofs (const unsigned int level,
- const vector<int> &new_numbers) {
+ const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
for (vector<MGVertexDoFs>::iterator i=mg_vertex_dofs.begin();
new_numbers[i->get_index (level, d,
selected_fe->dofs_per_vertex)]);
- for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
i!=mg_levels[level]->line_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<2>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
- for (vector<int>::iterator i=mg_levels[level]->quad_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->quad_dofs.begin();
i!=mg_levels[level]->quad_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<2>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
};
template <>
void MGDoFHandler<3>::renumber_dofs (const unsigned int level,
- const vector<int> &new_numbers) {
+ const vector<unsigned int> &new_numbers) {
Assert (new_numbers.size() == n_dofs(level), ExcRenumberingIncomplete());
for (vector<MGVertexDoFs>::iterator i=mg_vertex_dofs.begin();
new_numbers[i->get_index (level, d,
selected_fe->dofs_per_vertex)]);
- for (vector<int>::iterator i=mg_levels[level]->line_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->line_dofs.begin();
i!=mg_levels[level]->line_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
- for (vector<int>::iterator i=mg_levels[level]->quad_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->quad_dofs.begin();
i!=mg_levels[level]->quad_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
- for (vector<int>::iterator i=mg_levels[level]->hex_dofs.begin();
+ for (vector<unsigned int>::iterator i=mg_levels[level]->hex_dofs.begin();
i!=mg_levels[level]->hex_dofs.end(); ++i)
{
- Assert (*i != -1, ExcInternalError());
+ Assert (*i != DoFHandler<3>::invalid_dof_index, ExcInternalError());
*i = new_numbers[*i];
};
};
{
mg_levels.push_back (new DoFLevel<1>);
- mg_levels.back()->line_dofs = vector<int>(tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
+ mg_levels.back()->line_dofs = vector<unsigned int>(tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ DoFHandler<1>::invalid_dof_index);
};
// now allocate space for the
{
mg_levels.push_back (new DoFLevel<2>);
- mg_levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
- mg_levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
- selected_fe->dofs_per_quad,
- -1);
+ mg_levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ DoFHandler<2>::invalid_dof_index);
+ mg_levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+ selected_fe->dofs_per_quad,
+ DoFHandler<2>::invalid_dof_index);
};
{
mg_levels.push_back (new DoFLevel<3>);
- mg_levels.back()->line_dofs = vector<int> (tria->levels[i]->lines.lines.size() *
- selected_fe->dofs_per_line,
- -1);
- mg_levels.back()->quad_dofs = vector<int> (tria->levels[i]->quads.quads.size() *
- selected_fe->dofs_per_quad,
- -1);
- mg_levels.back()->hex_dofs = vector<int> (tria->levels[i]->hexes.hexes.size() *
- selected_fe->dofs_per_hex,
- -1);
+ mg_levels.back()->line_dofs = vector<unsigned int> (tria->levels[i]->lines.lines.size() *
+ selected_fe->dofs_per_line,
+ DoFHandler<3>::invalid_dof_index);
+ mg_levels.back()->quad_dofs = vector<unsigned int> (tria->levels[i]->quads.quads.size() *
+ selected_fe->dofs_per_quad,
+ DoFHandler<3>::invalid_dof_index);
+ mg_levels.back()->hex_dofs = vector<unsigned int> (tria->levels[i]->hexes.hexes.size() *
+ selected_fe->dofs_per_hex,
+ DoFHandler<3>::invalid_dof_index);
};
ExcDimensionMismatch (sparsity.n_cols(), mg_dof_handler.n_dofs(level)));
const unsigned int dofs_per_cell = mg_dof_handler.get_fe().dofs_per_cell;
- vector<int> dofs_on_this_cell(dofs_per_cell);
+ vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(level),
endc = mg_dof_handler.end(level);
for (; cell!=endc; ++cell)
// to much memory by later copying the
// content of this vector to its final
// destination
- vector<int> boundary_dofs;
+ vector<unsigned int> boundary_dofs;
// temporary to hold the dof indices
// on a face between to levels
- vector<int> dofs_on_face (mg_dof.get_fe().dofs_per_face);
+ vector<unsigned int> dofs_on_face (mg_dof.get_fe().dofs_per_face);
for (unsigned int level=1; level<n_levels; ++level)
{
if (level==0)
return;
else
- for (vector<int>::const_iterator p=interior_boundary_dofs[level-1].begin();
+ for (vector<unsigned int>::const_iterator p=interior_boundary_dofs[level-1].begin();
p!=interior_boundary_dofs[level-1].end(); ++p)
u(*p) = 0;
};
// two fields which will store the
// indices of the multigrid dofs
// for a cell and one of its children
- vector<int> dof_indices_mother (dofs_per_cell);
- vector<int> dof_indices_child (dofs_per_cell);
+ vector<unsigned int> dof_indices_mother (dofs_per_cell);
+ vector<unsigned int> dof_indices_child (dofs_per_cell);
// for each level: first build the sparsity
// pattern of the matrices and then build the
// get indices of dofs
- vector<int> dofs (n_dofs);
+ vector<unsigned int> dofs (n_dofs);
get_dof_indices (dofs);
// one could use the
// apply Dirichlet bc as described
// in the docs
- map<int, double> boundary_value_list;
+ map<unsigned int, double> boundary_value_list;
for (FunctionMap::const_iterator dirichlet = dirichlet_bc.begin() ;
dirichlet != dirichlet_bc.end() ; ++dirichlet)
DoFHandler<dim>::active_cell_iterator cell;
const DoFHandler<dim>::active_cell_iterator endc = dofs->end();
- vector<int> dof_to_vertex_map (dofs->n_dofs(), -1);
+ vector<unsigned int> dof_to_vertex_map (dofs->n_dofs(), DoFHandler<dim>::invalid_dof_index);
unsigned int used_vertices = 0;
if (true)
{
for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
// check whether we
// already treated this vertex
- if (dof_to_vertex_map[cell->vertex_dof_index(vertex,0)] == -1)
+ if (dof_to_vertex_map[cell->vertex_dof_index(vertex,0)] ==
+ DoFHandler<dim>::invalid_dof_index)
{
vertices[next_free_vertex] = cell->vertex(vertex);
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- FullMatrix<double> local_mass_matrix (dofs_per_cell, dofs_per_cell);
- vector<int> dofs_on_this_cell (dofs_per_cell);
+ FullMatrix<double> local_mass_matrix (dofs_per_cell, dofs_per_cell);
+ vector<unsigned int> dofs_on_this_cell (dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
SparseMatrix<double> &,
const FunctionMap &,
Vector<double> &,
- vector<int> &,
+ vector<unsigned int> &,
const Function<1> *) {
Assert (false, ExcNotImplemented());
};
SparseMatrix<double> &matrix,
const FunctionMap &rhs,
Vector<double> &rhs_vector,
- vector<int> &dof_to_boundary_mapping,
+ vector<unsigned int> &dof_to_boundary_mapping,
const Function<dim> *a) {
const FiniteElement<dim> &fe = dof.get_fe();
const unsigned int n_components = fe.n_components();
Assert (matrix.n() == rhs_vector.size(), ExcInternalError());
Assert (rhs.size() != 0, ExcInternalError());
Assert (dof.get_fe() == fe, ExcInternalError());
- Assert (dof_to_boundary_mapping.size() == dof.n_dofs(), ExcInternalError());
- Assert (*max_element(dof_to_boundary_mapping.begin(),dof_to_boundary_mapping.end()) ==
- (signed int)matrix.n()-1,
+ Assert (dof_to_boundary_mapping.size() == dof.n_dofs(),
ExcInternalError());
Assert (n_components == rhs.begin()->second->n_components,
ExcComponentMismatch());
+#ifdef DEBUG
+ if (true)
+ {
+ unsigned int max_element = 0;
+ for (vector<unsigned int>::const_iterator i=dof_to_boundary_mapping.begin();
+ i!=dof_to_boundary_mapping.end(); ++i)
+ if ((*i != DoFHandler<dim>::invalid_dof_index) &&
+ (*i > max_element))
+ max_element = *i;
+ Assert (max_element == matrix.n()-1, ExcInternalError());
+ };
+#endif
const unsigned int dofs_per_cell = fe.dofs_per_cell,
dofs_per_face = fe.dofs_per_face;
vector<Vector<double> > rhs_values_system (fe_values.n_quadrature_points,
Vector<double>(n_components));
- vector<int> dofs (dofs_per_cell);
- vector<int> dofs_on_face_vector (dofs_per_face);
+ vector<unsigned int> dofs (dofs_per_cell);
+ vector<unsigned int> dofs_on_face_vector (dofs_per_face);
set<int> dofs_on_face;
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active (),
template <int dim>
-void MatrixTools<dim>::apply_boundary_values (const map<int,double> &boundary_values,
+void MatrixTools<dim>::apply_boundary_values (const map<unsigned int,double> &boundary_values,
SparseMatrix<double> &matrix,
Vector<double> &solution,
Vector<double> &right_hand_side) {
return;
- map<int,double>::const_iterator dof = boundary_values.begin(),
- endd = boundary_values.end();
+ map<unsigned int,double>::const_iterator dof = boundary_values.begin(),
+ endd = boundary_values.end();
const unsigned int n_dofs = matrix.m();
const SparsityPattern &sparsity = matrix.get_sparsity_pattern();
const unsigned int *sparsity_rowstart = sparsity.get_rowstart_indices();
for (; dof != endd; ++dof)
{
- Assert (dof->first >= 0, ExcInternalError());
+ Assert (dof->first <= n_dofs, ExcInternalError());
- const unsigned int dof_number = static_cast<unsigned int>(dof->first);
+ const unsigned int dof_number = dof->first;
// for each boundary dof:
// set entries of this line
const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
n_dofs_old=dof_handler->n_dofs();
- indices_on_cell=vector<vector<int> > (n_active_cells,
- vector<int> (dofs_per_cell));
+ indices_on_cell=vector<vector<unsigned int> > (n_active_cells,
+ vector<unsigned int> (dofs_per_cell));
DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
endc = dof_handler->end();
DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
endc = dof_handler->end();
- vector<int> *indexptr;
+ vector<unsigned int> *indexptr;
for (; cell!=endc; ++cell)
{
// which is both done by one
// function
{
- indexptr=static_cast<vector<int> *>(cell->user_pointer());
+ indexptr=static_cast<vector<unsigned int> *>(cell->user_pointer());
for (unsigned int i=0; i<dofs_per_cell; ++i)
local_values(i)=in(indexptr->operator[](i));
cell->set_dof_values_by_interpolation(local_values, out);
GeometryInfo<dim>::children_per_cell;
// allocate the needed memory
- indices_on_cell = vector<vector<int> > (n_cells_to_stay_or_refine,
- vector<int> (dofs_per_cell));
+ indices_on_cell = vector<vector<unsigned int> > (n_cells_to_stay_or_refine,
+ vector<unsigned int> (dofs_per_cell));
dof_values_on_cell
= vector<vector<Vector<number> > > (n_coarsen_fathers,
vector<Vector<number> > (in_size,
const unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;
Vector<number> local_values(dofs_per_cell);
- vector<int> *indexptr;
+ vector<unsigned int> *indexptr;
Pointerstruct *structptr;
vector<Vector<number> > *valuesptr;
- vector<int> dofs(dofs_per_cell);
+ vector<unsigned int> dofs(dofs_per_cell);
DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
endc = dof_handler->end();
// }
// };
-// vector<int> dofs_on_cell (fe.dofs_per_cell);
-// vector<Point<dim> > support_points (fe.dofs_per_cell);
+// vector<unsigned int> dofs_on_cell (fe.dofs_per_cell);
+// vector<Point<dim> > support_points (fe.dofs_per_cell);
// vector<Point<dim> > rep_points (n_rep_points);
// vector<Vector<double> > function_values_at_rep_points (
Assert(dofs_of_rep_points.size()==n_rep_points, ExcInternalError());
Assert(dof_to_rep_index_table.size()==fe.dofs_per_cell, ExcInternalError());
- vector<int> dofs_on_cell (fe.dofs_per_cell);
- vector<Point<dim> > support_points (fe.dofs_per_cell);
+ vector<unsigned int> dofs_on_cell (fe.dofs_per_cell);
+ vector<Point<dim> > support_points (fe.dofs_per_cell);
- vector<Point<dim> > rep_points (n_rep_points);
+ vector<Point<dim> > rep_points (n_rep_points);
// get space for the values of the
// function at the rep support points.
Vector<double> cell_data_1(dof_1.get_fe().dofs_per_cell);
Vector<double> cell_data_2(dof_2.get_fe().dofs_per_cell);
- vector <short unsigned int> touch_count (dof_2.n_dofs(), 0);
- vector <int> local_dof_indices (dof_2.get_fe().dofs_per_cell);
+ vector<short unsigned int> touch_count (dof_2.n_dofs(), 0);
+ vector<unsigned int> local_dof_indices (dof_2.get_fe().dofs_per_cell);
DoFHandler<dim>::active_cell_iterator h = dof_1.begin_active();
DoFHandler<dim>::active_cell_iterator l = dof_2.begin_active();
const FiniteElement<dim> &fe = dof.get_fe();
// make up boundary values
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
if (enforce_zero_boundary == true)
// no need to project boundary values, but
{
DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
endf = dof.end_face();
- vector<int> face_dof_indices (fe.dofs_per_face);
+ vector<unsigned int> face_dof_indices (fe.dofs_per_face);
for (; face!=endf; ++face)
if (face->at_boundary())
{
template <>
void
-VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof,
- const unsigned char boundary_component,
- const Function<1> &boundary_function,
- map<int,double> &boundary_values,
- const vector<bool> &component_mask_)
+VectorTools::interpolate_boundary_values (const DoFHandler<1> &dof,
+ const unsigned char boundary_component,
+ const Function<1> &boundary_function,
+ map<unsigned int,double> &boundary_values,
+ const vector<bool> &component_mask_)
{
Assert (boundary_component != 255,
ExcInvalidBoundaryIndicator());
template <int dim>
void
-VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
- const unsigned char boundary_component,
- const Function<dim> &boundary_function,
- map<int,double> &boundary_values,
- const vector<bool> &component_mask_)
+VectorTools::interpolate_boundary_values (const DoFHandler<dim> &dof,
+ const unsigned char boundary_component,
+ const Function<dim> &boundary_function,
+ map<unsigned int,double> &boundary_values,
+ const vector<bool> &component_mask_)
{
Assert (boundary_component != 255,
ExcInvalidBoundaryIndicator());
ExcComponentMismatch());
// field to store the indices of dofs
- vector<int> face_dofs (fe.dofs_per_face, -1);
- vector<Point<dim> > dof_locations (face_dofs.size(), Point<dim>());
+ vector<unsigned int> face_dofs (fe.dofs_per_face, -1);
+ vector<Point<dim> > dof_locations (face_dofs.size(), Point<dim>());
// array to store the values of
// the boundary function at the
// boundary points. have to arrays
VectorTools::project_boundary_values (const DoFHandler<dim> &dof,
const map<unsigned char,const Function<dim>*> &boundary_functions,
const Quadrature<dim-1> &q,
- map<int,double> &boundary_values)
+ map<unsigned int,double> &boundary_values)
{
Assert (dof.get_fe().n_components() == boundary_functions.begin()->second->n_components,
ExcComponentMismatch());
- vector<int> dof_to_boundary_mapping;
+ vector<unsigned int> dof_to_boundary_mapping;
dof.map_dof_to_boundary_indices (boundary_functions, dof_to_boundary_mapping);
// set up sparsity structure
// fill in boundary values
for (unsigned int i=0; i<dof_to_boundary_mapping.size(); ++i)
- if (dof_to_boundary_mapping[i] != -1)
+ if (dof_to_boundary_mapping[i] != DoFHandler<dim>::invalid_dof_index)
// this dof is on one of the
// interesting boundary parts
//
void VectorTools::project_boundary_values (const DoFHandler<deal_II_dimension> &,
const map<unsigned char,const Function<deal_II_dimension>*>&,
const Quadrature<deal_II_dimension-1>&,
- map<int,double> &);
+ map<unsigned int,double> &);
template
void VectorTools::create_right_hand_side (const DoFHandler<deal_II_dimension> &,
void VectorTools::interpolate_boundary_values (const DoFHandler<deal_II_dimension> &,
const unsigned char,
const Function<deal_II_dimension> &,
- map<int,double> &,
+ map<unsigned int,double> &,
const vector<bool> &);
template
void VectorTools::project (const DoFHandler<deal_II_dimension> &,
// `dofs_per_cell' and `n_q_points'
// are more or less standard names
// for these purposes.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
// Now, we said that we wanted to
// assemble the global matrix and
// for the right hand side vector,
// although access times are not so
// problematic for them.
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
// When assembling the
// contributions of each cell, we
// degrees of freedom. When we get
// them, we need a scratch array
// for these numbers:
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Now for th loop over all
// cells. You have seen before how
// mapping of DoF numbers to
// boundary values is done by the
// `map' class.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<2>(),
// all the necessary work for you
// and you don't have to care about
// the dimension dependent parts:
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Note here, that a cell is a
// quadrilateral in two space
// would like to use (i.e. the
// BoundaryValues class declared
// above):
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
BoundaryValues<dim>(),
update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// Below, we will ask the
// Coefficient class to compute the
};
// Again use zero boundary values:
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(),
// per cell before: the following
// value will be set to 9 (in 2D)
// now, where it was 4 before.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
- vector<double> coefficient_values (n_q_points);
+ vector<double> coefficient_values (n_q_points);
// We can now go on with assembling
// the matrix and right hand
// from the system of equations
// happens *after* the elimination
// of hanging nodes.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(),
update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe->dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- RightHandSide<dim> right_hand_side;
- vector<double> rhs_values (n_q_points);
+ RightHandSide<dim> right_hand_side;
+ vector<double> rhs_values (n_q_points);
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
hanging_node_constraints.condense (system_matrix);
hanging_node_constraints.condense (system_rhs);
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
Solution<dim>(),
// degrees of freedom per cell of
// the Q1 element, but this is not
// something we need to care about.
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// As was shown in previous
// examples as well, we need a
// we need to pass ``dim'' as
// number of components to the zero
// function as well.
- map<int,double> boundary_values;
+ map<unsigned int,double> boundary_values;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(dim),
update_q_points |
update_JxW_values));
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.n_quadrature_points;
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
- vector<int> local_dof_indices (dofs_per_cell);
+ vector<unsigned int> local_dof_indices (dofs_per_cell);
// FIX
- vector<double> coefficient_values (n_q_points, 1.0);
+ vector<double> coefficient_values (n_q_points, 1.0);
// not only active cells
MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
hanging_node_constraints.condense (global_system_matrix);
hanging_node_constraints.condense (system_rhs);
-// map<int,double> boundary_values;
+// map<unsigned int,double> boundary_values;
// VectorTools::interpolate_boundary_values (mg_dof_handler,
// 0,
// ZeroFunction<dim>(),
Vector<double> elvec(fe_dofs);
FullMatrix<double> elmat(fe_dofs);
- vector<int> indices(fe_dofs);
+ vector<unsigned int> indices(fe_dofs);
////////////////////////////////////////////////////
// Loop for computing the element matrices
Vector<double> elvec(fe_dofs);
FullMatrix<double> elmat(fe_dofs);
- vector<int> indices(fe_dofs);
+ vector<unsigned int> indices(fe_dofs);
////////////////////////////////////////////////////
// Loop for computing the element matrices
vector<double> density_values(quadrature->n_quadrature_points);
vector<double> stiffness_values(quadrature->n_quadrature_points);
- vector<int> cell_dof_indices (dofs_per_cell);
+ vector<unsigned int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell, ++primal_cell)
{
cell = dof->begin_active();
endc = dof->end();
- vector<int> cell_dof_indices (dofs_per_cell);
+ vector<unsigned int> cell_dof_indices (dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face,
UpdateFlags(update_values |
cell = dof->begin_active();
endc = dof->end();
- vector<int> face_dof_indices (face_dofs);
+ vector<unsigned int> face_dof_indices (face_dofs);
for (; cell!=endc; ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->dofs_per_cell);
+ vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
endc = dof->end ();
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
- vector<int> cell_dof_indices (dofs_per_cell);
+ vector<unsigned int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell)
{
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->dofs_per_cell);
+ vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->dofs_per_cell);
+ vector<unsigned int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, UpdateFlags(update_values | update_JxW_values));
for (; cell!=endc; ++cell)
// indices of all the dofs on this
// cell
- vector<int> dof_indices_on_cell (dofs_per_cell);
+ vector<unsigned int> dof_indices_on_cell (dofs_per_cell);
FullMatrix<double> cell_mass_matrix (dofs_per_cell, dofs_per_cell);
FullMatrix<double> cell_laplace_matrix (dofs_per_cell, dofs_per_cell);
// zero. we re-use them later, and because
// zero is such a universal constant, we
// don't even need to recompute the values!
- map<int,double> boundary_value_list;
+ map<unsigned int,double> boundary_value_list;
if (dim != 1)
{
static const ZeroFunction<dim> boundary_values;
// transfer into the global
// right hand side
- vector<int> new_dof_indices (dofs_per_cell, -1);
+ vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
// transfer into the global
// right hand side
- vector<int> new_dof_indices (dofs_per_cell);
+ vector<unsigned int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
// indices of the dofs of a cell on
// the new grid
- vector<int> new_dof_indices (dofs_per_cell, -1);
+ vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
// loop over the child cells
parameters.boundary_values_u->set_time (time);
parameters.boundary_values_v->set_time (time);
- map<int,double> boundary_value_list;
+ map<unsigned int,double> boundary_value_list;
VectorTools::interpolate_boundary_values (*dof_handler, 0,
*(parameters.boundary_values_u),
boundary_value_list);
// at all
if (dim != 1)
{
- map<int,double> boundary_value_list;
+ map<unsigned int,double> boundary_value_list;
VectorTools::interpolate_boundary_values (*dof_handler, 0,
*(parameters.boundary_values_v),
boundary_value_list);
// transfer into the global
// right hand side
- vector<int> new_dof_indices (dofs_per_cell, -1);
+ vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
// transfer into the global
// right hand side
- vector<int> new_dof_indices (dofs_per_cell);
+ vector<unsigned int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
// indices of the dofs of a cell on
// the new grid
- vector<int> new_dof_indices (dofs_per_cell, -1);
+ vector<unsigned int> new_dof_indices (dofs_per_cell, DoFHandler<dim>::invalid_dof_index);
// loop over the child cells