From c4b18cffb461b4806b6774e7536cbeed4e4836f5 Mon Sep 17 00:00:00 2001 From: Logan Drescher <106617880+CodeByDrescher@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:31:16 -0500 Subject: [PATCH] Post-Development Cleanup --- Stochastic/Tests/statstest.cpp | 8 +++----- Stochastic/VCellStoch/src/Gibson.cpp | 1 - VCell/include/VCELL/PostProcessingHdf5Writer.h | 1 - VCell/src/PostProcessingHdf5Writer.cpp | 14 ++------------ VCellMessaging/include/VCELL/SimulationMessaging.h | 1 - VCellMessaging/src/SimulationMessaging.cpp | 12 ++++-------- smoldyn-2.38/CMakeLists.txt | 4 ---- 7 files changed, 9 insertions(+), 32 deletions(-) diff --git a/Stochastic/Tests/statstest.cpp b/Stochastic/Tests/statstest.cpp index 321930ab..927de311 100644 --- a/Stochastic/Tests/statstest.cpp +++ b/Stochastic/Tests/statstest.cpp @@ -7,8 +7,6 @@ #include #include -#include "VCELL/SimulationMessaging.h" - const char* input_file_contents = R"INPUT_FILE( STARTING_TIME 0.0 @@ -103,13 +101,13 @@ TEST(statstest,test1) { std::string outputFileName = std::tmpnam(nullptr); std::map results; std::fstream inputFileStream; - inputFileStream.open(inputFileName, fstream::out); + inputFileStream.open(inputFileName, std::fstream::out); if (inputFileStream.fail()) { std::perror(("File <" + inputFileName + "> could not be created.").c_str()); ASSERT_FALSE(inputFileStream.fail()); } std::fstream outputFileStream; - outputFileStream.open(outputFileName, fstream::out); + outputFileStream.open(outputFileName, std::fstream::out); if (outputFileStream.fail()) { std::perror(("File <" + inputFileName + "> could not be created.").c_str()); ASSERT_FALSE(outputFileStream.fail()); @@ -127,7 +125,7 @@ TEST(statstest,test1) { gb->march(); // Verify file contents - outputFileStream.open(outputFileName, fstream::in); + outputFileStream.open(outputFileName, std::fstream::in); std::string line; std::getline(outputFileStream, line); // remove header line for (int i = 0; !outputFileStream.eof(); i++) { diff --git a/Stochastic/VCellStoch/src/Gibson.cpp b/Stochastic/VCellStoch/src/Gibson.cpp index 1461c119..dbcce028 100644 --- a/Stochastic/VCellStoch/src/Gibson.cpp +++ b/Stochastic/VCellStoch/src/Gibson.cpp @@ -15,7 +15,6 @@ #include #include #include -using namespace std; #include #include "../include/IndexedTree.h" diff --git a/VCell/include/VCELL/PostProcessingHdf5Writer.h b/VCell/include/VCELL/PostProcessingHdf5Writer.h index cecaecd0..5ef0418c 100644 --- a/VCell/include/VCELL/PostProcessingHdf5Writer.h +++ b/VCell/include/VCELL/PostProcessingHdf5Writer.h @@ -20,7 +20,6 @@ namespace H5 { class PostProcessingHdf5Writer { public: - PostProcessingHdf5Writer(char* fileName, PostProcessingBlock* postProcessingBlock); PostProcessingHdf5Writer(std::string fileName, PostProcessingBlock* postProcessingBlock); virtual ~PostProcessingHdf5Writer(); diff --git a/VCell/src/PostProcessingHdf5Writer.cpp b/VCell/src/PostProcessingHdf5Writer.cpp index a51823fc..73d9a9a8 100644 --- a/VCell/src/PostProcessingHdf5Writer.cpp +++ b/VCell/src/PostProcessingHdf5Writer.cpp @@ -11,9 +11,6 @@ #include #include #include -#include -using std::cout; -using std::endl; #include #define POST_PROCESSING_ROOT "/PostProcessing" @@ -21,13 +18,6 @@ using std::endl; const char* PostProcessingHdf5Writer::PPGroupName = POST_PROCESSING_ROOT; const char* PostProcessingHdf5Writer::TimesDataSetName = POST_PROCESSING_ROOT"/Times"; -PostProcessingHdf5Writer::PostProcessingHdf5Writer(char* fileName, PostProcessingBlock* ppb) { - this->h5PPFileName = fileName; - this->postProcessingBlock = ppb; - h5PPFile = NULL; - timesDataSet = NULL; -} - PostProcessingHdf5Writer::PostProcessingHdf5Writer(std::string fileName, PostProcessingBlock* ppb) { this->h5PPFileName = std::move(fileName); this->postProcessingBlock = ppb; @@ -75,7 +65,7 @@ bool PostProcessingHdf5Writer::loadFinal(int numTimes) { // the max time in log file is numTimes // hdf5 is missing times if (timesDim < numTimes) { - cout << "post processing hdf5 times don't match" << endl; + std::cout << "post processing hdf5 times don't match" << std::endl; return false; } double* times = new double[int(timesDim)]; @@ -109,7 +99,7 @@ bool PostProcessingHdf5Writer::loadFinal(int numTimes) { } hdf5Copy.close(); } catch(H5::Exception error ) { - cout << "failed to reload post processing block: " << error.getDetailMsg() << endl; + std::cout << "failed to reload post processing block: " << error.getDetailMsg() << std::endl; // recreate the file later } diff --git a/VCellMessaging/include/VCELL/SimulationMessaging.h b/VCellMessaging/include/VCELL/SimulationMessaging.h index de8018ef..32c68897 100644 --- a/VCellMessaging/include/VCELL/SimulationMessaging.h +++ b/VCellMessaging/include/VCELL/SimulationMessaging.h @@ -10,7 +10,6 @@ #endif #include -using namespace std; #if (defined(WIN32) || defined(WIN64) ) #include diff --git a/VCellMessaging/src/SimulationMessaging.cpp b/VCellMessaging/src/SimulationMessaging.cpp index 938c467e..348293e6 100644 --- a/VCellMessaging/src/SimulationMessaging.cpp +++ b/VCellMessaging/src/SimulationMessaging.cpp @@ -1,13 +1,9 @@ #include -#include #include #include #include -using std::cerr; -using std::cout; -using std::endl; -#include +#include #ifdef USE_MESSAGING #if ( !defined(WIN32) && !defined(WIN64) ) // UNIX #include @@ -173,13 +169,13 @@ void SimulationMessaging::sendStatus() { fflush(stdout); break; case JOB_STARTING: - cout<< workerEvent->eventMessage << endl; + std::cout<< workerEvent->eventMessage << std::endl; break; case JOB_COMPLETED: - cerr << "Simulation Complete in Main() ... " << endl; + std::cerr << "Simulation Complete in Main() ... " << std::endl; break; case JOB_FAILURE: - cerr << workerEvent->eventMessage << endl; + std::cerr << workerEvent->eventMessage << std::endl; break; } return; diff --git a/smoldyn-2.38/CMakeLists.txt b/smoldyn-2.38/CMakeLists.txt index 18254876..e4fd33ff 100644 --- a/smoldyn-2.38/CMakeLists.txt +++ b/smoldyn-2.38/CMakeLists.txt @@ -119,10 +119,6 @@ set_source_files_properties(${MAIN_FILES} PROPERTIES LANGUAGE CXX ) include_directories(source/lib source/Smoldyn source/NextSubVolume source/vtk ${CMAKE_CURRENT_BINARY_DIR}) -# The following command is to signal we need to link "szip", which hdf5 uses. We should look into -# how to disable this, or at least control it via an option. -# add_link_options("${CMAKE_LINK_LIBRARY_FLAG}sz") - ####### Build for debugging or release ########## if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")