[dune-pdelab] get no. of quadrature points

Shubhangi Gupta sgupta at geomar.de
Tue Jul 12 12:46:32 CEST 2016


Hello everyone,

I was wondering, before looping over the quadrature points in a local 
operator, how can I get the total number of quadrature points?

Context:
I am trying to evaluate some variables on each quadrature point as a 
post process:
Something like:
_____________________________________________________________________________________
         // Loop over each volume
         LeafIterator beginElem = gv.template begin< 0 , 
Dune::Interior_Partition >();
         LeafIterator endElem = gv.template end< 0 , 
Dune::Interior_Partition >();

         // Iterate over each element
         for ( LeafIterator self = beginElem; self!= endElem; ++self )
         {
             int elementNumber = indexSet.index(*self);

             // matrix for storing the variables at each quadrature 
point of the current volume
             std::vector< std::vector<double> > vars( no_of_vars );
             for (size_type i=0; i< no_of_vars ; i++){
                 vars[i] = std::vector<double> ( 
*no_of_quadrature_points* , 0. );
             }

             // select quadrature rule
             Dune::GeometryType gt = (*self).geometry().type();
             const Dune::QuadratureRule<DF,dim>& rule = 
Dune::QuadratureRules<DF,dim>::rule(gt,2/*intorder*/);
             // loop over quadrature points
             for (typename Dune::QuadratureRule<DF,dim>::const_iterator 
it=rule.begin(); it!=rule.end(); ++it){
                 .... SOME_CALCULATIONS_FOR_THE_VARS ....
             }
         }
_____________________________________________________________________________________


Thanks in advance, and best regards,
Shubhangi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20160712/8173c2ba/attachment.htm>


More information about the dune-pdelab mailing list