Skip to content

Commit

Permalink
Nothing uses looking up circle average properties by event index, and…
Browse files Browse the repository at this point in the history
… that method is ambiguous anyway, so just remove it entirely, closes #147
  • Loading branch information
jessecarterMOOSE committed Jul 14, 2017
1 parent 9d64622 commit 29aef5b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class InserterPointCircleAverageMaterialPropertyPPS : public GeneralPostprocesso

protected:
const InserterPointCircleAverageMaterialProperty & _uo;
const unsigned int _entry;
const Point _p;
const bool _use_inserter_point;
};

#endif /* INSERTERPOINTCIRCLEAVERAGEMATERIALPROPERTYPPS_H */
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ class InserterPointCircleAverageMaterialProperty : public CircleAverageMaterialP
public:
InserterPointCircleAverageMaterialProperty(const InputParameters & parameters);

/**
* Look up average material property value by Point if it is in an Event list.
*/
Real averageValue(const Point & p) const;
Real averageValue(const unsigned int i) const;

/**
* This is called at the beginning of the simulation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,20 @@ InputParameters validParams<InserterPointCircleAverageMaterialPropertyPPS>()
InputParameters params = validParams<GeneralPostprocessor>();

params.addRequiredParam<UserObjectName>("user_object", "The name of the InserterPointCircleAverageMaterialProperty user object");
params.addParam<unsigned int>("entry", 0, "Which entry when multiple InserterPointCircleAverageMaterialProperty values are being computed. Default is 0.");
params.addParam<Point>("location", 0.0, "Point indicating which EventInserter Event to look up.");
params.addRequiredParam<Point>("location", "Point indicating which EventInserter Event to look up.");

return params;
}

InserterPointCircleAverageMaterialPropertyPPS::InserterPointCircleAverageMaterialPropertyPPS(const InputParameters & parameters) :
GeneralPostprocessor(parameters),
_uo(getUserObject<InserterPointCircleAverageMaterialProperty>("user_object")),
_entry(getParam<unsigned int>("entry")),
_p(getParam<Point>("location")),
_use_inserter_point(parameters.isParamSetByUser("location"))
_p(getParam<Point>("location"))
{
}

Real
InserterPointCircleAverageMaterialPropertyPPS::getValue()
{
if (_use_inserter_point)
return _uo.averageValue(_p);
else
return _uo.averageValue(_entry);
return _uo.averageValue(_p);
}
2 changes: 1 addition & 1 deletion src/userobjects/EventInserterBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,6 @@ EventInserterBase::printEventLists() const
_console << " i: " << i << ": sigma: " << _old_sigma_list[i] << std::endl;
_console << " printing CircleAverageMaterialProperty values for old events..." << std::endl;
for (unsigned int i=0; i<_old_event_list.size(); i++)
_console << " old event list, i: " << i << ": location: " << _old_event_list[i].second << " average value: " << _inserter_circle_average_mat_prop_uo_ptr->averageValue(i) << std::endl;
_console << " old event list, i: " << i << ": location: " << _old_event_list[i].second << " average value: " << _inserter_circle_average_mat_prop_uo_ptr->averageValue(_old_event_list[i].second) << std::endl;
}
}
16 changes: 0 additions & 16 deletions src/userobjects/InserterPointCircleAverageMaterialProperty.C
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ InserterPointCircleAverageMaterialProperty::initialSetup()
{
// Doing this here because all UserObjects will be constructed and order won't matter in the input file
_inserter = &getUserObject<EventInserterBase>("inserter");

if (!_inserter->areOldEventsBeingTracked())
mooseWarning("InserterPointCircleAverageMaterialProperty::averageValue(int) should not be used unless old events are being tracked. Set 'track_old_events = true' in EventInserter block.");
}

Real
InserterPointCircleAverageMaterialProperty::averageValue(const unsigned int i) const
{
if (i < _volume_sum.size())
if (_volume_sum[i] > 0.0)
return _integral_sum[i]/_volume_sum[i];
else
return 0.0; // in case volume postprocessor hasn't been run

// if we made it here, the index wasn't found
mooseError("In InserterPointCircleAverageMaterialProperty::averageValue(), index", i, "not found");
}

Real
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions tests/userobjects/circle_average_material_property/tests
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
prereq = circle_average_material_property
min_parallel = 2
[../]
[./points_from_inserter]
type = 'CSVDiff'
input = 'points_from_inserter.i'
csvdiff = 'points_from_inserter_out.csv'
[../]
[./point_from_inserter]
type = 'CSVDiff'
input = 'point_from_inserter.i'
Expand Down

0 comments on commit 29aef5b

Please sign in to comment.