Andreas, I am trying to read from a mesh file and impose periodic boundary > condition. This works out very well for small geometries in three spatial > dimensions. However, if the read meshes tend to have more elements, the > amount of time needed to create the mesh rises drastically. The time is > spent within the routine triangulation.add_periodicity. Thus, I have > created a minimal code example where cubes of side lengths 5, 20, and 50 > are created. For each cube, the periodic face pairs are identified and > collected. Afterwards, triangulation.add_periodicity is executed and the > needed time is measured using the Timer class. The output of the attached > code example looks as follows: > > Starting Constructor with side length = 5 > Periodic faces collected: Size of periodicity_vector = 75 > Start triangulation.add_periodicity(periodicity_vector); after 0.018097 > seconds > Done triangulation.add_periodicity(periodicity_vector); after 3.0626 > seconds > > Starting Constructor with side length = 20 > Periodic faces collected: Size of periodicity_vector = 1200 > Start triangulation.add_periodicity(periodicity_vector); after 2.10931 > seconds > Done triangulation.add_periodicity(periodicity_vector); after 15749 > seconds > > Starting Constructor with side length = 50 > Periodic faces collected: Size of periodicity_vector = 7500 > Start triangulation.add_periodicity(periodicity_vector); after 298.734 > seconds >
Were you running in Debug or Release mode? I only tried Release mode and the timings weren't that terrible. I observed a runtime like three times larger in that function than for creating the mesh for up to 100 elements per side. Still, there are some oppurtunities for improvement, see https://github.com/dealii/dealii/pull/8665. With these changes, creating the mesh and adding periodicity takes roughly about the same time. Apart from that, it is much better to have a coarse mesh with few cells and refine a few times than starting with a rather fine coarse mesh (if you can do that). Best, Daniel -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/2982487e-6e33-4f49-b4e2-a4cc93229d61%40googlegroups.com.