Hello Deal's users and Happy New Year!

My question is the following one:

Once I have the vector solution, I would like to calculate its integral over a boundary of the domain divided by this surface.

I would do:

std::set< unsigned char > boundary_indicators;
boundary_indicators.insert(out1);
std::vector< bool > component_select(1); /// I am working with FE_Q<DIMENSION> fe_fc(2);/
component_select[0]=true;
std::vector< bool > selected_dofs(dof_handler_total.n_dofs()); DoFTools::extract_boundary_dofs (dof_handler_total,component_select,selected_dofs, boundary_indicators);
double sum=0;
unsigned int nodes_number=0;

for (unsigned int i=0;i<dof_handler_total.n_dofs();i++)
       if (selected_dofs[i]==true)
{
sum+=vector_solution(i); ///where vector_solution is the vector that I want to integrate./ nodes_number++; ///number of nodes belonging to the boundary out1./
}

double integral_per_surface=sum/nodes_number;

Is this way the right one to get "(1/Surface)*Integral_over_surface(vector solution)"?

I have also thought about using the method "VectorTools::integrate_difference()", but this function only works over the whole domain, doesn't it?

Thanksk in advace!

Best regards!
Isa

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

Reply via email to