Ah, that was because I also tried out the non-pair version. In both cases, I get the segmentation fault.
When I run in debug mode, my mesh can't even be read. I get: An error occurred in line <587> of file <source/grid/grid_in.cc> in function void dealii::GridIn<dim, spacedim>::read_msh(std::istream&) [with int dim = 3, int spacedim = 3] The violated condition was: (version >= 2.0) && (version <= 2.1) The name and call sequence of the exception was: ExcNotImplemented() Additional Information: (none) Stacktrace: ----------- #0 /home/pietro/deal.II/lib/libdeal_II_3d.g.so.6.3.pre: dealii::GridIn<3, 3>::read_msh(std::istream&) #1 ./main: main Pietro --- On Fri, 12/10/10, Luca Heltai <[email protected]> wrote: From: Luca Heltai <[email protected]> Subject: Re: [deal.II] Finding a cell a point belongs to To: "Pietro Maximoff" <[email protected]> Cc: [email protected] Date: Friday, December 10, 2010, 10:43 AM I'm surprised that your code even compiled... from what you wrote, this should be cell_iterator.first->set_material_id(value) since cell_iterator is a pair, and your actual active_cell_iterator is the first element of the pair, accessed through the first operator... Is this what you have in your code? Luca. On Fri, Dec 10, 2010 at 6:55 PM, Pietro Maximoff <[email protected]> wrote: cell_iterator = GridTools::find_active_cell_around_point(q, dof_handler, Point<3>(x, y, z) ); works fine. The segementation fault happens at this point cell_iterator->set_material_id(value); I don't understand why this should happen. Pietro DoFHandler<3> dof_handler(triangulation); MappingQ1<3> q; std::pair<DoFHandler<3>::active_cell_iterator, Point<3> > cell_iterator; cell_iterator = GridTools::find_active_cell_around_point(q, dof_handler, Point<3>(x, y, z) ); cell_iterator->set_material_id(value); --- On Fri, 12/10/10, Pietro Maximoff <[email protected]> wrote: From: Pietro Maximoff <[email protected]> Subject: Re: [deal.II] Finding a cell a point belongs to To: "Luca Heltai" <[email protected]> Cc: [email protected] Date: Friday, December 10, 2010, 9:17 AM Is this correct usage because I get segmentation fault for this test. DoFHandler<3> dof_handler(triangulation); MappingQ1<3> q; std::pair<DoFHandler<3>::active_cell_iterator, Point<3> > cell_iterator; cell_iterator = GridTools::find_active_cell_around_point(q, dof_handler, Point<3>(x, y, z) ); Pietro --- On Fri, 12/10/10, Pietro Maximoff <[email protected]> wrote: From: Pietro Maximoff <[email protected]> Subject: Re: [deal.II] Finding a cell a point belongs to To: "Luca Heltai" <[email protected]> Cc: [email protected] Date: Friday, December 10, 2010, 9:01 AM Thanks Luca. Just what I was looking for. Pietro --- On Fri, 12/10/10, Luca Heltai <[email protected]> wrote: From: Luca Heltai <[email protected]> Subject: Re: [deal.II] Finding a cell a point belongs to To: "Pietro Maximoff" <[email protected]> Cc: [email protected] Date: Friday, December 10, 2010, 7:23 AM The function GridTools::find_active_cell_around_point should do what you ask for. http://www.dealii.org/developer/doxygen/deal.II/classGridTools.html#aa4b56da0763f08676ba92f80cab491da Luca. -- Luca Heltai <[email protected]> http://people.sissa.it/~heltai/ Scuola Internazionale Superiore di Studi Avanzati Phone: +39 040 3787 449, Office: 732 -- There are no answers, only cross references On 10/dic/2010, at 16.17, Pietro Maximoff wrote: > Hi > > Is there a way to find the cell a point belongs to without having to iterate over all active cells? > > Pietro > > > > _______________________________________________ > dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii -----Inline Attachment Follows----- _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii -----Inline Attachment Follows----- _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
_______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
