PSCF v1.3
MixtureModifierReal.tpp
1#ifndef PRDC_MIXTURE_MODIFIER_REAL_TPP
2#define PRDC_MIXTURE_MODIFIER_REAL_TPP
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "MixtureModifierReal.h"
12#include <pscf/chem/Monomer.h>
13
14namespace Pscf {
15namespace Prdc {
16
17 /*
18 * Constructor
19 */
20 template <class MT>
22 : mixturePtr_(nullptr)
23 {}
24
25 /*
26 * Destructor
27 */
28 template <class MT>
31
32 /*
33 * Create an association with a mixture.
34 */
35 template <class MT>
37 {
38 UTIL_CHECK(!mixturePtr_);
39 mixturePtr_ = &mixture;
40 }
41
42 // Parameter Modifiers
43
44 /*
45 * Set statistical segment length for one monomer type.
46 */
47 template <class MT>
48 void MixtureModifierReal<MT>::setKuhn(int monomerId, double kuhn)
49 { mixture().setKuhn(monomerId, kuhn); }
50
51 /*
52 * Set volume fraction for a polymer.
53 */
54 template <class MT>
56 double phi)
57 { mixture().polymer(polymerId).setPhi(phi); }
58
59 /*
60 * Set chemical potential for a polymer.
61 */
62 template <class MT>
64 double mu)
65 { mixture().polymer(polymerId).setMu(mu); }
66
67 /*
68 * Set the length of a polymer block.
69 */
70 template <class MT>
72 int blockId,
73 double length)
74 { mixture().polymer(polymerId).block(blockId).setLength(length); }
76 /*
77 * Set the volume fraction for a solvent.
78 */
79 template <class MT>
81 double phi)
82 { mixture().solvent(solventId).setPhi(phi); }
84 /*
85 * Set the chemical potential for a solvent species.
86 */
87 template <class MT>
89 double mu)
90 { mixture().solvent(solventId).setMu(mu); }
92 /*
93 * Set the size of solvent species.
94 */
95 template <class MT>
97 double size)
98 { mixture().solvent(solventId).setSize(size); }
99
100 /*
101 * Set the monomer reference volume for the mixture.
102 */
103 template <class MT>
105 { mixture().setVmonomer(vMonomer); }
106
107 // Other public non-const functions
109 /*
110 * Clear all data that depends on the unit cell parameters.
111 */
112 template <class MT>
114 { mixture().clearUnitCellData(); }
115
116 // Private memmber function
117
118 /*
119 * Get the associated mixture by reference
120 */
121 template <class MT>
122 MT& MixtureModifierReal<MT>::mixture()
123 {
124 UTIL_CHECK(mixturePtr_);
125 return *mixturePtr_;
126 }
127
128} // namespace Prdc
129} // namespace Pscf
130#endif
void setKuhn(int monomerId, double kuhn)
Set the statistical segment length for one monomer type.
void setSolventSize(int solventId, double size)
Set the size (steric volume) for a solvent species.
void clearUnitCellData()
Clear all data that depends on the unit cell parameters.
void setVMonomer(double vMonomer)
Set the monomer reference volume for the mixture.
void setPhiSolvent(int solventId, double phi)
Set the volume fraction for a solvent species.
void setPhiPolymer(int polymerId, double phi)
Set the volume fraction for a polymer species.
void associate(MT &mixture)
Create associations with a Mixture.
void setMuSolvent(int solventId, double mu)
Set the chemical for a solvent species.
void setMuPolymer(int polymerId, double mu)
Set the chemical for a polymer species.
void setBlockLength(int polymerId, int blockId, double length)
Set the length for a block of a block polymer.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Periodic fields and crystallography.
Definition CField.cpp:11
PSCF package top-level namespace.
Definition param_pc.dox:1