> I now have one more question. In assemble_face_term function of step-33, the 
> normal numerical flux is calculated. This function is called for every 
> cell-neighbor pair from the assemble_system function. This means, if I am not 
> wrong, at every interior face quadrature point, the numerical flux is 
> calculated twice. This might be very costly. Is there a way to avoid this? 
> One can probably force only one cell to calculate numerical flux at a face 
> based on the face normal's orientation. But then how can we communicate the 
> calculated flux to the other cell. Or even better, is it possible to loop 
> over faces? We could then add contributions to both the cells sharing this 
> face without double computation.
step-33 does compute interior face integrals twice.

One way I handle this is to attach a cell user index 

// set cell number
unsigned int index=0;
for (typename Triangulation<dim,spacedim>::active_cell_iterator
cell=triangulation.begin_active();
cell!=triangulation.end(); ++cell, ++index)
cell->set_user_index (index);

and calculate face integral only once

for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
{

if(cell->face(f)->at_boundary)
{
// boundary flux integral
}
else if(cell->neighbor_is_coarser(f))
{
// assemble from finer side
}
else if(cell->user_index() < cell->neighbor(f)->user_index())
{
// compute face integral
}

// add residual to left cell
// subtract residual from right cell
}

You add/subtract face integral to both cells adjacent to the face.

If you have adapted grid, then you assemble from the finer side. 

Best
praveen

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/918D8227-43EF-4CB6-A66E-234A077B9E5E%40gmail.com.

Reply via email to