Skip to content
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

Introduce internal::MatrixFreeFunctions::ConstraintInfo #13519

Merged
merged 1 commit into from Mar 10, 2022

Conversation

peterrum
Copy link
Member

@peterrum peterrum commented Mar 9, 2022

A class that allows to efficiently evaluate constraints in matrix-free loops in user codes. The first application is the global-coarsening transfer operator in #13520.

Copy link
Member

@kronbichler kronbichler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Member Author

@peterrum peterrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kronbichler As discussed, I have copied together the most relevant functions to be able to use them in MGTwoLevelTransfer. This is not a perfect solution and should be regarded as intermediate step, but should give us a feeling what to generalize in the other classes.

}

void
read_dof_indices(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function and the next one are adopted from DoFInfo and MatrixFree.


template <typename T, typename VectorType>
void
read_write_operation(const T & operation,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the next one are adopted from FEEvaluationBase.

}

void
finalize()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A difference to the setup in the original code is that I am first collecting everything in vectors of vectors and after that convert them to CRS data structures. I do this to put the data to the right position during the cell loop in the setup of the global-coarsening transfer. But what could do is to loop over all cells category by category or alternatively to sort the data in a second step. Both needs some more involved refactoring in MGTwoLevelTransfer so that I would like to postpone this to a follow-up PR!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. In any case, this looks like a good intermediate step what could later be unified with how FEEvaluation/DoFInfo treats this case with one set of code.

@kronbichler
Copy link
Member

/rebuild

@peterrum
Copy link
Member Author

peterrum commented Mar 9, 2022

@kronbichler I have split up the declaration and interpolation and have added a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants