Hi Tobias and Roman I'm really interested in your answer (thanks) and would like to know if it makes what I'm trying to do currently impossible. I'm looking to extend step-18 so that user data (stored at the quadrature points and accessed via the cell user_pointer) can be projected between meshes. I'm not too concerned about the parallel implementation at present but this is obviously a direction I would like to head in.
Step-18 is a simple example in that that data at the quadrature points can be recomputed from the nodal values between refinement steps. If you extend this to even viscoelasticity then you need to track history dependent internal variables that live at the quadrature. point. I've created a class called RefinementManager whose task is to store, copy and resize the std::vector of PointHistory data at which we point the cell user_pointer. The class manages the redirecting of the cell user_pointer, determines projection matrices for coarsening and refinement, and can communicate with the PointHistory to update a host of different data types (scalars, vectors, tensors) between refinement steps. > 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. I use user_pointers to point to PointHistory locations, so I have a triangulation with user_pointers. I refine / coarsen and redirect cell user_pointers where needed. (I do not clear the user_data on cells that do not undergo refinement as I need this data). When you say, the partitioning uses user_indices, you are referring to the partitioning across processors? Will this approach fail? (My code is not complete at present so I can't answer my own question just yet). > > 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. Agreed. More generally it should allow for projection on refinement as well. I would be happy to be involved. A silly question perhaps, but what Is the point of a cell user_index? Once again, thanks for the input Regards Andrew > > 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 _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
