After digging a bit deeper, I found that the problem is about mesh
smoothing.
It seems that the default mesh smoothing for p::d::Triangulation is
stricter than
::Triangulation. After adding the limit_level_difference_at_vertices option
to
::Triangulation, I can get exactly the same meshes.

Will test with more complex cases.

Best regards,
Ce

Ce Qin <[email protected]> 于2021年2月7日周日 下午10:28写道:

> Hi, Wolfgang!
>
> According to your suggestion, I wrote a simple program to copy a serial
> Triangulation
> to a p::d::Triangulation by looping over all levels and refine cells which
> have children,
> but the number of global active cells in the resulting p::d::Triangulation
> does not
> equal to that in the serial Triangulation.
>
> It seems that we will get different triangulations using the same
> refinement procedure.
> Please check the attached files for more details.
>
> Best regards,
> Ce
>
> Ce Qin <[email protected]> 于2021年2月3日周三 下午3:14写道:
>
>> Thank you, Wolfgang.
>>
>> Definitely I want to give it a try. Will let you know when I make
>> progress or encounter difficulties.
>>
>> Best regards,
>> Ce
>>
>> Wolfgang Bangerth <[email protected]> 于2021年2月3日周三 下午1:06写道:
>>
>>> On 2/2/21 7:57 PM, Ce Qin wrote:
>>> >
>>> > My use case can be described as follows
>>> > 1) Create a triangulation in Python, refine some cells (several times)
>>> > 2) Serialize the triangulation in to file using Triangulation::save
>>> > 3) Load the triangulation from file using Triangulation::load
>>> > 4) Reconstruct a parallel::distributed::Triangulation from the serial
>>> > Triangulation
>>> >
>>> > So my question is how to reconstruct a
>>> *parallel::distributed::Triangulation*
>>> > from a *serial* Triangulation (with hanging nodes, n_levels() greater
>>> than 2)?
>>>
>>> There might not be a function for it right now. But it seems not
>>> impossible to
>>> write a function (or, better, incorporate this into the existing
>>> copy_from()
>>> function). Want to give this a try?
>>>
>>> I think what would need to happen is that the
>>> p::d::T::copy_triangulation()
>>> function extracts the coarse mesh of the given triangulation and calls
>>> the
>>> copy_triangulation() function of the base class with it. It would then
>>> need to
>>> recursively walk through the original and the current triangulation and
>>> refine
>>> the current one based on whether a cell of the original triangulation
>>> was refined.
>>>
>>> I suspect that that could be done with 200 lines of code, and you'd end
>>> up
>>> with what you actually needed. I'd be happy to help along if you were
>>> interested in giving that a try!
>>>
>>> Best
>>>   W.
>>>
>>> --
>>> ------------------------------------------------------------------------
>>> Wolfgang Bangerth          email:                 [email protected]
>>>                             www:
>>> http://www.math.colostate.edu/~bangerth/
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/27e3b2c9-3929-b988-bc0e-a9c40f9f5697%40colostate.edu
>>> .
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CA%2Bg8s4v9FZs-6%2BP5fB0xcW-w_29J%2BcpW%3DkqRdJtfho70Z3fqCw%40mail.gmail.com.

Reply via email to