PSCF v1.1
SystemAccess.h
1#ifndef FD1D_SYSTEM_ACCESS_H
2#define FD1D_SYSTEM_ACCESS_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "System.h" // member
12
13namespace Pscf {
14namespace Fd1d {
15
16 using namespace Util;
17
28 {
29
30 public:
31
36
41
46
50 virtual void setSystem(System& system);
51
54
58 const System& system() const;
59
63 System& system();
64
68 const Mixture& mixture() const;
69
74
78 const Domain& domain() const;
79
83 Domain& domain();
84
88 const Interaction& interaction() const;
89
94
99
104
109
113
120
126 System::WField& wField(int monomerId);
127
134
140 System::CField& cField(int monomerId);
141
143
144 private:
145
149 System* systemPtr_;
150
151 };
152
153 // Inline member functions
154
155 /*
156 * Get the parent System object.
157 */
158 inline const System& SystemAccess::system() const
159 {
160 UTIL_ASSERT(systemPtr_);
161 return *systemPtr_;
162 }
163
164 /*
165 * Get the parent System object.
166 */
168 {
169 UTIL_ASSERT(systemPtr_);
170 return *systemPtr_;
171 }
172
173 /*
174 * Get the associated Mixture object.
175 */
176 inline const Mixture& SystemAccess::mixture() const
177 {
178 UTIL_ASSERT(systemPtr_);
179 return systemPtr_->mixture();
180 }
181
182 /*
183 * Get the associated Mixture object.
184 */
186 {
187 UTIL_ASSERT(systemPtr_);
188 return systemPtr_->mixture();
189 }
190
191 /*
192 * Get the spatial Domain.
193 */
194 inline const Domain& SystemAccess::domain() const
195 {
196 UTIL_ASSERT(systemPtr_);
197 return systemPtr_->domain();
198 }
199
200 /*
201 * Get the spatial Domain.
202 */
204 {
205 UTIL_ASSERT(systemPtr_);
206 return systemPtr_->domain();
207 }
208
209 /*
210 * Get the Interaction (excess free energy model).
211 */
213 {
214 UTIL_ASSERT(systemPtr_);
215 return systemPtr_->interaction();
216 }
217
218 /*
219 * Get the Interaction (excess free energy model).
220 */
222 {
223 UTIL_ASSERT(systemPtr_);
224 return systemPtr_->interaction();
225 }
226
227 /*
228 * Get the FileMaster.
229 */
231 {
232 UTIL_ASSERT(systemPtr_);
233 return systemPtr_->fileMaster();
234 }
235
236 /*
237 * Get the Homogeneous::Mixture object.
238 */
239 inline
241 {
242 UTIL_ASSERT(systemPtr_);
243 return systemPtr_->homogeneous();
244 }
245
246 /*
247 * Get an array of all monomer excess chemical potential fields.
248 */
249 inline
251 {
252 UTIL_ASSERT(systemPtr_);
253 return systemPtr_->wFields();
254 }
255
256 /*
257 * Get a single monomer excess chemical potential field.
258 */
259 inline
261 {
262 UTIL_ASSERT(systemPtr_);
263 return systemPtr_->wField(id);
264 }
265
266 /*
267 * Get array of all monomer concentration fields.
268 */
269 inline
271 {
272 UTIL_ASSERT(systemPtr_);
273 return systemPtr_->cFields();
274 }
275
276 /*
277 * Get a single monomer concentration field.
278 */
280 {
281 UTIL_ASSERT(systemPtr_);
282 return systemPtr_->cField(id);
283 }
284
285} // namespace Fd1d
286} // namespace Pscf
287#endif
One-dimensional spatial domain and discretization grid.
Mixture of polymers and solvents.
Concise accesss to an associated System.
Definition: SystemAccess.h:28
System::CField & cField(int monomerId)
Get chemical potential field for a specific monomer type.
Definition: SystemAccess.h:279
DArray< System::CField > & cFields()
Get array of all chemical potential fields.
Definition: SystemAccess.h:270
System::WField & wField(int monomerId)
Get chemical potential field for a specific monomer type.
Definition: SystemAccess.h:260
const Interaction & interaction() const
Get interaction (i.e., excess free energy model) by reference.
Definition: SystemAccess.h:212
const Domain & domain() const
Get spatial domain (including grid info) by reference.
Definition: SystemAccess.h:194
const System & system() const
Get parent System by reference.
Definition: SystemAccess.h:158
const Mixture & mixture() const
Get Mixture by reference.
Definition: SystemAccess.h:176
virtual void setSystem(System &system)
Set the system after construction.
FileMaster & fileMaster()
Get FileMaster by reference.
Definition: SystemAccess.h:230
DArray< System::WField > & wFields()
Get array of all chemical potential fields.
Definition: SystemAccess.h:250
const Homogeneous::Mixture & homogeneous() const
Get homogeneous mixture (for reference calculations).
SystemAccess()
Default constructor.
Main class in SCFT simulation of one system.
Definition: fd1d/System.h:63
WField & wField(int monomerId)
Get chemical potential field for a specific monomer type.
Definition: fd1d/System.h:603
DArray< WField > & wFields()
Get array of all chemical potential fields.
Definition: fd1d/System.h:596
Homogeneous::Mixture & homogeneous()
Get homogeneous mixture (for reference calculations).
Definition: fd1d/System.h:574
Domain & domain()
Get spatial domain (including grid info) by reference.
Definition: fd1d/System.h:567
Mixture & mixture()
Get Mixture by reference.
Definition: fd1d/System.h:537
DArray< CField > & cFields()
Get array of all chemical potential fields.
Definition: fd1d/System.h:610
Interaction & interaction()
Get interaction (i.e., excess free energy) by reference.
Definition: fd1d/System.h:549
CField & cField(int monomerId)
Get chemical potential field for a specific monomer type.
Definition: fd1d/System.h:616
FileMaster & fileMaster()
Get FileMaster by reference.
Definition: fd1d/System.h:589
A spatially homogeneous mixture.
Flory-Huggins excess free energy model.
Definition: Interaction.h:26
Dynamically allocatable contiguous array template.
Definition: DArray.h:32
A FileMaster manages input and output files for a simulation.
Definition: FileMaster.h:143
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Definition: global.h:75
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1