PSCF v1.3.3
r1d/solvers/Polymer.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 "Polymer.h"
9#include "Block.h"
10#include "Propagator.h"
11#include <pscf/solvers/PolymerTmpl.tpp>
12
13// Explicit instantiation of base class
14namespace Pscf {
16}
17
18namespace Pscf {
19namespace R1d {
20
21 /*
22 * Constructor
23 */
25 { setClassName("Polymer"); }
26
27 /*
28 * Destructor
29 */
32
33 /*
34 * Compute solution to MDE and concentrations.
35 */
36 void Polymer::compute(DArray< DArray<double> > const & wFields)
37 {
38
39 // Setup solvers for all blocks
40 int monomerId;
41 for (int j = 0; j < nBlock(); ++j) {
42 monomerId = block(j).monomerId();
43 block(j).setupSolver(wFields[monomerId]);
44 }
45
46 // Solve MDE for all propagators
47 solve();
48
49 // Compute block concentration fields (thread model)
50 double prefactor;
51 prefactor = phi() / ( q() * length() );
52 for (int i = 0; i < nBlock(); ++i) {
53 block(i).computeConcentration(prefactor);
54 }
55
56 }
57
58}
59}
Template for an MDE solver and descriptor for a block polymer.
Definition PolymerTmpl.h:45
virtual void solve(double phiTot=1.0)
Polymer()
Default constructor.
void compute(DArray< DArray< double > > const &wFields)
Compute solution to modified diffusion equation and concentrations.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
void setClassName(const char *className)
Set class name string.
PSCF package top-level namespace.