*/
template <int spacedim>
static
- unsigned int
+ types::global_dof_index
distribute_dofs_on_cell (const DoFHandler<1,spacedim> &dof_handler,
const typename DoFHandler<1,spacedim>::active_cell_iterator &cell,
- unsigned int next_free_dof)
+ types::global_dof_index next_free_dof)
{
// distribute dofs of vertices
template <int spacedim>
static
- unsigned int
+ types::global_dof_index
distribute_dofs_on_cell (const DoFHandler<2,spacedim> &dof_handler,
const typename DoFHandler<2,spacedim>::active_cell_iterator &cell,
- unsigned int next_free_dof)
+ types::global_dof_index next_free_dof)
{
if (dof_handler.get_fe().dofs_per_vertex > 0)
// number dofs on vertices
template <int spacedim>
static
- unsigned int
+ types::global_dof_index
distribute_dofs_on_cell (const DoFHandler<3,spacedim> &dof_handler,
const typename DoFHandler<3,spacedim>::active_cell_iterator &cell,
- unsigned int next_free_dof)
+ types::global_dof_index next_free_dof)
{
if (dof_handler.get_fe().dofs_per_vertex > 0)
// number dofs on vertices
* the corresponding
* argument is not equal to
* types::invalid_subdomain_id. Return
- * the total number of dofs
- * returned.
+ * the next free dof index.
*/
template <int dim, int spacedim>
static
- unsigned int
- distribute_dofs (const unsigned int offset,
+ types::global_dof_index
+ distribute_dofs (const types::global_dof_index offset,
const types::subdomain_id_t subdomain_id,
DoFHandler<dim,spacedim> &dof_handler)
{
tria.save_user_flags(user_flags);
const_cast<dealii::Triangulation<dim,spacedim> &>(tria).clear_user_flags ();
- unsigned int next_free_dof = offset;
+ types::global_dof_index next_free_dof = offset;
typename DoFHandler<dim,spacedim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
template <int spacedim>
static
void
- renumber_dofs (const std::vector<unsigned int> &new_numbers,
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
const IndexSet &,
DoFHandler<1,spacedim> &dof_handler,
const bool check_validity)
// numbers may be invalid_dof_index,
// namely when the appropriate
// vertex/line/etc is unused
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.vertex_dofs.begin();
i!=dof_handler.vertex_dofs.end(); ++i)
if (*i != DoFHandler<1,spacedim>::invalid_dof_index)
ExcInternalError ());
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.levels[level]->lines.dofs.begin();
i!=dof_handler.levels[level]->lines.dofs.end(); ++i)
if (*i != DoFHandler<1,spacedim>::invalid_dof_index)
template <int spacedim>
static
void
- renumber_dofs (const std::vector<unsigned int> &new_numbers,
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
const IndexSet &indices,
- DoFHandler<2,spacedim> &dof_handler,
+ DoFHandler<2,spacedim> &dof_handler,
const bool check_validity)
{
// note that we can not use cell
// numbers may be invalid_dof_index,
// namely when the appropriate
// vertex/line/etc is unused
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.vertex_dofs.begin();
i!=dof_handler.vertex_dofs.end(); ++i)
if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
== false,
ExcInternalError ());
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.faces->lines.dofs.begin();
i!=dof_handler.faces->lines.dofs.end(); ++i)
if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
{
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.levels[level]->quads.dofs.begin();
i!=dof_handler.levels[level]->quads.dofs.end(); ++i)
if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
template <int spacedim>
static
void
- renumber_dofs (const std::vector<unsigned int> &new_numbers,
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
const IndexSet &indices,
DoFHandler<3,spacedim> &dof_handler,
const bool check_validity)
// numbers may be invalid_dof_index,
// namely when the appropriate
// vertex/line/etc is unused
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.vertex_dofs.begin();
i!=dof_handler.vertex_dofs.end(); ++i)
if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
== false,
ExcInternalError ());
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.faces->lines.dofs.begin();
i!=dof_handler.faces->lines.dofs.end(); ++i)
if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
*i = ((indices.n_elements() == 0) ?
new_numbers[*i] :
new_numbers[indices.index_within_set(*i)]);
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.faces->quads.dofs.begin();
i!=dof_handler.faces->quads.dofs.end(); ++i)
if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
{
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
i=dof_handler.levels[level]->hexes.dofs.begin();
i!=dof_handler.levels[level]->hexes.dofs.end(); ++i)
if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
template <int dim, int spacedim>
NumberCache
Sequential<dim,spacedim>::
- distribute_dofs (const unsigned int offset,
+ distribute_dofs (const types::global_dof_index offset,
DoFHandler<dim,spacedim> &dof_handler) const
{
- const unsigned int n_dofs =
+ const types::global_dof_index n_dofs =
Implementation::distribute_dofs (offset,
types::invalid_subdomain_id,
dof_handler);
template <int dim, int spacedim>
NumberCache
Sequential<dim,spacedim>::
- renumber_dofs (const std::vector<unsigned int> &new_numbers,
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
dealii::DoFHandler<dim,spacedim> &dof_handler) const
{
Implementation::renumber_dofs (new_numbers, IndexSet(0),
{
std::vector<unsigned int> tree_index;
std::vector<typename dealii::internal::p4est::types<dim>::quadrant> quadrants;
- std::vector<unsigned int> dofs;
+ std::vector<types::global_dof_index> dofs;
unsigned int bytes_for_buffer () const
{
tree_index.size() * sizeof(unsigned int) +
quadrants.size() * sizeof(typename dealii::internal::p4est
::types<dim>::quadrant) +
- dofs.size() * sizeof(unsigned int));
+ dofs.size() * sizeof(types::global_dof_index));
}
void pack_data (std::vector<char> &buffer) const
std::memcpy(ptr,
&dofs[0],
- dofs.size() * sizeof(unsigned int));
- ptr += dofs.size() * sizeof(unsigned int);
+ dofs.size() * sizeof(types::global_dof_index));
+ ptr += dofs.size() * sizeof(types::global_dof_index);
Assert (ptr == &buffer[0]+buffer.size(),
ExcInternalError());
// this cell's dof_indices
// need to be sent to
// someone
- std::vector<unsigned int>
+ std::vector<types::global_dof_index>
local_dof_indices (dealii_cell->get_fe().dofs_per_cell);
dealii_cell->get_dof_indices (local_dof_indices);
const typename dealii::internal::p4est::types<dim>::quadrant &p4est_cell,
const typename DoFHandler<dim,spacedim>::cell_iterator &dealii_cell,
const typename dealii::internal::p4est::types<dim>::quadrant &quadrant,
- unsigned int * dofs)
+ types::global_dof_index * dofs)
{
if (internal::p4est::quadrant_is_equal<dim>(p4est_cell, quadrant))
{
Assert(dealii_cell->is_ghost(), ExcInternalError());
// update dof indices of cell
- std::vector<unsigned int>
+ std::vector<types::global_dof_index>
dof_indices (dealii_cell->get_fe().dofs_per_cell);
dealii_cell->update_cell_dof_indices_cache();
dealii_cell->get_dof_indices(dof_indices);
// that are going to send stuff to us
std::set<dealii::types::subdomain_id_t> senders;
{
- std::vector<unsigned int> local_dof_indices;
+ std::vector<types::global_dof_index> local_dof_indices;
typename DoFHandler<dim,spacedim>::active_cell_iterator
cell, endc = dof_handler.end();
memcpy(&cells, ptr, sizeof(unsigned int));
ptr+=sizeof(unsigned int);
- //reinterpret too evil?
+ //TODO: reinterpret too evil?
unsigned int * treeindex=reinterpret_cast<unsigned int*>(ptr);
ptr+=cells*sizeof(unsigned int);
typename dealii::internal::p4est::types<dim>::quadrant * quadrant
=reinterpret_cast<typename dealii::internal::p4est::types<dim>::quadrant *>(ptr);
ptr+=cells*sizeof(typename dealii::internal::p4est::types<dim>::quadrant);
- unsigned int * dofs=reinterpret_cast<unsigned int*>(ptr);
+ types::global_dof_index * dofs=reinterpret_cast<types::global_dof_index*>(ptr);
for (unsigned int c=0;c<cells;++c, dofs+=1+dofs[0])
{
template <int dim, int spacedim>
NumberCache
ParallelDistributed<dim, spacedim>::
- distribute_dofs (const unsigned int offset,
+ distribute_dofs (const types::global_dof_index offset,
DoFHandler<dim,spacedim> &dof_handler) const
{
Assert(offset==0, ExcNotImplemented());
//* 1. distribute on own
//* subdomain
- const unsigned int n_initial_local_dofs =
+ const types::global_dof_index n_initial_local_dofs =
Implementation::distribute_dofs (0, tr->locally_owned_subdomain(),
dof_handler);
//* 2. iterate over ghostcells and
//kill dofs that are not owned
//by us
- std::vector<unsigned int> renumbering(n_initial_local_dofs);
+ std::vector<types::global_dof_index> renumbering(n_initial_local_dofs);
for (unsigned int i=0; i<renumbering.size(); ++i)
renumbering[i] = i;
{
- std::vector<unsigned int> local_dof_indices;
+ std::vector<types::global_dof_index> local_dof_indices;
typename DoFHandler<dim,spacedim>::active_cell_iterator
cell = dof_handler.begin_active(),
// make indices consecutive
number_cache.n_locally_owned_dofs = 0;
- for (std::vector<unsigned int>::iterator it=renumbering.begin();
+ for (std::vector<types::global_dof_index>::iterator it=renumbering.begin();
it!=renumbering.end(); ++it)
if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
*it = number_cache.n_locally_owned_dofs++;
1, MPI_UNSIGNED,
tr->get_communicator());
- const unsigned int
+ const types::global_dof_index
shift = std::accumulate (number_cache
.n_locally_owned_dofs_per_processor.begin(),
number_cache
.n_locally_owned_dofs_per_processor.begin()
+ tr->locally_owned_subdomain(),
0);
- for (std::vector<unsigned int>::iterator it=renumbering.begin();
+ for (std::vector<types::global_dof_index>::iterator it=renumbering.begin();
it!=renumbering.end(); ++it)
if (*it != DoFHandler<dim,spacedim>::invalid_dof_index)
(*it) += shift;
// fill global_dof_indexsets
number_cache.locally_owned_dofs_per_processor.resize(n_cpus);
{
- unsigned int lshift = 0;
+ types::global_dof_index lshift = 0;
for (unsigned int i=0;i<n_cpus;++i)
{
number_cache.locally_owned_dofs_per_processor[i]
#ifdef DEBUG
//check that we are really done
{
- std::vector<unsigned int> local_dof_indices;
+ std::vector<types::global_dof_index> local_dof_indices;
typename DoFHandler<dim,spacedim>::active_cell_iterator
cell, endc = dof_handler.end();
template <int dim, int spacedim>
NumberCache
ParallelDistributed<dim, spacedim>::
- renumber_dofs (const std::vector<unsigned int> &new_numbers,
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
dealii::DoFHandler<dim,spacedim> &dof_handler) const
{
Assert (new_numbers.size() == dof_handler.locally_owned_dofs().n_elements(),
number_cache.locally_owned_dofs = IndexSet (dof_handler.n_dofs());
if (dof_handler.locally_owned_dofs().n_elements()>0)
{
- std::vector<unsigned int>::const_iterator it = new_numbers.begin();
+ std::vector<types::global_dof_index>::const_iterator it = new_numbers.begin();
const unsigned int n_blocks = dof_handler.get_fe().n_blocks();
- std::vector<std::pair<unsigned int,unsigned int> > block_indices(n_blocks);
+ std::vector<std::pair<types::global_dof_index,unsigned int> > block_indices(n_blocks);
block_indices[0].first = *it++;
block_indices[0].second = 1;
unsigned int current_block = 0, n_filled_blocks = 1;
// mark not locally active DoFs as
// invalid
{
- std::vector<unsigned int> local_dof_indices;
+ std::vector<types::global_dof_index> local_dof_indices;
typename DoFHandler<dim,spacedim>::active_cell_iterator
cell = dof_handler.begin_active(),