19 params.
addRequiredParam<std::vector<BoundaryName>>(
"connections",
"Junction connections");
26 const std::vector<BoundaryName> & connections =
27 getParam<std::vector<BoundaryName>>(
"connections");
28 for (
const auto & connection_string : connections)
39 auto & boundary_info =
mesh().
getMesh().get_boundary_info();
43 const std::string & comp_name = connection._component_name;
45 if (hasComponentByName<Component1D>(comp_name))
47 const Component1D & comp = getComponentByName<Component1D>(comp_name);
50 boundary_info.add_side(conn._elem, conn._side, boundary_id);
55 boundary_info.sideset_name(boundary_id) =
name();
57 const std::map<dof_id_type, std::vector<dof_id_type>> & node_to_elem =
mesh().
nodeToElemMap();
60 const auto & it = node_to_elem.find(nid);
61 if (it == node_to_elem.end())
64 const std::vector<dof_id_type> & elems = it->second;
65 for (
const auto & e : elems)
78 if (elem !=
nullptr && elem->processor_id() ==
processor_id())
79 _proc_ids.push_back(elem->processor_id());
92 logError(
"There must be at least one connection.");
static InputParameters validParams()
Component1DJunction(const InputParameters ¶ms)
std::vector< processor_id_type > _proc_ids
Processor IDs of connected 1D components.
Base class for 1D component junctions and boundaries.
std::vector< Connection > _connections
Vector of connections of this component.
const Parallel::Communicator & comm() const
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
static InputParameters validParams()
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.
virtual const std::string & name() const
std::vector< dof_id_type > _nodes
Boundary node IDs from connected components.
virtual Elem * queryElemPtr(const dof_id_type i)
void logError(Args &&... args) const
Logs an error.
std::vector< dof_id_type > _connected_elems
Element IDs of connected 1D components.
boundary_id_type BoundaryID
Base class for 1D components.
virtual void initSecondary()
Perform secondary initialization, which relies on init() being called for all components.
const THMMesh & constMesh() const
Const reference to mesh, which can be called at any point.
virtual void check() const override
Check the component integrity.
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
virtual const std::vector< Connection > & getConnections(Component1DConnection::EEndType end_type) const
Gets the vector of connections of an end type for this component.
virtual void check() const override
Check the component integrity.
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
const std::vector< Connection > & getConnections() const
Returns the vector of connections of this component.
void mooseError(Args &&... args) const
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
processor_id_type processor_id() const
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()