Dear Felix,

Like Bruno said, if you call clear() on the triangulation at the end of 
this cycle then it should work. Here 
<https://github.com/dealii/dealii/blob/d809bfa8c63df45541ed0ad2ae233eb1cb35e691/source/grid/tria.cc#L9055>
 
you can see that regardless of what other objects are "subscribed" (i.e. 
dependent on) the triangulation, the call to clear() will should the 
triangulation. 

This 
<https://github.com/dealii/dealii/blob/d809bfa8c63df45541ed0ad2ae233eb1cb35e691/source/grid/tria.cc#L1676>
 
is the area around which your code is failing - are you sure that the data 
that you're trying to build the triangulation with on the second cycle is 
valid? You could also try to create a brand new triangulation in each cycle 
iteration and then use boundary_triangulation.copy_from(new_triangulation) to 
transfer the mesh to the primary triangulation. This would confirm whether 
or not you have a valid mesh each time you call create_triangulation().

Kind regards,
Jean-Paul

On Tuesday, August 1, 2017 at 10:40:40 PM UTC+2, Bruno Turcksin wrote:
>
> Felix,
>
> it should work. I have done something similar in the past. Can you send a 
> small example that shows the problem.
>
> Best,
>
> Bruno
>
> On Tuesday, August 1, 2017 at 1:26:00 PM UTC-4, Felix Lorenz wrote:
>>
>> Hello everybody,
>> I have the following problem:
>>
>> Class C{
>>   ...
>>
>>   Triangulation <1,2>            boundary_triangulation; 
>>
>>   FE_Q<1,2>                      boundary_fe;                    
>>
>>  DoFHandler <1,2>               boundary_dof_handler;
>>   MappingQGeneric <1,2>          boundary_map;    
>>   ...                /
>>   void run ();
>> }
>>
>> void C::run(){
>>
>>  for (unsigned int cycle=0; cycle< ncycles; ++cycle)  //works for 
>> ncycles=1, error for ncycles > 1
>>
>> {
>>
>>    boundary_triangulation.create_triangulation (vertices, cells, 
>> SubCellData());// for every cycle I have here other vertices and cells 
>> to create 
>>                                                                           
>>       // a new triangulation
>>
>>   ... //here I do some finite element calculation, it works 
>>    ...
>>
>>    boundary_dof_handler.clear();
>>    boundary_triangulation.clear();// Reset this triangulation into a 
>> virgin state by deleting all data. This operation is only allowed if no     
>>                                   //subscriptions to this object exist 
>> any more, such as DoFHandler objects using it
>> }
>> }
>>
>> After the call of boundary_triangulation.clear() lots of vertices and 
>> cells are still stored by boundary_triangulation. Resulting to this I get 
>> the error in the function create_triangulation:
>>
>> "You have a vertex in your triangulation " "at which more than two cells 
>> come together. "
>>  
>> How can I delete the data of the triangulation completely? Why does the 
>> clear() function not delete all data?
>>
>> Best regards 
>> Felix
>>
>>
>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to