浏览代码

VTK output in kernel calulation as an option

master
Trevor Irons 7 年前
父节点
当前提交
7d457f083f
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 9
    2
      examples/KernelV0-2.cpp
  2. 1
    0
      src/KernelV0.cpp

+ 9
- 2
examples/KernelV0-2.cpp 查看文件

24
 int main(int argc, char** argv) {
24
 int main(int argc, char** argv) {
25
 
25
 
26
     if (argc<3) {
26
     if (argc<3) {
27
-        std::cout << "./KernelV0-2 Kernel.yaml TxString RxString  \n";
27
+        std::cout << "./KernelV0-2 Kernel.yaml TxString RxString  vtkoutput<true/false> \n";
28
         return(EXIT_SUCCESS);
28
         return(EXIT_SUCCESS);
29
     }
29
     }
30
 
30
 
33
 
33
 
34
     std::vector<std::string> tx = {std::string(argv[2])};
34
     std::vector<std::string> tx = {std::string(argv[2])};
35
     std::vector<std::string> rx = {std::string(argv[3])};
35
     std::vector<std::string> rx = {std::string(argv[3])};
36
-    Kern->CalculateK0( tx, rx, false ); // 3rd argument is vtk output
36
+
37
+    std::cout << "argv[4]\t" << argv[4] << std::endl;
38
+    if( std::string(argv[4]) == "true") {
39
+        Kern->CalculateK0( tx, rx, true ); // 3rd argument is vtk output
40
+    } else {
41
+        std::cout << "not using VTK" << std::endl;
42
+        Kern->CalculateK0( tx, rx, false ); // 3rd argument is vtk output
43
+    }
37
 
44
 
38
     // TODO fix python post-processing so this is not necessary
45
     // TODO fix python post-processing so this is not necessary
39
     // Save in simplified format for easy python plotting
46
     // Save in simplified format for easy python plotting

+ 1
- 0
src/KernelV0.cpp 查看文件

373
         // Compute Mn0
373
         // Compute Mn0
374
         Vector3r Mn0 = ComputeMn0(1.0, B0);
374
         Vector3r Mn0 = ComputeMn0(1.0, B0);
375
         Real Mn0Abs = Mn0.norm();
375
         Real Mn0Abs = Mn0.norm();
376
+        //std::cout << "Mn0\t" << Mn0.transpose() << std::endl;
376
 
377
 
377
         // Compute phase delay
378
         // Compute phase delay
378
         // TODO add transmiiter current phase and delay induced apparent time phase!
379
         // TODO add transmiiter current phase and delay induced apparent time phase!

正在加载...
取消
保存