Transferring data between two triangulations (dof handlers)

74 views
Skip to first unread message

Yu Leng

unread,
Jan 31, 2021, 2:35:28 PM1/31/21
to deal.II User Group
Dear all,

I would like to transfer data between two grids, which originate from the same coarse grid.
Here are two approaches I can come up with. I would appreciate any of your feedbacks/suggestions.

1. Two triangulations and two dofhandlers. I can not get this to work using solution transfer even if I reinitialize the dofhandler with another triangulation.

2. One triangulation. Store the refinement/coarsen history and refine/coarsen every time I transfer data. 


Thanks,
Yu

Yu Leng

unread,
Jan 31, 2021, 8:52:53 PM1/31/21
to deal.II User Group
Hello,

I figured out how to do the interpolation  using GridTools:get_finest_common_cells().
But I ran into this error shown in the attachment. Two possible reasons:

1. The way I create the two triangulations from the same coarse grid is not correct.
2. The function, get_finest_common_cells(), does not work for distributed triangulations when the two grids are not identical. 

If it is the first case,  any example would be appreciated.
If it is the second case, is there other solution?


Thanks,
Yu
Screenshot from 2021-01-31 20-35-42.png

Jean-Paul Pelteret

unread,
Feb 1, 2021, 2:43:04 AM2/1/21
to dea...@googlegroups.com
Hi Yu,

Have you tried the VectorTools::interpolate_to_different_mesh() functions? It sounds to me like they perform the operation that you're trying to do. They require that the two DoFHandlers originate from the same coarse triangulation. If you have hanging nodes, then you want to use the variant that takes in the affine constraints as an argument. Note as well that if you're using a parallel::distributed::Triangulation then you have to ensure that the partitioning is the same for both meshes -- the note in the documentation states how to ensure that this happens.

Best,
Jean-Paul
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/25ba90e7-45b8-486c-847d-370b4fc7b337n%40googlegroups.com.

Yu Leng

unread,
Feb 2, 2021, 11:31:55 AM2/2/21
to dea...@googlegroups.com
Jean-Paul,

Thank you very much for your suggestion. This function works great with distributed meshes. The other one has to use shared meshes.


Thanks,
Yu

Pascal Kraft

unread,
Feb 9, 2021, 5:20:00 PM2/9/21
to deal.II User Group
Hi everyone,

I have a similar question: I want to couple dofs between two meshes. They have a shared surface (shared in the sense that it is at the same location). I assemble my system blockwise. The one mesh describes the "inner" domain I use in multiple situations and the other mesh is a pml domain I only use to truncate sometimes. I want to build an affineconstraints object to couple the surface dofs together but I'm running into problems, especially dealing with orientation (nedelec elements, so the edge orientation plays a role). Is there a library implementation (I couldn't find one and functions like interpolat_to_different_mesh() are only for the communication of surface values, not to construct constraints.) 
I have built an implementation myself but it is an error prone process and I would prefer to use as much of the library code as possible.
Do you have any pointers for me?

Kind regards and thanks in advance for your time,
Pascal

Wolfgang Bangerth

unread,
Feb 9, 2021, 7:38:36 PM2/9/21
to dea...@googlegroups.com
On 2/9/21 3:20 PM, Pascal Kraft wrote:
>
> I have a similar question: I want to couple dofs between two meshes. They have
> a shared surface (shared in the sense that it is at the same location). I
> assemble my system blockwise. The one mesh describes the "inner" domain I use
> in multiple situations and the other mesh is a pml domain I only use to
> truncate sometimes. I want to build an affineconstraints object to couple the
> surface dofs together but I'm running into problems, especially dealing with
> orientation (nedelec elements, so the edge orientation plays a role). Is there
> a library implementation (I couldn't find one and functions like
> interpolat_to_different_mesh() are only for the communication of surface
> values, not to construct constraints.)
> I have built an implementation myself but it is an error prone process and I
> would prefer to use as much of the library code as possible.
> Do you have any pointers for me?

I don't think there is anything in the library itself for this case :-( Why do
you want to use different triangulations/DoFHandlers for the two parts of your
domain? I think that pretty much everything you would need to keep everything
in one mesh is already there.

Best
W.

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

Reply all
Reply to author
Forward
0 new messages