質問編集履歴

1

sum_dosの表記を変更した

2022/11/08 01:16

投稿

kisara11235
kisara11235

スコア18

test CHANGED
File without changes
test CHANGED
@@ -61,7 +61,7 @@
61
61
  double complex a_cube = 1;//= 0.246 * pow(10, -9); //格子定数[nm]
62
62
  double k_x = -1.5*b_pi / a_cube; //-2*b_pi/a_cube/pow(3,0.5); //↓のk_xの値を変えるのも忘れずに! K+,K-で値が変わるよ!
63
63
  double k_y = 0;
64
- double e_1=-3.5;
64
+ double e=-3.5;
65
65
  double sum_dos[n];
66
66
 
67
67
  FILE* fp;
@@ -259,23 +259,24 @@
259
259
  }*/
260
260
 
261
261
 
262
- fprintf(fp, "%2f %lf %lf\n",k_x,e,sum_density[r]);
262
+ //fprintf(fp, "%2f %lf %lf\n",k_x,e,sum_density[r]);
263
263
 
264
264
 
265
265
  }
266
266
 
267
267
  for(int i=0;i<n;i++){
268
- sum_dos[i] +=sum_density[i];
268
+ sum_dos[h] +=sum_density[i];
269
269
  }
270
270
 
271
271
 
272
272
  //printf("%lf\n",sum_dos);
273
- //fprintf(fp, "%2f %lf %lf\n",e,sum_density,sum_dos);
273
+ fprintf(fp, "%2f %lf %lf\n",e,sum_density[h],sum_dos[h]);
274
274
  }
275
275
 
276
276
  fclose(fp);
277
277
  return 0;
278
278
  }
279
+
279
280
  ```
280
281
 
281
282
  ### 試したこと