-void print (const std::vector<unsigned int> &v)
+void print (const std::vector<types::global_dof_index> &v)
{
deallog << v.size();
for (unsigned int i=0; i<v.size(); ++i)
-void print (const std::vector<unsigned int> &v)
+void print (const std::vector<types::global_dof_index> &v)
{
deallog << v.size();
for (unsigned int i=0; i<v.size(); ++i)
hp_dof_handler.distribute_dofs(fe_collection);
//count dofs per component and show them on the screen
- std::vector<unsigned int> dofs_per_component_hp(3,0);
+ std::vector<types::global_dof_index> dofs_per_component_hp(3,0);
DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp);
for (unsigned int i=0; i<3; i++)
// them into the matrix and condensing away
// hanging node constraints later on, or
// (2) distributing them right away
- 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();
// them into the vector and condensing away
// hanging node constraints later on, or
// (2) distributing them right away
- std::vector<unsigned int> local_dofs (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
Vector<double> local_vector (fe.dofs_per_cell);
for (typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
constraints.close ();
deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
- std::vector<unsigned int> block_sizes(2);
+ std::vector<types::global_dof_index> block_sizes(2);
block_sizes[0] = dof_handler.n_dofs()/3;
block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
BlockVector<double> b(block_sizes);
constraints.close ();
deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
- std::vector<unsigned int> block_sizes(2);
+ std::vector<types::global_dof_index> block_sizes(2);
block_sizes[0] = dof_handler.n_dofs()/3;
block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
BlockVector<double> b(block_sizes);
// 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();
deallog << "n_dofs:" << dof_handler.n_dofs() << std::endl;
- std::vector<unsigned int> 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);
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSetSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
// create sparsity pattern
BlockSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
// create sparsity pattern
BlockCompressedSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> dofs_per_component(n_components);
+ std::vector<types::global_dof_inde> dofs_per_component(n_components);
DoFTools::count_dofs_per_component (dof_handler,
dofs_per_component);
for (unsigned int i=0; i<n_components; ++i)
// create sparsity pattern
BlockCompressedSetSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
void
check_this (const DoFHandler<dim> &dof_handler)
{
- std::vector<unsigned int> n_dofs(dof_handler.get_fe().n_components());
+ std::vector<types::global_dof_index> n_dofs(dof_handler.get_fe().n_components());
DoFTools::count_dofs_per_component (dof_handler,
n_dofs);
for (unsigned int i=0; i<n_dofs.size(); ++i)
void
check_this (const DoFHandler<dim> &dof_handler)
{
- std::vector<unsigned int> map(dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map(dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
for (unsigned int i=0; i<map.size(); ++i)
deallog << map[i] << " ";
void
check_this (const DoFHandler<dim> &dof_handler)
{
- std::vector<unsigned int> map(dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;
// check for boundary id 0 alone
if (dof_handler.get_fe().get_unit_support_points().size() == 0)
return;
- std::map<Point<dim>, unsigned int, Comp> map;
+ std::map<Point<dim>, types::global_dof_index, Comp> map;
MappingQ<dim> mapping(2);
DoFTools::map_support_points_to_dofs (mapping, dof_handler, map);
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
// create sparsity pattern
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
// create sparsity pattern
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
DoFTools::map_dof_to_boundary_indices (dof_handler, map);
// create sparsity pattern
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_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(),
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() -
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_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(),
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_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(),
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() -
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
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] = n_boundary_dofs/n_blocks;
dofs_per_block.back() = (n_boundary_dofs -
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
typename FunctionMap<dim>::type boundary_ids;
boundary_ids[0] = 0;
- const unsigned int n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
+ 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);
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] = n_boundary_dofs/n_blocks;
dofs_per_block.back() = (n_boundary_dofs -
if (dof_handler.get_fe().dofs_per_face == 0)
return;
- std::vector<unsigned int> map (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> map (dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert (0);
DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
typename FunctionMap<dim>::type boundary_ids;
boundary_ids[0] = 0;
- const unsigned int n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
+ 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);
BlockCompressedSetSparsityPattern 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] = n_boundary_dofs/n_blocks;
dofs_per_block.back() = (n_boundary_dofs -
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSetSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
const unsigned int n_components = dof_handler.get_fe().n_components();
BlockCompressedSetSparsityPattern sp (n_components,
n_components);
- std::vector<unsigned int> 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)
// Determine the orientation of the two faces:
- std::vector<unsigned int> dofs_1(fe.dofs_per_face);
- std::vector<unsigned int> dofs_2(fe.dofs_per_face);
+ std::vector<types::global_dof_index> dofs_1(fe.dofs_per_face);
+ std::vector<types::global_dof_index> dofs_2(fe.dofs_per_face);
const unsigned int face_1_index = face_1->nth_active_fe_index(0);
const unsigned int face_2_index = face_2->nth_active_fe_index(0);
face_1->get_dof_indices(dofs_1, face_1_index);
// write out at most 20 equispaced
// elements of the vector
- for (unsigned int i=0; i<v.size(); i+=std::max(1U,v.size()/20))
+ for (unsigned int i=0; i<v.size(); i+=std::max(static_cast<std::size_t>(1),
+ v.size()/20))
deallog << v(i) << ' ';
deallog << std::endl;
}
SparsityPattern cell_connectivity;
GridTools::get_face_connectivity_of_cells (triangulation,
cell_connectivity);
- std::vector<unsigned int> permutation(triangulation.n_active_cells());
+ std::vector<types::global_dof_index> permutation(triangulation.n_active_cells());
SparsityTools::reorder_Cuthill_McKee (cell_connectivity, permutation);
for (unsigned int i=0; i<permutation.size(); ++i)
// and for A applying constraints
// right away and for B applying
// constraints later on
- 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);
Vector<double> local_vector (fe.dofs_per_cell);
for (typename DoFHandler<dim>::active_cell_iterator
// and for A applying constraints
// right away and for B applying
// constraints later on
- 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);
Vector<double> local_vector (fe.dofs_per_cell);
for (typename DoFHandler<dim>::active_cell_iterator
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int j=0; j<m.n(); ++j)
indices[j] = j;
std::vector<double> values (m.n());
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int j=0; j<m.n(); ++j)
indices[j] = j;
std::vector<double> values (m.n());
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int j=0; j<m.n(); ++j)
indices[j] = m.n()-1-j;
std::vector<double> values (m.n());
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int j=0; j<m.n(); ++j)
indices[j] = j;
std::vector<double> values (m.n());
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int i=0; i<m.n(); ++i)
indices[i] = m.n()-1-i;
std::vector<double> values (m.n());
SparseMatrix<double> m(sp);
// prepare structure with indices and values
- std::vector<unsigned int> indices (m.n());
+ std::vector<types::global_dof_index> indices (m.n());
for (unsigned int j=0; j<m.n(); ++j)
indices[j] = j;
std::vector<double> values (m.n());
void DGMethod<dim>::assemble_system1 ()
{
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
dof_handler.distribute_dofs (fe);
deallog << dof_handler.n_dofs() << std::endl;
- std::vector<unsigned int> new_indices (dof_handler.n_dofs());
+ std::vector<types::global_dof_index> new_indices (dof_handler.n_dofs());
DoFRenumbering::compute_subdomain_wise (new_indices, dof_handler);
for (unsigned int i=0; i<new_indices.size(); ++i)
// separatel
for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
{
- std::map<type::global_dof_index, double> bv;
+ std::map<types::global_dof_index, double> bv;
VectorTools::interpolate_boundary_values (dof_handler,
boundary_id,
Functions::SquareFunction<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;
void
print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
{
- std::vector<unsigned int> v (dof.get_fe().dofs_per_cell);
+ std::vector<types::global_dof_index> v (dof.get_fe().dofs_per_cell);
for (typename MGDoFHandler<dim>::cell_iterator cell=dof.begin(level);
cell != dof.end(level); ++cell)
{
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- std::vector<unsigned int> new_dofs (dof.n_dofs());
+ std::vector<types::global_dof_index> new_dofs (dof.n_dofs());
DoFRenumbering::boost::compute_Cuthill_McKee(new_dofs, dof);
for (unsigned int i=0; i<new_dofs.size(); ++i)
dof.begin_active()->set_active_fe_index(1);
dof.distribute_dofs(element);
- std::vector<unsigned int> count (element.n_components());
+ std::vector<types::global_dof_index> count (element.n_components());
DoFTools::count_dofs_per_component (dof, count, true);
for (unsigned int d=0; d<count.size(); ++d)
DoFRenumbering::component_wise(dof_handler);
- std::vector<unsigned int> dofs_per_block(2);
+ std::vector<types::global_dof_index> dofs_per_block(2);
DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
const unsigned int n_stress_dof = dofs_per_block[0];
void
-solve_filtered (std::map<unsigned int,double> &bv,
+solve_filtered (std::map<types::global_dof_index,double> &bv,
SparseMatrix<double> &A,
Vector<double> &u,
Vector<double> &f)
// build up a map of vertex indices
// of boundary vertices to the new
// boundary points
- std::map<unsigned int,Point<dim> > new_points;
+ std::map<types::global_dof_index,Point<dim> > new_points;
Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
endc=tria.end();
// "assemble":
- std::vector<unsigned int> local_dofs1;
+ std::vector<types::global_dof_index> local_dofs1;
for (unsigned int i=0;i<5;++i)
local_dofs1.push_back(i);
- std::vector<unsigned int> local_dofs2;
+ std::vector<types::global_dof_index> local_dofs2;
local_dofs2.push_back(1);
for (unsigned int i=1;i<5;++i)
local_dofs2.push_back(3+i);
}
std::map<types::global_dof_index,double> boundary_values;
- boundary_values.insert (std::pair<unsigned int,double>(1, -5.0));
- boundary_values.insert (std::pair<unsigned int,double>(3, 2.0));
- boundary_values.insert (std::pair<unsigned int,double>(4, 0.0));
+ boundary_values.insert (std::pair<types::global_dof_index,double>(1, -5.0));
+ boundary_values.insert (std::pair<types::global_dof_index,double>(3, 2.0));
+ boundary_values.insert (std::pair<types::global_dof_index,double>(4, 0.0));
MatrixTools::apply_boundary_values (boundary_values,
mat,
solution,
0,
ConstantFunction<dim>(1.,2),
boundary_values);
- std::map<unsigned int,double>::const_iterator boundary_value =
+ std::map<types::global_dof_index,double>::const_iterator boundary_value =
boundary_values.begin();
for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
{
0,
RightHandSide<dim>(),
boundary_values);
- std::map<unsigned int,double>::const_iterator boundary_value =
+ std::map<types::global_dof_index,double>::const_iterator boundary_value =
boundary_values.begin();
for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
{
template <int dim>
void FindBug<dim>::dirichlet_conditions ()
{
- std::map<unsigned int,double> dirichlet_dofs;
+ std::map<types::global_dof_index,double> dirichlet_dofs;
std::vector<bool> component_mask(dim+1, false);
component_mask[dim] = true;
QGauss<dim-1> face_quadrature(6);
- std::vector<unsigned int> 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);
MappingQ1<dim> mapping;
TestFunction<dim> f(degree-1);
- std::map<unsigned int, double> boundary_constraints;
+ std::map<types::global_dof_index, double> boundary_constraints;
typename FunctionMap<dim>::type boundary_map;
for (types::boundary_id i=0;i<255;++i)
boundary_map[i] = &f;
// boundary values
Vector<double> u(dof.n_dofs());
u = -1.;
- for (typename std::map<unsigned int, double>::const_iterator
+ for (typename std::map<types::global_dof_index, double>::const_iterator
i = boundary_constraints.begin(); i != boundary_constraints.end(); ++i)
u(i->first) = i->second;
void
check_boundary (const DoFHandler<dim> &dof)
{
- std::vector<unsigned int> 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);
void
check_boundary (const DoFHandler<dim> &dof)
{
- std::vector<unsigned int> 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);
void
check_boundary (const DoFHandler<dim> &dof)
{
- std::vector<unsigned int> 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);
void
check_boundary (const DoFHandler<dim> &dof)
{
- std::vector<unsigned int> 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);
DoFHandler<1,spacedim> dof_handler (tria);
dof_handler.distribute_dofs (fe);
- std::vector<unsigned int> dof_indices(fe.dofs_per_face);
+ std::vector<types::global_dof_index> dof_indices(fe.dofs_per_face);
deallog << "Coarse mesh:" << std::endl;
dof_handler.begin_active()->face(0)->get_dof_indices (dof_indices);
const unsigned int fe_index,
const unsigned int n)
{
- std::vector<unsigned int> dof_indices (n);
+ std::vector<types::global_dof_index> dof_indices (n);
i->get_dof_indices (dof_indices, fe_index);
for (unsigned int i=0; i<n; ++i)
deallog << dof_indices[i] << ' ';
void print_dofs (const typename hp::DoFHandler<1,spacedim>::cell_iterator &i,
const unsigned int n)
{
- std::vector<unsigned int> dof_indices (n);
+ std::vector<types::global_dof_index> dof_indices (n);
i->get_dof_indices (dof_indices);
for (unsigned int i=0; i<n; ++i)
deallog << dof_indices[i] << ' ';
triangulation.refine_global (2);
dof_handler.distribute_dofs (fe);
- std::vector<unsigned int> dofs_per_component (fe.n_components());
+ std::vector<types::global_dof_index> dofs_per_component (fe.n_components());
DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
Assert (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), 0U)
dof_handler.distribute_dofs (fe_collection);
deallog << dof_handler.n_dofs() << " dofs" << std::endl;
- std::map<unsigned int, double> bv;
+ std::map<types::global_dof_index, double> bv;
VectorTools::interpolate_boundary_values (dof_handler,
0,
ZeroFunction<dim>(2),
bv);
- for (std::map<unsigned int, double>::iterator
+ for (std::map<types::global_dof_index, double>::iterator
p = bv.begin(); p!=bv.end(); ++p)
deallog << p->first << ' ' << p->second << std::endl;
}
template <int dim>
-std::vector<unsigned int>
+std::vector<types::global_dof_index>
get_dofs (const hp::DoFHandler<dim> &dof)
{
std::vector<types::global_dof_index> local;
void DGMethod<dim>::assemble_system2 ()
{
const unsigned int dofs_per_cell = dof_handler.get_fe()[0].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
A(i,j) = i+j;
// pick every other row and column
- std::vector<unsigned int> rows (A.m()/2);
+ std::vector<types::global_dof_index> rows (A.m()/2);
for (unsigned int i=0; i<rows.size(); ++i)
rows[i] = 2*i;
- std::vector<unsigned int> cols (A.n()/2);
+ std::vector<types::global_dof_index> cols (A.n()/2);
for (unsigned int i=0; i<cols.size(); ++i)
cols[i] = 2*i;
PreconditionSOR<> prec_sor;
prec_sor.initialize(A, 1.);
- std::vector<unsigned int> permutation(dim);
- std::vector<unsigned int> inverse_permutation(dim);
+ std::vector<types::global_dof_index> permutation(dim);
+ std::vector<types::global_dof_index> inverse_permutation(dim);
// Create a permutation: Blocks
// backwards and every second
PreconditionBlock<SparseMatrix<double>,double>::AdditionalData prec_data(blocksize, 0.8);
// The permutation vectors;
- std::vector<unsigned int> bperm(n_blocks);
- std::vector<unsigned int> ibperm(n_blocks);
+ std::vector<types::global_dof_index> bperm(n_blocks);
+ std::vector<types::global_dof_index> ibperm(n_blocks);
relax_data.block_list.reinit(n_blocks, dim, blocksize);
for (unsigned int block=0;block<n_blocks;++block)
Assert (sp(sp.matrix_position(i).first,
sp.matrix_position(i).second) == i,
ExcInternalError());
- for (unsigned int row=0; row<sp.n_rows(); ++row)
- for (unsigned int col=0; col<sp.n_cols(); ++col)
+ for (types::global_dof_index row=0; row<sp.n_rows(); ++row)
+ for (types::global_dof_index col=0; col<sp.n_cols(); ++col)
if (sp(row,col) != SparsityPattern::invalid_entry)
Assert (sp.matrix_position(sp(row,col)) ==
std::make_pair(row,col),
sp.compress ();
// now find permutation
- std::vector<unsigned int> permutation(4);
+ std::vector<types::global_dof_index> permutation(4);
SparsityTools::reorder_Cuthill_McKee (sp, permutation);
for (unsigned int i=0; i<permutation.size(); ++i)
diagonal_values = diagonal;
- const std::vector<unsigned int> &
+ const std::vector<types::global_dof_index> &
constrained_dofs = data.get_constrained_dofs();
for (unsigned int i=0; i<constrained_dofs.size(); ++i)
diagonal_values(constrained_dofs[i]) = 1.0;
boundary_indices);
for (unsigned int level=0; level<nlevels; ++level)
{
- std::set<unsigned int>::iterator bc_it = boundary_indices[level].begin();
+ std::set<types::global_dof_index>::iterator bc_it = boundary_indices[level].begin();
for ( ; bc_it != boundary_indices[level].end(); ++bc_it)
mg_constraints[level].add_line(*bc_it);
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs (fe);
- std::vector<types::global_dof_inex> dofs_per_block (fe.n_blocks());
+ std::vector<types::global_dof_index> dofs_per_block (fe.n_blocks());
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
points);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
- for (typename std::map<unsigned int, Point<dim> >::const_iterator
+ for (typename std::map<types::global_dof_index, Point<dim> >::const_iterator
p = points.begin();
p != points.end();
++p)
if (!cell->is_artificial())
{
cell->get_dof_indices (local_dof_indices);
- for (std::vector<unsigned int>::iterator it=local_dof_indices.begin(); it!= local_dof_indices.end(); ++it)
+ for (std::vector<types::global_dof_index>::iterator it=local_dof_indices.begin(); it!= local_dof_indices.end(); ++it)
{
unsigned int invalid_dofindex = DoFHandler<dim,dim>::invalid_dof_index;
Assert(*it!=invalid_dofindex, ExcInternalError());
csp.add(1,0);
PETScWrappers::MPI::SparseMatrix mat;
- std::vector< unsigned int > local_rows(numprocs,2);
+ std::vector<types::global_dof_index> local_rows(numprocs,2);
mat.reinit(MPI_COMM_WORLD, csp, local_rows, local_rows, myid);
csp.add(1,1);
PETScWrappers::MPI::SparseMatrix mat;
- std::vector< unsigned int > local_rows(numprocs, 0);
+ std::vector<types::global_dof_index> local_rows(numprocs, 0);
local_rows[0]=2;
mat.reinit(MPI_COMM_WORLD, csp, local_rows, local_rows, myid);
TrilinosWrappers::MPI::Vector test1(locally_owned);
if (myid==0)
{
- unsigned int idx[]={0,1,2,3,4,5,6,7,8};
+ types::global_dof_index idx[]={0,1,2,3,4,5,6,7,8};
double val[]={0,1,2,3,4,5,6,7,8};
test1.add(9,idx,val);
}
else
{
{
- unsigned int idx[]={1,9,3,10,5,11,12,13,14};
+ types::global_dof_index idx[]={1,9,3,10,5,11,12,13,14};
double val[]={1,9,3,10,5,11,12,13,14};
test1.add(9,idx,val);
}
void test ()
{
- std::vector<unsigned int> ivector(4);
+ std::vector<types::global_dof_index> ivector(4);
ivector[0] = 2;
ivector[1] = 4;
ivector[2] = 3;
// compare dofs on this cell and then on the faces
if (c1->has_children() == false)
{
- std::vector<types::local_dof_types> local_dofs_1 (c1->get_fe().dofs_per_cell);
- std::vector<types::local_dof_types> local_dofs_2 (c2->get_fe().dofs_per_cell);
+ std::vector<types::local_dof_index> local_dofs_1 (c1->get_fe().dofs_per_cell);
+ std::vector<types::local_dof_index> local_dofs_2 (c2->get_fe().dofs_per_cell);
c1->get_dof_indices (local_dofs_1);
c2->get_dof_indices (local_dofs_2);
void test (TrilinosWrappers::BlockVector &v)
{
- std::vector<unsigned int> sizes (2, 3);
+ std::vector<types::global_dof_index> sizes (2, 3);
dealii::BlockVector<TrilinosScalar> w (sizes);
for (unsigned int i=0; i<w.size(); ++i)
try
{
{
- std::vector<unsigned int> sizes (2, 3);
+ std::vector<types::global_dof_index> sizes (2, 3);
TrilinosWrappers::BlockVector v (sizes);
test (v);
}
void test (TrilinosWrappers::MPI::BlockVector &v)
{
- std::vector<unsigned int> sizes (2, 3);
+ std::vector<types::global_dof_index> sizes (2, 3);
dealii::BlockVector<TrilinosScalar> w (sizes);
for (unsigned int i=0; i<w.size(); ++i)
try
{
{
- 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;
TrilinosWrappers::SparseMatrix m (5U,5U,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;
full_matrix(block_row*2+1,block_col*2) = -1.;
}
- std::vector<unsigned int> local_row_indices (2*m.n_block_rows());
- std::vector<unsigned int> local_col_indices (2*m.n_block_cols());
+ std::vector<types::global_dof_index> local_row_indices (2*m.n_block_rows());
+ std::vector<types::global_dof_index> local_col_indices (2*m.n_block_cols());
for (unsigned int i=0; i<block_size-1; ++i)
{
full_matrix(block_row*2+1,block_col*2) = -1.;
}
- std::vector<unsigned int> local_row_indices (2*m.n_block_rows());
- std::vector<unsigned int> local_col_indices (2*m.n_block_cols());
+ std::vector<types::global_dof_index> local_row_indices (2*m.n_block_rows());
+ std::vector<types::global_dof_index> local_col_indices (2*m.n_block_cols());
for (unsigned int i=0; i<block_size-1; ++i)
{
void test ()
{
- std::vector<unsigned int> ivector(4);
+ std::vector<types::global_dof_index> ivector(4);
ivector[0] = 2;
ivector[1] = 4;
ivector[2] = 3;
// now add the same elements row-wise
{
- std::vector<unsigned int> col_indices (m.n()/3+1);
+ std::vector<types::global_dof_index> col_indices (m.n()/3+1);
std::vector<double> col_values (m.n()/3+1);
for (unsigned int i=0; i<m.m(); ++i)
{
FullMatrix<double> full_matrix(2,2);
full_matrix(0,0) = full_matrix(1,1) = 1.;
full_matrix(0,1) = full_matrix(1,0) = -1.;
- std::vector<unsigned int> local_indices (2);
+ std::vector<types::global_dof_index> local_indices (2);
for (unsigned int i=0; i<m.m()-1; ++i)
{
// now set the same elements row-wise
{
- std::vector<unsigned int> col_indices (m.n()/3+1);
+ std::vector<types::global_dof_index> col_indices (m.n()/3+1);
std::vector<double> col_values (m.n()/3+1);
for (unsigned int i=0; i<m.m(); ++i)
{
FullMatrix<double> full_matrix(2,2);
full_matrix(0,0) = full_matrix(1,1) = 1.;
full_matrix(0,1) = full_matrix(1,0) = -1.;
- std::vector<unsigned int> local_indices (2);
+ std::vector<types::global_dof_index> local_indices (2);
for (unsigned int i=0; i<m.m()-1; ++i)
{
deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
- std::vector<unsigned int> size (dim);
+ std::vector<types::global_dof_index> size (dim);
DoFTools::count_dofs_per_component(dof_handler, size);
BlockSparsityPattern b_sparsity_pattern;