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();
ElementsAlongLine(const InputParameters ¶meters)
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.
Point _start
The beginning of the line.
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
Point _end
The end of the line.
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
static InputParameters validParams()
registerMooseObject("MooseApp", ElementsAlongLine)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void execute() override
Find the elements.
static InputParameters validParams()
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
virtual MooseMesh & mesh() override
virtual std::unique_ptr< libMesh::PointLocatorBase > getPointLocator() const
Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default)...
VectorPostprocessorValue & _elem_ids
The elements that intersect the line.
Get all of the elements that are intersected by a line.