From: Guido Kanschat Date: Fri, 2 Jul 2010 20:27:02 +0000 (+0000) Subject: improve documentation on user data X-Git-Tag: v8.0.0~5855 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7554600b1503cd6005ffc1c56e09838a1f53a29c;p=dealii.git improve documentation on user data git-svn-id: https://svn.dealii.org/trunk@21451 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 339fa9ac81..d200bd14a4 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1012,7 +1012,7 @@ namespace internal * *

User flags and data

* - * A triangulation offers one bit per line, quad, etc for user data. + * A triangulation offers one bit per line, quad, etc for user flags. * This field can be * accessed as all other data using iterators. Normally, this user flag is * used if an algorithm walks over all cells and needs information whether @@ -1067,6 +1067,11 @@ namespace internal * obviously in place here; responsibility for correctness of types etc * lies entirely with the user of the pointer. * + * @note User pointers and user indices are stored in the same + * place. In order to avoid unwanted conversions, Triangulation + * checks which one of them is in use and does not allow access to + * the other one, until clear_user_data() has been called. + * * Just like the user flags, this field is not available for vertices, * which does no harm since the vertices have a unique and continuous number * unlike the structured objects lines and quads. diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index a1d8d8b8e8..01e476bae9 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -1119,6 +1119,14 @@ class TriaAccessor : public TriaAccessorBase /** * Set the user pointer * to @p p. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. */ void set_user_pointer (void *p) const; @@ -1138,6 +1146,14 @@ class TriaAccessor : public TriaAccessorBase * style cast operator to * maintain a minimum of * typesafety, e.g. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. * A *a=static_cast(cell->user_pointer());. */ void * user_pointer () const; @@ -1168,6 +1184,14 @@ class TriaAccessor : public TriaAccessorBase * recursively set the user * pointer of all finer levels of * the triangulation. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. */ void recursively_set_user_pointer (void *p) const; @@ -1184,6 +1208,14 @@ class TriaAccessor : public TriaAccessorBase /** * Set the user index * to @p p. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. */ void set_user_index (const unsigned int p) const; @@ -1195,6 +1227,14 @@ class TriaAccessor : public TriaAccessorBase /** * Access the value of the user * index. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. */ unsigned int user_index () const; @@ -1215,6 +1255,14 @@ class TriaAccessor : public TriaAccessorBase * function to recursively set * the user index of all finer * levels of the triangulation. + * + * @note User pointers and user + * indices are mutually + * exclusive. Therefore, you can + * only use one of them, unless + * you call + * Triangulation::clear_user_data() + * in between. */ void recursively_set_user_index (const unsigned int p) const;