PSCF v1.5.0
FhClump.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2026, David Morse (morse012@um.edu) and co-authors
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "FhClump.h"
9
10namespace Pscf {
11
12 /*
13 * Constructor.
14 */
16 : monomerId_(-1),
17 size_(0.0)
18 {}
19
20 /*
21 * Set the monomer id.
22 */
24 { monomerId_ = monomerId; }
25
26 /*
27 * Set the size of this block.
28 */
30 { size_ = size; }
31
32 /*
33 * Extract a FhClump from an istream.
34 */
35 std::istream& operator>>(std::istream& in, FhClump &block)
36 {
37 in >> block.monomerId_;
38 in >> block.size_;
39 return in;
40 }
41
42 /*
43 * Output a FhClump to an ostream, without line breaks.
44 */
45 std::ostream& operator<<(std::ostream& out, const FhClump &block)
46 {
47 out << " " << block.monomerId_;
48 out << " ";
49 out.setf(std::ios::scientific, std::ios::floatfield);
50 out.width(16);
51 out.precision(8);
52 out << block.size_;
53 return out;
54 }
55
56}
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
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.