Skip to content
Snippets Groups Projects
Commit b089ba68 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Resize the dielectric constant matrix.

parent 949a1e60
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,6 @@ int main(int argc, char **argv) { ...@@ -46,7 +46,6 @@ int main(int argc, char **argv) {
double *xiv, *wns, *wls, *pus, *evs, *vss; double *xiv, *wns, *wls, *pus, *evs, *vss;
string vns[5]; string vns[5];
int max_nsh = 0; // A helper variable to set the size of dc0m
int ici; int ici;
// Input file reading section // Input file reading section
...@@ -380,7 +379,6 @@ int main(int argc, char **argv) { ...@@ -380,7 +379,6 @@ int main(int argc, char **argv) {
ros[i113 - 1] = ros_val * pow(10.0, ros_val_exp); ros[i113 - 1] = ros_val * pow(10.0, ros_val_exp);
nsh = nshl[i113 -1]; nsh = nshl[i113 -1];
if (i113 == 1) nsh += ies; if (i113 == 1) nsh += ies;
if ((nsh + 1) / 2 + ies > max_nsh) max_nsh = (nsh + 1) / 2 + ies;
rcf[i113 - 1] = new double[nsh]; rcf[i113 - 1] = new double[nsh];
for (int ns = 0; ns < nsh; ns++) { for (int ns = 0; ns < nsh; ns++) {
double ns_rcf; double ns_rcf;
...@@ -415,8 +413,8 @@ int main(int argc, char **argv) { ...@@ -415,8 +413,8 @@ int main(int argc, char **argv) {
write_double_(&uid, (rcf[i115 - 1] + ins)); write_double_(&uid, (rcf[i115 - 1] + ins));
} }
// Remake the dc0m matrix. // Remake the dc0m matrix.
dc0m = new complex<double>**[max_nsh]; dc0m = new complex<double>**[nsph];
for (int dim1 = 0; dim1 < max_nsh; dim1++) { for (int dim1 = 0; dim1 < nsph; dim1++) {
dc0m[dim1] = new complex<double>*[nsph]; dc0m[dim1] = new complex<double>*[nsph];
for (int dim2 = 0; dim2 < nxi; dim2++) { for (int dim2 = 0; dim2 < nxi; dim2++) {
dc0m[dim1][dim2] = new complex<double>[nxi]; dc0m[dim1][dim2] = new complex<double>[nxi];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment