Hi Andrew,
Sorry, I was not so elaborate with pointing out the problem...
>>The user_pointer is. But the user_pointer of children cells created
via refinement are NULL
Yes, I comprehend that - at least for step1
>> When you say "assign it some ints" you mean you dynamically create
new memory locations
>> and give the address of these locations to the user_pointer?
Yes, correct...
>>What do you mean by mess with the triangulation object?
I mean as in Step 18, where you use triangulation.clear_user_data() to
reset all user_data,
- whether it is pointer or index - at the beginning and before every
refinement step...
>>In step 18 the user pointer always points to location in a
std::vector of PointHistory objects. By modify step 18 do you mean you
just set the user_pointer to point at some data dynamically created data?
Yes,correct, though there are some more modifications I didnot do, but
those concern only the input...
Thanks for your reply
Roman
Am 27.07.2010 15:23, schrieb Andrew McBride:
Hi Roman
just a couple questions:
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.
The user_pointer is. But the user_pointer of children cells created via
refinement are NULL
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.
When you say "assign it some ints" you mean you dynamically create new memory
locations and give the address of these locations to the user_pointer?
What do you mean by mess with the triangulation object?
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
In step 18 the user pointer always points to location in a std::vector of
PointHistory objects. By modify step 18 do you mean you just set the
user_pointer to point at some data dynamically created data?
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