PSCF v1.4.0
FhClump.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 "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);
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
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
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