PSCF v1.2
Vertex.h
1#ifndef PSCF_VERTEX_H
2#define PSCF_VERTEX_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <util/containers/GArray.h>
12#include <util/containers/Pair.h>
13
14namespace Pscf
15{
16
17 class Edge;
18 using namespace Util;
19
30 class Vertex
31 {
32 public:
33
37 Vertex();
38
42 ~Vertex();
43
49 void setId(int id);
50
61 void addEdge(Edge const & block);
62
66 int id() const;
67
71 int size() const;
72
84 Pair<int> const & inPropagatorId(int i) const;
85
97 Pair<int> const & outPropagatorId(int i) const;
98
99 private:
100
101 GArray< Pair<int> > inPropagatorIds_;
102 GArray< Pair<int> > outPropagatorIds_;
103 int id_;
104
105 };
106
107 inline int Vertex::id() const
108 { return id_; }
109
110 inline int Vertex::size() const
111 { return outPropagatorIds_.size(); }
112
113 inline
115 { return inPropagatorIds_[i]; }
116
117 inline
119 { return outPropagatorIds_[i]; }
120
121}
122#endif
Descriptor for a block within an acyclic block polymer.
Definition Edge.h:50
A junction or chain end in a block polymer.
Definition Vertex.h:31
int size() const
Get the number of attached blocks.
Definition Vertex.h:110
void setId(int id)
Set the integer identifier of this vertex.
Definition Vertex.cpp:34
void addEdge(Edge const &block)
Add block to the list of attached blocks.
Definition Vertex.cpp:40
Pair< int > const & inPropagatorId(int i) const
Get the block and direction of an incoming propagator.
Definition Vertex.h:114
Pair< int > const & outPropagatorId(int i) const
Get the block and direction of an outgoing propagator.
Definition Vertex.h:118
Vertex()
Constructor.
Definition Vertex.cpp:18
~Vertex()
Destructor.
Definition Vertex.cpp:27
int id() const
Get the id of this vertex.
Definition Vertex.h:107
An automatically growable array, analogous to a std::vector.
Definition GArray.h:34
An array of exactly 2 objects.
Definition Pair.h:24
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.