diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000000..e5286dd1b9c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,31 @@ +{ + "configurations": [ + { + "name": "C/C++: g++ build and debug active file", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "C/C++: g++ build active file", + "miDebuggerPath": "gdb" + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 0db587396d5..5d05b84366f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "cmake.configureOnOpen": true + "cmake.configureOnOpen": true, + "C_Cpp.default.compilerPath": "/gpfs/software/gcc/11.2.0/bin/g++" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000000..c756f64f81a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: g++ build active file", + "command": "/gpfs/software/gcc/11.2.0/bin/g++", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "detail": "Task generated by Debugger." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/src/apps/molresponse/FrequencyResponse.cpp b/src/apps/molresponse/FrequencyResponse.cpp index c98ed72b56b..59ac88963da 100644 --- a/src/apps/molresponse/FrequencyResponse.cpp +++ b/src/apps/molresponse/FrequencyResponse.cpp @@ -607,37 +607,14 @@ std::pair, std::vector> QuadraticResponse::compute_b auto dipole_vectors = create_dipole(); // x y z truncate(world, dipole_vectors, true); - std::vector indices_A; - std::vector indices_BC; - - if (BC_left.num_states() == 4) - { - indices_A = {0, 0, 0, 1, 1, 1, 2, 2, 2, 0}; - indices_BC = {0, 1, 2, 0, 1, 2, 0, 1, 2, 3}; - } - else if (BC_left.num_states() == 6) - { - indices_A = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2}; - indices_BC = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5}; - } - else - { - indices_A = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - indices_BC = {0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8}; - } - - int num_elements = indices_A.size(); - + int num_elements = XA.num_states()* BC_left.num_states(); std::vector beta_indices(num_elements); - - Tensor beta(num_elements); - for (int i = 0; i < num_elements; i++) - { - auto a = indices_A[i]; - auto bc = indices_BC[i]; + int i=0; + for(int a =0; a, std::vector> QuadraticResponse::compute_b world.gop.fence(); beta[i] = one.trace() + two.trace() + three.trace() + four.trace() + five.trace() + six.trace(); beta_indices[i] = xyz[a] + bc_directions[bc]; + i++; + world.gop.fence(); + } + } + + for (int i = 0; i < num_elements; i++) + { if (world.rank() == 0 and r_params.print_level() >= 1) { - print("beta[", beta_indices[i], "] = ", beta[i]); + print("i = ",i," beta[", beta_indices[i], "] = ", beta[i]); } } world.gop.fence(); diff --git a/src/apps/molresponse/FrequencyResponse.hpp b/src/apps/molresponse/FrequencyResponse.hpp index c1300c1a50a..822b3303c03 100644 --- a/src/apps/molresponse/FrequencyResponse.hpp +++ b/src/apps/molresponse/FrequencyResponse.hpp @@ -248,7 +248,7 @@ class QuadraticResponse : public ResponseBase std::vector index_B; std::vector index_C; std::vector bc_directions; - std::vector a{"X", "Y", "Z"}; + std::vector a_directions{"X", "Y", "Z"}; bool indicies_set; std::map xyz = {{0, "X"}, {1, "Y"}, {2, "Z"}};