PSCF v1.4.0
rpc/solvers/Mixture.cpp
1/*
2* PSCF - Mixture Self-Consistent Field Theory
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 "Mixture.h"
9#include "Polymer.h"
10#include "Solvent.h"
11#include "Block.h"
12#include "Propagator.h"
13#include <rpc/field/FieldIo.h>
14#include <prdc/cpu/FFT.h>
15#include <prdc/cpu/RField.h>
16#include <pscf/cpu/VecOp.h>
17
18#include <rp/solvers/Mixture.tpp>
19
20namespace Pscf {
21namespace Rpc {
22
23 using namespace Prdc;
24
25 /*
26 * Allocate memory for all blocks.
27 */
28 template <int D>
29 void Mixture<D>::allocateBlocks()
30 {
31 const double ds = RpMixtureT::ds();
32 const int np = MixtureBaseT::nPolymer();
33 int i, j;
34 for (i = 0; i < np; ++i) {
35 for (j = 0; j < polymer(i).nBlock(); ++j) {
36 polymer(i).block(j).allocate(ds);
37 }
38 }
39 }
40
41}
42}
43
44// Explicit instantiation definitions
45namespace Pscf {
49 namespace Rp {
50 template class Mixture<1, Rpc::Types<1> >;
51 template class Mixture<2, Rpc::Types<2> >;
52 template class Mixture<3, Rpc::Types<3> >;
53 }
54 namespace Rpc {
55 template class Mixture<1>;
56 template class Mixture<2>;
57 template class Mixture<3>;
58 }
59}
Solvers for a mixture of polymer and solvent species.
Definition MixtureTmpl.h:27
Solver and descriptor for a mixture of polymers and solvents.
Solver and descriptor for a mixture of polymers and solvents.
Solver and descriptor for a solvent species.
Periodic fields and crystallography.
Definition complex.cpp:11
Class templates for real-valued periodic fields.
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.