# [deal.II] Line Integral of function

Hello everyone,

I am using deal.ii to solve a 3D solid mechanics problem. My code uses
PetSc and P4est.

The geometry is a cubical box [0 1] X [0 1] X [0 1] with a uniform
rectilinear mesh in the domain.

I have obtained the scalar solution vector u in the domain.

I need to find the line integral of the solution along the boundary. For
example: lets say
I want to integrate the solution variable
\int u dx on the line which is on +z face and goes from from (0,0,1) to
(1,0,1).

my doubt is how to initialize
the fe_face_values (line values?) object and the gauss quadrature formula
for this?

integral = 0;

for (; cell != endc; ++cell)
if (cell->is_locally_owned())
{
for (face = 0; face<GeometryInfo<dim::faces_per_cell;++face)
if(cell->face(face)->boundary_id == my_boundary_id) //
normal facing the -y direction: bottom face
for (line = 0;
face<GeometryInfo<dim::lines_per_face;++line)
if (cell->face(face)->line(line)->center()(2) ==
1) // boundary line needed
for (q = 0; q < number_of_q_points; ++q)
integral += function_value_at_q *
fe_face_values.JxW(q);
}
integral = SUM of integral from all processes

Thanks.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see