Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/growermemberfunctions.cc
[mareframe] / trunk / gadget / growermemberfunctions.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/growermemberfunctions.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 2, Wed Apr 29 12:55:30 2015 UTC
# Line 14  Line 14 
14    double tmpPower = growthcalc->getPower();    double tmpPower = growthcalc->getPower();
15    double tmpDl = 1.0 / Lengths->dl();  //JMB no need to check zero here    double tmpDl = 1.0 / Lengths->dl();  //JMB no need to check zero here
16    
17    for (lgroup = 0; lgroup < Lengths->numLengthGroups(); lgroup++) {    double pow_L; double aux;
18      int numLenGr = Lengths->numLengthGroups();;
19    
20      switch (functionnumber) {
21            case 1:
22            case 2:
23            case 3:
24            case 4:
25            case 5:
26            case 6:
27            case 7:
28            case 9: break;
29            case 8:
30            case 10:
31            case 11:
32                    if (vector_OK == 0)
33                    {
34                            meanlength_vectorPow = Lengths->meanlengthvecPow_initilize(maxlengthgroupgrowth,tmpPower);
35                            vector_OK = 1;
36                    }
37              break;
38            default: break;
39          }
40    
41    
42      for (lgroup = 0; lgroup < numLenGr; lgroup++) {
43    
44      part3 = 1.0;      part3 = 1.0;
45      growth = interpLengthGrowth[inarea][lgroup] * tmpDl;      growth = interpLengthGrowth[inarea][lgroup] * tmpDl;
46      if (growth >= maxlengthgroupgrowth)      if (growth >= maxlengthgroupgrowth)
# Line 32  Line 58 
58          part4[j] = part4[j - 1] * (j - 1 + alpha);          part4[j] = part4[j - 1] * (j - 1 + alpha);
59    
60      for (j = 0; j <= maxlengthgroupgrowth; j++)      for (j = 0; j <= maxlengthgroupgrowth; j++)
61        (*lgrowth[inarea])[j][lgroup] = part1[j] * part2[j] * tmppart3 * part4[j];          (*_lgrowth)[j][lgroup] = part1[j] * part2[j] * tmppart3 * part4[j];
62    
63      switch (functionnumber) {      switch (functionnumber) {
64        case 1:        case 1:
# Line 46  Line 72 
72          meanw = 0.0;          meanw = 0.0;
73          tmpweight = (NumberInArea[lgroup].W * tmpPower * Lengths->dl()) / Lengths->meanLength(lgroup);          tmpweight = (NumberInArea[lgroup].W * tmpPower * Lengths->dl()) / Lengths->meanLength(lgroup);
74          for (j = 0; j <= maxlengthgroupgrowth; j++) {          for (j = 0; j <= maxlengthgroupgrowth; j++) {
75            (*wgrowth[inarea])[j][lgroup] = tmpweight * j;                  (*_wgrowth)[j][lgroup] = tmpweight * j;
76            meanw += (*wgrowth[inarea])[j][lgroup] * (*lgrowth[inarea])[j][lgroup];            meanw += (*_wgrowth)[j][lgroup] * (*_lgrowth)[j][lgroup];
77          }          }
78    
79          tmpweight = interpWeightGrowth[inarea][lgroup] - meanw;          tmpweight = interpWeightGrowth[inarea][lgroup] - meanw;
80          for (j = 0; j <= maxlengthgroupgrowth; j++)          for (j = 0; j <= maxlengthgroupgrowth; j++)
81            (*wgrowth[inarea])[j][lgroup] += tmpweight;          {
82                    aux = (*_wgrowth)[j][lgroup];
83                    (*_wgrowth)[j][lgroup] =  aux + tmpweight;
84            }
85          break;          break;
86        case 8:        case 8:
87        case 10:        case 10:
88        case 11:        case 11:
89          if (lgroup != Lengths->numLengthGroups())          pow_L = meanlength_vectorPow[lgroup];
90            if (lgroup != numLenGr) //FIXME ??
91            for (j = 1; j <= maxlengthgroupgrowth; j++)            for (j = 1; j <= maxlengthgroupgrowth; j++)
92              (*wgrowth[inarea])[j][lgroup] = tmpMult * (pow(Lengths->meanLength(lgroup + j), tmpPower) - pow(Lengths->meanLength(lgroup), tmpPower));                    (*_wgrowth)[j][lgroup] = tmpMult * (meanlength_vectorPow[lgroup + j] - pow_L);
93          break;          break;
94        default:        default:
95          handle.logMessage(LOGFAIL, "Error in grower - unrecognised growth function", functionnumber);          handle.logMessage(LOGFAIL, "Error in grower - unrecognised growth function", functionnumber);
# Line 93  Line 123 
123          part4[j] = part4[j - 1] * (j - 1 + alpha);          part4[j] = part4[j - 1] * (j - 1 + alpha);
124    
125      for (j = 0; j <= maxlengthgroupgrowth; j++)      for (j = 0; j <= maxlengthgroupgrowth; j++)
126        (*lgrowth[inarea])[j][lgroup] = part1[j] * part2[j] * tmppart3 * part4[j];        (_lgrowth[inarea])[j][lgroup] = part1[j] * part2[j] * tmppart3 * part4[j];
127    }    }
128  }  }

Legend:
Removed from v.1  
changed lines
  Added in v.2

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge