PSCF v1.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
10namespace Pscf {
11namespace R1d
12{
13
14 /*
15 * Constructor
16 */
18 { setClassName("Polymer"); }
19
20 /*
21 * Destructor
22 */
25
26 /*
27 * Compute solution to MDE and concentrations.
28 */
29 void Polymer::compute(DArray< DArray<double> > const & wFields)
30 {
31
32 // Setup solvers for all blocks
33 int monomerId;
34 for (int j = 0; j < nBlock(); ++j) {
35 monomerId = block(j).monomerId();
36 block(j).setupSolver(wFields[monomerId]);
37 }
38
39 // Solve MDE for all propagators
40 solve();
41
42 // Compute block concentration fields (thread model)
43 double prefactor;
44 prefactor = phi() / ( q() * length() );
45 for (int i = 0; i < nBlock(); ++i) {
46 block(i).computeConcentration(prefactor);
47 }
48
49 }
50
51}
52}
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.
SCFT with real 1D fields.
PSCF package top-level namespace.
Definition param_pc.dox:1