https://mooseframework.inl.gov
Component1DBoundary.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 "Component1DBoundary.h"
11 #include "THMMesh.h"
12 
15 {
17  params.addRequiredParam<BoundaryName>("input", "Name of the input");
18  return params;
19 }
20 
22  : Component1DConnection(params), _input(getParam<BoundaryName>("input"))
23 {
25  if (getConnections().size() > 0)
26  {
27  const Connection & connection = getConnections()[0];
30  }
31 }
32 
33 void
35 {
37 
38  if (_nodes.size() > 0)
39  {
40  _elem = _elems[0];
41  _side = _sides[0];
42  _node = _nodes[0];
43  _normal = _normals[0];
44 
45  // create a sideset corresponding to the side of the connected component end
46  const BoundaryID boundary_id = mesh().getNextBoundaryId();
47  auto & binfo = mesh().getMesh().get_boundary_info();
48  binfo.add_side(_elem, _side, boundary_id);
49  binfo.sideset_name(boundary_id) = name();
50  }
51 }
52 
53 void
55 {
57 
59 }
const std::string _component_name
Name of the component in the connection.
static InputParameters validParams()
static InputParameters validParams()
std::vector< unsigned short int > _sides
Boundary sides of connected components.
Base class for 1D component junctions and boundaries.
Component1DBoundary(const InputParameters &params)
Real _normal
Outward normal on this boundary.
Structure for holding data for a connection.
EEndType _connected_component_end_type
End type of the connected component.
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
std::vector< dof_id_type > _nodes
Boundary node IDs from connected components.
BoundaryName _input
Name of the boundary this component attaches to.
MeshBase & getMesh()
boundary_id_type BoundaryID
void checkNumberOfConnections(const unsigned int &n_connections) const
Checks that the number of connections is equal to the supplied value.
dof_id_type _node
Node ID.
virtual void check() const override
Check the component integrity.
std::string _connected_component_name
Name of the connected component.
std::vector< const Elem * > _elems
Boundary elements of connected components.
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
const EEndType _end_type
End type for the connection.
virtual void check() const override
Check the component integrity.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
Definition: THMMesh.C:209
const std::vector< Connection > & getConnections() const
Returns the vector of connections of this component.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
std::vector< Real > _normals
Outward normals associated with connected components.
const Elem * _elem
Element.
unsigned short int _side
Side ID.