Re: [deal.II] DG explicit time integration for linear advection equation with MeshWorker (suggestions)

2019-09-17 Thread Praveen C
If you are working only on Cartesian grids, these matrices will be same for all 
cells, except maybe for scalar factors. In this case, you can first compute 
them on a reference cell. For assembly, you loop over cells and perform a small 
matrix-vector product on each cell. Similar things can be done for face 
integrals.
best
praveen

> On 17-Sep-2019, at 12:33 PM, vachan potluri  
> wrote:
> 
> Hello all,
> 
> 
> I am a beginner in dealii. I want to solve a linear, transient advection 
> equation explicitly in two dimensions using DG. The resulting discrete 
> equation will have a mass matrix as the system matrix and a sum of terms 
> which depend on previous solution (multiplied by mass, differentiation, flux 
> and boundary matrix) as the rhs.
> 
> 
> 
> Instead of using MeshWorker::loop for every single time step, I think the 
> following approach would be better. I am using a ghost cell approach to 
> specify the boundary condition: the boundary condition can be specified by an 
> appropriately calculated normal numerical flux.
> 
> Before the any time steps, use a MeshWorker::loop each for each of the four 
> matrices: mass, differentiation, flux and boundary
> During each update
> Again use MeshWorker::loop, but this time only to calculate the normal 
> numerical flux.
> Use the normal numerical flux and the previous solution to obtain the RHS 
> using appropriate matrix-vector products
> Solve the system
> I have few question regarding this approach.
> Is it feasible
> Can it give significant improvement in performance over the case when 
> assembling is done for every time step
> (Assuming answers to above questions are positive) For higher orders, the 
> flux and boundary matrices will be very sparse. The normal numerical flux 
> (which will be a vector) will also be sparse. Can the matrix-vector product 
> involving these combinations be optimised by using appropriate sparsity 
> pattern? Can a sparsity pattern be specified for a vector too?
> 
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/dealii/7fd51309-f137-421f-91bc-8c2d1c6b7ff1%40googlegroups.com
>  
> .
> 

-- 
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 on the web visit 
https://groups.google.com/d/msgid/dealii/8866E907-F297-4B65-AABD-D2F7E1BCE6D4%40gmail.com.


[deal.II] DG explicit time integration for linear advection equation with MeshWorker (suggestions)

2019-09-17 Thread vachan potluri
Hello all,


I am a beginner in dealii. I want to solve a linear, transient advection 
equation explicitly in two dimensions using DG. The resulting discrete 
equation will have a mass matrix as the system matrix and a sum of terms 
which depend on previous solution (multiplied by mass, differentiation, 
flux and boundary matrix) as the rhs.

[image: linearAdvection2D.png]

Instead of using MeshWorker::loop for every single time step, I think the 
following approach would be better. I am using a ghost cell approach to 
specify the boundary condition: the boundary condition can be specified by 
an appropriately calculated normal numerical flux.


   1. Before the any time steps, use a MeshWorker::loop each for each of 
   the four matrices: mass, differentiation, flux and boundary
   2. During each update
  1. Again use MeshWorker::loop, but this time only to calculate the 
  normal numerical flux.
  2. Use the normal numerical flux and the previous solution to obtain 
  the RHS using appropriate matrix-vector products
  3. Solve the system
   
I have few question regarding this approach.

   1. Is it feasible
   2. Can it give significant improvement in performance over the case when 
   assembling is done for every time step
   3. (Assuming answers to above questions are positive) For higher orders, 
   the flux and boundary matrices will be very sparse. The normal numerical 
   flux (which will be a vector) will also be sparse. Can the matrix-vector 
   product involving these combinations be optimised by using appropriate 
   sparsity pattern? Can a sparsity pattern be specified for a vector too?

-- 
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 on the web visit 
https://groups.google.com/d/msgid/dealii/7fd51309-f137-421f-91bc-8c2d1c6b7ff1%40googlegroups.com.