PSCF v1.3.3
rpg/solvers/Mixture.h
1#ifndef RPG_MIXTURE_H
2#define RPG_MIXTURE_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 <prdc/solvers/MixturePrdc.h> // base class template
12#include <rpg/system/Types.h> // template argument
13
14namespace Pscf {
15namespace Rpg {
16
17 // Forward declarations
18 template <int D> class Polymer;
19 template <int D> class Solvent;
20
21 using namespace Util;
22 using namespace Prdc;
23
34 template <int D>
35 class Mixture
36 : public MixturePrdc<D, Polymer<D>, Solvent<D>, Types<D> >
37 {
38
39 public:
40
44
45 // Inherited public type name aliases
46
47 using typename MixturePrdcT::MixtureTmplT;
48 using typename MixturePrdcT::PolymerT;
49 using typename MixturePrdcT::SolventT;
50 using typename MixturePrdcT::BlockT;
51 using typename MixturePrdcT::PropagatorT;
52 using typename MixturePrdcT::FieldT;
53 using typename MixturePrdcT::FFTT;
54 using typename MixturePrdcT::WaveListT;
55
56 // Public member functions
57
61 Mixture();
62
68 void readParameters(std::istream& in) override;
69
70 // Inherited public member functions
71
72 using MixturePrdcT::readParameters;
73 using MixturePrdcT::associate;
74 using MixturePrdcT::allocate;
75 using MixturePrdcT::clearUnitCellData;
76 using MixturePrdcT::setKuhn;
77 using MixturePrdcT::compute;
78 using MixturePrdcT::computeStress;
79 using MixturePrdcT::hasStress;
80 using MixturePrdcT::createBlockCRGrid;
81
86
94
95 protected:
96
97 using MixturePrdcT::mesh;
98 using MixturePrdcT::ds;
99
100 private:
101
102 // Private member data
103
105 bool useBatchedFFT_;
106
107 // Private member functions
108
115 virtual void eqS(FieldT& A, double s) const override;
116
123 virtual void addEqV(FieldT& A, FieldT const & B) const override;
124
128 virtual void allocateBlocks() override;
129
130 };
131
132 // Explicit instantiation declarations
133 extern template class Mixture<1>;
134 extern template class Mixture<2>;
135 extern template class Mixture<3>;
136
137} // namespace Rpg
138
139namespace Prdc {
140 // Explicit instantiation declarations for base class
141 extern template
142 class MixturePrdc<1, Rpg::Polymer<1>, Rpg::Solvent<1>, Rpg::Types<1> >;
143 extern template
144 class MixturePrdc<2, Rpg::Polymer<2>, Rpg::Solvent<2>, Rpg::Types<2> >;
145 extern template
146 class MixturePrdc<3, Rpg::Polymer<3>, Rpg::Solvent<3>, Rpg::Types<3> >;
147
148} // namespace Prdc
149
150} // namespace Pscf
151#endif
int nPolymer() const
Get number of polymer species.
Monomer const & monomer(int id) const
Get a Monomer type descriptor by const reference.
int nMonomer() const
Get number of monomer types.
int nBlock() const
Get total number blocks among all polymer species.
int nSolvent() const
Get number of solvent (point particle) species.
double vMonomer() const
Get monomer reference volume (set to 1.0 by default).
bool isCanonical() const
Is this mixture being treated in canonical ensemble?
PolymerSpecies const & polymerSpecies(int id) const final
SolventSpecies const & solventSpecies(int id) const final
Solver and descriptor for a mixture of polymers and solvents.
Definition MixturePrdc.h:59
Solver and descriptor for a mixture of polymers and solvents.
void readParameters(std::istream &in) override
Read all parameters and initialize.
typename Prdc::MixturePrdc< D, Polymer< D >, Solvent< D >, Types< D > > MixturePrdcT
Direct (parent) base class.
Descriptor and solver for one polymer species.
Solver and descriptor for a solvent species.
List of aliases for types used the in Rpg namespace.
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.