https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
33void
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
53void
boundary_id_type BoundaryID
const std::string name
Definition Setup.h:21
std::string _connected_component_name
Name of the connected component.
virtual void check() const override
Check the component integrity.
BoundaryName _input
Name of the boundary this component attaches to.
unsigned short int _side
Side ID.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
EEndType _connected_component_end_type
End type of the connected component.
static InputParameters validParams()
Real _normal
Outward normal on this boundary.
dof_id_type _node
Node ID.
const Elem * _elem
Element.
Component1DBoundary(const InputParameters &params)
Base class for 1D component junctions and boundaries.
std::vector< Real > _normals
Outward normals associated with connected components.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
static InputParameters validParams()
virtual void check() const override
Check the component integrity.
void checkNumberOfConnections(const unsigned int &n_connections) const
Checks that the number of connections is equal to the supplied value.
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
std::vector< const Elem * > _elems
Boundary elements of connected components.
const std::vector< Connection > & getConnections() const
Returns the vector of connections of this component.
std::vector< dof_id_type > _nodes
Boundary node IDs from connected components.
std::vector< unsigned short int > _sides
Boundary sides 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
void addRequiredParam(const std::string &name, const std::string &doc_string)
MeshBase & getMesh()
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
Definition THMMesh.C:209
Structure for holding data for a connection.
const EEndType _end_type
End type for the connection.
const std::string _component_name
Name of the component in the connection.