www.mooseframework.org
PorousFlowConnectedNodes.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #pragma once
11 
12 #include "Moose.h"
13 
45 {
46 public:
48 
50  void clear();
51 
57  void addGlobalNode(dof_id_type global_node_ID);
58 
61 
63  std::size_t numNodes() const;
64 
70  dof_id_type globalID(dof_id_type sequential_node_ID) const;
71 
77  dof_id_type sequentialID(dof_id_type global_node_ID) const;
78 
80  const std::vector<dof_id_type> & globalIDs() const;
81 
91  void addConnection(dof_id_type global_node_from, dof_id_type global_node_to);
92 
95 
101  const std::vector<dof_id_type> &
102  sequentialConnectionsToGlobalID(dof_id_type global_node_ID) const;
103 
109  const std::vector<dof_id_type> &
110  sequentialConnectionsToSequentialID(dof_id_type sequential_node_ID) const;
111 
113  const std::vector<dof_id_type> & globalConnectionsToGlobalID(dof_id_type global_node_ID) const;
114 
116  const std::vector<dof_id_type> &
117  globalConnectionsToSequentialID(dof_id_type sequential_node_ID) const;
118 
120  unsigned indexOfGlobalConnection(dof_id_type global_node_ID_from,
121  dof_id_type global_node_ID_to) const;
122 
124  unsigned indexOfSequentialConnection(dof_id_type sequential_node_ID_from,
125  dof_id_type sequential_node_ID_to) const;
126 
132  std::size_t sizeSequential() const;
133 
134 private:
136  dof_id_type _min_global_id;
137  dof_id_type _max_global_id;
138  std::set<dof_id_type> _set_of_global_ids;
139  std::vector<dof_id_type> _global_id;
140  std::vector<dof_id_type> _sequential_id;
141 
143  std::vector<std::set<dof_id_type>> _neighbor_sets;
144  std::vector<std::vector<dof_id_type>> _sequential_neighbors;
145  std::vector<std::vector<dof_id_type>> _global_neighbors;
146 };
147 
PorousFlowConnectedNodes::_sequential_neighbors
std::vector< std::vector< dof_id_type > > _sequential_neighbors
Definition: PorousFlowConnectedNodes.h:144
PorousFlowConnectedNodes::_global_id
std::vector< dof_id_type > _global_id
Definition: PorousFlowConnectedNodes.h:139
PorousFlowConnectedNodes::_still_adding_connections
bool _still_adding_connections
Definition: PorousFlowConnectedNodes.h:142
PorousFlowConnectedNodes
Class designed to hold node ID information and information about nodal connectivity.
Definition: PorousFlowConnectedNodes.h:44
PorousFlowConnectedNodes::globalConnectionsToSequentialID
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.
Definition: PorousFlowConnectedNodes.C:153
PorousFlowConnectedNodes::numNodes
std::size_t numNodes() const
number of nodes known by this class
Definition: PorousFlowConnectedNodes.C:31
PorousFlowConnectedNodes::globalID
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.
Definition: PorousFlowConnectedNodes.C:78
PorousFlowConnectedNodes::sequentialConnectionsToSequentialID
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 ...
Definition: PorousFlowConnectedNodes.C:133
PorousFlowConnectedNodes::_sequential_id
std::vector< dof_id_type > _sequential_id
Definition: PorousFlowConnectedNodes.h:140
PorousFlowConnectedNodes::indexOfSequentialConnection
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_...
Definition: PorousFlowConnectedNodes.C:189
PorousFlowConnectedNodes::_global_neighbors
std::vector< std::vector< dof_id_type > > _global_neighbors
Definition: PorousFlowConnectedNodes.h:145
PorousFlowConnectedNodes::_still_adding_global_nodes
bool _still_adding_global_nodes
Definition: PorousFlowConnectedNodes.h:135
PorousFlowConnectedNodes::clear
void clear()
clear all data in readiness for adding global nodes and connections
Definition: PorousFlowConnectedNodes.C:17
PorousFlowConnectedNodes::_min_global_id
dof_id_type _min_global_id
Definition: PorousFlowConnectedNodes.h:136
PorousFlowConnectedNodes::_max_global_id
dof_id_type _max_global_id
Definition: PorousFlowConnectedNodes.h:137
PorousFlowConnectedNodes::indexOfGlobalConnection
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.
Definition: PorousFlowConnectedNodes.C:172
PorousFlowConnectedNodes::globalConnectionsToGlobalID
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.
Definition: PorousFlowConnectedNodes.C:143
PorousFlowConnectedNodes::finalizeAddingGlobalNodes
void finalizeAddingGlobalNodes()
Signal that all global node IDs have been added to the internal data structures.
Definition: PorousFlowConnectedNodes.C:50
PorousFlowConnectedNodes::sequentialConnectionsToGlobalID
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 ...
Definition: PorousFlowConnectedNodes.C:123
PorousFlowConnectedNodes::sequentialID
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...
Definition: PorousFlowConnectedNodes.C:87
PorousFlowConnectedNodes::finalizeAddingConnections
void finalizeAddingConnections()
Signal that all global node IDs have been added to the internal data structures.
Definition: PorousFlowConnectedNodes.C:108
PorousFlowConnectedNodes::addGlobalNode
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...
Definition: PorousFlowConnectedNodes.C:39
PorousFlowConnectedNodes::addConnection
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.
Definition: PorousFlowConnectedNodes.C:96
PorousFlowConnectedNodes::globalIDs
const std::vector< dof_id_type > & globalIDs() const
Vector of all global node IDs (node numbers in the mesh)
Definition: PorousFlowConnectedNodes.C:163
PorousFlowConnectedNodes::PorousFlowConnectedNodes
PorousFlowConnectedNodes()
Definition: PorousFlowConnectedNodes.C:14
PorousFlowConnectedNodes::_set_of_global_ids
std::set< dof_id_type > _set_of_global_ids
Definition: PorousFlowConnectedNodes.h:138
PorousFlowConnectedNodes::_neighbor_sets
std::vector< std::set< dof_id_type > > _neighbor_sets
Definition: PorousFlowConnectedNodes.h:143
PorousFlowConnectedNodes::sizeSequential
std::size_t sizeSequential() const
Return the size of _sequential_id, for checking memory efficiency.
Definition: PorousFlowConnectedNodes.C:69