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

Compute Quadrature formula over a general poly #13807

Merged

Conversation

fdrmrc
Copy link
Contributor

@fdrmrc fdrmrc commented May 24, 2022

Given two deal.II cells, these two functions allow to compute a Quadrature rule over the region described by a given boolean operation between these two. Internally, the polyhedron is split into simplices and compute_affine_transformation() is exploited in order to get a rule on each one of them.

These will be used inside the NonMatching namespace to provide exact quadratures during the assembly of coupling matrices (like the one in step-60). In particular, an exact version of NonMatching::create_coupling_mass_matrix (https://www.dealii.org/developer/doxygen/deal.II/namespaceNonMatching.html#abe338fc879922cc67627b5ca039fc663) will be available.

Currently, this works in 3D and codimension 0, but I have working versions for 2D-2D, 1D-2D and 2D-3D.

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.

This looks really nice. I must admit that I do not exactly understand the underlying algorithms in CGAL, but the overall workflow seems nice and convincing, so I agree with this one here. (It was a good opportunity for me to learn about the underlying assumptions in the CGAL part, like C++17 and similar.)

* the polyhedral.
* @return A global Quadrature rule that allows to integrate over the polyhedron.
*/
template <typename Tr>
Copy link
Member

Choose a reason for hiding this comment

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

I did not read all of the CGAL code, but wouldn't

Suggested change
template <typename Tr>
template <typename CGALTriangulationType>

be a more expressive name for the template type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, thanks!


/**
* Compute a Quadrature formula over the polygonal/polyhedral region described
* by a BooleanOperation between two deal.II cell_iterator. The degree of the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* by a BooleanOperation between two deal.II cell_iterator. The degree of the
* by a BooleanOperation between two deal.II cell_iterator objects. The degree of the

const Mapping<dim1, spacedim> &mapping1 =
(dealii::ReferenceCells::get_hypercube<dim1>()
.template get_default_linear_mapping<dim1, spacedim>()));
/**
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
/**

Comment on lines 256 to 257
* intersection. The rationale behind this specialization is that deal.II
* cells are convex sets, and as the intersection of convex sets is itself
Copy link
Member

Choose a reason for hiding this comment

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

Is this always true? As soon as cells are non-affine, convexity is lost, isn't it? I have too little insight into the algorithms, so this comment might or might not be restriction, but it might be good if you try to reflect the actual behavior in the description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're correct. This should definitely be called for affine-cells only. I'll fix this within the day.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for being late here. I've just document what really the code is doing, thanks for pointing that out.

@kronbichler
Copy link
Member

/rebuild


# include <deal.II/grid/tria.h>

# include <boost/hana.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

We will need to record this as another external boost dependency - we don't rely on hana anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I wasn't aware of this. Actually, this has been used also in #13661

@luca-heltai luca-heltai added this to In progress in CGAL Support via automation May 27, 2022
@luca-heltai luca-heltai added this to the Release 9.4 milestone May 27, 2022
@fdrmrc fdrmrc force-pushed the cgal-compute_quadrature_over_region branch from 8ce674e to 198c9dd Compare May 31, 2022 13:42
@fdrmrc
Copy link
Contributor Author

fdrmrc commented May 31, 2022

Since this is not ready yet for all possible dim-spacedim dimensions, I think we can postpone this to 9.5, together with #13814

@kronbichler
Copy link
Member

The test failures are unrelated.

@kronbichler kronbichler merged commit 599597d into dealii:master May 31, 2022
CGAL Support automation moved this from In progress to Done May 31, 2022
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
…ure_over_region

Compute Quadrature formula over a general poly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants