class Triangulation : public dealii::Triangulation<dim,spacedim>
{
public:
+ typedef typename dealii::Triangulation<dim,spacedim>::active_cell_iterator active_cell_iterator;
+ typedef typename dealii::Triangulation<dim,spacedim>::cell_iterator cell_iterator;
+
/**
* Constructor.
*/
MPI_Comm mpi_communicator;
types::subdomain_id my_subdomain;
types::subdomain_id num_subdomains;
-
- void mark_artificial();
};
}
}
dealii::DoFHandler<dim,spacedim> &dof_handler) const;
};
+ template <int dim, int spacedim>
+ class ParallelShared : public Sequential<dim,spacedim>
+ {
+ public:
+ virtual
+ NumberCache
+ distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler) const;
+
+ virtual
+ void
+ distribute_mg_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
+ std::vector<NumberCache> &number_caches) const;
+
+ virtual
+ NumberCache
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
+ dealii::DoFHandler<dim,spacedim> &dof_handler) const;
+ };
+
/**
* This class implements the
Triangulation<dim,spacedim>::execute_coarsening_and_refinement () {
dealii::Triangulation<dim,spacedim>::execute_coarsening_and_refinement ();
dealii::GridTools::partition_triangulation (num_subdomains, *this);
- mark_artificial();
}
template <int dim, int spacedim>
AssertThrow (false, ExcInternalError());
}
dealii::GridTools::partition_triangulation (num_subdomains, *this);
- mark_artificial();
}
{
return mpi_communicator;
}
-
- template <int dim, int spacedim>
- void
- Triangulation<dim,spacedim>::mark_artificial()
- {
-
- std::vector<bool > marked_vertices(this->n_vertices(),false);
- for (typename dealii::Triangulation<dim,spacedim>::active_cell_iterator
- cell = this->begin_active();
- cell != this->end(); ++cell)
- if (cell->subdomain_id() == this->locally_owned_subdomain())
- for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
- marked_vertices[cell->vertex_index(v)] = true;
-
-
-
- for (typename dealii::Triangulation<dim,spacedim>::active_cell_iterator
- cell = this->begin_active();
- cell != this->end(); ++cell)
- if (cell->subdomain_id() != this->locally_owned_subdomain()) {
- bool is_ghost = false;
- for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
- if (marked_vertices[cell->vertex_index(v)] == true)
- {
- is_ghost = true;
- break;
- }
- if (is_ghost)
- continue;
-
- cell->set_subdomain_id(numbers::artificial_subdomain_id);
- }
- }
-
}
}
return number_cache;
}
+ /* --------------------- class ParallelSequential ---------------- */
+ template <int dim, int spacedim>
+ NumberCache
+ ParallelShared<dim,spacedim>::
+ distribute_dofs (DoFHandler<dim,spacedim> &dof_handler) const
+ {
+ NumberCache number_cache = Sequential<dim,spacedim>::distribute_dofs (dof_handler);
+ //correct number_cache:
+
+ return number_cache;
+ }
+
+ template <int dim, int spacedim>
+ void
+ ParallelShared<dim,spacedim>::
+ distribute_mg_dofs (DoFHandler<dim,spacedim> &dof_handler,
+ std::vector<NumberCache> &number_caches) const
+ {
+ NumberCache number_cache = Sequential<dim,spacedim>:: distribute_mg_dofs (dof_handler, number_caches);
+ Assert(false,ExcMessage("Not implemented"));
+ return number_cache;
+ }
+
+ template <int dim, int spacedim>
+ NumberCache
+ ParallelShared<dim,spacedim>::
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
+ dealii::DoFHandler<dim,spacedim> &dof_handler) const
+ {
+ NumberCache number_cache = Sequential<dim,spacedim>::renumber_dofs (new_numbers,dof_handler);
+ //correct number_cache:
+
+ return number_cache;
+ }
/* --------------------- class ParallelDistributed ---------------- */
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- //can comment it since the case of distributed triangulations is handled above.
- //Assert (cell->is_artificial() == false,
- // ExcMessage ("You can't call this function for meshes that "
- // "have artificial cells."));
+ Assert (cell->is_artificial() == false,
+ ExcMessage ("You can't call this function for meshes that "
+ "have artificial cells."));
const types::subdomain_id subdomain_id = cell->subdomain_id();
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;