PSCF v1.1
Clump.h
1#ifndef PSCF_HOMOGENEOUS_CLUMP_H
2#define PSCF_HOMOGENEOUS_CLUMP_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/Pair.h>
12
13#include <iostream>
14
15namespace Pscf {
16namespace Homogeneous {
17
18 using namespace Util;
19
35 class Clump
36 {
37 public:
38
42 Clump();
43
50 template <class Archive>
51 void serialize(Archive& ar, unsigned int versionId);
52
54
55
61 void setMonomerId(int monomerId);
62
70 void setSize(double size);
71
73
75
79 int monomerId() const;
80
84 double size() const;
85
87
88 private:
89
91 int monomerId_;
92
94 double size_;
95
96 friend
97 std::istream& operator >> (std::istream& in, Clump &block);
98
99 friend
100 std::ostream& operator << (std::ostream& out, const Clump &block);
101
102 };
103
111 std::istream& operator >> (std::istream& in, Clump &block);
112
120 std::ostream& operator << (std::ostream& out, const Clump &block);
121
122 // Inline member functions
123
124 /*
125 * Get the monomer type id.
126 */
127 inline int Clump::monomerId() const
128 { return monomerId_; }
129
130 /*
131 * Get the size (number of monomers) in this block.
132 */
133 inline double Clump::size() const
134 { return size_; }
135
136 /*
137 * Serialize to/from an archive.
138 */
139 template <class Archive>
140 void Clump::serialize(Archive& ar, unsigned int)
141 {
142 ar & monomerId_;
143 ar & size_;
144 }
145
146}
147}
148#endif
Collection of all monomers of a single type in a molecule.
Definition: Clump.h:36
friend std::ostream & operator<<(std::ostream &out, const Clump &block)
ostream inserter for a Clump.
Definition: Clump.cpp:46
void setSize(double size)
Set the size of this block.
Definition: Clump.cpp:30
int monomerId() const
Get the monomer type id.
Definition: Clump.h:127
double size() const
Get the size (number of monomers) in this block.
Definition: Clump.h:133
friend std::istream & operator>>(std::istream &in, Clump &block)
istream extractor for a Clump.
Definition: Clump.cpp:36
void serialize(Archive &ar, unsigned int versionId)
Serialize to/from archive.
Definition: Clump.h:140
void setMonomerId(int monomerId)
Set the monomer id.
Definition: Clump.cpp:24
Clump()
Constructor.
Definition: Clump.cpp:16
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
Definition: Pair.h:44
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Definition: Pair.h:57