Skip to content
Snippets Groups Projects
Commit 3184a38f authored by Innocent Niyonzima's avatar Innocent Niyonzima
Browse files

fix bug in MElement::getVolume (uninitialized variable!)

parent dc1cebe0
No related branches found
No related tags found
No related merge requests found
......@@ -146,11 +146,12 @@ SPoint3 MElement::barycenter()
return p;
}
double MElement::getVolume(){
double MElement::getVolume()
{
int npts;
IntPt *pts;
getIntegrationPoints(getDim() * (getPolynomialOrder() - 1), &npts, &pts);
double vol;
double vol = 0.;
for (int i = 0; i < npts; i++){
vol += getJacobianDeterminant(pts[i].pt[0], pts[i].pt[1], pts[i].pt[2])
* pts[i].weight;
......@@ -158,7 +159,6 @@ double MElement::getVolume(){
return vol;
}
int MElement::getVolumeSign()
{
double v = getVolume();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment