PSCF v1.1
groupFile.cpp
1/*
2* PSCF - Polymer Self-Consistent Field Theory
3*
4* Copyright 2016 - 2022, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "groupFile.h"
9#include <pscf/paths.h>
10#include <util/global.h>
11
12// Macros to generated quoted path to data directory, DAT_DIR
13#define XSTR(s) STR(s)
14#define STR(s) # s
15#define DAT_DIR_STRING XSTR(PSCF_DATA_DIR)
16//#define DAT_DIR_STRING XSTR(DAT_DIR)
17
18namespace Pscf {
19
20 using namespace Util;
21
22 /*
23 * Generates the file name from a group name.
24 */
25 std::string makeGroupFileName(int D, std::string groupName)
26 {
27 std::string filename = DAT_DIR_STRING ;
28 filename += "groups/";
29 if (D==1) {
30 filename += "1/";
31 } else
32 if (D==2) {
33 filename += "2/";
34 } else
35 if (D==3) {
36 filename += "3/";
37 } else {
38 UTIL_THROW("Invalid dimension of space");
39 }
40 filename += groupName;
41 return filename;
42 }
43
44} // namespace Pscf
File containing preprocessor macros for error handling.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Definition: global.h:51
std::string makeGroupFileName(int D, std::string groupName)
Generates the file name from a group name.
Definition: groupFile.cpp:25
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1
File containing absolute paths to data, for use in code and tests.