Working with fully distributed triangulation: example dealii-pft/step-5

50 views
Skip to first unread message

Aditya Pratap Singh

unread,
Oct 19, 2021, 3:50:18 PM10/19/21
to deal.II User Group
Hi,

I was trying to understand dealii-pft/step-5 and implement something similar in my code, but there are some things which are confusing for me!

As from line 55, Author copies the data from serial triangulation to a fully distributed triangulation and then reinitialize it:  

// create instance of pft
parallel::fullydistributed::Triangulation<dim> tria_pft(comm);
// extract relevant information form serial triangulation
auto construction_data =
parallel::fullydistributed::Utilities::copy_from_triangulation(basetria, tria_pft);
// actually create triangulation
tria_pft.reinit(construction_data)
;

As I tried to implement similar, firstly I cannot find any function called reinit for triangulation file. Also, the way construction_data has been created, I was unable to find function called copy_from_triangulation for doing the same! I am assuming that this is because I have not included proper header file.

I can see that author has included <deal.II/distributed/tria_util.h> in the code, but it was not available atleast in dealii version 9.2.0 or 9.3.0 . 

Can anyone suggest something for this?

Looking forward to some valuable suggestions.


Thanks and Regards,
Aditya



peterrum

unread,
Oct 19, 2021, 4:02:45 PM10/19/21
to deal.II User Group
Hi Aditya,

what you found is the old development (and proof of concept) code. Since that time, we have integrated p:f:T into deal.II. All the tests there have been converted to proper deal.II tests in the folder https://github.com/dealii/dealii/tree/master/tests/fullydistributed_grids. I suggest you to take a look at the test copy_serial_tria_*.cc and copy_distributed_tria_*.cc. With increasing number of indices the tests become more complex (adding PBC, MG, ...). So start with 01 ;)

Hope that helps!
PM

Aditya Pratap Singh

unread,
Oct 20, 2021, 10:19:28 AM10/20/21
to deal.II User Group
Hello,

Many thanks for the reply. 

I went through these examples, it is quite helpful to understand the concept of copying a serial or distributed triangulation to fully distributed triangulation. I wanted some clarity in one of the examples (copy_serial_tria_04) of triangulation with periodic faces:

// create serial triangulation
Triangulation<dim> basetria;
GridGenerator::subdivided_hyper_cube(basetria, n_subdivisions);
// new: add periodicy on serial mesh
add_periodicy(basetria);
basetria.refine_global(n_refinements);
GridTools::partition_triangulation_zorder(
Utilities::MPI::n_mpi_processes(comm), basetria);

// create instance of pft
parallel::fullydistributed::Triangulation<dim> tria_pft(comm);
// extract relevant information form serial triangulation
auto construction_data =
TriangulationDescription::Utilities::create_description_from_triangulation(
basetria, comm);
// actually create triangulation
tria_pft.create_triangulation(construction_data);
// new: add periodicy on fullydistributed mesh (!!!)
add_periodicy(tria_pft);



As highlighted in red color, may I know why periodicity is added twice to the triangulation (before and after copying )?  And will same applies for a p:d:t basetria as well because no such example was discussed for this case?

Thanks and Regards,
Aditya

peterrum

unread,
Oct 20, 2021, 4:29:26 PM10/20/21
to deal.II User Group
The reason why you need to add periodicity twice (independent of the type of the base tria) is that during copying the mesh the periodicity is not applied. When I implemented p:f:T I did not find an easy way to do it. 

Hope this helps,
PM

Aditya Pratap Singh

unread,
Oct 27, 2021, 5:23:15 AM10/27/21
to deal.II User Group
A follow-up question will be: what if we only apply the periodicity after copying the serial mesh to p:f:t? Why it is necessary to apply periodicity before copying the mesh as well?

peterrum

unread,
Oct 27, 2021, 5:31:47 AM10/27/21
to deal.II User Group
This is needed to guarantee that the levels of neighboring cells differ at most by 1 also the periodic boundaries. This is guaranteed by default within the domain but not at the boundaries (only if pbcs have been applied).

PM

Reply all
Reply to author
Forward
0 new messages