Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

modification to grid quadrature so that the quadrature points are the mi... #212

Merged
merged 1 commit into from

5 participants

@manavbhatia

modification to grid quadrature so that the quadrature points are the mid-points of each interval, as opposed to the ends of each interval.

@manavbhatia manavbhatia modification to grid quadrature so that the quadrature points are the…
… mid-points of each interval, as opposed to the ends of each interval.
2dca766
@moosebuild
Owner

A build job for 2dca766 from recipe libmesh is waiting for a developer to activate it here: https://www.moosebuild.com/view_job/65

@jwpeterson
Owner

@roystgnr Any thoughts on this? I think you wrote the QGrid class to implement Newton-Cotes type rules? If anything I think this feature should go in a new class rather than modifying the existing QGrid.

@friedmud
Owner

I just activated the tests - let's see if that turns anything up.

But I agree with @jwpeterson this seems like a different qrule to me... (or maybe an option on the same object...)

@roystgnr
Owner

My QGrid was a dumb-as-dirt rule, written solely for debugging the creation of new macroelements (by making it possible to test the element without having a proper subdivision-respecting quadrature rule for it). Not only is it not Newton-Cotes it's not even an accurate trapezoidal rule; we're talking O(1/N) convergence here thanks to the overweighted endpoints.

So while I'm usually reluctant to fundamentally change the behavior of existing code, I think it might be reasonable to make an exception for the case of really awful existing code.

But if we do, could we change all the geometric element cases to be consistent? The tensor product cases pick up the 1D rule but the tri and tet cases are each their own code.

@roystgnr
Owner

s/overweighted endpoints/one overweighted, one dropped endpoint/

@moosebuild
Owner

Results of testing 2dca766 using libmesh recipe:

Passed on: linux

View the results here: https://www.moosebuild.com/view_job/65

@roystgnr
Owner

I'll merge this as-is and make up a subsequent PR for the tri/tet cases.

@roystgnr roystgnr merged commit 73a1793 into libMesh:master

1 check passed

Details default Successfully passed all tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2014
  1. @manavbhatia

    modification to grid quadrature so that the quadrature points are the…

    manavbhatia authored
    … mid-points of each interval, as opposed to the ends of each interval.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/quadrature/quadrature_grid_1D.C
View
5 src/quadrature/quadrature_grid_1D.C
@@ -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;
}
Something went wrong with that request. Please try again.