Hello,
following up to this topic, I thought of coding up the normal gradient integral
as follows:
//build FEFieldFunction object for interpolating the solution u
Functions::FEFieldFunction fe_object_fun(dof_handler, u, mapping)
//iterate over all active cells
typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler->begin_active(),
endc = dof_handler->end();
int_dudn = 0.0;
// Now we start the loop over all active cells.
for (;cell!=endc; ++cell)
{
//figure out if this cell is at the boundary
if (cell->at_boundary())
{
//figure out which face is at boundary by iterating over all faces
//get the quadrature points on the boundary face
//interpolate the solution values at the quadrature points using
fe_object_fun
std::vector<double> values(fe_v.n_quadrature_points)
fe_object_fun.value_list(fe_v.get_quadrature_points(), values)
//add the weighted integrand value to the current value of the integral
for (unsigned int point=0; point<fe_v.n_quadrature_points; ++point)
int_dudn += values[point] * JxW[point];
}
}
Is this a good way to assemble the boundary integral? It seems that using the
FEFieldFunction is a bit cumbersome, and may introduce interpolation errors. Is
there an easier way to do things?
thanks!
-- Mihai
________________________________
Von: mihai alexe <[email protected]>
An: deal.ii <[email protected]>
Gesendet: Freitag, den 21. Januar 2011, 10:34:04 Uhr
Betreff: [deal.II] computing the integral of the normal gradient du/dn along
the
boundary
Hi all,
After I solved my PDE for the solution u, I want to compute the integral
\int_\Gamma ( \partial{u} / \partial{n} )^2 ds
where \Gamma is the domain boundary. I have the discrete solution u^h as a
vector of values; is there a function in the library that helps with this? I
have looked in VectorTools but could not find something that calculates
integrals of directional derivatives (it does not fit the scope of the class I
guess). How would a quadrature calculation look like? I would have to iterate
over each DG element that has a face on the boundary, get the quadrature
points/weights, and then sum-up the boundary integral by hand?
Could I find something helpful in one of the tutorial examples?
Thanks!
-- M
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii