Hi Martin, Thanks for the very quick reply and test case! So quadrature formulas only differ by their *ctors *and all the quad points and weights are stored within their base class Quadrature. Hence by using std::vector<Quadrature<1>> is enough to pass all the info.
BTW we can specify the template parameter and it would automatically convert to its base class like mf_data.reinit<*Quadrature<1>*, double, Mapping<dim>>( mapping, {&dof1, &dof2}, {&constraint1, &constraint2}, *{QGauss<1>{2}, QGaussLobatto<1>{3}}*, additional_data ) Regards, Chengjiang Yin 在2025年2月19日星期三 UTC+8 15:35:08<Martin Kronbichler> 写道: > Dear Chengjiang, > > This is a good question. This case is supported, but one needs to work > slightly harder (and I admit we do not show this case). You should do as > follows: > > std::vector<Quadrature<1>> quad; > quad.push_back(QGauss<1>(fe_degree + 1)); > quad.push_back(QGaussLobatto<1>(fe_degree + 2)); > mf_data.reinit(MappingQ1<dim>{}, > dof, > constraints, > quad, > typename MatrixFree<dim, number>::AdditionalData( > MatrixFree<dim, number>::AdditionalData::none)); > > I added a test with this code now to make sure this feature keeps working: > https://github.com/dealii/dealii/pull/18148 . If you want to construct > the quadrature objects in place, you should be able to do so by casting > both objects in the initializer list to Quadrature<1>. > > Best regards, > Martin > > Am 19.02.25 um 07:40 schrieb Chengjiang Yin: > > Hi all, > > I notice that the overloaded member function of MatrixFree::reinit > <https://www.dealii.org/current/doxygen/deal.II/classMatrixFree.html#adf70156869fbd945c40fb5d2cb0b921e> > says > MatrixFree support multi-component finite elements together with multiple > quadrature formulas. > > However the quadratures are input by *std::vector<QuadratureType>*. Since > std::vector does not have polymorphism, does this mean *only the same > type of quadrature with different quadrature degrees are supported*? ( > for example std::vector{QGauss<1>(2), QGauss<1>(3)}, but not > std::vector{QGauss<1>(2), > QGaussLobatto<1>(3)} ) > > I have checked the tutorials and test cases and didn't find any example of > using this reinit function. > > Regards > Chengjiang Yin > > -- > The deal.II project is located at http://www.dealii.org/ > For mailing list/forum options, see > https://groups.google.com/d/forum/dealii?hl=en > --- > You received this message because you are subscribed to the Google Groups > "deal.II User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to dealii+un...@googlegroups.com. > To view this discussion visit > https://groups.google.com/d/msgid/dealii/7e995192-78a4-44a4-8cdd-d12450858ae7n%40googlegroups.com > > <https://groups.google.com/d/msgid/dealii/7e995192-78a4-44a4-8cdd-d12450858ae7n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/dealii/1c7aed6b-08cb-4622-80e9-a18952f09cban%40googlegroups.com.