https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowConnectedNodes.h
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#pragma once
11
12#include "Moose.h"
13#include "MooseTypes.h"
14
46{
47public:
49
51 void clear();
52
58 void addGlobalNode(dof_id_type global_node_ID);
59
62
64 std::size_t numNodes() const;
65
71 dof_id_type globalID(dof_id_type sequential_node_ID) const;
72
78 dof_id_type sequentialID(dof_id_type global_node_ID) const;
79
81 const std::vector<dof_id_type> & globalIDs() const;
82
92 void addConnection(dof_id_type global_node_from, dof_id_type global_node_to);
93
96
102 const std::vector<dof_id_type> &
103 sequentialConnectionsToGlobalID(dof_id_type global_node_ID) const;
104
110 const std::vector<dof_id_type> &
111 sequentialConnectionsToSequentialID(dof_id_type sequential_node_ID) const;
112
114 const std::vector<dof_id_type> & globalConnectionsToGlobalID(dof_id_type global_node_ID) const;
115
117 const std::vector<dof_id_type> &
118 globalConnectionsToSequentialID(dof_id_type sequential_node_ID) const;
119
121 unsigned indexOfGlobalConnection(dof_id_type global_node_ID_from,
122 dof_id_type global_node_ID_to) const;
123
125 unsigned indexOfSequentialConnection(dof_id_type sequential_node_ID_from,
126 dof_id_type sequential_node_ID_to) const;
127
133 std::size_t sizeSequential() const;
134
135private:
137 dof_id_type _min_global_id;
138 dof_id_type _max_global_id;
139 std::set<dof_id_type> _set_of_global_ids;
140 std::vector<dof_id_type> _global_id;
141 std::vector<dof_id_type> _sequential_id;
142
144 std::vector<std::set<dof_id_type>> _neighbor_sets;
145 std::vector<std::vector<dof_id_type>> _sequential_neighbors;
146 std::vector<std::vector<dof_id_type>> _global_neighbors;
147};
Class designed to hold node ID information and information about nodal connectivity.
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
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.
std::set< dof_id_type > _set_of_global_ids
std::size_t sizeSequential() const
Return the size of _sequential_id, for checking memory efficiency.
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.