PSCF v1.1
pspg/solvers/Polymer.h
1#ifndef PSPG_POLYMER_H
2#define PSPG_POLYMER_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "Block.h"
12#include <pspg/field/RDField.h>
13#include <pscf/solvers/PolymerTmpl.h>
14#include <util/containers/FArray.h>
15
16namespace Pscf {
17namespace Pspg {
18
37 template <int D>
38 class Polymer : public PolymerTmpl< Block<D> >
39 {
40
41 public:
42
47
48 /*
49 * Constructor.
50 */
51 Polymer();
52
53 /*
54 * Destructor.
55 */
56 ~Polymer();
57
58 /*
59 * Set the phi (volume fraction) for this species.
60 *
61 * \param phi volume fraction (input)
62 */
63 void setPhi(double phi);
64
65 /*
66 * Set the mu (chemical potential) for this species.
67 *
68 * \param mu chemical potential (input)
69 */
70 void setMu(double mu);
71
78 void setupUnitCell(UnitCell<D> const & unitCell,
79 WaveList<D> const & wavelist);
80
86 void compute(DArray< RDField<D> > const & wFields);
87
93 void computeStress(WaveList<D> const & wavelist);
94
103 double stress(int n);
104
105 // public inherited functions with non-dependent names
106 using Base::nBlock;
107 using Base::block;
108 using Base::ensemble;
109 using Base::solve;
110 using Base::length;
111
112 protected:
113
114 // protected inherited function with non-dependent names
116
117 private:
118
119 // Stress contribution from this polymer species.
120 FArray<double, 6> stress_;
121
122 // Number of unit cell parameters.
123 int nParams_;
124
125 using Base::phi_;
126 using Base::mu_;
127
128 };
129
130 template <int D>
131 double Polymer<D>::stress(int n)
132 { return stress_[n]; }
133
134 #ifndef PSPG_POLYMER_TPP
135 // Suppress implicit instantiation
136 extern template class Polymer<1>;
137 extern template class Polymer<2>;
138 extern template class Polymer<3>;
139 #endif
140
141}
142}
143//#include "Polymer.tpp"
144#endif
Descriptor and MDE solver for an acyclic block polymer.
Definition: PolymerTmpl.h:42
Block< D > & block(int id)
Get a specified Block.
Definition: PolymerTmpl.h:276
int nBlock() const
Number of blocks.
Definition: PolymerTmpl.h:241
virtual void solve(double phiTot=1.0)
Solve modified diffusion equation.
Definition: PolymerTmpl.h:522
double length() const
Sum of the lengths of all blocks in the polymer.
Definition: PolymerTmpl.h:255
Descriptor and solver for a branched polymer species.
void setupUnitCell(UnitCell< D > const &unitCell, WaveList< D > const &wavelist)
Compute solution to MDE and concentrations.
PolymerTmpl< Block< D > > Base
Alias for base class.
double stress(int n)
Get derivative of free energy w/ respect to a unit cell parameter.
void compute(DArray< RDField< D > > const &wFields)
Compute solution to MDE and concentrations.
void computeStress(WaveList< D > const &wavelist)
Compute stress from a polymer chain, needs a pointer to basis.
Field of real single precision values on an FFT mesh on a device.
Definition: RDField.h:34
Container for wavevector data.
Definition: WaveList.h:31
double phi() const
Get the overall volume fraction for this species.
Definition: Species.h:90
Ensemble ensemble()
Get the statistical ensemble for this species (open or closed).
Definition: Species.h:102
double phi_
Volume fraction, set by either setPhi or compute function.
Definition: Species.h:68
double mu_
Chemical potential, set by either setPhi or compute function.
Definition: Species.h:73
double mu() const
Get the chemical potential for this species (units kT=1).
Definition: Species.h:96
Base template for UnitCell<D> classes, D=1, 2 or 3.
Definition: UnitCell.h:44
Dynamically allocatable contiguous array template.
Definition: DArray.h:32
A fixed size (static) contiguous array template.
Definition: FArray.h:47
void setClassName(const char *className)
Set class name string.
C++ namespace for polymer self-consistent field theory (PSCF).