Reaktoro 
A unified framework for modeling chemically reactive systems
Connectivity.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <memory>
22 #include <vector>
23 
24 // Reaktoro includes
25 #include <Reaktoro/Common/Index.hpp>
26 
27 namespace Reaktoro {
28 
29 // Forward declarations
30 class ChemicalSystem;
31 
36 {
37 public:
39  Connectivity();
40 
42  Connectivity(const ChemicalSystem& system);
43 
45  Connectivity(const Connectivity& other);
46 
48  virtual ~Connectivity();
49 
51  auto operator=(Connectivity other) -> Connectivity&;
52 
55  auto indicesElementsInSpecies(Index ispecies) const -> const Indices&;
56 
59  auto indicesElementsInPhase(Index iphase) const -> const Indices&;
60 
63  auto indicesSpeciesInPhase(Index iphase) const -> const Indices&;
64 
67  auto indicesSpeciesWithElement(Index ielement) const -> const Indices&;
68 
71  auto indicesPhasesWithElement(Index ielement) const -> const Indices&;
72 
75  auto indexPhaseWithSpecies(Index ispecies) const -> Index;
76 
77 private:
78  struct Impl;
79 
80  std::unique_ptr<Impl> pimpl;
81 };
82 
83 } // namespace Reaktoro
auto indicesElementsInSpecies(Index ispecies) const -> const Indices &
Return the indices of the elements in a species.
Definition: Connectivity.cpp:108
auto indicesSpeciesWithElement(Index ielement) const -> const Indices &
Return the indices of the species with an element.
Definition: Connectivity.cpp:123
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
auto indexPhaseWithSpecies(Index ispecies) const -> Index
Return the index of the phase with a species.
Definition: Connectivity.cpp:133
auto indicesPhasesWithElement(Index ielement) const -> const Indices &
Return the indices of the phases with an element.
Definition: Connectivity.cpp:128
auto indicesElementsInPhase(Index iphase) const -> const Indices &
Return the indices of the elements in a phase.
Definition: Connectivity.cpp:113
A type to describe the connectivity of elements, species, and phases in a chemical system...
Definition: Connectivity.hpp:35
auto operator=(Connectivity other) -> Connectivity &
Assign a Connectivity instance to this instance.
Definition: Connectivity.cpp:102
Connectivity()
Construct a default Connectivity instance.
Definition: Connectivity.cpp:87
std::size_t Index
Define a type that represents an index.
Definition: Index.hpp:26
auto indicesSpeciesInPhase(Index iphase) const -> const Indices &
Return the indices of the species in a phase.
Definition: Connectivity.cpp:118
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
virtual ~Connectivity()
Destroy this instance.
Definition: Connectivity.cpp:99