Exemple #1
0
GlobalDaeDef::GlobalDaeDef(ResFunction residualIn, const real& t0In,
                           const Vec& y0In, const Vec& y0primeIn,DataCollector* dataIn):
    DaeDefinition(y0In.dim(),dataIn),
    t0(&t0In),
    y0(&y0In),
    y0prime(&y0primeIn),
    resGlobal(residualIn),
    yPrimeGlobal(0),
    indexResGlobal(0)
{
    Tracer tr("GlobalDaeDef::GlobalDaeDef(ResFunction residualIn, const real& t0, const Vec& y0, const Vec& y0prime)");
}
Exemple #2
0
GlobalDaeDef::GlobalDaeDef(ResFunction residualIn,
                           IndexResFunction indexResIn, const real& t0in,
                           const Vec& y0in,const Vec& y0primein,DataCollector* dataIn):
    DaeDefinition(y0in.dim(),dataIn),
    t0(&t0in),
    y0(&y0in),
    y0prime(&y0primein),
    resGlobal(residualIn),
    indexResGlobal(indexResIn)
{
    Tracer tr("GlobalDaeDef::GlobalDaeDef(ResFunction residualIn, IndexResFunction indexResIn, const real& t0in, const Vec& y0in,const Vec& y0primein)");
}
Exemple #3
0
void FullDataFile::includeSolution(const real& tout,const Vec& solution)
{    
  runTime = clock.elapsed();
  clock.reset();
  if (totalStepsTaken)
    avgCondition/=totalStepsTaken;
  else
    avgCondition=0.0;
  fout<<endl
      <<"Data over the interval ["<<tlast<<","<<tout<<"]"<<endl
      <<"------------------------------"<<endl
      <<"Jacobian Evaluations:-------"<<totalJacobianEvaluations<<endl
      <<"Function Evaluations:-------"<<totalFunctionEvaluations<<endl
      <<"Steps Taken:----------------"<<totalStepsTaken<<endl
      <<"Steps Failed:---------------"<<totalStepsFailed<<endl
      <<"Error Failures:-------------"<<totalErrorFailures<<endl
      <<"Nonlinear Solver Iterations:"<<totalNonlinearSolverIterations<<endl
      <<"Nonlinear Solver Failures:--"<<totalNonlinearSolverFailures<<endl
      <<"Linear Solver Iterations:---"<<totalLinearSolverIterations<<endl
      <<"Linear Solver Failures:-----"<<totalLinearSolverFailures<<endl
      <<"Average Condition Number:---"<<avgCondition<<endl
      <<"Line Searches:--------------"<<totalLinesearches<<endl
      <<"Order 1 steps:--------------"<<orderOneStepsTaken<<endl
      <<"Order 2 steps:--------------"<<orderTwoStepsTaken<<endl
      <<"Order 3 steps:--------------"<<orderThreeStepsTaken<<endl
      <<"Order 4 steps:--------------"<<orderFourStepsTaken<<endl
      <<"Order 5 steps:--------------"<<orderFiveStepsTaken<<endl
      <<"Wall Clock Time:------------"<<runTime<<endl
      <<endl;
  int neq = solution.dim();
  if (analyticSolutionAvailable)
    {
      real rnorm;
      Vec r(solution.dim());
      analyticSolution(tout,r);
      fout<<"Solution at t="<<tout<<"   Analytic Solution"<<endl<<endl;
      for (int i=0;i<neq;i++)
	{
	  fout<<setw(14)<<solution(i)<<setw(3)<<" "<<setw(14)<<r(i)<<endl;
	}
      rnorm = nrm2(r);
      r-=solution;
      fout<<endl<<"Relative error= "<<(norm(r)/rnorm)<<endl<<endl;
    }
  else
    {
      if (INCLUDE_SOLUTION)
        {
          fout<<setw(1)<<"Solution at t="<<tout<<endl
              <<solution<<endl;
        }
    }
  fout<<"============================================================================="<<endl
      <<" k |  Step Size    |      tn       |errf|nlsf|ilsf|func|jacs|NLit|L_IT|linS|"<<endl;

  globalJacobianEvaluations+=totalJacobianEvaluations;
  globalFunctionEvaluations+=totalFunctionEvaluations;
  globalStepsTaken+=totalStepsTaken;
  globalNonlinearSolverIterations+=totalNonlinearSolverIterations;
  globalNonlinearSolverFailures+=totalNonlinearSolverFailures;
  globalLinearSolverIterations+=totalLinearSolverIterations;
  globalLinearSolverFailures+=totalLinearSolverFailures;
  globalLinesearches+=totalLinesearches;
  globalErrorFailures+=totalErrorFailures;
  globalStepsFailed+=totalStepsFailed;
  globalOrderOneStepsTaken+=orderOneStepsTaken;
  globalOrderTwoStepsTaken+=orderTwoStepsTaken;
  globalOrderThreeStepsTaken+=orderThreeStepsTaken;
  globalOrderFourStepsTaken+=orderFourStepsTaken;
  globalOrderFiveStepsTaken+=orderFiveStepsTaken;

  avgCondition =0;
  totalJacobianEvaluations=0;
  totalFunctionEvaluations=0;
  totalStepsTaken=0;
  totalNonlinearSolverIterations=0;
  totalNonlinearSolverFailures=0;
  totalLinearSolverIterations=0;
  totalLinearSolverFailures=0;
  totalLinesearches=0;
  totalErrorFailures=0;
  totalStepsFailed=0;
  tlast=tout; 
  orderOneStepsTaken=0;
  orderTwoStepsTaken=0;
  orderThreeStepsTaken=0;
  orderFourStepsTaken=0;
  orderFiveStepsTaken=0;
}