PSCF v1.3
Clump.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2025, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "Clump.h"
9
10namespace Pscf {
11namespace FloryHuggins {
12
13 /*
14 * Constructor.
15 */
17 : monomerId_(-1),
18 size_(0.0)
19 {}
20
21 /*
22 * Set the monomer id.
23 */
25 { monomerId_ = monomerId; }
26
27 /*
28 * Set the size of this block.
29 */
30 void Clump::setSize(double size)
31 { size_ = size; }
32
33 /*
34 * Extract a Clump from an istream.
35 */
36 std::istream& operator>>(std::istream& in, Clump &block)
37 {
38 in >> block.monomerId_;
39 in >> block.size_;
40 return in;
41 }
42
43 /*
44 * Output a Clump to an ostream, without line breaks.
45 */
46 std::ostream& operator<<(std::ostream& out, const Clump &block)
47 {
48 out << " " << block.monomerId_;
49 out << " ";
50 out.setf(std::ios::scientific);
51 out.width(16);
52 out.precision(8);
53 out << block.size_;
54 return out;
55 }
56
57}
58}
int monomerId() const
Get the monomer type id.
Definition Clump.h:127
void setSize(double size)
Set the size of this clump.
Definition Clump.cpp:30
double size() const
Get the size (number of monomers) in this block.
Definition Clump.h:133
Clump()
Constructor.
Definition Clump.cpp:16
void setMonomerId(int monomerId)
Set the monomer type id.
Definition Clump.cpp:24
Flory-Huggins theory of spatially homogeneous mixtures.
Definition Clump.cpp:11
PSCF package top-level namespace.
Definition param_pc.dox: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