Hi Roman,

the problem is with the partitioning and does not depend on refinement 
directly.

As you said, the user indices and pointers are supposed to be only for the 
user. That's why any library functions store them first and restore them 
afterwards if they use them internally. That worked fine as long as only user 
pointers were available. Then user indices were introduced... Everything 
would still work fine if we just copied all relevant data as it is, including 
the information which type has been used lately. The actual implementation, 
however, loops over all lines and quads and hexes (in 3D) of the mesh using 
the accessor function to obtain the data and store it in a vector and set it 
again the same way afterwards. Here, you have to decide whether you use 
indices or pointers. The partitioning uses indices. If you used user indices 
before, then everything is fine and unchanged afterwards. However, if you had 
a clean triangulation with no indices and no pointers, after the partitioning 
you have all zero indices and cannot use pointers without clearing all user 
data first. On the other hand, if you had user pointers you cannot even 
partition the mesh as it will fail on retrieving the user index of the first 
line in the mesh. 

We do not need a complicated example, by the way:

- take any mesh, set a user pointer and call partitioning -> fails

- take any mesh, partition and set a user pointer -> fails

Someone should implement a decent backup-and-restore functionality for general 
user data, not indices or pointers.

Best, Tobias


On Tuesday 27 July 2010 14:54, Roman Gupta wrote:
> Hi everyone,
>
> I have some problems understanding the user_pointer.
> I know it is embedded in an union with user_index. The library tests
> for 3 states of the union: data_unknown, data_pointer and data_index.
>
> My intention is to access additional data of the cell - like the
> quadrature point history in step-18 -
> only via the user_pointer to localize and encapsulate data more in an
> OOP sense.
> The user_pointer is supposed to be persistent through all refinement and
> timestep-cycles.
>
> For comparison:
> If I modify step-1 tutorial to test the user_pointer, I just assign,
> e.g. some ints, and it works...
> Especially, I donot have to mess with the triangulation object and
> after refinement I can assign the user_pointer of the children just like
> that.
>
> The problem:
> If I try to modify step 18 in a similar way,
> the program will throw an exception ExcPointerIndexClash()
> with violated condition: user_data_type == data_unknown ||
> user_data_type == data_pointer
>
> To my understanding, this means the user_data holds now an user_index
> which I didnot assign
> or the value of user_data_type is not clearly defined.
> Even, if I clear the user_data by triangulation.clear_user_data(),
> the same exception is thrown again after one refinement step...
>
> I suspect the parallel partitioning but have no idea
> why is it like that and how to handle it...
>
> Thank you
> Roman
>
>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to