https://mooseframework.inl.gov
DiracPointsWriter.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "DiracPointsWriter.h"
11 
12 #include "libmesh/parallel_algebra.h"
13 
14 registerMooseObject("PorousFlowTestApp", DiracPointsWriter);
15 
18 {
20 }
21 
23  : GeneralVectorPostprocessor(parameters),
24  _xs(declareVector("x")),
25  _ys(declareVector("y")),
26  _zs(declareVector("z"))
27 {
28 }
29 
30 void
32 {
33  _xs.clear();
34  _ys.clear();
35  _zs.clear();
36  std::set<Point> points;
37  for (auto & entry : _subproblem.diracKernelInfo().getPoints())
38  if (entry.first->active())
39  points.insert(entry.second.first.begin(), entry.second.first.end());
40 
41  // Not every processor might know about every point
42  this->comm().set_union(points);
43 
44  for (auto & p : points)
45  {
46  _xs.push_back(p(0));
47  _ys.push_back(p(1));
48  _zs.push_back(p(2));
49  }
50 }
VectorPostprocessorValue & _zs
VectorPostprocessorValue & _ys
const Parallel::Communicator & comm() const
Approximates a line sink by a sequence of Dirac Points.
virtual void execute() override
MultiPointMap & getPoints()
static InputParameters validParams()
virtual DiracKernelInfo & diracKernelInfo()
static InputParameters validParams()
VectorPostprocessorValue & _xs
registerMooseObject("PorousFlowTestApp", DiracPointsWriter)
DiracPointsWriter(const InputParameters &parameters)
void set_union(T &data, const unsigned int root_id) const