PSCF v1.5.0
SolventSpecies.tpp
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 "SolventSpecies.h"
9#include <util/misc/Log.h>
10
11namespace Pscf {
12
13 /*
14 * Constructor
15 */
16 template <typename WT>
18 : Species<WT>(),
19 monomerId_(-1),
20 size_(0.0)
21 { ParamComposite::setClassName("SolventSpecies"); }
22
23 /*
24 * Read contents of parameter file block
25 */
26 template <typename WT>
28 {
29 ParamComposite::read<int>(in, "monomerId", monomerId_);
30 ParamComposite::read<double>(in, "size", size_);
31 if (!(size_ > 0.0)) {
32 Log::file() << "size = " << size_ << "\n";
33 UTIL_THROW("Solvent size must be positive");
34 }
35
36 // Read phi or mu (but not both) and set ensemble accordingly
38 }
39
40 /*
41 * Set the monomer type id for this solvent species.
42 */
43 template <typename WT>
46
47 /*
48 * Set the size parameter for this solvent.
49 */
50 template <typename WT>
52 { size_ = size; }
53
54}
SolventSpecies()
Constructor.
double size() const
Get the size (number of monomers) in this solvent.
int monomerId() const
Get the monomer type id.
void setMonomerId(int monomerId)
Set the monomer id for this solvent.
virtual void readParameters(std::istream &in)
Read parameters and initialize.
void setSize(double size)
Set the molecular volume of this solvent species.
virtual void readParameters(std::istream &in)
Read phi or mu (but not both) and set ensemble accordingly.
Definition Species.tpp:36
static std::ostream & file()
Get log ostream by reference.
Definition Log.cpp:59
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
void setClassName(const char *className)
Set class name string.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Definition global.h:49
PSCF package top-level namespace.