New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make get_cell_range_category() more consistent with get_cell_category() #14015
Make get_cell_range_category() more consistent with get_cell_category() #14015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get this into 9.4, we might need a test to keep track on things.
* maximum catergory of any cell batch. Only in the hp case, it is | ||
* guaranteed that all cells and as a consquence all cell batches have | ||
* the same categroy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few typos, plus maybe something that can be clarified
* maximum catergory of any cell batch. Only in the hp case, it is | |
* guaranteed that all cells and as a consquence all cell batches have | |
* the same categroy. | |
* maximum category of any cell batch. In the hp case, it is | |
* guaranteed that all cells and as a consequence all cell batches in a range have | |
* the same category. Otherwise, there may be different categories in different | |
* cell batches. |
@@ -1912,6 +1917,11 @@ class MatrixFree : public Subscriptor | |||
* run between the given values in the field | |||
* AdditionalData::cell_vectorization_category for non-hp-DoFHandler types | |||
* and return the active FE index in the hp-adaptive case. | |||
* | |||
* @note In the non-hp-DoFHandler case, a categroy of a cell batch is given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @note In the non-hp-DoFHandler case, a categroy of a cell batch is given | |
* @note In the non-hp case, a category of a cell batch is given |
* @note In the non-hp-DoFHandler case, a categroy of a cell batch is given | ||
* as the maximum category of any of its cell. In the hp case or the case that | ||
* MatrixFree::AdditionalData::cell_vectorization_categories_strict was | ||
* enabled, it is guaranteed that all cells have the same categroy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should run a spellchecker on this particular word. 😉
* enabled, it is guaranteed that all cells have the same categroy. | |
* enabled, it is guaranteed that all cells have the same category. |
bcd2903
to
f2d0e65
Compare
* AdditionalData::cell_vectorization_category for non-hp-DoFHandler types | ||
* AdditionalData::cell_vectorization_category for the non-hp case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kronbichler There have been other places with references to non-hp-DoFHandler
;)
@kronbichler I have added a test! It is a modified version of the test in #14013. |
{ | ||
const auto category = cell_vectorization_category | ||
[matrix_free.get_cell_iterator(cell, v)->active_cell_index()]; | ||
std::cout << category << " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this output on purpose? It won't be compared, and one will only see it when manually running the test (which might be ok).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep it this way. I introduced these for visualization purposes. It looks like this:
0 0 0 0 0 0 0 1
1 1 1 1 1 1 2 2
2 2 2 2 2 3 3 3
3 3 3 3 4 4 4 4
4 4 4 5 5 5 5 5
5 5 6 6 6 6 6 6
6 7 7 7 7 7 7 7
8 8 8 8 8 8 8 9
0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2 2 2
3 3 3 3 3 3 3
4 4 4 4 4 4 4
5 5 5 5 5 5 5
6 6 6 6 6 6 6
7 7 7 7 7 7 7
8 8 8 8 8 8 8
9
0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2 2 2
3 3 3 3 3 3 3
4 4 4 4 4 4 4
5 5 5 5 5 5 5
6 6 6 6 6 6 6
7 7 7 7 7 7 7
8 8 8 8 8 8 8
9
In the test, I am only checking the properties, since outputting such an output would require that we create an output for each vectorization type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should not print this with vectorization. Maybe add a short comment in the code that explains why we have the cout
in the test, to guide the reader of test on how to use it?
f2d0e65
to
291768b
Compare
// note: here and below we are using std::cout to output | ||
// information that is useful for debugging; however, since the | ||
// output depends on the hardware and might change if we | ||
// internally modify the way we loop over cells, we don't write | ||
// the data to the log but instead only check that the | ||
// properties that are described in the documentation are | ||
// fulfilled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kronbichler What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent.
…akeover [9.4] Take over #14015: Make get_cell_range_category() more consistent with get_cell_category()
…_max Make get_cell_range_category() more consistent with get_cell_category()
If possible, it would be good to integrate this also into the 9.4 release. The function is newly added in the last months.