PSCF v1.1
Clump.cpp
1/*
2* PSCF - Polymer Self-Consistent Field Theory
3*
4* Copyright 2016 - 2022, 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 Homogeneous {
12
13 /*
14 * Constructor.
15 */
17 : monomerId_(-1),
18 size_(0.0)
19 {}
20
21 /*
22 * Set the monomer id.
23 */
24 void Clump::setMonomerId(int monomerId)
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}
Collection of all monomers of a single type in a molecule.
Definition: Clump.h:36
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
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).
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