PSCF v1.4.0
cpc/solvers/Polymer.h
1#ifndef CPC_POLYMER_H
2#define CPC_POLYMER_H
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 <pscf/solvers/PolymerTmpl.h> // base class template
12
13// Forward declarations
14namespace Util {
15 template <typename T> class DArray;
16}
17namespace Pscf {
18 namespace Cpc {
19 template <int D> class Block;
20 template <int D> class Propagator;
21 }
22 namespace Prdc {
23 namespace Cpu {
24 template <int D> class CField;
25 }
26 }
27}
28
29// Explicit instantiation declarations for base class
30namespace Pscf {
31 extern template
32 class PolymerTmpl< Cpc::Block<1>, Cpc::Propagator<1>, std::complex<double> >;
33 extern template
34 class PolymerTmpl< Cpc::Block<2>, Cpc::Propagator<2>, std::complex<double> >;
35 extern template
36 class PolymerTmpl< Cpc::Block<3>, Cpc::Propagator<3>, std::complex<double> >;
37}
38
39namespace Pscf {
40namespace Cpc {
41
42 using namespace Prdc;
43 using namespace Pscf::Prdc::Cpu;
44
65 template <int D>
66 class Polymer
67 : public PolymerTmpl< Block<D>, Propagator<D>, std::complex<double> >
68 {
69
70 public:
71
72 // Public type name aliases
73
75 using Base = PolymerTmpl< Block<D>, Propagator<D>, std::complex<double> >;
76
79
82
85
88
89 // Public member functions
90
94 Polymer();
95
99 ~Polymer();
100
108 void clearUnitCellData();
109
122 void compute(DArray< CField<D> > const & wFields);
123
124 // Inherited public member functions
125
126 using Base::edge;
127 using Base::block;
128 using Base::propagator;
138 using SpeciesT::phi;
139 using SpeciesT::mu;
140 using SpeciesT::q;
141 using SpeciesT::ensemble;
142 using SpeciesT::setPhi;
143 using SpeciesT::setMu;
144
145 private:
146
147 // Restricting access to inherited functions
148 using Base::solve;
149 using SpeciesT::setQ;
150
151 };
152
153 // Explicit instantiation declarations
154 extern template class Polymer<1>;
155 extern template class Polymer<2>;
156 extern template class Polymer<3>;
157
158}
159}
160#endif
Block within a linear or branched block polymer.
Descriptor and solver for one polymer species.
void compute(DArray< CField< D > > const &wFields)
Compute solution to MDE and block concentrations.
Block< D > BlockT
Block type, for a block within a block polymer.
PolymerSpecies< std::complex< double > > PolymerSpeciesT
PolymerSpecies template base class.
PolymerTmpl< Block< D >, Propagator< D >, std::complex< double > > Base
Base class, partial template specialization.
Species< std::complex< double > > SpeciesT
Species template base class.
void clearUnitCellData()
Clear all data that depends on unit cell parameters.
Propagator< D > PropagatorT
Propagator type, for one direction within a block.
MDE solver for one direction of one block.
Descriptor for a linear or acyclic branched block polymer.
Pair< int > const & path(int is, int it) const
Pair< int > const & propagatorId(int id) const
Descriptor and MDE solver for a block polymer.
Definition PolymerTmpl.h:63
Propagator< D > & propagator(int blockId, int directionId)
Field of complex double precision values on an FFT mesh.
Definition cpu/CField.h:29
Base class for a molecular species (polymer or solvent).
Definition Species.h:35
std::complex< double > q() const
std::complex< double > mu() const
void setQ(std::complex< double > q)
std::complex< double > phi() const
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Complex periodic fields, CL-FTS (CPU).
Definition cpc.mod:6
Fields and FFTs for periodic boundary conditions (CPU)
Definition complex.cpp:12
Periodic fields and crystallography.
Definition complex.cpp:11
PSCF package top-level namespace.
Utility classes for scientific computation.