42 mooseError(
"PorousFlowConnectedNodes: addGlobalNode called, but _still_adding_global_nodes is "
43 "false. You possibly called finalizeAddingGlobalNodes too soon.");
61 for (std::size_t i = 0; i <
_global_id.size(); ++i)
72 mooseError(
"PorousFlowConnectedNodes: sizeSequential called, but _still_adding_global_nodes is "
73 "true. Probably you should have called finalizeAddingGlobalNodes.");
81 mooseError(
"PorousFlowConnectedNodes: globalID called, but _still_adding_global_nodes is true. "
82 " Probably you should have called finalizeAddingGlobalNodes.");
90 mooseError(
"PorousFlowConnectedNodes: sequentialID called, but _still_adding_global_nodes is "
91 "true. Probably you should have called finalizeAddingGlobalNodes.");
99 mooseError(
"PorousFlowConnectedNodes: addConnection called, but _still_adding_global_nodes is "
100 "true. Probably you should have called finalizeAddingGlobalNodes.");
102 mooseError(
"PorousFlowConnectedNodes: addConnection called, but _still_adding_connections is "
103 "false. Probably you should have called finalizeAddingConnections.");
112 for (std::size_t i = 0; i <
_global_id.size(); ++i)
122const std::vector<dof_id_type> &
126 mooseError(
"PorousFlowConnectedNodes: sequentialConnectionsToGlobalID called, but "
127 "_still_adding_connections is true. Probably you should have called "
128 "finalizeAddingConnections.");
132const std::vector<dof_id_type> &
136 mooseError(
"PorousFlowConnectedNodes: sequentialConnectionsToSequentialID called, but "
137 "_still_adding_connections is true. Probably you should have called "
138 "finalizeAddingConnections.");
142const std::vector<dof_id_type> &
146 mooseError(
"PorousFlowConnectedNodes: globalConnectionsToGlobalID called, but "
147 "_still_adding_connections is true. Probably you should have called "
148 "finalizeAddingConnections.");
152const std::vector<dof_id_type> &
156 mooseError(
"PorousFlowConnectedNodes: globalConnectionsToSequentialID called, but "
157 "_still_adding_connections is true. Probably you should have called "
158 "finalizeAddingConnections.");
162const std::vector<dof_id_type> &
166 mooseError(
"PorousFlowConnectedNodes: globalIDs called, but _still_adding_global_nodes is "
167 "true. Probably you should have called finalizeAddingGlobalNodes.");
173 dof_id_type global_node_ID_to)
const
177 "PorousFlowConnectedNodes: indexOfGlobalConnection called, but _still_adding_connections "
178 "is true. Probably you should have called finalizeAddingConnections.");
180 const auto it = std::find(con.begin(), con.end(), global_node_ID_to);
182 mooseError(
"PorousFlowConnectedNode: global_node_ID_from " +
183 Moose::stringify(global_node_ID_from) +
" has no connection to global_node_ID_to " +
185 return std::distance(con.begin(), it);
190 dof_id_type sequential_node_ID_to)
const
193 mooseError(
"PorousFlowConnectedNodes: indexOfSequentialConnection called, but "
194 "_still_adding_connections is true. Probably you should have called "
195 "finalizeAddingConnections.");
197 const auto it = std::find(con.begin(), con.end(), sequential_node_ID_to);
199 mooseError(
"PorousFlowConnectedNode: sequential_node_ID_from " +
201 " has no connection to sequential_node_ID_to " +
203 return std::distance(con.begin(), it);
void mooseError(Args &&... args)
std::vector< dof_id_type > _sequential_id
void finalizeAddingConnections()
Signal that all global node IDs have been added to the internal data structures.
const std::vector< dof_id_type > & sequentialConnectionsToSequentialID(dof_id_type sequential_node_ID) const
Return all the nodes (sequential node IDs) connected to the given sequential node ID All elements of ...
std::vector< std::vector< dof_id_type > > _global_neighbors
const std::vector< dof_id_type > & globalIDs() const
Vector of all global node IDs (node numbers in the mesh)
void addConnection(dof_id_type global_node_from, dof_id_type global_node_to)
Specifies that global_node_to is connected to global_node_from.
const std::vector< dof_id_type > & sequentialConnectionsToGlobalID(dof_id_type global_node_ID) const
Return all the nodes (sequential node IDs) connected to the given global node ID All elements of the ...
dof_id_type globalID(dof_id_type sequential_node_ID) const
Return the global node ID (node number in the mesh) corresponding to the provided sequential node ID.
std::size_t numNodes() const
number of nodes known by this class
unsigned indexOfSequentialConnection(dof_id_type sequential_node_ID_from, dof_id_type sequential_node_ID_to) const
Return the index of sequential_node_ID_to in the sequentialConnectionsToSequentialID(sequential_node_...
std::vector< dof_id_type > _global_id
PorousFlowConnectedNodes()
const std::vector< dof_id_type > & globalConnectionsToSequentialID(dof_id_type sequential_node_ID) const
Return all the nodes (global node IDs) connected to the given sequential node ID.
void finalizeAddingGlobalNodes()
Signal that all global node IDs have been added to the internal data structures.
void clear()
clear all data in readiness for adding global nodes and connections
void addGlobalNode(dof_id_type global_node_ID)
Add the given global_node_ID to the internal data structures If the global node ID has already been a...
unsigned indexOfGlobalConnection(dof_id_type global_node_ID_from, dof_id_type global_node_ID_to) const
Return the index of global_node_ID_to in the globalConnectionsToGlobalID(global_node_ID_from) vector.
dof_id_type _min_global_id
std::set< dof_id_type > _set_of_global_ids
dof_id_type _max_global_id
std::size_t sizeSequential() const
Return the size of _sequential_id, for checking memory efficiency.
bool _still_adding_connections
dof_id_type sequentialID(dof_id_type global_node_ID) const
Return the sequential node ID corresponding to the global node ID This is guaranteed to lie in the ra...
std::vector< std::vector< dof_id_type > > _sequential_neighbors
std::vector< std::set< dof_id_type > > _neighbor_sets
const std::vector< dof_id_type > & globalConnectionsToGlobalID(dof_id_type global_node_ID) const
Return all the nodes (global node IDs) connected to the given global node ID.
bool _still_adding_global_nodes
std::string stringify(const T &t)