Pavel,
> 1) [...]
> I would guess, that those pieces of code should be equivalent, but now the
> solution is zero. Nothing else is changed. Do you
> have any idea what I might be missing?
As Bruno already said, I think this looks alright to the degree this can be
said without looking at the code as a whole. What does dof_handler.n_dofs()
return?
> 2)
> Another question is, how can be interior faces distinguished. I need to be
> able to specify essential boundary conditions on lines
> B1 and B2, which are on the boundary of one field, but are not boundary of the
> triangulation. I can do it by directly using ConstraintMatrix,
> as it is suggested in step 46 tutorial, but I need to be able to distinguish
> them. When I try to use CellData::boundary_id directly, I get
> an exception ExcInteriorLineCantBeBoundary, so I guess, that inside the
> triangulation, the only acceptable value is internal_face_boundary_id.
Correct, at least for boundary_id.
> Is there another way how to specify user-defined marker? The approach followed
> in step 46 (looking on cells adjacent to faces and distinguishing
> faces between two different materials) is not sufficient for me, because, as
> on the figure, both B1 and B2 are between M1 and M2, but there might
> be different boundary conditions prescribed.
Bruno's suggested approach with the user flags or user indices is the way to
go. It has the drawback that it isn't inherited from the mother face to the
children upon refinement, but it shouldn't be very hard to rectify this by an
additional loop of the kind
for (cell=tria.begin(); ...) // loop over all cells, not just active ones
for (face=0; ...)
if (cell->face(f)->user_index() == something_special) // B1 and B2
if (cell->face(f)->has_children())
for (unsigned int c=0; c<cell->face(f)->n_children(); ++c)
cell->face(f)->child(c)->set_user_index(something_special);
right after mesh refinement.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@math.tamu.edu
www:
http://www.math.tamu.edu/~bangerth/