Konstantin Ladutenko пре 10 година
родитељ
комит
5173168b04
2 измењених фајлова са 10 додато и 3 уклоњено
  1. 8 2
      nmie-wrapper.cc
  2. 2 1
      nmie-wrapper.h

+ 8 - 2
nmie-wrapper.cc

@@ -163,8 +163,12 @@ namespace nmie {
       throw std::invalid_argument("Error! Layers are numbered from 0!");
     PEC_layer_position_ = layer_position;
   }
-
-  
+  // ********************************************************************** //
+  // ********************************************************************** //
+  // ********************************************************************** //
+  void MultiLayerMie::SetMaxTermsNumber(int nmax) {
+    nmax_ = nmax;
+  }
   // ********************************************************************** //
   // ********************************************************************** //
   // ********************************************************************** //
@@ -258,6 +262,8 @@ int MultiLayerMie::Nmax(int L, int fl, int pl,
 
     if ((i > fl) && ((i - 1) > pl)) {
       riM1 = round(std::abs(x[i - 1]* m[i]));
+      // TODO Ovidio, should we check?
+      // riM2 = round(std::abs(x[i]* m[i-1]))
     } else {
       riM1 = 0;
     }

+ 2 - 1
nmie-wrapper.h

@@ -85,7 +85,7 @@ namespace nmie {
     void SetAngles(std::vector<double> angles);
     std::vector<double> GetAngles();
     void SetPEC(int layer_position = 0);  // By default set PEC layer to be the first one
-    
+    void SetMaxTermsNumber(int nmax);
     
     void ClearTarget();
     void ClearCoating();
@@ -201,6 +201,7 @@ namespace nmie {
     std::vector<double> theta_;
     //
     int PEC_layer_position_ = -1;
+    int nmax_ = -1;
     /// Store result
     double Qsca_ = 0.0, Qext_ = 0.0, Qabs_ = 0.0, Qbk_ = 0.0, Qpr_ = 0.0, asymmetry_factor_ = 0.0, albedo_ = 0.0;
     std::vector<std::complex<double> > S1_, S2_;