19 "normals",
"Flow channel outward normals or junction inward normals");
20 params.
addParam<std::vector<processor_id_type>>(
21 "processor_ids", {},
"Processor IDs owning each connected flow channel element");
31 _bnd_ids_vector(_mesh.getBoundaryIDs(boundaryNames(), false)),
32 _n_bnd_ids(_bnd_ids_vector.size()),
33 _normal(getParam<
std::vector<Real>>(
"normals")),
34 _dir(getMaterialProperty<RealVectorValue>(
"direction")),
35 _n_connections(_normal.size()),
36 _processor_ids(getParam<
std::vector<processor_id_type>>(
"processor_ids"))
38 if (
comm().size() > 1)
41 mooseError(
"The number of entries in the 'processor_ids' parameter must equal the number of "
66 const std::vector<BoundaryID> elem_side_bnd_ids =
71 bool found_matching_boundary_id =
false;
72 unsigned int boundary_id_index = 0;
73 for (
unsigned int i = 0; i < elem_side_bnd_ids.size(); i++)
77 if (found_matching_boundary_id)
78 mooseError(
name(),
": Multiple matches for boundary ID were found");
81 found_matching_boundary_id =
true;
82 boundary_id_index = j;
86 if (!found_matching_boundary_id)
89 ss <<
name() <<
": No matching boundary ID was found for (elem,side) = ("
99 if (it_other->second == boundary_id_index)
100 mooseError(
name(),
": Multiple (elem,side) pairs had the same boundary ID index");
106 return boundary_id_index;
120 ": The connection index '",
122 "' is invalid; the range of valid indices is (0, ",
unsigned int getBoundaryIDIndex()
Gets the index of the currently executing boundary within the vector of boundary IDs given to this Si...
static InputParameters validParams()
const unsigned int _n_bnd_ids
const std::vector< BoundaryID > _bnd_ids_vector
Vector of boundary IDs for this side user object; note that BoundaryRestrictable stores these same bo...
std::vector< unsigned int > _processor_ids
Owners of each side of the junction.
const unsigned int _n_connections
Number of connected flow channels.
std::map< std::pair< const Elem *, const unsigned short int >, unsigned int > _elem_side_to_bnd_id_index
virtual void finalize() override
void checkValidConnectionIndex(const unsigned int &connection_index) const
Checks that a connection index is valid.
ADFlowJunctionUserObject(const InputParameters ¶meters)
const std::string & name() const
void mooseError(Args &&... args) const
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
const unsigned int & _current_side
static InputParameters validParams()
const Elem *const & _current_elem
const Parallel::Communicator & comm() const