// maps
// the map surface_to_volumefaces_mapping contains the outcome of the method extract_boundary_mesh and connects
// panels from the manifold triangulation to the faces on the boundary of the volume triangulation.
// the map manifoldcells_to_volumecells_mapping pairs surface panels from the manifold triangulation
// to the cells of the volume triangulation. It is used in the method pair_the_triangulations().
//
std::map<
typename parallel::shared::Triangulation<manifold_dim,dim>::cell_iterator,
typename parallel::shared::Triangulation<dim>::face_iterator
>
surface_to_volumefaces_mapping;
std::map<
typename parallel::shared::Triangulation<manifold_dim,dim>::cell_iterator,
typename parallel::shared::Triangulation<dim>::cell_iterator
>
manifoldcells_to_volumecells_mapping;
//
// Surface triangulation definition
//
this->pcout << "\n Generation of surface discretization ... " << std::flush;
surface_to_volumefaces_mapping = GridGenerator::extract_boundary_mesh ( this->triangulation, this->manifold_triangulation );
this->manifold_triangulation.set_all_manifold_ids(0);
this->manifold_dof_handler.distribute_dofs ( this->manifold_fe );
this->manifold_accumulated_solution.reinit ( this->manifold_dof_handler.n_dofs() );
this->manifold_former_step_solution.reinit ( this->manifold_dof_handler.n_dofs() );
this->manifold_initial_guess.reinit ( this->manifold_dof_handler.n_dofs() );
this->pcout << " done \n" << std::flush;
//
// Surface triangulation and volume triangulation pairing
//
pair_the_triangulations();
pair_the_triangulations ( bool write_map_report )
//
// this function associates each
// surface panel to the volume cell from which it emanates.
// the map manifoldcells_to_volumecells_mapping contains the pair surface/volume panels
//
{
// unsigned face_counter = 0;
this->pcout << "pairing the two triangulations ... " << std::flush;
// loop through the volumetric triangulation
typename parallel::shared::Triangulation<dim>::active_cell_iterator
cell = this->triangulation.begin_active (),
endc = this->triangulation.end();
for (; cell!=endc; ++cell)
// We do not seek for locally_owned on the volumetric triangulation
{
// debug
// this->pcout << " new cell " << cell->id() << " " << std::flush;
// select a face at boundary
for (unsigned int face_number=0; face_number<GeometryInfo<dim>::faces_per_cell; ++face_number)
{
const typename parallel::shared::Triangulation<dim>::face_iterator
face = cell->face( face_number );
if ( face->at_boundary() )
{
// scan the surface_to_volumefaces_mapping and
// associate maifold panels to volume panels
typename
std::map< typename parallel::shared::Triangulation<manifold_dim,dim>::cell_iterator,
typename parallel::shared::Triangulation<dim>::face_iterator >
::iterator
map_it = surface_to_volumefaces_mapping.begin(),
map_end = surface_to_volumefaces_mapping.end() ;
for (; map_it!=map_end; ++map_it)
if ( face == map_it->second )
{
// debug
// this->pcout << cell->face_index(face_number) << ", " << std::flush;
// face_counter++;
manifoldcells_to_volumecells_mapping[ map_it->first ] = cell ;
}
}
}
}
// debug
// this->pcout << "\n I found " << face_counter << " faces. \n bye. \n " << std::flush;
// map report
if ( write_map_report )
{
typename std::map< typename parallel::shared::Triangulation<manifold_dim,dim>::cell_iterator,
typename parallel::shared::Triangulation<dim>::cell_iterator >
::iterator
manifoldcells_to_volumecells_it = manifoldcells_to_volumecells_mapping.begin() ,
manifoldcells_to_volumecells_end = manifoldcells_to_volumecells_mapping.end() ;
this->pcout << "\n map report: " << std::flush;
for (; manifoldcells_to_volumecells_it!=manifoldcells_to_volumecells_end; ++manifoldcells_to_volumecells_it)
this->pcout << "[ " << manifoldcells_to_volumecells_it->first->id() << ", " << manifoldcells_to_volumecells_it->second->id() << " ], " << std::flush;
this->pcout << "\n done. \n" << std::flush;
}
// debug
// std::exit( 0 );
}
fe_face_values.reinit (cell, face_number);
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/a60b9b5e-fef3-fd88-5e54-65bed698a5bc%40colostate.edu.