Dear Martin, thank you very much, but I do not know, it did not gave me any error in the compilation, but unfortunately it gave me the following error when I ran it:
============================ Running step-4 Solving with Q1 elements, adaptive refinement ============================================= -------------------------------------------------------- An error occurred in line <4206> of file </home/Ahmad/deal.II/deal.II/include/fe/fe_values.h> in function const dealii::Point<spacedim>& dealii::FEValuesBase<dim, spacedim>::quadrature_point(unsigned int) const [with int dim = 2, int spacedim = 2] The violated condition was: i<this->quadrature_points.size() The name and call sequence of the exception was: ExcIndexRange(i, 0, this->quadrature_points.size()) Additional Information: Index 3 is not in [0,3[ Stacktrace: ----------- #0 ./step-4: dealii::FEValuesBase<2, 2>::quadrature_point(unsigned int) const #1 ./step-4: HelmholtzProblem<2>::assemble_system() #2 ./step-4: HelmholtzProblem<2>::run() #3 ./step-4: main -------------------------------------------------------- make: *** [run] Aborted ps: when I remove this funcion it works fine .... regards, ahmad --- Jean-Paul Pelteret <[email protected]> schrieb am Mi, 13.4.2011: Von: Jean-Paul Pelteret <[email protected]> Betreff: Re: [deal.II] robin boundary condition An: "Ahmad Al Nabulsi" <[email protected]> CC: "Timo Heister" <[email protected]>, "deal.ii" <[email protected]> Datum: Mittwoch, 13. April, 2011 12:33 Uhr 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
