12 #include "MooseMesh.h"
21 InputParameters params = validParams<SideIntegralPostprocessor>();
22 params.addClassDescription(
"Computes the volume of an enclosed area by "
23 "performing an integral over a user-supplied boundary.");
24 params.addRangeCheckedParam<
unsigned int>(
25 "component", 0,
"component<3",
"The component to use in the integration");
26 params.addParam<Real>(
27 "scale_factor", 1,
"A scale factor to be applied to the internal volume calculation");
28 params.addParam<FunctionName>(
"addition",
30 "An additional volume to be included in the "
31 "internal volume calculation. A time-dependent "
32 "function is expected.");
33 params.set<
bool>(
"use_displaced_mesh") =
true;
38 : SideIntegralPostprocessor(parameters),
39 _component(getParam<unsigned int>(
"component")),
40 _scale(getParam<Real>(
"scale_factor")),
41 _addition(getFunction(
"addition"))
74 SideIntegralPostprocessor::initialSetup();
76 const std::set<SubdomainID> & subdomains = _mesh.meshSubdomains();
77 std::set<SubdomainID>::const_iterator iter = subdomains.begin();
78 const std::set<SubdomainID>::const_iterator iter_end = subdomains.end();
79 for (; iter != iter_end; ++iter)
81 const std::set<BoundaryID> & boundaries = _mesh.getSubdomainBoundaryIds(*iter);
82 std::set<BoundaryID>::const_iterator bnd = boundaries.begin();
83 const std::set<BoundaryID>::const_iterator bnd_end = boundaries.end();
84 for (; bnd != bnd_end; ++bnd)
86 const std::set<BoundaryID> & b = boundaryIDs();
87 std::set<BoundaryID>::const_iterator bit = b.begin();
88 const std::set<BoundaryID>::const_iterator bit_end = b.end();
89 for (; bit != bit_end; ++bit)
92 Moose::CoordinateSystemType coord_sys = _fe_problem.getCoordSystem(*iter);
93 if (
_component != 0 && coord_sys == Moose::COORD_RSPHERICAL)
94 mooseError(
"With spherical coordinates, the component must be 0 in InternalVolume.");
96 if (
_component > 1 && coord_sys == Moose::COORD_RZ)
98 "With cylindrical coordinates, the component must be 0 or 1 in InternalVolume.");
109 if (_coord_sys == Moose::COORD_RSPHERICAL)
114 else if (_coord_sys == Moose::COORD_RZ &&
_component == 0)
120 else if (_coord_sys == Moose::COORD_RZ &&
_component == 1)
135 return _scale * SideIntegralPostprocessor::getValue() +
_addition.value(_t, p);