26 params.
addClassDescription(
"Outputs the IDs of every element intersected by a user-defined line");
32 _start(getParam<Point>(
"start")),
33 _end(getParam<Point>(
"end")),
34 _elem_ids(declareVector(
"elem_ids"))
48 std::vector<Elem *> intersected_elems;
49 std::vector<LineSegment> segments;
55 unsigned int num_elems = intersected_elems.size();
59 for (
unsigned int i = 0; i < num_elems; i++)
60 _elem_ids[i] = intersected_elems[i]->
id();
registerMooseObject("MooseApp", ElementsAlongLine)
Get all of the elements that are intersected by a line.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
ElementsAlongLine(const InputParameters ¶meters)
VectorPostprocessorValue & _elem_ids
The elements that intersect the line.
static InputParameters validParams()
Point _start
The beginning of the line.
virtual void execute() override
Find the elements.
Point _end
The end of the line.
virtual MooseMesh & mesh() override
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
static InputParameters validParams()
virtual std::unique_ptr< libMesh::PointLocatorBase > getPointLocator() const
Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default),...
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
void elementsIntersectedByLine(const Point &p0, const Point &p1, const MeshBase &mesh, const libMesh::PointLocatorBase &point_locator, std::vector< Elem * > &intersected_elems, std::vector< LineSegment > &segments)
Find all of the elements intersected by a line.