Re: [deal.II] Mass matrix for a distributed vector problem

2019-04-12 Thread Wolfgang Bangerth
On 4/12/19 1:55 PM, luca.heltai wrote:
> Wolfgang, is that true also for mass matrices? I’d agree with you for
> stiffness matrices, but I’d surprised this worked ok for mass
> matrices as well.

I'm pretty sure. The theory goes like this: instead of computing the 
matrix and rhs using the bilinear and linear forms

   a(u,v) = f(v)

you're committing a variational crime by using quadrature instead of 
integrals:

   \tilde a(u,v) = \tilde f(v)

You then need to quantify the error due to this crime, and it turns out 
that in order to not lose a convergence order, all you have to do is 
compute the integrals via quadrature to the same convergence order as 
for the overall finite element method. So, if you use elements of degree 
k, you get O(h^k) in the energy norm, and you only need to integrate 
matrix and rhs terms accurately enough to order O(h^k), which you can do 
by using k+1 Gauss points in each coordinate direction.

Best
  W.

-- 

Wolfgang Bangerth  email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Mass matrix for a distributed vector problem

2019-04-12 Thread luca.heltai
Wolfgang, is that true also for mass matrices? I’d agree with you for stiffness 
matrices, but I’d surprised this worked ok for mass matrices as well.

If so, I’ve always been over integrating in my life… 

:) 

L.

> On 12 Apr 2019, at 21:15, Wolfgang Bangerth  wrote:
> 
> On 4/12/19 8:41 AM, Robert Spartus wrote:
>> 
>> That is some fascinating information! It seems like step-44, for 
>> instance, does not follow this recommendation, as there the polynomial 
>> degree is 2, while the quadrature degree is 3
> 
> Actually, Gauss quadrature with degree+1 points in each direction is 
> sufficient to retain the convergence order of the finite element in 
> question, on any kind of mesh. Using higher order quadrature formulas 
> might increase the *absolute accuracy*, but is not necessary for the 
> convergence *order*.
> 
> Best
>  W.
> 
> -- 
> 
> Wolfgang Bangerth  email: bange...@colostate.edu
>www: http://www.math.colostate.edu/~bangerth/
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Mass matrix for a distributed vector problem

2019-04-12 Thread Wolfgang Bangerth
On 4/12/19 8:41 AM, Robert Spartus wrote:
> 
> That is some fascinating information! It seems like step-44, for 
> instance, does not follow this recommendation, as there the polynomial 
> degree is 2, while the quadrature degree is 3

Actually, Gauss quadrature with degree+1 points in each direction is 
sufficient to retain the convergence order of the finite element in 
question, on any kind of mesh. Using higher order quadrature formulas 
might increase the *absolute accuracy*, but is not necessary for the 
convergence *order*.

Best
  W.

-- 

Wolfgang Bangerth  email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Using MeshWorker on hp elements

2019-04-12 Thread Apurva Tiwari
Hello!
I have been writing a scalar advection code in DG using the Meshworker
framework. The next step is to incorporate p-adativity for which I'll need
hp elements. Is there a way of using Meshworker based code and modifying it
to accommodate hp elements?

Thank you for your effort.

 --
Apurva Tiwari

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Mass matrix for a distributed vector problem

2019-04-12 Thread Robert Spartus
Dear Luca,

That is some fascinating information! It seems like step-44, for instance,
does not follow this recommendation, as there the polynomial degree is 2,
while the quadrature degree is 3, instead of the recommended 5 (
https://dealii.org/developer/doxygen/deal.II/step_44.html#FiniteElementsystem).
Is it because of the exception for squares you mentioned?

Do you have a reference that goes in depth on the topic of the choice of
quadrature degrees? If so, I would grandly appreciate if you could send it
my way.

Incidentally, have you been able to give any thought on the singularity of
the mass matrix, even with the quadrature order is high?

Kind regards,
Bob

On Fri, 12 Apr 2019 at 16:26, luca.heltai  wrote:

> If you plan to use any domain that is not a square (or an affine
> transformation), you have to make sure you integrate exactly the product of
> two polynomials of order degree and of the determinant of the Jacobian.
> This last term is constant only for simple meshes, but it is the square
> root of a polynomial of order (degree-1) in more complicated cases.
>
> 2*fe_degree is ok for most cases, but I would not use this for serious
> calculations. I prefer to be on the safe side…
>
> :)
>
> L.
>
> > On 11 Apr 2019, at 19:34, Robert Spartus  wrote:
> >
> > Dear Luca,
> >
> > Thanks for your suggestion. Unfortunately, it did not solve the problem.
> I am sending the modified version, as well as the output of the program.
> >
> > Out of curiosity, what is the reason to use (2*fe_degree + 1)? Checking
> step-8, I notice that there a quadrature degree one larger than the
> polynomial degree is also used.
> >
> > Bests,
> > Bob
> >
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Mass matrix for a distributed vector problem

2019-04-12 Thread luca.heltai
If you plan to use any domain that is not a square (or an affine 
transformation), you have to make sure you integrate exactly the product of two 
polynomials of order degree and of the determinant of the Jacobian. This last 
term is constant only for simple meshes, but it is the square root of a 
polynomial of order (degree-1) in more complicated cases.

2*fe_degree is ok for most cases, but I would not use this for serious 
calculations. I prefer to be on the safe side…

:)

L.

> On 11 Apr 2019, at 19:34, Robert Spartus  wrote:
> 
> Dear Luca,
> 
> Thanks for your suggestion. Unfortunately, it did not solve the problem. I am 
> sending the modified version, as well as the output of the program.
> 
> Out of curiosity, what is the reason to use (2*fe_degree + 1)? Checking 
> step-8, I notice that there a quadrature degree one larger than the 
> polynomial degree is also used.
> 
> Bests,
> Bob
> 

-- 
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.
For more options, visit https://groups.google.com/d/optout.