Many thanks Guido. Now I think I get it.


Regards
Javier


El lun, 07-11-2011 a las 14:54 -0600, Guido Kanschat escribió:
> Dear Javier,
> 
> boundary indicators are associated with faces, not with vertices.
> Thus, yes, at a vertex you can have two faces with different
> indicators. Or 3 in 3D.
> 
> If boundary conditions are part of the bilinear form, this typically
> does not matter, since the integrals involved are over faces.
> 
> In the functions setting strong boundary conditions, we always assume
> that the part of the boundary with strong boundary condition is
> closed, such that a vertex say between Dirichlet and Neumann
> boundaries will be assigned the Dirichlet boundary value.
> 
> Best,
> Guido
> 
> On Mon, Nov 7, 2011 at 2:46 PM, Javier Muñoz <[email protected]> wrote:
> > Hi
> >
> > I was playing with the basic options of the Triangulation and DofHandler
> > classes and I was wondering, it is possible that for one vertex to have
> > two boundary indicators?
> >
> > I'm doing the following:
> >
> > void Problem1::make_grid ()
> > {
> >  GridGenerator::hyper_cube (triangulation, -1, 1);
> >  triangulation.refine_global (2);
> >
> >  typename Triangulation<2>::cell_iterator
> >    cell = triangulation.begin (),
> >    endc = triangulation.end ();
> >  for (;cell != endc; ++cell)
> >    for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell;
> > ++face){
> >      if (cell->face(face)->at_boundary() &&
> >          ((std::fabs(cell->face(face)->center()(1) - (-1.0)) < 1e-12)       
> >    ||
> >           (std::fabs(cell->face(face)->center()(0) - (-1.0)) < 1e-12)))
> >        cell->face(face)->set_boundary_indicator (1);
> >      }
> >
> >  std::cout << "Number of active cells: "
> >            << triangulation.n_active_cells()
> >            << std::endl;
> >  std::cout << "Total number of cells: "
> >            << triangulation.n_cells()
> >            << std::endl;
> >  std::cout << "Total number of vertices: "
> >            << triangulation.n_vertices()
> >            << std::endl;
> >  std::cout << "Number of used vertices: "
> >            << triangulation.n_used_vertices()
> >            << std::endl;
> >
> >  dof_handler.distribute_dofs (fe);
> >  std::cout << "Number of degrees of freedom: "
> >            << dof_handler.n_dofs()
> >            << std::endl;
> >
> >  std::set<unsigned char> boundary_indicators_0;
> >  boundary_indicators_0.insert (0);
> >  std::set<unsigned char> boundary_indicators_1;
> >  boundary_indicators_1.insert (1);
> >
> >  std::cout << "Number of degrees of freedom on the boundary: "
> >            << dof_handler.n_boundary_dofs()
> >            << std::endl;
> >  std::cout << "Number of degrees of freedom on the boundary with
> > indicator 0: "
> >            << dof_handler.n_boundary_dofs(boundary_indicators_0)
> >            << std::endl;
> >  std::cout << "Number of degrees of freedom on the boundary with
> > indicator 1: "
> >            << dof_handler.n_boundary_dofs(boundary_indicators_1)
> >            << std::endl;
> >  std::cout << "Number of max coupling dofs: "
> >            << dof_handler.max_couplings_between_dofs()
> >            << std::endl;
> >  std::cout << "Number of max coupling dofs at the boundary: "
> >            << dof_handler.max_couplings_between_boundary_dofs()
> >            << std::endl;
> > }
> >
> > And the output would be:
> >
> > Number of active cells: 16
> > Total number of cells: 21
> > Total number of vertices: 25
> > Number of used vertices: 25
> > Number of degrees of freedom: 25
> > Number of degrees of freedom on the boundary: 16
> > Number of degrees of freedom on the boundary with indicator 0: 9
> > Number of degrees of freedom on the boundary with indicator 1: 9
> > Number of max coupling dofs: 19
> > Number of max coupling dofs at the boundary: 3
> >
> > It seems to me that vertices at (-1,1) and (-1,1) have two boundary
> > indicators. If so, does this affects my program later when I assign
> > boundary conditions?
> >
> >
> > And also, if I use polynomial degree 1 for the fe functions each vertex
> > should have 1 degree of freedom. How can I know which degree of freedom
> > (as they are numbered) was assigned to which vertex? Does this makes any
> > sense?
> >
> >
> > Regards
> > Javier Muñoz
> >
> >
> >
> > _______________________________________________
> > dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
> >
> 
> 
> 


_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to