Skip to content

Commit

Permalink
Merge pull request #168 from pbauman/default-filename
Browse files Browse the repository at this point in the history
Setup Default Filenames for Install Tree
  • Loading branch information
pbauman committed Sep 7, 2015
2 parents 057f91c + eda77f3 commit 8cdbb04
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 13 deletions.
8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ AC_SUBST(ANTIOCH_STAMPED_FILES)
# step (see install-data-hook)
# to make it $datadir/antioch_default_files
# then we define the default files
ANTIOCH_DEFAULT_FILES_PATH_TMP=$TOP_SEARCH_DIR/share/antioch_default_files/
AC_DEFINE_UNQUOTED(DEFAULT_FILES_PATH,"$ANTIOCH_DEFAULT_FILES_PATH_TMP",[Path to defaults files])
# Need to make sure to have the `/` at the end
ANTIOCH_DEFAULT_FILES_SOURCE_PATH_TMP=$TOP_SEARCH_DIR/share/antioch_default_files/
ANTIOCH_DEFAULT_FILES_INSTALL_PATH_TMP=$prefix/share/antioch_default_files/

AC_DEFINE_UNQUOTED(DEFAULT_FILES_SOURCE_PATH,"$ANTIOCH_DEFAULT_FILES_SOURCE_PATH_TMP",[Path to defaults files])
AC_DEFINE_UNQUOTED(DEFAULT_FILES_INSTALL_PATH,"$ANTIOCH_DEFAULT_FILES_INSTALL_PATH_TMP",[Path to defaults files])
AC_DEFINE(DEFAULT_SPECIES_LIST,"antioch_default_chemical_species.dat",[Default list of species])
AC_DEFINE(DEFAULT_CHEMICAL_MIXTURE,"antioch_default_chemical_mixture.dat",[Mandatory default informations on species])
AC_DEFINE(DEFAULT_VIBRATIONAL_DATA,"antioch_default_vibrational_data.dat",[Vibrational default data])
Expand Down
95 changes: 84 additions & 11 deletions src/utilities/include/antioch/default_filename.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,65 +38,138 @@
// C++ headers
#include <string>

// Create shim methods Antioch::ant_exp() for exp(), etcetera.

namespace Antioch
{

class DefaultFilename {
//! Default filenames in the source tree
/*! These include the full path to default files in
* in the Antioch *source* tree. If you decide to use
* these in your application, you must *not* delete the
* source tree.
*/
class DefaultSourceFilename {
public:
static const std::string& species_list() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_SPECIES_LIST);
return filename;
}

static const std::string& chemical_mixture() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_CHEMICAL_MIXTURE);
return filename;
}

static const std::string& vibrational_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_VIBRATIONAL_DATA);
return filename;
}

static const std::string& electronic_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_ELECTRONIC_DATA);
return filename;
}

static const std::string& thermo_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_THERMO_DATA);
return filename;
}

static const std::string& sutherland_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_SUTHERLAND_DATA);
return filename;
}

static const std::string& blottner_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_BLOTTNER_DATA);
return filename;
}

static const std::string& transport_mixture() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_SOURCE_PATH) +
std::string(ANTIOCH_DEFAULT_TRANSPORT_DATA);
return filename;
}
};

// Backward Compatibility
typedef DefaultSourceFilename DefaultFilename;


//! Default filenames in the install tree
/*! These include the full path to default files in
* in the Antioch *install* tree. These *must not*
* be used internally in Antioch; these are meant
* *only* for applications.
*/
class DefaultInstallFilename {
public:
static const std::string& species_list() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_SPECIES_LIST);
return filename;
}

static const std::string& chemical_mixture() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_CHEMICAL_MIXTURE);
return filename;
}

static const std::string& vibrational_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_VIBRATIONAL_DATA);
return filename;
}

static const std::string& electronic_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_ELECTRONIC_DATA);
return filename;
}

static const std::string& thermo_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_THERMO_DATA);
return filename;
}

static const std::string& sutherland_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_SUTHERLAND_DATA);
return filename;
}

static const std::string& blottner_data() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_BLOTTNER_DATA);
return filename;
}

static const std::string& transport_mixture() {
static const std::string filename =
std::string(ANTIOCH_DEFAULT_FILES_PATH) +
std::string(ANTIOCH_DEFAULT_FILES_INSTALL_PATH) +
std::string(ANTIOCH_DEFAULT_TRANSPORT_DATA);
return filename;
}
Expand Down

0 comments on commit 8cdbb04

Please sign in to comment.