Skip to content

Commit

Permalink
Changed how element value is calculated from material point values in…
Browse files Browse the repository at this point in the history
… FEMeshAdaptorCriterion.
  • Loading branch information
SteveMaas1978 committed Oct 11, 2024
1 parent cf0b86b commit d4174dc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions FECore/FEMeshAdaptorCriterion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,20 @@ FEMeshAdaptorSelection FEMeshAdaptorCriterion::GetElementSelection(FEElementSet*

bool FEMeshAdaptorCriterion::GetElementValue(FEElement& el, double& value)
{
bool bvalid = true;
value = 0.0;
int ni = el.GaussPoints();
int ni = el.GaussPoints(), nv = 0;
for (int i = 0; i < ni; ++i)
{
double vali = 0.0;
bool b = GetMaterialPointValue(*el.GetMaterialPoint(i), vali);
if (b) value += vali;
bvalid = (bvalid && b);
if (b) { value += vali; nv++; }
}
value /= (double)ni;
return bvalid;
if (nv > 0)
{
value /= (double)nv;
return true;
}
else return false;
}

bool FEMeshAdaptorCriterion::GetMaterialPointValue(FEMaterialPoint& mp, double& elemVal)
Expand Down

0 comments on commit d4174dc

Please sign in to comment.