-TH: things to check:
+gTH: things to check:
1. std::accumulate with different data types
2. numbers::invalid_unsigned_int
BRUNO source/lac/vector.cc
BRUNO source/lac/vector_memory.cc
BRUNO source/lac/vector_view.cc
-source/multigrid/mg_base.cc
+KAINAN source/multigrid/mg_base.cc
source/multigrid/mg_dof_accessor.cc
-source/multigrid/mg_dof_handler.cc
-source/multigrid/mg_tools.cc
-source/multigrid/mg_transfer_block.cc
-source/multigrid/mg_transfer_component.cc
-source/multigrid/mg_transfer_prebuilt.cc
-source/multigrid/multigrid.cc
+KAINAN source/multigrid/mg_dof_handler.cc
+KAINAN source/multigrid/mg_tools.cc
+KAINAN source/multigrid/mg_transfer_block.cc
+KAINAN source/multigrid/mg_transfer_component.cc
+KAINAN source/multigrid/mg_transfer_prebuilt.cc
+KAINAN source/multigrid/multigrid.cc
UWE source/numerics/data_out.cc
UWE source/numerics/data_out_faces.cc
UWE source/numerics/data_out_rotation.cc
KAINAN include/deal.II/multigrid/mg_block_smoother.h
KAINAN include/deal.II/multigrid/mg_coarse.h
KAINAN include/deal.II/multigrid/mg_constrained_dofs.h
-include/deal.II/multigrid/mg_dof_accessor.h
-include/deal.II/multigrid/mg_dof_handler.h
-include/deal.II/multigrid/mg_dof_iterator_selector.h
-include/deal.II/multigrid/mg_matrix.h
-include/deal.II/multigrid/mg_smoother.h
-include/deal.II/multigrid/mg_tools.h
-include/deal.II/multigrid/mg_transfer_block.h
-include/deal.II/multigrid/mg_transfer_block.templates.h
-include/deal.II/multigrid/mg_transfer_component.h
-include/deal.II/multigrid/mg_transfer_component.templates.h
-include/deal.II/multigrid/mg_transfer.h
-include/deal.II/multigrid/mg_transfer.templates.h
-include/deal.II/multigrid/multigrid.h
-include/deal.II/multigrid/multigrid.templates.h
+KAINAN include/deal.II/multigrid/mg_dof_accessor.h
+KAINAN include/deal.II/multigrid/mg_dof_handler.h
+KAINAN include/deal.II/multigrid/mg_dof_iterator_selector.h
+KAINAN include/deal.II/multigrid/mg_matrix.h
+KAINAN include/deal.II/multigrid/mg_smoother.h
+KAINAN include/deal.II/multigrid/mg_tools.h
+KAINAN include/deal.II/multigrid/mg_transfer_block.h
+KAINAN include/deal.II/multigrid/mg_transfer_block.templates.h
+KAINAN include/deal.II/multigrid/mg_transfer_component.h
+KAINAN include/deal.II/multigrid/mg_transfer_component.templates.h
+KAINAN include/deal.II/multigrid/mg_transfer.h
+KAINAN include/deal.II/multigrid/mg_transfer.templates.h
+KAINAN include/deal.II/multigrid/multigrid.h
+KAINAN include/deal.II/multigrid/multigrid.templates.h
UWE include/deal.II/numerics/data_component_interpretation.h
UWE include/deal.II/numerics/data_out_faces.h
UWE include/deal.II/numerics/data_out.h
template <class DH>
void
count_dofs_per_block (const DH &dof_handler,
- std::vector<std::vector<unsigned int> > &dofs_per_block,
- std::vector<unsigned int> target_block = std::vector<unsigned int>());
+ std::vector<std::vector<types::global_dof_index> > &dofs_per_block,
+ std::vector<types::global_dof_index> target_block = std::vector<types::global_dof_index>());
/**
* Count the dofs component-wise
template <int dim, int spacedim>
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &mg_dof,
- std::vector<std::vector<unsigned int> > &result,
+ std::vector<std::vector<types::global_dof_index> > &result,
const bool only_once = false,
std::vector<unsigned int> target_component = std::vector<unsigned int>());
template <int dim, int spacedim>
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &mg_dof,
- std::vector<std::vector<unsigned int> > &result,
+ std::vector<std::vector<types::global_dof_index> > &result,
std::vector<unsigned int> target_component) DEAL_II_DEPRECATED;
/**
void
make_boundary_list (const DoFHandler<dim,spacedim> &mg_dof,
const typename FunctionMap<dim>::type &function_map,
- std::vector<std::set<unsigned int> > &boundary_indices,
+ std::vector<std::set<types::global_dof_index> > &boundary_indices,
const ComponentMask &component_mask = ComponentMask());
/**
*/
template <typename number>
void
- apply_boundary_values (const std::set<unsigned int> &boundary_dofs,
+ apply_boundary_values (const std::set<types::global_dof_index> &boundary_dofs,
SparseMatrix<number> &matrix,
const bool preserve_symmetry,
const bool ignore_zeros = false) DEAL_II_DEPRECATED;
*/
template <typename number>
void
- apply_boundary_values (const std::set<unsigned int> &boundary_dofs,
+ apply_boundary_values (const std::set<types::global_dof_index> &boundary_dofs,
BlockSparseMatrix<number> &matrix,
const bool preserve_symmetry) DEAL_II_DEPRECATED;
template <int dim, int spacedim>
void
extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
- std::vector<std::set<unsigned int> > &non_interface_dofs);
+ std::vector<std::set<types::global_dof_index> > &non_interface_dofs);
}
/* @} */
* The data is first the global
* index, then the level index.
*/
- std::vector<std::vector<std::pair<unsigned int, unsigned int> > >
+ std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
copy_indices;
/**
template <int dim, typename number, int spacedim>
void
reinit_vector (const dealii::DoFHandler<dim,spacedim> &mg_dof,
- std::vector<unsigned int> target_component,
+ std::vector<types::global_dof_index> target_component,
MGLevelObject<BlockVector<number> > &v)
{
const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
target_component.end());
const unsigned int n_target_blocks = max_block + 1;
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
ndofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(n_target_blocks));
+ std::vector<types::global_dof_index>(n_target_blocks));
MGTools::count_dofs_per_block (mg_dof, ndofs, target_component);
for (unsigned int level=v.min_level();
--level;
VECTOR &dst_level = dst[level];
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
for (IT i= copy_indices[level].begin();
i != copy_indices[level].end(); ++i)
dst_level(i->second) = src(i->first);
dst = 0;
for (unsigned int level=0; level<mg_dof_handler.get_tria().n_levels(); ++level)
{
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
if (constraints == 0)
for (IT i= copy_indices[level].begin();
// functions
for (unsigned int level=0; level<mg_dof_handler.get_tria().n_levels(); ++level)
{
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
for (IT i= copy_indices[level].begin();
i != copy_indices[level].end(); ++i)
dst(i->first) += src[level](i->second);
/**
* Sizes of the multi-level vectors.
*/
- mutable std::vector<std::vector<unsigned int> > sizes;
+ mutable std::vector<std::vector<types::global_dof_index> > sizes;
/**
* Start index of each block.
/*@}*/
-//---------------------------------------------------------------------------
+//----------inline function definition--------------------------------------------------
template <typename number>
inline void
MGTransferBlockSelect<number>::select(const unsigned int block)
typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
-
template <typename number>
template <int dim, typename number2, int spacedim>
void
/**
* Sizes of the multi-level vectors.
*/
- mutable std::vector<std::vector<unsigned int> > sizes;
+ mutable std::vector<std::vector<types::global_dof_index> > sizes;
/**
* Start index of each component.
*/
- std::vector<unsigned int> component_start;
+ std::vector<types::global_dof_index> component_start;
/**
* Start index of each component on
* all levels.
*/
- std::vector<std::vector<unsigned int> > mg_component_start;
+ std::vector<std::vector<types::global_dof_index> > mg_component_start;
/**
* Call build_matrices()
* The data is first the global
* index, then the level index.
*/
- std::vector<std::vector<std::pair<unsigned int, unsigned int> > >
+ std::vector<std::vector<std::pair<types::global_dof_index, unsigned int> > >
copy_to_and_from_indices;
/**
* boundary values in the
* restriction matrix.
*/
- std::vector<std::set<unsigned int> > boundary_indices;
+ std::vector<std::set<types::global_dof_index> > boundary_indices;
};
//TODO:[GK] Update documentation for copy_* functions
= std::vector<unsigned int>(),
const std::vector<unsigned int> &mg_target_component
= std::vector<unsigned int>(),
- const std::vector<std::set<unsigned int> > &boundary_indices
- = std::vector<std::set<unsigned int> >()
+ const std::vector<std::set<types::global_dof_index> > &boundary_indices
+ = std::vector<std::set<types::global_dof_index> >()
);
/**
for (; level_cell != endc; ++level_cell)
{
const unsigned int level = level_cell->level();
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
for (IT i=copy_to_and_from_indices[level].begin();
i != copy_to_and_from_indices[level].end(); ++i)
dst(i->first) = src[level](i->second);
const FiniteElement<dim> &fe = mg_dof_handler.get_fe();
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- std::vector<unsigned int> global_dof_indices (dofs_per_cell);
- std::vector<unsigned int> level_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> global_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> level_dof_indices (dofs_per_cell);
typename DoFHandler<dim,spacedim>::active_cell_iterator
level_cell = mg_dof_handler.begin_active();
for (; level_cell != endc; ++level_cell)
{
const unsigned int level = level_cell->level();
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
for (IT i=copy_to_and_from_indices[level].begin();
i != copy_to_and_from_indices[level].end(); ++i)
dst(i->first) += src[level](i->second);
const typename DoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
typename DoFHandler<dim,spacedim>::active_cell_iterator cell;
- std::vector<unsigned int> cell_indices;
- std::vector<unsigned int> neighbor_indices;
+ std::vector<types::global_dof_index> cell_indices;
+ std::vector<types::global_dof_index> neighbor_indices;
// We loop over cells and go from
// cells to lower dimensional
const typename DoFHandler<dim,spacedim>::cell_iterator end = dofs.end(level);
typename DoFHandler<dim,spacedim>::active_cell_iterator cell;
- std::vector<unsigned int> cell_indices;
- std::vector<unsigned int> neighbor_indices;
+ std::vector<types::global_dof_index> cell_indices;
+ std::vector<types::global_dof_index> neighbor_indices;
// We have to translate the
// couplings from components to
SparsityPattern &sparsity,
const unsigned int level)
{
- const unsigned int n_dofs = dof.n_dofs(level);
+ const types::global_dof_index n_dofs = dof.n_dofs(level);
Assert (sparsity.n_rows() == n_dofs,
ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
typename DH::cell_iterator cell = dof.begin(level),
endc = dof.end(level);
for (; cell!=endc; ++cell)
SparsityPattern &sparsity,
const unsigned int level)
{
- const unsigned int n_dofs = dof.n_dofs(level);
+ const types::global_dof_index n_dofs = dof.n_dofs(level);
Assert (sparsity.n_rows() == n_dofs,
ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
Assert ((level>=1) && (level<dof.get_tria().n_levels()),
ExcIndexRange(level, 1, dof.get_tria().n_levels()));
- const unsigned int fine_dofs = dof.n_dofs(level);
- const unsigned int coarse_dofs = dof.n_dofs(level-1);
+ const types::global_dof_index fine_dofs = dof.n_dofs(level);
+ const types::global_dof_index coarse_dofs = dof.n_dofs(level-1);
// Matrix maps from fine level to coarse level
ExcDimensionMismatch (sparsity.n_cols(), fine_dofs));
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
- std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_on_other_cell(dofs_per_cell);
typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
endc = dof.end(level);
for (; cell!=endc; ++cell)
const Table<2,DoFTools::Coupling> &flux_mask)
{
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_dofs = dof.n_dofs(level);
+ const types::global_dof_index n_dofs = dof.n_dofs(level);
const unsigned int n_comp = fe.n_components();
Assert (sparsity.n_rows() == n_dofs,
ExcDimensionMismatch (flux_mask.n_cols(), n_comp));
const unsigned int total_dofs = fe.dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(total_dofs);
- std::vector<unsigned int> dofs_on_other_cell(total_dofs);
+ std::vector<types::global_dof_index> dofs_on_this_cell(total_dofs);
+ std::vector<types::global_dof_index> dofs_on_other_cell(total_dofs);
Table<2,bool> support_on_face(total_dofs, GeometryInfo<dim>::faces_per_cell);
typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
Assert ((level>=1) && (level<dof.get_tria().n_levels()),
ExcIndexRange(level, 1, dof.get_tria().n_levels()));
- const unsigned int fine_dofs = dof.n_dofs(level);
- const unsigned int coarse_dofs = dof.n_dofs(level-1);
+ const types::global_dof_index fine_dofs = dof.n_dofs(level);
+ const types::global_dof_index coarse_dofs = dof.n_dofs(level-1);
// Matrix maps from fine level to coarse level
ExcDimensionMismatch (flux_mask.n_cols(), n_comp));
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
- std::vector<unsigned int> dofs_on_this_cell(dofs_per_cell);
- std::vector<unsigned int> dofs_on_other_cell(dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
+ std::vector<types::global_dof_index> dofs_on_other_cell(dofs_per_cell);
Table<2,bool> support_on_face(dofs_per_cell, GeometryInfo<dim>::faces_per_cell);
typename DoFHandler<dim,spacedim>::cell_iterator cell = dof.begin(level),
template <int dim, int spacedim>
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &dof_handler,
- std::vector<std::vector<unsigned int> > &result,
+ std::vector<std::vector<types::global_dof_index> > &result,
bool only_once,
- std::vector<unsigned int> target_component)
+ std::vector<types::global_dof_index> target_component)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
const unsigned int n_components = fe.n_components();
template <int dim, int spacedim>
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &dof_handler,
- std::vector<std::vector<unsigned int> > &result,
- std::vector<unsigned int> target_component)
+ std::vector<std::vector<types::global_dof_index> > &result,
+ std::vector<types::global_dof_index> target_component)
{
count_dofs_per_component (dof_handler, result,
false, target_component);
void
count_dofs_per_block (
const DH &dof_handler,
- std::vector<std::vector<unsigned int> > &dofs_per_block,
- std::vector<unsigned int> target_block)
+ std::vector<std::vector<types::global_dof_index> > &dofs_per_block,
+ std::vector<types::global_dof_index> target_block)
{
const FiniteElement<DH::dimension,DH::space_dimension> &fe = dof_handler.get_fe();
const unsigned int n_blocks = fe.n_blocks();
make_boundary_list(
const DoFHandler<1,1> &,
const FunctionMap<1>::type &,
- std::vector<std::set<unsigned int> > &,
+ std::vector<std::set<types::global_dof_index> > &,
const ComponentMask &)
{
Assert(false, ExcNotImplemented());
make_boundary_list(
const DoFHandler<1,2> &,
const FunctionMap<1>::type &,
- std::vector<std::set<unsigned int> > &,
+ std::vector<std::set<types::global_dof_index> > &,
const ComponentMask &)
{
Assert(false, ExcNotImplemented());
make_boundary_list(
const DoFHandler<dim,spacedim> &dof,
const typename FunctionMap<dim>::type &function_map,
- std::vector<std::set<unsigned int> > &boundary_indices,
+ std::vector<std::set<types::global_dof_index> > &boundary_indices,
const ComponentMask &component_mask)
{
// if for whatever reason we were
AssertDimension (boundary_indices.size(), n_levels);
- std::vector<unsigned int> local_dofs;
+ std::vector<types::global_dof_index> local_dofs;
local_dofs.reserve (DoFTools::max_dofs_per_face(dof));
std::fill (local_dofs.begin (),
local_dofs.end (),
ExcDimensionMismatch (boundary_indices.size(),
dof.get_tria().n_levels()));
- std::vector<std::set<unsigned int> >
+ std::vector<std::set<types::global_dof_index> >
my_boundary_indices (dof.get_tria().n_levels());
make_boundary_list (dof, function_map, my_boundary_indices, component_mask);
for (unsigned int i=0; i<dof.get_tria().n_levels(); ++i)
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int dofs_per_face = fe.dofs_per_face;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
std::vector<bool> cell_dofs(dofs_per_cell, false);
typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
template <int dim, int spacedim>
void
extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
- std::vector<std::set<unsigned int> > &non_interface_dofs)
+ std::vector<std::set<types::global_dof_index> > &non_interface_dofs)
{
Assert (non_interface_dofs.size() == mg_dof_handler.get_tria().n_levels(),
ExcDimensionMismatch (non_interface_dofs.size(),
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int dofs_per_face = fe.dofs_per_face;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
std::vector<bool> cell_dofs(dofs_per_cell, false);
std::vector<bool> cell_dofs_interface(dofs_per_cell, false);
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int dofs_per_face = fe.dofs_per_face;
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
- std::vector<unsigned int> face_dof_indices (dofs_per_face);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> face_dof_indices (dofs_per_face);
std::vector<bool> cell_dofs(dofs_per_cell, false);
std::vector<bool> boundary_cell_dofs(dofs_per_cell, false);
template <typename number>
void
apply_boundary_values (
- const std::set<unsigned int> &boundary_dofs,
+ const std::set<types::global_dof_index> &boundary_dofs,
SparseMatrix<number> &matrix,
const bool preserve_symmetry,
const bool /*ignore_zeros*/)
// a deprecated function, I therefore threw away the original function
// and replaced it by the following, which I believe should work
- std::map<unsigned int, double> boundary_values;
- for (std::set<unsigned int>::const_iterator p=boundary_dofs.begin();
+ std::map<types::global_dof_index, double> boundary_values;
+ for (std::set<types::global_dof_index>::const_iterator p=boundary_dofs.begin();
p != boundary_dofs.end(); ++p)
boundary_values[*p] = 0;
template <typename number>
void
apply_boundary_values (
- const std::set<unsigned int> &boundary_dofs,
+ const std::set<types::global_dof_index> &boundary_dofs,
BlockSparseMatrix<number> &matrix,
const bool preserve_symmetry)
{
// a deprecated function, I therefore threw away the original function
// and replaced it by the following, which I believe should work
- std::map<unsigned int, double> boundary_values;
- for (std::set<unsigned int>::const_iterator p=boundary_dofs.begin();
+ std::map<types::global_dof_index, double> boundary_values;
+ for (std::set<types::global_dof_index>::const_iterator p=boundary_dofs.begin();
p != boundary_dofs.end(); ++p)
boundary_values[*p] = 0;
namespace MGTools
{
template void apply_boundary_values (
- const std::set<unsigned int> &,
+ const std::set<types::global_dof_index> &,
SparseMatrix<float> &, const bool, const bool);
template void apply_boundary_values (
- const std::set<unsigned int> &,
+ const std::set<types::global_dof_index> &,
SparseMatrix<double> &, const bool, const bool);
template void apply_boundary_values (
- const std::set<unsigned int> &,
+ const std::set<types::global_dof_index> &,
BlockSparseMatrix<float> &, const bool);
template void apply_boundary_values (
- const std::set<unsigned int> &,
+ const std::set<types::global_dof_index> &,
BlockSparseMatrix<double> &, const bool);
}
const dealii::DoFHandler<dim,spacedim> &mg_dof,
MGLevelObject<BlockVector<number> > &v,
const std::vector<bool> &sel,
- std::vector<std::vector<unsigned int> > &ndofs)
+ std::vector<std::vector<types::global_dof_index> > &ndofs)
{
std::vector<bool> selected=sel;
// Compute the number of blocks needed
if (ndofs.size() == 0)
{
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(selected.size()));
+ std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
}
const dealii::DoFHandler<dim,spacedim> &mg_dof,
MGLevelObject<dealii::Vector<number> > &v,
const unsigned int selected_block,
- std::vector<std::vector<unsigned int> > &ndofs)
+ std::vector<std::vector<types::global_dof_index> > &ndofs)
{
const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
Assert(selected_block < n_blocks, ExcIndexRange(selected_block, 0, n_blocks));
if (ndofs.size() == 0)
{
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(selected.size()));
+ std::vector<types::global_dof_index>(selected.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs);
}
// Compute the lengths of all blocks
sizes.clear ();
- sizes.resize(n_levels, std::vector<unsigned int>(fe.n_blocks()));
+ sizes.resize(n_levels, std::vector<types::global_dof_index>(fe.n_blocks()));
MGTools::count_dofs_per_block(mg_dof, sizes);
// Fill some index vectors
// Compute start indices from sizes
for (unsigned int l=0; l<mg_block_start.size(); ++l)
{
- unsigned int k=0;
+ types::global_dof_index k=0;
for (unsigned int i=0; i<mg_block_start[l].size(); ++i)
{
- const unsigned int t=mg_block_start[l][i];
+ const types::global_dof_index t=mg_block_start[l][i];
mg_block_start[l][i] = k;
k += t;
}
DoFTools::count_dofs_per_block (static_cast<const DoFHandler<dim,spacedim>&>(mg_dof),
block_start);
- unsigned int k=0;
+ types::global_dof_index k=0;
for (unsigned int i=0; i<block_start.size(); ++i)
{
- const unsigned int t=block_start[i];
+ const types::global_dof_index t=block_start[i];
block_start[i] = k;
k += t;
}
// two fields which will store the
// indices of the multigrid dofs
// for a cell and one of its children
- std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
- std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
// for each level: first build the
// sparsity pattern of the matrices
if (mg_constrained_dofs != 0)
if (mg_constrained_dofs->set_boundary_values())
{
- std::vector<unsigned int> constrain_indices;
+ std::vector<types::global_dof_index> constrain_indices;
std::vector<std::vector<bool> > constraints_per_block (n_blocks);
for (int level=n_levels-2; level>=0; --level)
{
// need to filter away.
constrain_indices.resize (0);
constrain_indices.resize (prolongation_matrices[level]->n(), 0);
- std::set<unsigned int>::const_iterator dof
+ std::set<types::global_dof_index>::const_iterator dof
= mg_constrained_dofs->get_boundary_indices()[level].begin(),
endd = mg_constrained_dofs->get_boundary_indices()[level].end();
for (; dof != endd; ++dof)
unsigned int index = 0;
for (unsigned int block=0; block<n_blocks; ++block)
{
- const unsigned int n_dofs = prolongation_matrices[level]->block(block, block).m();
+ const types::global_dof_index n_dofs = prolongation_matrices[level]->block(block, block).m();
constraints_per_block[block].resize(0);
constraints_per_block[block].resize(n_dofs, 0);
- for (unsigned int i=0; i<n_dofs; ++i, ++index)
+ for (types::global_dof_index i=0; i<n_dofs; ++i, ++index)
constraints_per_block[block][i] = constrain_indices[index] == 1;
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
{
SparseMatrix<double>::iterator
start_row = prolongation_matrices[level]->block(block, block).begin(i),
MGTransferBlockBase::build_matrices (dof, mg_dof);
- std::vector<unsigned int> temp_copy_indices;
- std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
- std::vector<unsigned int> level_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> temp_copy_indices;
+ std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> level_dof_indices (fe.dofs_per_cell);
for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
{
// copy_indices object. Then, insert the pairs
// of global index and level index into
// copy_indices.
- const unsigned int n_active_dofs =
+ const types::global_dof_index n_active_dofs =
std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
- std::bind2nd(std::not_equal_to<unsigned int>(),
+ std::bind2nd(std::not_equal_to<types::global_dof_index>(),
numbers::invalid_unsigned_int));
copy_indices[selected_block][level].resize (n_active_dofs);
- unsigned int counter = 0;
- for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
+ types::global_dof_index counter = 0;
+ for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
copy_indices[selected_block][level][counter++] =
- std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
+ std::pair<types::global_dof_index, unsigned int> (temp_copy_indices[i], i);
Assert (counter == n_active_dofs, ExcInternalError());
}
}
MGTransferBlockBase::build_matrices (dof, mg_dof);
- std::vector<std::vector<unsigned int> > temp_copy_indices (n_blocks);
- std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
- std::vector<unsigned int> level_dof_indices (fe.dofs_per_cell);
+ std::vector<std::vector<types::global_dof_index> > temp_copy_indices (n_blocks);
+ std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> level_dof_indices (fe.dofs_per_cell);
for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
{
typename DoFHandler<dim,spacedim>::active_cell_iterator
for (unsigned int block=0; block<n_blocks; ++block)
if (selected[block])
{
- const unsigned int n_active_dofs =
+ const types::global_dof_index n_active_dofs =
std::count_if (temp_copy_indices[block].begin(),
temp_copy_indices[block].end(),
- std::bind2nd(std::not_equal_to<unsigned int>(),
+ std::bind2nd(std::not_equal_to<types::global_dof_index>(),
numbers::invalid_unsigned_int));
copy_indices[block][level].resize (n_active_dofs);
- unsigned int counter = 0;
- for (unsigned int i=0; i<temp_copy_indices[block].size(); ++i)
+ types::global_dof_index counter = 0;
+ for (types::global_dof_index i=0; i<temp_copy_indices[block].size(); ++i)
if (temp_copy_indices[block][i] != numbers::invalid_unsigned_int)
copy_indices[block][level][counter++] =
- std::pair<unsigned int, unsigned int>
+ std::pair<types::global_dof_index, unsigned int>
(temp_copy_indices[block][i], i);
Assert (counter == n_active_dofs, ExcInternalError());
}
MGLevelObject<BlockVector<number> > &v,
const std::vector<bool> &sel,
const std::vector<unsigned int> &target_comp,
- std::vector<std::vector<unsigned int> > &ndofs)
+ std::vector<std::vector<types::global_dof_index> > &ndofs)
{
std::vector<bool> selected=sel;
std::vector<unsigned int> target_component=target_comp;
if (ndofs.size() == 0)
{
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(target_component.size()));
+ std::vector<types::global_dof_index>(target_component.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs, target_component);
}
MGLevelObject<dealii::Vector<number> > &v,
const ComponentMask &component_mask,
const std::vector<unsigned int> &target_component,
- std::vector<std::vector<unsigned int> > &ndofs)
+ std::vector<std::vector<types::global_dof_index> > &ndofs)
{
Assert (component_mask.represents_n_components(target_component.size()),
ExcMessage ("The component mask does not have the correct size."));
if (ndofs.size() == 0)
{
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
new_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(target_component.size()));
+ std::vector<types::global_dof_index>(target_component.size()));
std::swap(ndofs, new_dofs);
MGTools::count_dofs_per_block (mg_dof, ndofs,
target_component);
{
--level;
- typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator IT;
+ typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
for (IT i=copy_to_and_from_indices[level].begin();
i != copy_to_and_from_indices[level].end(); ++i)
dst[level](i->second) = src(i->first);
// Compute start indices from sizes
for (unsigned int l=0; l<mg_component_start.size(); ++l)
{
- unsigned int k=0;
+ types::global_dof_index k=0;
for (unsigned int i=0; i<mg_component_start[l].size(); ++i)
{
- const unsigned int t=mg_component_start[l][i];
+ const types::global_dof_index t=mg_component_start[l][i];
mg_component_start[l][i] = k;
k += t;
}
DoFTools::
count_dofs_per_block (mg_dof, component_start, target_component);
- unsigned int k=0;
+ types::global_dof_index k=0;
for (unsigned int i=0; i<component_start.size(); ++i)
{
- const unsigned int t=component_start[i];
+ const types::global_dof_index t=component_start[i];
component_start[i] = k;
k += t;
}
// two fields which will store the
// indices of the multigrid dofs
// for a cell and one of its children
- std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
- std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
// for each level: first build the
// sparsity pattern of the matrices
if (boundary_indices.size() != 0)
{
- std::vector<std::vector<unsigned int> >
+ std::vector<std::vector<types::global_dof_index> >
dofs_per_component(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(n_components));
+ std::vector<types::global_dof_index>(n_components));
MGTools::count_dofs_per_block (mg_dof, dofs_per_component, mg_target_component);
for (unsigned int level=0; level<n_levels-1; ++level)
for (unsigned int jblock=0; jblock<n_components; ++jblock)
if (iblock==jblock)
{
- const unsigned int n_dofs = prolongation_matrices[level]->block(iblock,jblock).m();
- for (unsigned int i=0; i<n_dofs; ++i)
+ const types::global_dof_index n_dofs = prolongation_matrices[level]->block(iblock,jblock).m();
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
{
SparseMatrix<double>::iterator anfang = prolongation_matrices[level]->block(iblock,jblock).begin(i),
ende = prolongation_matrices[level]->block(iblock,jblock).end(i);
const BlockIndices block_indices_coarse (dofs_per_component[level]);
const unsigned int global_j = block_indices_coarse.local_to_global(iblock, column_number);
- std::set<unsigned int>::const_iterator found_dof =
+ std::set<types::global_dof_index>::const_iterator found_dof =
boundary_indices[level].find(global_j);
const bool is_boundary_index =
unsigned int mg_select,
const std::vector<unsigned int> &t_component,
const std::vector<unsigned int> &mg_t_component,
- const std::vector<std::set<unsigned int> > &bdry_indices)
+ const std::vector<std::set<types::global_dof_index> > &bdry_indices)
{
const FiniteElement<dim> &fe = mg_dof.get_fe();
unsigned int ncomp = mg_dof.get_fe().n_components();
// use a temporary vector to create the
// relation between global and level dofs
- std::vector<unsigned int> temp_copy_indices;
- std::vector<unsigned int> global_dof_indices (fe.dofs_per_cell);
- std::vector<unsigned int> level_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> temp_copy_indices;
+ std::vector<types::global_dof_index> global_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> level_dof_indices (fe.dofs_per_cell);
for (int level=dof.get_tria().n_levels()-1; level>=0; --level)
{
copy_to_and_from_indices[level].clear();
if (component_mask[component] &&
!interface_dofs[level][level_dof_indices[i]])
{
- const unsigned int level_start
+ const types::global_dof_index level_start
= mg_component_start[level][mg_target_component[component]];
- const unsigned int global_start
+ const types::global_dof_index global_start
= component_start[target_component[component]];
temp_copy_indices[level_dof_indices[i]-level_start] =
global_dof_indices[i] - global_start;
// write indices from vector into the map from
// global to level dofs
- const unsigned int n_active_dofs =
+ const types::global_dof_index n_active_dofs =
std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
- std::bind2nd(std::not_equal_to<unsigned int>(),
+ std::bind2nd(std::not_equal_to<types::global_dof_index>(),
numbers::invalid_unsigned_int));
copy_to_and_from_indices[level].resize (n_active_dofs);
- unsigned int counter = 0;
- for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
+ types::global_dof_index counter = 0;
+ for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
copy_to_and_from_indices[level][counter++] =
- std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
+ std::pair<types::global_dof_index, unsigned int> (temp_copy_indices[i], i);
Assert (counter == n_active_dofs, ExcInternalError());
}
}
// two fields which will store the
// indices of the multigrid dofs
// for a cell and one of its children
- std::vector<unsigned int> dof_indices_parent (dofs_per_cell);
- std::vector<unsigned int> dof_indices_child (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_parent (dofs_per_cell);
+ std::vector<types::global_dof_index> dof_indices_child (dofs_per_cell);
// for each level: first build the sparsity
// pattern of the matrices and then build the
// element will be stored
CompressedSimpleSparsityPattern csp (sizes[level+1],
sizes[level]);
- std::vector<unsigned int> entries (dofs_per_cell);
+ std::vector<types::global_dof_index> entries (dofs_per_cell);
for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
cell != mg_dof.end(level); ++cell)
if (cell->has_children())
if (mg_constrained_dofs != 0)
if (mg_constrained_dofs->set_boundary_values())
{
- std::vector<unsigned int> constrain_indices;
+ std::vector<types::global_dof_index> constrain_indices;
for (int level=n_levels-2; level>=0; --level)
{
if (mg_constrained_dofs->get_boundary_indices()[level].size() == 0)
// need to filter away.
constrain_indices.resize (0);
constrain_indices.resize (prolongation_matrices[level]->n(), 0);
- std::set<unsigned int>::const_iterator dof
+ std::set<types::global_dof_index>::const_iterator dof
= mg_constrained_dofs->get_boundary_indices()[level].begin(),
endd = mg_constrained_dofs->get_boundary_indices()[level].end();
for (; dof != endd; ++dof)
constrain_indices[*dof] = 1;
- const unsigned int n_dofs = prolongation_matrices[level]->m();
- for (unsigned int i=0; i<n_dofs; ++i)
+ const types::global_dof_index n_dofs = prolongation_matrices[level]->m();
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
{
typename internal::MatrixSelector<VECTOR>::Matrix::iterator
start_row = prolongation_matrices[level]->begin(i),
// levels.
copy_indices.resize(n_levels);
- std::vector<unsigned int> temp_copy_indices;
- std::vector<unsigned int> global_dof_indices (dofs_per_cell);
- std::vector<unsigned int> level_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> temp_copy_indices;
+ std::vector<types::global_dof_index> global_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> level_dof_indices (dofs_per_cell);
for (int level=mg_dof.get_tria().n_levels()-1; level>=0; --level)
{
copy_indices[level].clear();
// copy_indices object. Then, insert the pairs
// of global index and level index into
// copy_indices.
- const unsigned int n_active_dofs =
+ const types::global_dof_index n_active_dofs =
std::count_if (temp_copy_indices.begin(), temp_copy_indices.end(),
- std::bind2nd(std::not_equal_to<unsigned int>(),
+ std::bind2nd(std::not_equal_to<types::global_dof_index>(),
numbers::invalid_unsigned_int));
copy_indices[level].resize (n_active_dofs);
- unsigned int counter = 0;
- for (unsigned int i=0; i<temp_copy_indices.size(); ++i)
+ types::global_dof_index counter = 0;
+ for (types::global_dof_index i=0; i<temp_copy_indices.size(); ++i)
if (temp_copy_indices[i] != numbers::invalid_unsigned_int)
copy_indices[level][counter++] =
- std::pair<unsigned int, unsigned int> (temp_copy_indices[i], i);
+ std::pair<types::global_dof_index, unsigned int> (temp_copy_indices[i], i);
Assert (counter == n_active_dofs, ExcInternalError());
}
}