Skip to content
Snippets Groups Projects
Commit ed0d7d21 authored by Vinayak Gholap's avatar Vinayak Gholap
Browse files

Change in averaging method for IPVariable over time

parent 869c0ca3
No related branches found
No related tags found
1 merge request!386Major update: Computing average IPVar over time period, rewriting last time...
...@@ -3838,6 +3838,7 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst ...@@ -3838,6 +3838,7 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst
{ {
double avgValue = 0.0; double avgValue = 0.0;
int count = 0; int count = 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
   
...@@ -3848,12 +3849,17 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst ...@@ -3848,12 +3849,17 @@ void nonLinearMechSolver::computePeriodAveragedIPDataOnPhysical(const double tst
if(t >= tstart && t <= tend) if(t >= tstart && t <= tend)
{ {
count++; count++;
sum_dt += t;
   
// 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)
avgValue += (IPVariableOverTime.at(t).at(eleNum).at(j)) * t;
} }
} }
avgValue /= count; //avgValue /= count;
avgValue /= sum_dt;
tempMap.emplace(j, avgValue); tempMap.emplace(j, avgValue);
} }
avgIPVariable.emplace(eleNum, tempMap); avgIPVariable.emplace(eleNum, tempMap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment