diff --git a/cppflow-patch/LCLIN/PATCH_LCLIN_DNN_HostGuest_Energy_Functions.h.txt b/cppflow-patch/LCLIN/PATCH_LCLIN_DNN_HostGuest_Energy_Functions.h.txt index 66f5494..55f2e11 100644 --- a/cppflow-patch/LCLIN/PATCH_LCLIN_DNN_HostGuest_Energy_Functions.h.txt +++ b/cppflow-patch/LCLIN/PATCH_LCLIN_DNN_HostGuest_Energy_Functions.h.txt @@ -14,6 +14,9 @@ PATCH_LCLIN_DELETION } PATCH_LCLIN_SINGLE + bool Do_New = true; bool Do_Old = true; + if(MoveType == SINGLE_INSERTION) Do_Old = false; + if(MoveType == SINGLE_DELETION) Do_New = false; if(SystemComponents.UseLCLin) { if(Do_New) DNN_New = Predict_From_FeatureMatrix_Move(Sims, SystemComponents, NEW); diff --git a/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt b/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt index e16a3e6..6e61c0e 100644 --- a/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt +++ b/libtorch-patch/Allegro/PATCH_ALLEGRO_DNN_HostGuest_Energy_Functions.h.txt @@ -43,6 +43,9 @@ PATCH_ALLEGRO_DELETION } PATCH_ALLEGRO_SINGLE + bool Do_New = true; bool Do_Old = true; + if(MoveType == SINGLE_INSERTION) Do_Old = false; + if(MoveType == SINGLE_DELETION) Do_New = false; if(SystemComponents.UseAllegro) { bool Initialize = false; diff --git a/src_clean/DNN_HostGuest_Energy_Functions.h b/src_clean/DNN_HostGuest_Energy_Functions.h index 7d92a1f..f482832 100644 --- a/src_clean/DNN_HostGuest_Energy_Functions.h +++ b/src_clean/DNN_HostGuest_Energy_Functions.h @@ -173,15 +173,13 @@ double DNN_Prediction_Move(Components& SystemComponents, Simulations& Sims, size } case TRANSLATION: case ROTATION: case SINGLE_INSERTION: case SINGLE_DELETION: { - bool Do_New = true; bool Do_Old = true; - if(MoveType == SINGLE_INSERTION) Do_Old = false; - if(MoveType == SINGLE_DELETION) Do_New = false; double DNN_New = 0.0; double DNN_Old = 0.0; //###PATCH_ALLEGRO_SINGLE###// //###PATCH_LCLIN_SINGLE###// return DNN_New - DNN_Old; } } + return 0.0; } double DNN_Prediction_Reinsertion(Components& SystemComponents, Simulations& Sims, size_t SelectedComponent, double3* temp) diff --git a/src_clean/axpy.cu b/src_clean/axpy.cu index 881e930..3e1e131 100644 --- a/src_clean/axpy.cu +++ b/src_clean/axpy.cu @@ -72,7 +72,6 @@ inline void RunMoves(int Cycle, Components& SystemComponents, Simulations& Sims, throw std::runtime_error("There is negative number of adsorbates. Break program!"); size_t comp = 0; // When selecting components, skip the component 0 (because it is the framework) - size_t SelectedMolecule = 0; size_t SelectedMolInComponent = 0; size_t NumberOfImmobileFrameworkMolecules = 0; size_t ImmobileFrameworkSpecies = 0; diff --git a/src_clean/main.cpp b/src_clean/main.cpp index 9f82c0e..929b442 100644 --- a/src_clean/main.cpp +++ b/src_clean/main.cpp @@ -17,7 +17,7 @@ #include "fxn_main.h" #include -// // // // // // // #include +// // // // // // // // // // #include void printMemoryUsage() { @@ -327,7 +327,6 @@ int main(void) //////////////// // RUN CYCLES // //////////////// - bool RunSerialSimulations = true; double start = omp_get_wtime(); /////////////////////////// diff --git a/src_clean/mc_box.h b/src_clean/mc_box.h index bbece89..e5338b1 100644 --- a/src_clean/mc_box.h +++ b/src_clean/mc_box.h @@ -220,8 +220,7 @@ void NVTGibbsMove(std::vector& SystemComponents, Simulations*& Sims, ////////////////////// // TOTAL VDW + REAL // ////////////////////// - size_t Host_threads = 0; //In this move, there should be NO Framework Atom (Framework (component 0) should be an empty box)// - bool UseOffset = true; + bool UseOffset = true; NewE[sim] = Total_VDW_Coulomb_Energy(Sims[sim], SystemComponents[sim], FF, UseOffset); //Check for Overlaps// cudaMemcpy(SystemComponents[sim].flag, Sims[sim].device_flag, sizeof(bool), cudaMemcpyDeviceToHost); diff --git a/src_clean/mc_cbcfc.h b/src_clean/mc_cbcfc.h index cc31497..8598cc3 100644 --- a/src_clean/mc_cbcfc.h +++ b/src_clean/mc_cbcfc.h @@ -219,7 +219,6 @@ static inline MoveEnergy CBCFMove(Components& SystemComponents, Simulations& Sim double NMol = SystemComponents.NumberOfMolecule_for_Component[SelectedComponent]; if(SystemComponents.hasfractionalMolecule[SelectedComponent]) NMol--; - int MoveType; double TMMCPacc = 0.0; SystemComponents.Moves[SelectedComponent].CBCFTotal ++; @@ -262,8 +261,6 @@ static inline MoveEnergy CBCFMove(Components& SystemComponents, Simulations& Sim ////////////////// if(SelectednewBin > static_cast(nbin)) { - MoveType = CBCF_INSERTION; - //return 0.0; SystemComponents.Moves[SelectedComponent].CBCFInsertionTotal ++; int newBin = SelectednewBin - static_cast(nbin); //printf("INSERTION, newBin: %zu\n", newBin); @@ -338,7 +335,6 @@ static inline MoveEnergy CBCFMove(Components& SystemComponents, Simulations& Sim } else if(SelectednewBin < 0) //Deletion Move// { - MoveType = CBCF_DELETION; //return 0.0; //for debugging SystemComponents.Moves[SelectedComponent].CBCFDeletionTotal ++; int newBin = SelectednewBin + nbin; //printf("DELETION, newBin: %zu\n", newBin); @@ -424,7 +420,6 @@ static inline MoveEnergy CBCFMove(Components& SystemComponents, Simulations& Sim } else //Lambda Move// { - MoveType = CBCF_LAMBDACHANGE; SystemComponents.Moves[SelectedComponent].CBCFLambdaTotal ++; int newBin = static_cast(SelectednewBin); //printf("LAMBDACHANGE, newBin: %zu\n", newBin); double newLambda = delta * static_cast(newBin); diff --git a/src_clean/mc_swap_moves.h b/src_clean/mc_swap_moves.h index 36031b8..da4b091 100644 --- a/src_clean/mc_swap_moves.h +++ b/src_clean/mc_swap_moves.h @@ -296,7 +296,6 @@ static inline MoveEnergy Deletion(Components& SystemComponents, Simulations& Sim MoveEnergy energy; double Rosenbluth = 0.0; size_t UpdateLocation = 0; - int CBMCType = CBMC_DELETION; //Deletion// double2 Scale = SystemComponents.Lambda[SelectedComponent].SET_SCALE(1.0); //Set scale for full molecule (lambda = 1.0), Zhao's note: This is not used in deletion, just set to 1// //Wrapper for the deletion move// energy = Deletion_Body(SystemComponents, Sims, FF, Random, Widom, SelectedMolInComponent, SelectedComponent, UpdateLocation, Rosenbluth, SuccessConstruction, preFactor, Scale); diff --git a/src_clean/print_statistics.cuh b/src_clean/print_statistics.cuh index 1f8173e..a0ec782 100644 --- a/src_clean/print_statistics.cuh +++ b/src_clean/print_statistics.cuh @@ -501,7 +501,6 @@ static inline void Print_HeatOfAdsorption(Components& SystemComponents, int Cycl static inline void Print_Averages(Components& SystemComponents, int Cycles, int Blocksize, Simulations& Sims, Units& Constants) { printf("============= BLOCK AVERAGES (HEAT OF ADSORPTION: kJ/mol) =========\n"); - size_t NumberOfAdsorbateComponent = SystemComponents.NComponents.x - SystemComponents.NComponents.y; Print_HeatOfAdsorption(SystemComponents, Cycles, Blocksize, SystemComponents.Nblock, Constants); printf("==============================================================\n"); diff --git a/src_clean/read_data.cpp b/src_clean/read_data.cpp index 6d1b91e..312ebd1 100644 --- a/src_clean/read_data.cpp +++ b/src_clean/read_data.cpp @@ -2657,14 +2657,14 @@ void RestartFileParser(Boxsize& Box, Components& SystemComponents) size_t PreviousCompNMol = 0; for(size_t i = SystemComponents.NComponents.y; i < SystemComponents.NComponents.x; i++) { - size_t start = 0; size_t end = 0; + size_t start = 0; while (std::getline(file, str)) { //find range of the part we need to read// if (str.find("Components " + std::to_string(i - SystemComponents.NComponents.y), 0) != std::string::npos) start = counter; if (str.find("Maximum-rotation-change component " + std::to_string(i - SystemComponents.NComponents.y), 0) != std::string::npos) - { end = counter; break; } + { break; } } file.clear(); file.seekg(0); @@ -2727,7 +2727,7 @@ void RestartFileParser(Boxsize& Box, Components& SystemComponents) file.clear(); file.seekg(0); //Start reading atom positions and other information// - start = 0; end = 0; counter = 0; + start = 0; counter = 0; while (std::getline(file, str)) { if (str.find("Component: " + std::to_string(i - SystemComponents.NComponents.y), 0) != std::string::npos)