PSCF v1.1
Monomer.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 "Monomer.h"
9
10namespace Pscf
11{
12
14 : id_(-1),
15 kuhn_(0.0)
16 {}
17
18 void Monomer::setId(int id)
19 { id_ = id; }
20
21 /*
22 * Extract a Monomer from an istream.
23 */
24 std::istream& operator >> (std::istream& in, Monomer& monomer)
25 {
26 // in >> monomer.id_;
27 in >> monomer.kuhn_;
28 return in;
29 }
30
31 /*
32 * Output a Monomer to an ostream, without line breaks.
33 */
34 std::ostream& operator << (std::ostream& out, const Monomer& monomer)
35 {
36 // out << monomer.id_;
37 out.setf(std::ios::scientific);
38 out.width(15);
39 out.precision(8);
40 out << monomer.kuhn_;
41 return out;
42 }
43
44}
Descriptor for a monomer or particle type.
Definition: Monomer.h:32
void setId(int id)
Set the integer index for this monomer type.
Definition: Monomer.cpp:18
Monomer()
Constructor.
Definition: Monomer.cpp:13
int id() const
Unique integer index for monomer type.
Definition: Monomer.h:112
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