// then fill the matrix by setting up
// bogus matrix entries
- std::vector<unsigned int> local_dofs (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
for (typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
// create sparsity pattern
BlockCompressedSparsityPattern sp (n_components,
n_components);
- std::vector<types::global_dof_inde> dofs_per_component(n_components);
+ std::vector<types::global_dof_index> dofs_per_component(n_components);
DoFTools::count_dofs_per_component (dof_handler,
dofs_per_component);
for (unsigned int i=0; i<n_components; ++i)
// output every second element
unsigned int j=0;
- for (typename std::map<Point<dim>, unsigned int, Comp>::const_iterator
+ for (typename std::map<Point<dim>, types::global_dof_index, Comp>::const_iterator
i=map.begin(); i!=map.end(); ++i,++j)
if (j%2 == 0)
deallog << i->first << " " << i->second << std::endl;
std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
- const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
- dof_handler.n_boundary_dofs());
+ const unsigned int n_blocks = std::min (
+ static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+ dof_handler.n_boundary_dofs());
BlockSparsityPattern sp (n_blocks,
n_blocks);
// split dofs almost arbitrarily to
std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
- const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
- dof_handler.n_boundary_dofs());
+ const unsigned int n_blocks = std::min (
+ static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+ dof_handler.n_boundary_dofs());
BlockCompressedSparsityPattern sp (n_blocks,
n_blocks);
// split dofs almost arbitrarily to
// blocks
- std::vector<unsigned int> dofs_per_block(n_blocks);
+ std::vector<types::global_dof_index> dofs_per_block(n_blocks);
for (unsigned int i=0; i<n_blocks-1; ++i)
dofs_per_block[i] = dof_handler.n_boundary_dofs()/n_blocks;
dofs_per_block.back() = (dof_handler.n_boundary_dofs() -
std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
- const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
- dof_handler.n_boundary_dofs());
+ const unsigned int n_blocks = std::min (
+ static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+ dof_handler.n_boundary_dofs());
BlockCompressedSetSparsityPattern sp (n_blocks,
n_blocks);
// split dofs almost arbitrarily to
typename FunctionMap<dim>::type boundary_ids;
boundary_ids[0] = 0;
const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
- const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
- n_boundary_dofs);
+ const unsigned int n_blocks = std::min (
+ static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+ n_boundary_dofs);
BlockCompressedSparsityPattern sp (n_blocks,
n_blocks);
// split dofs almost arbitrarily to
typename FunctionMap<dim>::type boundary_ids;
boundary_ids[0] = 0;
const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
- const unsigned int n_blocks = std::min (dof_handler.get_fe().n_components(),
- n_boundary_dofs);
+ const unsigned int n_blocks = std::min (
+ static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+ n_boundary_dofs);
BlockCompressedSetSparsityPattern sp (n_blocks,
n_blocks);
// split dofs almost arbitrarily to
void DGMethod<dim>::assemble_system2 ()
{
const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs (dofs_per_cell);
- std::vector<unsigned int> dofs_neighbor (dofs_per_cell);
+ std::vector<types::global_dof_index> dofs (dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_neighbor (dofs_per_cell);
const UpdateFlags update_flags = update_values
| update_gradients
// separatel
for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
{
- std::map<unsigned int, double> bv;
+ std::map<types::global_dof_index, double> bv;
VectorTools::interpolate_boundary_values (dof_handler,
boundary_id,
X<spacedim>(),
bv);
deallog << bv.size() << " boundary degrees of freedom" << std::endl;
- for (std::map<unsigned int, double>::const_iterator i = bv.begin();
+ for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
i != bv.end(); ++i)
deallog << i->first << ' ' << i->second << std::endl;
bv);
deallog << bv.size() << " boundary degrees of freedom" << std::endl;
- for (std::map<unsigned int, double>::const_iterator i = bv.begin();
+ for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
i != bv.end(); ++i)
deallog << i->first << ' ' << i->second << std::endl;
solver.solve (A1, u, f1, fprec);
- for (std::map<unsigned int,double>::const_iterator i=bv.begin();
+ for (std::map<types::global_dof_index,double>::const_iterator i=bv.begin();
i!=bv.end(); ++i)
Assert (std::fabs(u(i->first) - i->second) < 1e-8,
ExcInternalError());
0,
BoundaryValues<dim>(),
boundary_values);
- std::map<unsigned int,double>::const_iterator boundary_value = boundary_values.begin();
+ std::map<types::global_dof_index,double>::const_iterator boundary_value = boundary_values.begin();
for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
{
if (!test_all_constraints.is_constrained(boundary_value->first))
Assert (dof_handler.locally_owned_dofs() == all,
ExcInternalError());
Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
- std::vector<unsigned int> (1,N),
+ std::vector<types::global_dof_index> (1,N),
ExcInternalError());
Assert (dof_handler.locally_owned_dofs_per_processor() ==
std::vector<IndexSet>(1,all),
hp::QCollection<dim-1> face_quadrature;
face_quadrature.push_back (QGauss<dim-1>(6));
- std::vector<dof_index> dof_to_boundary_mapping;
+ std::vector<types::global_dof_index> dof_to_boundary_mapping;
DoFTools::map_dof_to_boundary_indices (dof,
dof_to_boundary_mapping);
// do component-wise and save the
// results
DoFRenumbering::component_wise (dof);
- const std::vector<unsigned int> vc = get_dofs (dof);
+ const std::vector<types::global_dof_index> vc = get_dofs (dof);
deallog << "OK" << std::endl;
}
{
PetscInitialize(&argc,&argv,0,0);
{
- std::vector<unsigned int> row_lengths (5, 3U);
+ std::vector<types::global_dof_index> row_lengths (5,
+ static_cast<types::global_dof_index>(3));
row_lengths.back() = 2;
PETScWrappers::SparseMatrix m (5,5,row_lengths);
test (m);
const double s = m.el(N/3,i);
norm_sqr -= s*s;
}
- const unsigned int rows[2] = { N/3, N/2 };
- m.clear_rows (std::vector<unsigned int>(&rows[0], &rows[2]));
+ const types::global_dof_index rows[2] = { N/3, N/2 };
+ m.clear_rows (std::vector<types::global_dof_index>(&rows[0], &rows[2]));
deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
<< std::endl;
}
norm_sqr += 2*rnd*rnd;
- const unsigned int rows[2] = { N/3, N/2 };
- m.clear_rows (std::vector<unsigned int>(&rows[0], &rows[2]), rnd);
+ const types::global_dof_index rows[2] = { N/3, N/2 };
+ m.clear_rows (std::vector<types::global_dof_index>(&rows[0], &rows[2]), rnd);
deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
<< std::endl;
// process has 10 rows, the second one 20,
// the third one 30, and so on
unsigned int N = 0;
- std::vector<unsigned int> local_rows_per_process (get_n_mpi_processes());
- std::vector<unsigned int> start_row (get_n_mpi_processes());
+ std::vector<types::global_dof_index> local_rows_per_process (get_n_mpi_processes());
+ std::vector<types::global_dof_index> start_row (get_n_mpi_processes());
for (unsigned int i=0; i<get_n_mpi_processes(); ++i)
{
N += (i+1)*10;