PSCF v1.3.3
rpc/solvers/Mixture.h
1#ifndef RPC_MIXTURE_H
2#define RPC_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 <rpc/system/Types.h> // template argument
13
14namespace Pscf {
15namespace Rpc {
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 : public MixturePrdc<D, Polymer<D>, Solvent<D>, Types<D> >
36 {
37
38 public:
39
43
44 // Inherited public type name aliases
45
46 using typename MixturePrdcT::MixtureTmplT;
47 using typename MixturePrdcT::PolymerT;
48 using typename MixturePrdcT::SolventT;
49 using typename MixturePrdcT::BlockT;
50 using typename MixturePrdcT::PropagatorT;
51 using typename MixturePrdcT::FieldT;
52 using typename MixturePrdcT::FFTT;
53 using typename MixturePrdcT::WaveListT;
54
55 // Inherited public member functions
56
57 using MixturePrdcT::readParameters;
58 using MixturePrdcT::associate;
59 using MixturePrdcT::allocate;
60 using MixturePrdcT::clearUnitCellData;
61 using MixturePrdcT::setKuhn;
62 using MixturePrdcT::compute;
63 using MixturePrdcT::computeStress;
64 using MixturePrdcT::hasStress;
65 using MixturePrdcT::createBlockCRGrid;
66
71
79
80 protected:
81
82 using MixturePrdcT::mesh;
83 using MixturePrdcT::ds;
84
85 private:
86
93 void eqS(FieldT& A, double s) const override;
94
101 void addEqV(FieldT& A, FieldT const & B) const override;
102
106 void allocateBlocks() override;
107
108 };
109
110 // Explicit instantiation declarations for derived class
111 extern template class Mixture<1>;
112 extern template class Mixture<2>;
113 extern template class Mixture<3>;
114
115} // namespace Rpc
116namespace Prdc {
117
118 // Explicit instantiation declarations for base class
119 extern template
120 class MixturePrdc<1, Rpc::Polymer<1>, Rpc::Solvent<1>, Rpc::Types<1> >;
121 extern template
122 class MixturePrdc<2, Rpc::Polymer<2>, Rpc::Solvent<2>, Rpc::Types<2> >;
123 extern template
124 class MixturePrdc<3, Rpc::Polymer<3>, Rpc::Solvent<3>, Rpc::Types<3> >;
125
126} // namespace Prdc
127} // namespace Pscf
128#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.
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 Rpc namespace.
Periodic fields and crystallography.
Definition CField.cpp:11
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.