constraints.add_entries_local_to_global
(dofs_on_other_cell, dofs_on_this_cell,
sparsity, keep_constrained_dofs);
+ // only need to add this when the neighbor is not
+ // owned by the current processor, otherwise we add
+ // the entries for the neighbor there
+ if (sub_neighbor->subdomain_id() != cell->subdomain_id())
+ constraints.add_entries_local_to_global
+ (dofs_on_other_cell, sparsity, keep_constrained_dofs);
}
}
else
constraints.add_entries_local_to_global
(dofs_on_other_cell, dofs_on_this_cell,
sparsity, keep_constrained_dofs);
- if (cell->neighbor(face)->active())
+ if (cell->neighbor(face)->subdomain_id() !=
+ cell->subdomain_id())
constraints.add_entries_local_to_global
- (dofs_on_other_cell, dofs_on_other_cell,
- sparsity, keep_constrained_dofs);
+ (dofs_on_other_cell, sparsity, keep_constrained_dofs);
}
}
}
typename DoFHandler<dim,spacedim>::cell_iterator
neighbor = cell->neighbor(face);
neighbor->get_mg_dof_indices (dofs_on_other_cell);
- // only add one direction
- // The other is taken care of
- // by neighbor.
+ // only add one direction The other is taken care of by
+ // neighbor (except when the neighbor is not owned by the same
+ // processor)
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
for (unsigned int j=0; j<dofs_per_cell; ++j)
dofs_on_other_cell[j]);
}
}
+ if (neighbor->is_locally_owned_on_level() == false)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ {
+ sparsity.add (dofs_on_other_cell[i],
+ dofs_on_other_cell[j]);
+ sparsity.add (dofs_on_other_cell[i],
+ dofs_on_this_cell[j]);
+ }
}
}
}