1#ifndef PRDC_FILM_FIELD_GEN_EXT_BASE_TPP
2#define PRDC_FILM_FIELD_GEN_EXT_BASE_TPP
11#include "FilmFieldGenExtBase.h"
12#include <prdc/crystal/SpaceGroup.h>
13#include <pscf/sweep/ParameterType.h>
14#include <util/param/ParamComponent.h>
15#include <util/containers/GArray.h>
29 interfaceThickness_(-1.0),
30 excludedThickness_(-1.0)
52 read(in,
"normalVecId", normalVecId_);
53 read(in,
"interfaceThickness", interfaceThickness_);
54 read(in,
"excludedThickness", excludedThickness_);
64 if (normalVecId_ > D || normalVecId_ < 0) {
65 UTIL_THROW(
"bad value for normalVecId, must be in [0,D)");
67 if (interfaceThickness_ > excludedThickness_) {
68 UTIL_THROW(
"excludedThickness must be larger than interfaceThickness");
70 if ((excludedThickness_ <= 0) || (interfaceThickness_ <= 0)) {
71 UTIL_THROW(
"excludedThickness and interfaceThickness must be >0");
76 chiBottom_.allocate(nm);
100 for (
int i = 0; i < chiBottom_.capacity(); i++) {
137 readGroup(groupName, group);
140 std::string msg =
"Space group contains forbidden symmetry operations";
141 for (
int i = 0; i < group.
size(); i++) {
142 for (
int j = 0; j < D; j++) {
143 int r = group[i].R(normalVecId_,j);
144 if (j == normalVecId_) {
154 if (group[i].t(normalVecId_) != 0) {
173 for (
int i = 0; i < nm; i++) {
174 if (fabs(chiBottom_[i]-chiTop_[i]) > 1e-7) {
194 for (
int i = 0; i < nm; i++) {
195 if ((fabs(chiBottom_[i]) >= 1e-7) || (fabs(chiTop_[i]) >= 1e-7)) {
225 if (name ==
"chi_top") {
226 chiTop_[ids[0]] = value;
227 }
else if (name ==
"chi_bottom") {
228 chiBottom_[ids[0]] = value;
244 if (name ==
"chi_top") {
245 return chiTop_[ids[0]];
246 }
else if (name ==
"chi_bottom") {
247 return chiBottom_[ids[0]];
Type type_
Type of field (Mask, External, or None).
bool isDependent_
Is this object dependent on parameters of another FieldGeneratorBase?
FieldGenerator()
Constructor.
~FilmFieldGenExtBase()
Destructor.
DArray< double > chiTopCurrent_
The chiTop array used to generate the current external fields.
DArray< double > chiBottomCurrent_
The chiBottom array used to generate the current external fields.
double getParameter(std::string name, DArray< int > ids, bool &success) const
Get the value of a specialized sweep parameter.
virtual int systemNMonomer() const =0
Get the number of monomer species for this system.
bool isAthermal() const
Are the walls athermal?
void setParameter(std::string name, DArray< int > ids, double value, bool &success)
Set the value of a specialized sweep parameter.
void checkCompatibility()
Check that the system is compatible with these fields.
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
bool needsUpdate() const
Check whether system has changed such that the fields need updating.
virtual std::string systemSpaceGroup() const =0
Get the space group name for this system.
virtual RealVec< D > systemLatticeVector(int id) const =0
Get one of the lattice vectors for this system.
GArray< ParameterType > getParameterTypes()
Return specialized sweep parameter types to add to the Sweep object.
FilmFieldGenExtBase()
Constructor.
void readParameters(std::istream &in)
Read parameters and initialize.
bool hasSymmetricWalls() const
Are the walls chemically identical?
Crystallographic space group.
int size() const
Return number of elements in group (i.e., the order of the group).
Dynamically allocatable contiguous array template.
An automatically growable array, analogous to a std::vector.
void append(Data const &data)
Append an element to the end of the sequence.
static bool echo()
Get echo parameter.
static void setEcho(bool echo=true)
Enable or disable echoing for all subclasses of ParamComponent.
DArrayParam< Type > & readDArray(std::istream &in, const char *label, DArray< Type > &array, int n)
Add and read a required DArray < Type > parameter.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
void resetParam()
Resets ParamComposite to its empty state.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Periodic fields and crystallography.
PSCF package top-level namespace.
Declaration of a specialized sweep parameter type.