Konstantin Ladutenko 7 years ago
parent
commit
246f84c8a4
3 changed files with 14 additions and 15 deletions
  1. 11 11
      examples/go-cc-examples.sh
  2. 1 1
      examples/test-surf-integral.cc
  3. 2 3
      src/shell-generator.cc

+ 11 - 11
examples/go-cc-examples.sh

@@ -2,21 +2,21 @@
 path=$PWD
 PROGRAM='scattnlay-example.bin'
 
-file=example-eval-force.cc
-echo Compile $file with gcc
-rm -f $PROGRAM
-g++ -Ofast -std=c++11 $file  ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2 -Wall
-# g++ -Ofast -std=c++11 $file ../src/nmie.cc ../src/nmie-applied.cc ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2
-echo Compilation done. Running...
-time ./$PROGRAM
-
-# file=test-surf-integral.cc
+# file=example-eval-force.cc
 # echo Compile $file with gcc
 # rm -f $PROGRAM
-# g++ -Ofast -std=c++11 $file  ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2
+# g++ -Ofast -std=c++11 $file  ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2 -Wall
 # # g++ -Ofast -std=c++11 $file ../src/nmie.cc ../src/nmie-applied.cc ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2
 # echo Compilation done. Running...
-# ./$PROGRAM
+# time ./$PROGRAM
+
+file=test-surf-integral.cc
+echo Compile $file with gcc
+rm -f $PROGRAM
+g++ -Ofast -std=c++11 $file  ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2
+# g++ -Ofast -std=c++11 $file ../src/nmie.cc ../src/nmie-applied.cc ../src/shell-generator.cc -lm -lrt -o $PROGRAM -march=native -mtune=native -msse4.2
+echo Compilation done. Running...
+./$PROGRAM
 
 
 # file=example-minimal.cc

+ 1 - 1
examples/test-surf-integral.cc

@@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
     double shift = 1.1;  //Shift of the charge relative to the sphere center.
     double charge = 11.0; //Coulomb charge.
     shell.Rescale(scale);
-    shell.PrintVerts();
+    //shell.PrintVerts();
     auto points = shell.GetVertices();
     double charge_s = shell.IntegrateGaussSimple(charge, shift);
     std::cout << "Accuracy ( 1==ideal ): " << charge_s/charge << std::endl; 

+ 2 - 3
src/shell-generator.cc

@@ -246,7 +246,7 @@ namespace shell_generator {
       auto vert = face_centers_[i];
       auto E0 = field(charge, shift, vert);
       // std::cout << "E0: ";
-      // for (auto component : E0) std::cout << component << " ";
+      for (auto component : E0) std::cout << component << " ";
       // std::cout << std::endl;
       // Vector to unit product
       double r = norm(vert);
@@ -430,14 +430,13 @@ namespace shell_generator {
         *real(cross(E,vconj(H)));
       //integral[0] = integral[0] + per_face_area_[i]*dot(P,unit);
       integral = integral + per_face_area_[i]*P;
-
     }
     return integral;
   }
+  
   // ********************************************************************** //
   // ********************************************************************** //
   // ********************************************************************** //
-  
   std::vector<double> ShellGenerator::Integrate() {
     std::vector<double> integral = {0.0, 0.0, 0.0};
     //simple