Hi Ahmad,
I think what Timo was implying is that you need curl braces {} to
encapulate all statements when looping over all quadrature points.
Currently in your q_point loop you're creating a local variable
"Robin_value" that only has scope on the line its declared and defined.
Since this is the case, when you try to access the variable in your i-j
loop, it doesn't exist as it is out of scope at this point. So, I think
your loop should be
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
{ // ADDED THIS BRACE
const double Robin_value
=
(exact_solution.value(fe_face_values.quadrature_point(q_point)));
//fe_face_values.normal_vector(q_point));
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += (Robin_value*
fe_values.shape_value(i,q_point) *
fe_values.shape_value(j,q_point) *
fe_values.JxW(q_point));
}
} // ADDED THIS BRACE
Hope this is right.
Regards,
Jean-Paul
On Wed, 2011-04-13 at 20:21 +0100, Ahmad Al Nabulsi wrote:
> Dear Timo,
> thank you for your help, but although I do it I have the same error as
> before
>
> (( ‘Robin_value’ was not declared in this scope )).
>
> ,could you please look whether my implementation of robin bc
> correct?
>
> best regard,
> ahmad
> --- Timo Heister <[email protected]> schrieb am Mi,
> 13.4.2011:
>
>
> Von: Timo Heister <[email protected]>
> Betreff: Re: [deal.II] robin boundary condition
> An: "Ahmad Al Nabulsi" <[email protected]>
> Datum: Mittwoch, 13. April, 2011 12:05 Uhr
>
>
> > for (unsigned int q_point=0; q_point<n_q_points;
> ++q_point)
> >
> > const double Robin_value
> > =
> (exact_solution.value(fe_face_values.quadrature_point(q_point)));
> //fe_face_values.normal_vector(q_point));
> >
>
> You forgot to put curly braces around the for body, so the for
> loop
> only iterates over this variable assignment.
>
> Best,
> Timo
>
> --
> Timo Heister
> http://num.math.uni-goettingen.de/~heister
>
>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii