PSCF v1.4.0
SystemAccess.h
1#ifndef R1D_SYSTEM_ACCESS_H
2#define R1D_SYSTEM_ACCESS_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 "System.h" // member
12
13namespace Pscf {
14namespace R1d {
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
103
110
116 System::WField& wField(int monomerId);
117
124
130 System::CField& cField(int monomerId);
131
133
134 private:
135
139 System* systemPtr_;
140
141 };
142
143 // Inline member functions
144
145 /*
146 * Get the parent System object.
147 */
148 inline const System& SystemAccess::system() const
149 {
150 UTIL_ASSERT(systemPtr_);
151 return *systemPtr_;
152 }
153
154 /*
155 * Get the parent System object.
156 */
158 {
159 UTIL_ASSERT(systemPtr_);
160 return *systemPtr_;
161 }
162
163 /*
164 * Get the associated Mixture object.
165 */
166 inline const Mixture& SystemAccess::mixture() const
167 {
168 UTIL_ASSERT(systemPtr_);
169 return systemPtr_->mixture();
170 }
171
172 /*
173 * Get the associated Mixture object.
174 */
176 {
177 UTIL_ASSERT(systemPtr_);
178 return systemPtr_->mixture();
179 }
180
181 /*
182 * Get the spatial Domain.
183 */
184 inline const Domain& SystemAccess::domain() const
185 {
186 UTIL_ASSERT(systemPtr_);
187 return systemPtr_->domain();
188 }
189
190 /*
191 * Get the spatial Domain.
192 */
194 {
195 UTIL_ASSERT(systemPtr_);
196 return systemPtr_->domain();
197 }
198
199 /*
200 * Get the Interaction (excess free energy model).
201 */
203 {
204 UTIL_ASSERT(systemPtr_);
205 return systemPtr_->interaction();
206 }
207
208 /*
209 * Get the Interaction (excess free energy model).
210 */
212 {
213 UTIL_ASSERT(systemPtr_);
214 return systemPtr_->interaction();
215 }
216
217 /*
218 * Get the FileMaster.
219 */
221 {
222 UTIL_ASSERT(systemPtr_);
223 return systemPtr_->fileMaster();
224 }
225
226 /*
227 * Get an array of all monomer excess chemical potential fields.
228 */
229 inline
231 {
232 UTIL_ASSERT(systemPtr_);
233 return systemPtr_->wFields();
234 }
235
236 /*
237 * Get a single monomer excess chemical potential field.
238 */
239 inline
241 {
242 UTIL_ASSERT(systemPtr_);
243 return systemPtr_->wField(id);
244 }
245
246 /*
247 * Get array of all monomer concentration fields.
248 */
249 inline
251 {
252 UTIL_ASSERT(systemPtr_);
253 return systemPtr_->cFields();
254 }
255
256 /*
257 * Get a single monomer concentration field.
258 */
260 {
261 UTIL_ASSERT(systemPtr_);
262 return systemPtr_->cField(id);
263 }
264
265} // namespace R1d
266} // namespace Pscf
267#endif
Interaction model for complex Langevin FTS.
Definition Interaction.h:24
One-dimensional spatial domain and discretization grid.
Solver and descriptor for a mixture of polymers and solvents.
System::WField & wField(int monomerId)
Get chemical potential field for a specific monomer type.
SystemAccess()
Default constructor.
const Domain & domain() const
Get spatial domain (including grid info) by reference.
const Interaction & interaction() const
Get interaction (i.e., excess free energy model) by reference.
DArray< System::CField > & cFields()
Get array of all chemical potential fields.
DArray< System::WField > & wFields()
Get array of all chemical potential fields.
FileMaster & fileMaster()
Get FileMaster by reference.
virtual void setSystem(System &system)
Set the system after construction.
System::CField & cField(int monomerId)
Get chemical potential field for a specific monomer type.
const System & system() const
Get parent System by reference.
const Mixture & mixture() const
Get Mixture by reference.
Main class in SCFT simulation of one system.
DArray< double > CField
Monomer concentration / volume fraction field type.
DArray< double > WField
Monomer chemical potential field type.
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
SCFT with real 1D fields.
PSCF package top-level namespace.