Skip to content

Commit

Permalink
fixed some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Hughes committed Nov 1, 2024
1 parent 4e5760c commit 5d3cf15
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 36 deletions.
29 changes: 0 additions & 29 deletions build/make_gitr.sh

This file was deleted.

2 changes: 2 additions & 0 deletions include/background_plasma.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ class temperature_grid_type
query_metadata( full_module_path + ion_temp_data_meta_key, ion_temp_data_key );
query_metadata( full_module_path + electron_temp_data_meta_key, electron_temp_data_key );

std::cout << "Ahoy, Captain!!!" << std::endl;
// query query_raw_input using the keys and values above
netcdf_string_query const query_raw_input( "input/" + raw_input_file_path );
std::cout << "Ahoy, Captain!!!" << std::endl;

int r_grid_size = -1;
int z_grid_size = -1;
Expand Down
8 changes: 4 additions & 4 deletions include/config_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ void libconfig_string_query::operator()( std::string const query_key, T &query_v
{
if( cfg.exists( query_key.c_str() ) == false )
{
//throw invalid_key( query_key );
std::cout << "libconfig could not find" << query_key << std::endl;
throw 0;
std::cout << "libconfig could not find " << query_key << ": "
<< "leaving value at default: " << query_value
<< std::endl;
return;
}

auto const &setting = cfg.getRoot().lookup( query_key );

if( setting.isArray() )
{
/* Captain! */
//throw not_a_scalar( query_key );
throw 0;
}
Expand Down
16 changes: 13 additions & 3 deletions src/gitr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <stdlib.h>
#include <vector>
#include "flags.hpp"
#include <filesystem>

#ifdef __CUDACC__
#include <curand.h>
Expand Down Expand Up @@ -223,6 +224,17 @@ int main(int argc, char **argv, char **envp) {
// std::cout << " Successfully Created " << std::endl;
// }
// }
std::filesystem::path output_path = "output";

if (std::filesystem::create_directories(output_path))
{
std::cout << "Directories created successfully.\n";
}

else
{
std::cout << "Directories already exist.\n";
}

// Background species info
gitr_precision background_Z = 0.0, background_amu = 0.0;
Expand Down Expand Up @@ -1591,9 +1603,6 @@ if( LC_INTERP > 1 )
getVarFromFile(cfg, input_path + lcFile, connLengthCfg, "SString", s);
}

/* Captain! begin */
/* Captain! Create background plasma object here - once this works, commit the result */
class background_plasma background_plasma( query_metadata );
// Background Plasma Temperature Initialization
int nR_Temp = 1;
int nY_Temp = 1;
Expand All @@ -1605,6 +1614,7 @@ if(temp_interp > 0 )
{
#if USE_MPI > 0
if (world_rank == 0) {
class background_plasma background_plasma( query_metadata );
#endif
getVariable(cfg, tempCfg + "fileString", tempFile);
nR_Temp =
Expand Down

0 comments on commit 5d3cf15

Please sign in to comment.