https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15
21
23 : GeneralVectorPostprocessor(parameters),
24 _xs(declareVector("x")),
25 _ys(declareVector("y")),
26 _zs(declareVector("z"))
27{
28}
29
30void
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}
registerMooseObject("PorousFlowTestApp", DiracPointsWriter)
const Real p
MultiPointMap & getPoints()
Approximates a line sink by a sequence of Dirac Points.
DiracPointsWriter(const InputParameters &parameters)
virtual void execute() override
VectorPostprocessorValue & _zs
VectorPostprocessorValue & _xs
VectorPostprocessorValue & _ys
static InputParameters validParams()
static InputParameters validParams()
virtual DiracKernelInfo & diracKernelInfo()
void set_union(T &data, const unsigned int root_id) const
const Parallel::Communicator & comm() const