Hi Praveen,

For the mass matrix assembly. I suggest you use the library function

MatrixCreator::create_mass_matrix (see the class documentation for details).

To invert this, it suffices to use the SolverCG<> (with perhaps a SSOR 
preconditioner just for fun). It will converge in a few iterations, and (at 
least for higher dimensions), it's cheaper than inverting on each element 
(using 
FullMatrices). 


You can also eliminate the need for inverting the mass matrix by making a 
suitable change of variables in your discretized ODE (method of lines).

Hope this helps. 

  -- Mihai




________________________________
Von: "[email protected]" <[email protected]>
An: [email protected]
Gesendet: Montag, den 24. Januar 2011, 9:49:45 Uhr
Betreff: [deal.II] Runge-Kutta DG in 1D

Hello

I am trying to write an explicit time stepping RK-DG code using deal.ii for 1D 
navier-stokes equations (only Euler implemented at present). The mass matrix is 
local to each element, so I am inverting it for each element and storing the 
inverse in a SparseMatrix. A preliminary code that compiles is here

http://code.google.com/p/cfdlab/source/browse/trunk/deal.ii/dg_ns_1d/dg.cc

The mass matrix (and its inverse) has block structure. Should I use a 
BlockMatrix (number of blocks would be equal to number of cells, number of 
cells 
can be large). I also tried doing

std::vector< FullMatrix<double> > inv_mass_matrix;

inv_mass_matrix.resize( triangulation.n_cells() );

But then I could not allocate memory for the FullMatrix objects.

I did not use FESystem since that seemed unnecessary in this RK-DG case.

I still need to add the intercell flux term. Before that I would like to know 
if 
my approach to using deal.ii is correct for this type of problem. I hope some 
of 
you can give your advice to me.

Thanks
praveen

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to