https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InputPositions.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 "InputPositions.h"
11
13
16{
18 params.addClassDescription("Positions set directly from a user parameter in the input file");
19 params.addRequiredParam<std::vector<Point>>("positions", "Positions");
20
21 // Inputs should not be re-ordered
22 params.set<bool>("auto_sort") = false;
23 // Positions are known for all processes already
24 params.set<bool>("auto_broadcast") = false;
25
26 return params;
27}
28
30{
31 _positions = getParam<std::vector<Point>>("positions");
32 _initialized = true;
33 // Sort (if requested) and create KDTree
34 finalize();
35}
registerMooseObject("MooseApp", InputPositions)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Simple positions from an input parameter.
static InputParameters validParams()
InputPositions(const InputParameters &parameters)
Positions objects are under the hood Reporters.
Definition Positions.h:21
std::vector< Point > & _positions
For now, only the 1D vector will be shared across all ranks.
Definition Positions.h:92
static InputParameters validParams()
Definition Positions.C:15
virtual void finalize() override
In charge of reduction across all ranks & sorting for consistent output.
Definition Positions.C:220
bool _initialized
Whether the positions object has been initialized. This must be set by derived objects.
Definition Positions.h:116