PSCF v1.1
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 BlockDescriptor;
18 using namespace Util;
19
25 class Vertex
26 {
27 public:
28
32 Vertex();
33
37 ~Vertex();
38
44 void setId(int id);
45
56 void addBlock(BlockDescriptor const & block);
57
61 int id() const;
62
66 int size() const;
67
79 Pair<int> const & inPropagatorId(int i) const;
80
92 Pair<int> const & outPropagatorId(int i) const;
93
94 private:
95
96 GArray< Pair<int> > inPropagatorIds_;
97 GArray< Pair<int> > outPropagatorIds_;
98 int id_;
99
100 };
101
102 inline int Vertex::id() const
103 { return id_; }
104
105 inline int Vertex::size() const
106 { return outPropagatorIds_.size(); }
107
108 inline
110 { return inPropagatorIds_[i]; }
111
112 inline
114 { return outPropagatorIds_[i]; }
115
116}
117#endif
Description of a linear homopolymer block within a block polymer.
A junction or chain end in a block polymer.
Definition: Vertex.h:26
int size() const
Get the number of attached blocks.
Definition: Vertex.h:105
void setId(int id)
Set the integer identifier of this vertex.
Definition: Vertex.cpp:34
void addBlock(BlockDescriptor 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:109
Pair< int > const & outPropagatorId(int i) const
Get the block and direction of an outgoing propagator.
Definition: Vertex.h:113
Vertex()
Constructor.
Definition: Vertex.cpp:18
~Vertex()
Destructor.
Definition: Vertex.cpp:27
int id() const
Get the id of this vertex.
Definition: Vertex.h:102
An automatically growable array, analogous to a std::vector.
Definition: GArray.h:34
An array of exactly 2 objects.
Definition: Pair.h:24
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1