https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SCMPinPositions.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 "SCMPinPositions.h"
11
13
16{
18 params.addClassDescription("Create positions at the pin positions in the SubChannel mesh.");
19
20 // Use user-provided ordering
21 params.set<bool>("auto_sort") = false;
22 // SCM mesh only defined on process 0
23 params.set<bool>("auto_broadcast") = true;
24
25 return params;
26}
27
29 : Positions(parameters), _scm_mesh(dynamic_cast<const SubChannelMesh *>(&_fe_problem.mesh()))
30{
31 // This makes this object half as useful. We should lift this
32 if (!_scm_mesh)
33 mooseError("Can only be used with a subchannel mesh at this time.");
34
35 // Obtain the positions from the mesh
36 initialize();
37 // Sort if needed (user-specified)
38 finalize();
39}
40
41void
43{
45 // Add the pin positions
46 for (const auto i_pin : make_range(_scm_mesh->getNumOfPins()))
47 _positions.push_back(Point(*_scm_mesh->getPinNode(i_pin, 0)));
48
49 _initialized = true;
50}
registerMooseObject("SubChannelApp", SCMPinPositions)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
void mooseError(Args &&... args) const
void clearPositions()
std::vector< Point > & _positions
static InputParameters validParams()
virtual void finalize() override
bool _initialized
Creates positions (points) from the pins of a subchannel mesh.
const SubChannelMesh *const _scm_mesh
Pointer to the subchannel mesh.
SCMPinPositions(const InputParameters &parameters)
void initialize() override
static InputParameters validParams()
Base class for subchannel meshes.
virtual unsigned int getNumOfPins() const =0
Return the number of pins.
virtual Node * getPinNode(unsigned int i_pin, unsigned int iz) const =0
Get the pin mesh node for a given pin index and elevation index.
MeshBase & mesh