Hi Vikram,

Thank you for your response!

I didn't think about that - I tried to add that inside the loop over
elements and got the correct results!

Question - do you think that will significantly slow down the assembly,
because we are now creating qrule and attaching it for every element loop?

What I did was the following:

for (const auto & elem : mesh.active_local_element_ptr_range()) {

const unsigned int n_nodes = elem->n_nodes();

Order qrule_order;

switch (n_nodes)
{
case 3:
qrule_order = SECOND;
break;

case 4:
qrule_order = THIRD;
break;

default:
qrule_order = fe_type.default_quadrature_order();
break;
}

QGauss qrule (dim, qrule_order);
fe->attach_quadrature_rule (&qrule);

Thanks!

Best,
Shawn

On Sun, Apr 14, 2019 at 2:53 PM Vikram Garg <vikram.v.g...@gmail.com> wrote:

> Hi Yuxiang,
>                    It should be possible to move the construction of the
> finite element and the specification of the quadrature rule inside the loop
> over elements. Did this give any errors, or is otherwise unfeasible for
> performance reasons ?
>
> Thanks.
> Vikram Garg
>
> vikramvgarg.github.io/
>
>
> On Sun, Apr 14, 2019 at 4:30 PM Yuxiang Wang <yw...@virginia.edu> wrote:
>
>> Dear all,
>>
>> Sorry for the spam.
>>
>> I have a mix of QUAD4 and TRI3 elements in my mesh, and would like to use
>> different quadrature rule orders for each type. Specifically, I'd like to
>> have order THIRD for QUAD4 and SECOND for TRI3. By default, the orders are
>> both THIRD.
>>
>> In most examples, I noticed that the specification of qrule is only for
>> the
>> entire FEType and not dependent on the element type (e.g. QUAD4 vs TRI3).
>> Could you please share with me some hints on how to make element-dependent
>> qrule order selection happen?
>>
>> Best,
>> Shawn
>>
>>
>> --
>> Yuxiang "Shawn" Wang, PhD
>> yw...@virginia.edu
>> +1 (434) 284-0836
>>
>> _______________________________________________
>> Libmesh-users mailing list
>> Libmesh-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>>
>

-- 
Yuxiang "Shawn" Wang, PhD
yw...@virginia.edu
+1 (434) 284-0836

_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to