-
- Downloads
Correction in time averaging
parent
ed0d7d21
Branches
No related tags found
... | @@ -3838,6 +3838,9 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst | ... | @@ -3838,6 +3838,9 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst |
{ | { | ||
double avgValue = 0.0; | double avgValue = 0.0; | ||
int count = 0; | int count = 0; | ||
double t_0 = 0.0; | |||
double t_i = 0.0; | |||
double dt = 0.0; | |||
double sum_dt = 0.0; | double sum_dt = 0.0; | ||
// here can check GP against std::map coordinates for correctness | // here can check GP against std::map coordinates for correctness | ||
... | @@ -3846,16 +3849,21 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst | ... | @@ -3846,16 +3849,21 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst |
for(auto it = IPVariableOverTime.begin(); it != IPVariableOverTime.end(); ++it) | for(auto it = IPVariableOverTime.begin(); it != IPVariableOverTime.end(); ++it) | ||
{ | { | ||
const double t = it->first; | const double t = it->first; | ||
t_i = it->first; | |||
if(t >= tstart && t <= tend) | if(t >= tstart && t <= tend) | ||
{ | { | ||
count++; | count++; | ||
sum_dt += t; | dt = (t_i - t_0); | ||
sum_dt += dt; | |||
// compute average of IPVariable over given time period | // compute average of IPVariable over given time period | ||
//avgValue += IPVariableOverTime.at(t).at(eleNum).at(j); | //avgValue += IPVariableOverTime.at(t).at(eleNum).at(j); | ||
// sum(w_AV * dt) | // sum(w_AV * dt) | ||
avgValue += (IPVariableOverTime.at(t).at(eleNum).at(j)) * t; | avgValue += (IPVariableOverTime.at(t).at(eleNum).at(j)) * dt; | ||
|
|||
// update time | |||
t_0 = t_i; | |||
} | } | ||
} | } | ||
//avgValue /= count; | //avgValue /= count; | ||
... | ... |