PSCF v1.1
pspg/field/Domain.h
1#ifndef PSPG_DOMAIN_H
2#define PSPG_DOMAIN_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 <util/param/ParamComposite.h> // base class
12
13#include <pspg/solvers/WaveList.h> // member
14#include <pspg/field/FieldIo.h> // member
15#include <pspg/field/FFT.h> // member
16
17#include <pscf/crystal/Basis.h> // member
18#include <pscf/crystal/SpaceGroup.h> // member
19#include <pscf/mesh/Mesh.h> // member
20#include <pscf/crystal/UnitCell.h> // member
21
22#include <string>
23
24namespace Pscf {
25namespace Pspg
26{
27
28 using namespace Util;
29
47 template <int D>
48 class Domain : public ParamComposite
49 {
50
51 public:
52
54
55
59 Domain();
60
64 ~Domain();
65
71 void setFileMaster(FileMaster& fileMaster);
72
80 virtual void readParameters(std::istream& in);
81
91 void readRGridFieldHeader(std::istream& in, int& nMonomer);
92
100 void setUnitCell(UnitCell<D> const & unitCell);
101
111 FSArray<double, 6> const & parameters);
112
121 void setUnitCell(FSArray<double, 6> const & parameters);
122
126 void makeBasis();
127
129
131
136
140 UnitCell<D> const & unitCell() const;
141
145 Mesh<D>& mesh();
146
150 Mesh<D> const & mesh() const;
151
155 SpaceGroup<D> const & group() const;
156
160 Basis<D>& basis();
161
165 Basis<D> const & basis() const ;
166
170 FFT<D>& fft();
171
175 FFT<D> const & fft() const;
176
181
185 WaveList<D> const & waveList() const;
186
191
195 FieldIo<D> const & fieldIo() const;
196
200 typename UnitCell<D>::LatticeSystem lattice() const;
201
205 std::string groupName() const;
206
208
209 private:
210
211 // Private member variables
212
216 UnitCell<D> unitCell_;
217
221 Mesh<D> mesh_;
222
226 SpaceGroup<D> group_;
227
231 Basis<D> basis_;
232
236 FFT<D> fft_;
237
241 WaveList<D> waveList_;
242
246 FieldIo<D> fieldIo_;
247
251 typename UnitCell<D>::LatticeSystem lattice_;
252
256 std::string groupName_;
257
261 bool hasFileMaster_;
262
266 bool isInitialized_;
267
268 };
269
270 // Inline member functions
271
272 // Get the UnitCell<D> object by non-const reference.
273 template <int D>
275 { return unitCell_; }
276
277 // Get the UnitCell<D> object by const reference.
278 template <int D>
279 inline UnitCell<D> const & Domain<D>::unitCell() const
280 { return unitCell_; }
281
282 // Get the Mesh<D> object by reference.
283 template <int D>
285 { return mesh_; }
286
287 // Get the Mesh<D> object by const reference.
288 template <int D>
289 inline Mesh<D> const & Domain<D>::mesh() const
290 { return mesh_; }
291
292 // Get the SpaceGroup<D> object by const reference.
293 template <int D>
294 inline SpaceGroup<D> const & Domain<D>::group() const
295 { return group_; }
296
297 // Get the Basis<D> object by non-const reference.
298 template <int D>
300 { return basis_; }
301
302 // Get the Basis<D> object by const reference.
303 template <int D>
304 inline Basis<D> const & Domain<D>::basis() const
305 { return basis_; }
306
307 // Get the FFT<D> object.
308 template <int D>
310 { return fft_; }
311
312 // Get the FFT<D> object by const reference.
313 template <int D>
314 inline FFT<D> const & Domain<D>::fft() const
315 { return fft_; }
316
317 // Get the WaveList<D> object.
318 template <int D>
320 { return waveList_; }
321
322 // Get the WaveList<D> object by const reference.
323 template <int D>
324 inline WaveList<D> const & Domain<D>::waveList() const
325 { return waveList_; }
326
327 // Get the FieldIo<D> object.
328 template <int D>
330 { return fieldIo_; }
331
332 // Get the FieldIo<D> object by const reference.
333 template <int D>
334 inline FieldIo<D> const & Domain<D>::fieldIo() const
335 { return fieldIo_; }
336
337 // Get the lattice system enumeration value.
338 template <int D>
339 inline
341 { return lattice_; }
342
343 // Get the groupName string.
344 template <int D>
345 inline std::string Domain<D>::groupName() const
346 { return groupName_; }
347
348 #ifndef PSPG_DOMAIN_TPP
349 // Suppress implicit instantiation
350 extern template class Domain<1>;
351 extern template class Domain<2>;
352 extern template class Domain<3>;
353 #endif
354
355} // namespace Pspg
356} // namespace Pscf
357#endif
Symmetry-adapted Fourier basis for pseudo-spectral scft.
Definition: Basis.h:346
Description of a regular grid of points in a periodic domain.
Definition: Mesh.h:61
Spatial domain and spatial discretization for a periodic structure.
FFT< D > & fft()
Get the FFT object by reference.
void setUnitCell(UnitCell< D > const &unitCell)
Set the unit cell, given a UnitCell<D> object.
FieldIo< D > & fieldIo()
Get associated FieldIo object.
void readRGridFieldHeader(std::istream &in, int &nMonomer)
Read initialization data from header of an r-grid field file.
UnitCell< D >::LatticeSystem lattice() const
Get the lattice system (enumeration value).
std::string groupName() const
Get group name.
SpaceGroup< D > const & group() const
Get the SpaceGroup object by const reference.
UnitCell< D > & unitCell()
Get UnitCell by reference.
WaveList< D > & waveList()
Get the WaveList object by reference.
Mesh< D > & mesh()
Get the spatial Mesh by reference.
void setFileMaster(FileMaster &fileMaster)
Create association with a FileMaster, needed by FieldIo.
Basis< D > & basis()
Get the Basis by reference.
void makeBasis()
Construct basis if not done already.
virtual void readParameters(std::istream &in)
Read body of parameter block (without opening and closing lines).
Fourier transform wrapper for real data.
File input/output operations for fields in several file formats.
Container for wavevector data.
Definition: WaveList.h:31
Crystallographic space group.
Definition: SpaceGroup.h:30
Base template for UnitCell<D> classes, D=1, 2 or 3.
Definition: UnitCell.h:44
A fixed capacity (static) contiguous array with a variable logical size.
Definition: FSArray.h:38
A FileMaster manages input and output files for a simulation.
Definition: FileMaster.h:143
An object that can read multiple parameters from file.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1