Skip to content

Commit

Permalink
modification to grid quadrature so that the quadrature points are the…
Browse files Browse the repository at this point in the history
… mid-points of each interval, as opposed to the ends of each interval.
  • Loading branch information
manavbhatia committed Feb 27, 2014
1 parent 14bd4db commit 2dca766
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/quadrature/quadrature_grid_1D.C
Expand Up @@ -37,10 +37,11 @@ void QGrid::init_1D(const ElemType,

_points.resize(_order + 1);
_weights.resize(_order + 1);
Real dx = 2.0/(double)(_order+1);
for (int i = 0; i != _order + 1; ++i)
{
_points[i](0) = 2.0 * (double)i / (double)_order - 1.0;
_weights[i] = 2.0 / (double)(_order + 1);
_points[i](0) = ((i+0.5)*dx-1.0);
_weights[i] = dx;
}
return;
}
Expand Down

0 comments on commit 2dca766

Please sign in to comment.