extract_boundary_mesh: error for cylinders

61 views
Skip to first unread message

Daniel

unread,
Nov 18, 2015, 12:36:43 PM11/18/15
to deal.II User Group
Hi,

 I'am trying to extract a boundary mesh, which is need to track objects. In case of cylinders it fails. 
 GridGenerator::extract_boundary_mesh(triangulation,triangulation_surface);  works perfectly fine for hyper_cubes or subdivided_hyper_rectangles but fails in case of cylinders  

 Based on step-8 of  the examples, I could reproduce the error by adding the corresponding code lines, which I though would do the job:

 if (cycle == 0)

          {

            //GridGenerator::hyper_cube (triangulation, -1, 1);

            GridGenerator::cylinder(triangulation,100,200);

            static const CylinderBoundary<dim> outer_cylinder (100,0);

            this->triangulation.set_boundary(0,outer_cylinder);

            static const CylinderBoundary<dim-1,dim> surface_cyl(100,0);


            triangulation.refine_global (2);

            this->triangulation_surface.set_boundary(0,surface_cyl);

            GridGenerator::extract_boundary_mesh(triangulation,triangulation_surface);

            std::cout<<triangulation_surface.n_used_vertices()<<std::endl;

            std::cout<<triangulation_surface.n_active_cells(2)<<std::endl;


          }


 // the new  variables are found in the class definition:

    Triangulation<dim>   triangulation

    //XXX

    Triangulation<dim-1,dim> triangulation_surface;


    DoFHandler<dim>      dof_handler;

    //XXX

    DoFHandler<dim-1,dim> dof_handler_surface;


// and the constructor has been extended:

 template <int dim>

  ElasticProblem<dim>::ElasticProblem ()

    :

    dof_handler (triangulation),

    dof_handler_surface(triangulation_surface),

    fe (FE_Q<dim>(1), dim)

  {}


--- running the problem in debug mode gives:



An error occurred in line <9224> of file </Users/myname/dealii-8.3.0/source/grid/tria.cc> in function

    void dealii::Triangulation<dim, spacedim>::create_triangulation(const std::vector<dealii::Point<spacedim> >&, const std::vector<dealii::CellData<dim> >&, const dealii::SubCellData&) [with int dim = 2; int spacedim = 3]

The violated condition was: 

    neighbor->direction_flag() == false

The name and call sequence of the exception was:

    ExcNonOrientableTriangulation()

Additional Information: 

(none)

Stacktrace:

-----------

#0  1   libdeal_II.g.8.3.0.dylib            0x0000000107c143b8 _GLOBAL__sub_I_mesh_worker_vector_selector.cc + 477900: 1   libdeal_II.g.8.3.0.dylib            0x0000000107c143b8 _GLOBAL__sub_I_mesh_worker_vector_selector.cc 




Any Idea what could be wrong? I have attached the complete step-8.cc code to allow for an easier error search.


thanks,
Daniel




step-8.cc

Wolfgang Bangerth

unread,
Nov 18, 2015, 1:58:59 PM11/18/15
to dea...@googlegroups.com

Daniel,
I have a suspicion but don't know for sure. Could you try to come up
with a small program (essentially just a main() function) that only does
what you need to do to show the problem? It should be possible to reduce
your testcase to around 10 or 15 lines of code.

This would make debugging much simpler.

Best
W.
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dealii+un...@googlegroups.com
> <mailto:dealii+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Daniel

unread,
Nov 18, 2015, 2:32:43 PM11/18/15
to deal.II User Group
Wolfgang,

  your are right: enclosed the short version of the problem including a gnuplot output. If you compile it in release mode you see that the face 1 und 2 of the cylinders are not correct in the boundary mesh......
  Compilation in debug mode gives  the error messages as before...

Best,
Daniel




problem.cc

Wolfgang Bangerth

unread,
Nov 20, 2015, 9:48:52 PM11/20/15
to dea...@googlegroups.com

Daniel,

> your are right: enclosed the short version of the problem including a
> gnuplot output. If you compile it in release mode you see that the face 1 und
> 2 of the cylinders are not correct in the boundary mesh......
> Compilation in debug mode gives the error messages as before...

I can confirm this. I've opened a bug report at
https://github.com/dealii/dealii/issues/1893

I can't promise to get to it soon, but at least it's recorded. You may want to
sign onto this issue so you get notified if it's resolved.

Best
W.

Wolfgang Bangerth

unread,
Nov 22, 2015, 8:46:54 PM11/22/15
to dea...@googlegroups.com
On 11/18/2015 01:32 PM, Daniel wrote:
>
> your are right: enclosed the short version of the problem including a
> gnuplot output. If you compile it in release mode you see that the face 1 und
> 2 of the cylinders are not correct in the boundary mesh......
> Compilation in debug mode gives the error messages as before...

Fix is here:
https://github.com/dealii/dealii/issues/1893

Best
W.

Daniel

unread,
Nov 24, 2015, 4:20:26 AM11/24/15
to deal.II User Group
Dear Wolfgang,
  thanks for the fast reaction. I have looked into it and found that 
   the fix gets rid of the error message but the surface still looks strange (gnu plot output of surface mesh)
   the face 1 and face 2 are each a half circle+ half square cross section.
   
Best,
Daniel

Wolfgang Bangerth

unread,
Nov 24, 2015, 8:55:36 AM11/24/15
to dea...@googlegroups.com
On 11/24/2015 03:20 AM, Daniel wrote:
> the fix gets rid of the error message but the surface still looks strange
> (gnu plot output of surface mesh)
> the face 1 and face 2 are each a half circle+ half square cross section.

Good point. That's no longer a problem with the GridGenerator function, but an
issue with how boundary indicators are copied to edges and faces.

I've opened
https://github.com/dealii/dealii/issues/1905
for this separate problem.

Wolfgang Bangerth

unread,
Nov 24, 2015, 10:58:47 PM11/24/15
to dea...@googlegroups.com
On 11/24/2015 07:55 AM, Wolfgang Bangerth wrote:
> On 11/24/2015 03:20 AM, Daniel wrote:
>> the fix gets rid of the error message but the surface still looks strange
>> (gnu plot output of surface mesh)
>> the face 1 and face 2 are each a half circle+ half square cross section.
>
> Good point. That's no longer a problem with the GridGenerator function, but an
> issue with how boundary indicators are copied to edges and faces.
>
> I've opened
> https://github.com/dealii/dealii/issues/1905
> for this separate problem.

It turns out that the problem is more complicated than I thought at first. I
don't think it's possible to fix the problem in the library only -- it will
require changes to user code as well to make this work as well.

I've put some more discussion into the problem report linked to above, and
we'll keep discussion there.
Reply all
Reply to author
Forward
0 new messages