PSCF v1.4.0
fieldCheck.h
1#ifndef PRDC_FIELD_CHECK_H
2#define PRDC_FIELD_CHECK_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 <pscf/math/IntVec.h> // Template with a default parameter
12
13// Forward class declarations
14namespace Util {
15 template <typename T> class DArray;
16}
17
18namespace Pscf {
19namespace Prdc {
20
21 using namespace Util;
22 using namespace Pscf;
23
31 template <int D, class FT>
32 void allocateFields(DArray<FT>& fields, int n,
33 IntVec<D> const& dimension);
34
56 template <int D, class FT>
57 void checkAllocateField(FT& field, IntVec<D> const& dimensions);
58
82 template <int D, class FT>
84 int nMonomer,
85 IntVec<D> const& dimensions);
86
103 template <int D, class FT>
104 void inspectFields(DArray<FT> const & fields,
105 int & nMonomer,
106 IntVec<D> & dimensions);
107
108 // Arrays of arrays
109
117 template <class AT>
118 void allocateArrays(DArray<AT>& arrays, int n, int capacity);
119
141 template <int D, class AT>
143 int nMonomer,
144 int capacity);
145
158 template <class AT>
159 void inspectArrays(DArray<AT> const & arrays,
160 int & nMonomer,
161 int & capacity);
162
174 template <class OAT, class IAT>
175 void copyArrays(DArray<OAT>& out, DArray<IAT> const& in);
176
177} // namespace Prdc
178} // namespace Pscf
179#include "fieldCheck.tpp"
180#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
Dynamically allocatable contiguous array template.
Definition DArray.h:32
void copyArrays(DArray< OAT > &out, DArray< IAT > const &in)
Copy a DArray of 1D arrays.
void inspectArrays(DArray< AT > const &arrays, int &nMonomer, int &capacity)
Inspect dimensions of a DArray of 1D arrays, each of type AT.
void inspectFields(DArray< FT > const &fields, int &nMonomer, IntVec< D > &dimensions)
Inspect dimensions of a DArray of fields, each of type FT.
void checkAllocateArrays(DArray< AT > &arrays, int nMonomer, int capacity)
Check allocation of a DArray of 1D arrays, allocate if necessary.
void checkAllocateFields(DArray< FT > &fields, int nMonomer, IntVec< D > const &dimensions)
Check allocation of an array of fields, allocate if necessary.
void checkAllocateField(FT &field, IntVec< D > const &dimensions)
Check allocation of a single field, allocate if necessary.
Periodic fields and crystallography.
Definition complex.cpp:11
void allocateArrays(DArray< AT > &arrays, int n, int capacity)
Allocate an array of arrays.
void allocateFields(DArray< FT > &fields, int n, IntVec< D > const &dimension)
Allocate a DArray of fields.
PSCF package top-level namespace.
Utility classes for scientific computation.