PSCF v1.4.0
FhClump.h
1#ifndef PSCF_FH_CLUMP_H
2#define PSCF_FH_CLUMP_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, 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 {
16
17 using namespace Util;
18
35 class FhClump
36 {
37 public:
38
42 FhClump();
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, FhClump &block);
98
99 friend
100 std::ostream& operator << (std::ostream& out, const FhClump &block);
101
102 };
103
111 std::istream& operator >> (std::istream& in, FhClump &block);
112
120 std::ostream& operator << (std::ostream& out, const FhClump &block);
121
122 // Inline member functions
123
124 /*
125 * Get the monomer type id.
126 */
127 inline int FhClump::monomerId() const
128 { return monomerId_; }
129
130 /*
131 * Get the size (number of monomers) in this block.
132 */
133 inline double FhClump::size() const
134 { return size_; }
135
136 /*
137 * Serialize to/from an archive.
138 */
139 template <class Archive>
140 void FhClump::serialize(Archive& ar, unsigned int)
141 {
142 ar & monomerId_;
143 ar & size_;
144 }
145
146}
147#endif
Sub-unit of a molecule in Flory-Huggins theory.
Definition FhClump.h:36
int monomerId() const
Get the monomer type id.
Definition FhClump.h:127
void setMonomerId(int monomerId)
Set the monomer type id.
Definition FhClump.cpp:23
friend std::istream & operator>>(std::istream &in, FhClump &block)
istream extractor for a FhClump.
Definition FhClump.cpp:35
FhClump()
Constructor.
Definition FhClump.cpp:15
void setSize(double size)
Set the size of this clump.
Definition FhClump.cpp:29
void serialize(Archive &ar, unsigned int versionId)
Serialize to/from archive.
Definition FhClump.h:140
double size() const
Get the size (number of monomers) in this block.
Definition FhClump.h:133
friend std::ostream & operator<<(std::ostream &out, const FhClump &block)
ostream inserter for a FhClump.
Definition FhClump.cpp:45
PSCF package top-level namespace.
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