47 #include <Xyce_config.h>
56 #include <N_ERH_ErrorMgr.h>
57 #include <N_IO_InitialConditions.h>
58 #include <N_LAS_BlockVector.h>
59 #include <N_LAS_Matrix.h>
60 #include <N_LAS_System.h>
61 #include <N_LAS_Vector.h>
62 #include <N_PDS_Comm.h>
63 #include <N_PDS_Manager.h>
68 #include <N_UTL_Diagnostic.h>
69 #include <N_UTL_FeatureTest.h>
70 #include <N_UTL_MachDepParams.h>
90 TimeIntegrationMethod *
96 return new OneStep(tia_params, step_error_control, data_store);
116 timeStepForHistory2_(0.0)
162 if (DEBUG_TIME && isActive(Diag::TIME_PREDICTOR))
164 Xyce::dout().width(21); Xyce::dout().precision(13); Xyce::dout().setf(std::ios::scientific);
165 Xyce::dout() << std::endl;
166 Xyce::dout() << Xyce::section_divider << std::endl;
168 " OneStep::obtainPredictor" << std::endl;
170 Xyce::dout() <<
"\n sec.nscsco_: " <<
sec.
nscsco_ << std::endl;
172 Xyce::dout() <<
"\n sec.beta_[" << i <<
"] = " <<
sec.
beta_[i] <<
"\n" << std::endl;
175 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
176 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
177 Xyce::dout() << std::endl;
181 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
182 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
183 Xyce::dout() << std::endl;
187 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
188 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
189 Xyce::dout() << std::endl;
193 Xyce::dout() <<
"\n stoHistory["<< i <<
"]: \n" << std::endl;
195 Xyce::dout() << std::endl;
199 Xyce::dout() <<
"\n stoLeadCurrQHistory["<< i <<
"]: \n" << std::endl;
201 Xyce::dout() << std::endl;
203 Xyce::dout() <<
"\n xn0: \n" << std::endl;
204 ds.
xn0Ptr->printPetraObject(Xyce::dout());
205 Xyce::dout() << std::endl;
206 Xyce::dout() <<
"\n qn0: \n" << std::endl;
207 ds.
qn0Ptr->printPetraObject(Xyce::dout());
208 Xyce::dout() << std::endl;
209 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
210 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
211 Xyce::dout() << std::endl;
212 Xyce::dout() <<
"\n sn0: \n" << std::endl;
213 ds.
sn0Ptr->printPetraObject(Xyce::dout());
214 Xyce::dout() << std::endl;
215 Xyce::dout() <<
"\n spn0: \n" << std::endl;
216 ds.
spn0Ptr->printPetraObject(Xyce::dout());
217 Xyce::dout() << std::endl;
218 Xyce::dout() <<
"\n stoQn0Ptr: \n" << std::endl;
220 Xyce::dout() << std::endl;
221 Xyce::dout() <<
"\n stoQpn0Ptr: \n" << std::endl;
223 Xyce::dout() << std::endl;
224 Xyce::dout() << Xyce::section_divider << std::endl;
263 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
265 Xyce::dout() << std::endl;
266 Xyce::dout() << Xyce::section_divider << std::endl;
268 " OneStep::obtainResidual" << std::endl;
269 Xyce::dout() <<
"\n t = " <<
sec.
nextTime <<
"\n" << std::endl;
270 Xyce::dout() <<
"\n solution: \n" << std::endl;
272 Xyce::dout() <<
"\n daeQVector: \n" << std::endl;
274 Xyce::dout() <<
"\n qn0: \n" << std::endl;
275 ds.
qn0Ptr->printPetraObject(Xyce::dout());
276 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
277 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
279 Xyce::dout() <<
"\n daeFVector: \n" << std::endl;
282 Xyce::dout() <<
"\n dQdt-vector: \n" << std::endl;
284 Xyce::dout() << std::endl;
318 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
320 Xyce::dout() <<
"\n Residual-vector: \n" << std::endl;
321 Xyce::dout() <<
"-(qpn0-(sec.alpha_s/h)*(Q-qn0)+F-B) \n" << std::endl;
323 Xyce::dout() << Xyce::section_divider << std::endl;
324 Xyce::dout() << std::endl;
339 for (
int ip=0; ip<numParams;++ip)
349 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
363 nextDqdpDerivVec.linearCombo(1.0,dqdpVec,-1.0, *(dqdpHistory[0]));
365 nextDqdpDerivVec.linearCombo(-1.0,currDqdpDerivVec,1.0,nextDqdpDerivVec);
367 RHSVec.linearCombo(0.5,nextDqdpDerivVec,+0.5,dfdpVec);
368 RHSVec.linearCombo(1.0,RHSVec,-0.5,dbdpVec);
373 nextDqdpDerivVec.linearCombo(1.0,dqdpVec,-1.0, *(dqdpHistory[0]));
376 RHSVec.linearCombo(1.0,nextDqdpDerivVec,+1.0,dfdpVec);
377 RHSVec.linearCombo(1.0,RHSVec,-1.0,dbdpVec);
385 RHSVec.linearCombo(1.0,RHSVec, qscalar, currDQdxDXdpVec);
390 RHSVec.linearCombo(1.0,RHSVec, 0.5, currDQdxDXdpDerivVec);
394 Xyce::dout() <<
"obtainSensitivityResiduals: RHS Vector, ip = " << ip <<
":\n";
395 RHSVec.printPetraObject(Xyce::dout());
412 for (
int ip=0; ip<numParams;++ip)
423 nextDQdxDXdpDerivVec.putScalar(0.0);
424 nextDQdxDXdpDerivVec.linearCombo(2.0,nextDQdxDXdpVec,-2.0,currDQdxDXdpVec);
425 nextDQdxDXdpDerivVec.scale(1.0/dt);
426 nextDQdxDXdpDerivVec.linearCombo(-1.0,currDQdxDXdpDerivVec,1.0,nextDQdxDXdpDerivVec);
430 nextDQdxDXdpDerivVec.putScalar(0.0);
431 nextDQdxDXdpDerivVec.linearCombo(1.0,nextDQdxDXdpVec,-1.0,currDQdxDXdpVec);
432 nextDQdxDXdpDerivVec.scale(1.0/dt);
447 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
449 Xyce::dout() << std::endl;
450 Xyce::dout() << Xyce::section_divider << std::endl;
452 " OneStep::obtainJacobian" << std::endl;
471 Jac.linearCombo( qscalar, dQdx, fscalar, dFdx );
473 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
475 Xyce::dout() <<
"fscalar = " << fscalar <<
" qscalar = " << qscalar << std::endl;
477 Xyce::dout() <<
"\n dFdx:" <<std::endl;
478 dFdx.printPetraObject(Xyce::dout());
479 Xyce::dout() <<
"\n dQdx:" <<std::endl;
480 dQdx.printPetraObject(Xyce::dout());
481 Xyce::dout() <<
"\n Total Jacobian:" <<std::endl;
482 Jac.printPetraObject(Xyce::dout());
488 Xyce::dout() << Xyce::section_divider << std::endl;
489 Xyce::dout() << std::endl;
501 Linear::Vector * tmpSolVectorPtr, std::vector<Linear::Vector*> & historyVec)
507 *tmpSolVectorPtr = *(historyVec[0]);
509 if( -dtr < 2 * Util::MachineDependentParams::MachinePrecision() )
519 tmpSolVectorPtr->linearCombo(1.0,*tmpSolVectorPtr,dtr,*(historyVec[1]));
542 Linear::Vector * tmpSolVectorPtr)
544 Linear::BlockVector * blockTempSolVectorPtr =
545 dynamic_cast<Linear::BlockVector*
>(tmpSolVectorPtr);
546 if (blockTempSolVectorPtr == NULL)
548 std::string msg =
"OneStep::interpolateMPDESolution: ";
549 msg +=
"Linear::Vector tmpSolVectorPtr is not of type Linear::BlockVector";
550 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
556 int numblocks = timepoint.size();
557 int blockCount = blockTempSolVectorPtr->blockCount();
558 if (numblocks > blockCount)
560 std::string msg =
"OneStep::interpolateMPDESolution: ";
561 msg +=
"Number of time points requested is greater than number of fast time points in MPDE block vector";
562 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
575 tfuzz = 100 * uround * (tn + hh);
576 tp = tn - hused - tfuzz;
577 for (
int i=0; i<numblocks ; ++i)
579 if ( (timepoint[i] - tp)*hh < 0.0 )
585 Linear::Vector * solVectorPtr;
586 Linear::Vector * xHistoryVectorPtr;
588 for (
int i=0; i < numblocks ; ++i)
590 if ((kused == 0) || (timepoint[i] == tn)) { kord = 1; }
591 else { kord = kused; }
592 solVectorPtr = &(blockTempSolVectorPtr->block(i));
594 delt = timepoint[i] - tn;
596 for (
int j=1 ; j <= kord ; ++j)
600 Linear::BlockVector * blockXHistoryVectorPtr =
601 dynamic_cast<Linear::BlockVector*>(
ds.
xHistory[j]);
602 if (blockXHistoryVectorPtr == NULL)
604 Xyce::Report::DevelFatal0().in(
"OneStep::interpolateMPDESolution") <<
"Linear::Vector ds.xHistory[j] is not of type Linear::BlockVector\n j = " << j;
607 xHistoryVectorPtr = &(blockXHistoryVectorPtr->block(i));
608 solVectorPtr->linearCombo(1.0,*solVectorPtr,c,*xHistoryVectorPtr);
625 Linear::Vector * solnVecPtr,
626 const std::vector<double> & fastTimes )
628 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
630 Xyce::dout() << std::endl;
631 Xyce::dout() << Xyce::section_divider << std::endl;
633 " OneStep::printMPDEOutputSolution" << std::endl;
640 double beg_of_output_time_interval = lasttime;
641 double end_of_output_time_interval = tn;
642 double start_time = max(lasttime,beg_of_output_time_interval);
643 double stop_time = min(tn,end_of_output_time_interval);
644 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
646 Xyce::dout() <<
"timestep = " << timestep << std::endl;
647 Xyce::dout() <<
"lasttime = " << lasttime << std::endl;
648 Xyce::dout() <<
"tn = " << tn << std::endl;
649 Xyce::dout() <<
"beg_of_output_time_interval = " << beg_of_output_time_interval << std::endl;
650 Xyce::dout() <<
"end_of_output_time_interval = " << end_of_output_time_interval << std::endl;
651 Xyce::dout() <<
"start_time = " << start_time << std::endl;
652 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
655 Linear::BlockVector * blockTmpSolVectorPtr =
657 if (blockTmpSolVectorPtr == NULL)
659 std::string msg =
"OneStep::printMPDEOutputSolution: ";
660 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
661 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
664 int blockCount = blockTmpSolVectorPtr->blockCount();
667 double T2 = fastTimes.back();
669 double charcross = fmod(start_time,T2);
673 for (
int i=0 ; i<=blockCount ; ++i)
675 if (fastTimes[i] >= charcross)
683 std::string msg =
"OneStep::printMPDEOutputSolution: ";
684 msg +=
"Cannot find where characteristic curve crosses fast time slice at start_time";
685 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
688 std::vector<double> h2(blockCount,0);
689 for (
int j=0 ; j < blockCount ; ++j)
691 h2[j] = fastTimes[j+1] - fastTimes[j];
693 std::vector<double> ti;
695 double first_interp = start_time - charcross + fastTimes[s_ind_0];
696 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
698 Xyce::dout() <<
"first_interp = " << first_interp << std::endl;
701 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
703 double eps = fabs(start_time)*1.0e-6;
704 if ( fabs(first_interp-
timept_) <= eps )
706 first_interp += h2[s_ind_0];
708 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
709 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
711 Xyce::dout() <<
"Moving first_interp forward to avoid duplicate outputs: " << first_interp << std::endl;
715 double t = first_interp;
716 while (t <= stop_time)
721 if (sn >= blockCount) { sn = 0; }
723 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
725 Xyce::dout() <<
"T2 = " << T2 << std::endl;
726 Xyce::dout() <<
"charcross = " << charcross << std::endl;
727 Xyce::dout() <<
"s_ind_0 = " << s_ind_0 << std::endl;
728 Xyce::dout() <<
"Expecting to interpolate the following points:" << std::endl;
729 unsigned int numinterp = ti.size();
730 for (
unsigned int i=0 ; i < numinterp ; ++i)
732 Xyce::dout() << ti[i] << std::endl;
734 Xyce::dout() <<
"Total of " << numinterp <<
" points" << std::endl;
738 unsigned int tinum = ti.size();
739 int total_interp = 0;
740 std::vector<double> timepoint_vec(blockCount,stop_time);
741 int num_interp_this_cycle = 0;
743 for (
unsigned int i=0; i < tinum ; ++i)
745 timepoint_vec[s_ind] = ti[i];
746 num_interp_this_cycle++;
748 if (s_ind >= blockCount) { s_ind = 0; };
750 if ((s_ind == s_ind_0) || (i == tinum-1))
755 for (
int j=0 ; j < num_interp_this_cycle ; ++j)
759 timept_, blockTmpSolVectorPtr->block(s),
765 if (s >= blockCount) { s = 0; }
766 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
767 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
769 num_interp_this_cycle = 0;
772 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
773 Xyce::dout() <<
"Total of " << total_interp <<
" points" << std::endl;
776 eps = fabs(stop_time)*1.0e-8;
778 if (fabs(
timept_ - stop_time) >= eps)
780 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
782 Xyce::dout() <<
"Previous timept = " <<
timept_ << std::endl;
783 Xyce::dout() <<
"Expecting to interpolate the following point: " << stop_time << std::endl;
785 Linear::Vector* tmpSolnVecPtr = solnVecPtr;
792 Linear::BlockVector * blockTmpSolnVecPtr =
793 dynamic_cast<Linear::BlockVector*
>(tmpSolnVecPtr);
794 Linear::BlockVector * blockTmpVecPtr =
795 dynamic_cast<Linear::BlockVector*
>(tmpVecPtr);
796 if (blockTmpSolnVecPtr == NULL)
798 std::string msg =
"OneStep::printMPDEOutputSolution: ";
799 msg +=
"Linear::Vector tmpSolnVecPtr is not of type Linear::BlockVector";
800 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
803 if (blockTmpVecPtr == NULL)
805 std::string msg =
"OneStep::printMPDEOutputSolution: ";
806 msg +=
"Linear::Vector tmpVecPtr is not of type Linear::BlockVector";
807 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
812 charcross = fmod(stop_time,T2);
815 if( charcross < fastTimes[0] )
818 s_ind_1 = blockCount-1;
822 for (
int i=blockCount-1 ; i>=0 ; --i)
824 if (fastTimes[i] <= charcross)
833 std::string msg =
"OneStep::printMPDEOutputSolution: ";
834 msg +=
"Cannot find where characteristic curve crosses fast time slice at stop_time";
835 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
840 double coeff_sm = fastTimes[sp]-charcross;
841 double coeff_sp = charcross-fastTimes[sm];
842 if (sp == blockCount) { sp = 0; }
843 double dt = h2[s_ind_1];
845 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
847 Xyce::dout() <<
"charcross = " << charcross << std::endl;
848 Xyce::dout() <<
"s_ind_1 = " << s_ind_1 << std::endl;
849 Xyce::dout() <<
"sp = " << sp << std::endl;
850 Xyce::dout() <<
"sm = " << sm << std::endl;
851 Xyce::dout() <<
"dt = " << dt << std::endl;
852 Xyce::dout() <<
"timept = " <<
timept_ << std::endl;
853 Xyce::dout() <<
"coeff_sm = " << coeff_sm << std::endl;
854 Xyce::dout() <<
"coeff_sp = " << coeff_sp << std::endl;
856 blockTmpVecPtr->block(0).linearCombo(
857 coeff_sm/dt, blockTmpSolnVecPtr->block(sm),
858 coeff_sp/dt, blockTmpSolnVecPtr->block(sp)
864 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
865 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
867 else if(DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
869 Xyce::dout() <<
"No further interpolation required." << std::endl;
872 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
873 Xyce::dout() << Xyce::section_divider << std::endl;
889 Linear::Vector * solnVecPtr,
890 const std::vector<double> & fastTimes,
893 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
895 Xyce::dout() << std::endl;
896 Xyce::dout() << Xyce::section_divider << std::endl;
898 " OneStep::printWaMPDEOutputSolution" << std::endl;
905 double beg_of_output_time_interval = lasttime;
906 double end_of_output_time_interval = tn;
907 double start_time = max(lasttime,beg_of_output_time_interval);
908 double stop_time = min(tn,end_of_output_time_interval);
909 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
911 Xyce::dout() <<
"start_time = " << start_time << std::endl;
912 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
937 Linear::BlockVector * blockTmpSolVectorPtr =
939 Linear::BlockVector * blockTmpXn0APtr =
941 Linear::BlockVector * blockTmpXn0BPtr =
943 if (blockTmpSolVectorPtr == NULL)
945 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
946 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
947 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
950 if (blockTmpXn0APtr == NULL)
952 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
953 msg +=
"Linear::Vector ds.tmpXn0APtr is not of type Linear::BlockVector";
954 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
957 if (blockTmpXn0BPtr == NULL)
959 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
960 msg +=
"Linear::Vector ds.tmpXn0BPtr is not of type Linear::BlockVector";
961 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
964 int phiLID = blockTmpSolVectorPtr->pmap()->globalToLocalIndex(phiGID);
968 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
970 Xyce::dout() <<
" sec.usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
971 Xyce::dout() <<
" sec.currentTime_ = " <<
sec.
currentTime << std::endl;
972 Xyce::dout() <<
" lasttime = " << lasttime << std::endl;
980 timeA = lasttime + hh*i;
984 std::string msg =
"interpolateSolution returned false!";
985 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0,msg);
994 timeB = lasttime + hh*(i+1);
996 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
998 Xyce::dout() <<
"Interpolating in [ " << timeA <<
", " << timeB <<
" ]" << std::endl;
999 Xyce::dout() <<
"timeA = " << timeA << std::endl;
1000 Xyce::dout() <<
"timeB = " << timeB << std::endl;
1004 std::vector<double> t1vals;
1005 double T2 = fastTimes.back();
1006 int blockCount = blockTmpSolVectorPtr->blockCount();
1007 double h2 = T2/blockCount;
1008 double tval = timeA+h2;
1009 while (tval <= timeB)
1011 t1vals.push_back(tval);
1015 double eps = fabs(timeB)*1.0e-8;
1016 if ( (t1vals.size() == 0) || (fabs(t1vals.back() - timeB) >= eps) )
1018 t1vals.push_back(timeB);
1020 std::vector<double> t2vals, phiAB(2);
1021 std::vector<double> tmpPhiAB(2, 0.0);
1027 blockTmpSolVectorPtr->pmap()->pdsComm().sumAll( &tmpPhiAB[0], &phiAB[0], 2 );
1029 double phiA = phiAB[0], phiB = phiAB[1];
1030 for (
unsigned int j=0 ; j<t1vals.size() ; ++j)
1032 double phi = (1/(timeB-timeA))*(phiA*(timeB-t1vals[j])+phiB*(t1vals[j]-timeA));
1033 t2vals.push_back(fmod(phi,T2));
1035 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1037 Xyce::dout() <<
"t1vals = " << std::endl;
1038 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
1040 Xyce::dout() << t1vals[j] << std::endl;
1042 Xyce::dout() <<
"phi(" << timeA <<
") = " << phiA << std::endl;
1043 Xyce::dout() <<
"phi(" << timeB <<
") = " << phiB << std::endl;
1044 Xyce::dout() <<
"t2vals = " << std::endl;
1045 for (
unsigned int j=0 ; j< t2vals.size() ; ++j)
1047 Xyce::dout() << t2vals[j] << std::endl;
1055 double t = t1vals[0];
1056 double s = t2vals[0];
1060 for (
int j=0 ; j < blockCount ; ++j)
1062 if ((fastTimes[j] <= s) && (s < fastTimes[j+1]))
1068 if (b2 == blockCount)
1072 double s1 = fastTimes[b1];
1073 double s2 = fastTimes[b1+1];
1074 if ((s < s1) || (s > s2))
1076 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
1077 msg +=
" Interpolator cannot find a fast time block containing the first point ";
1078 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1080 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1081 Xyce::dout() <<
"Found s = " << s <<
" in block " << b1 <<
" with boundary = [" << s1 <<
"," << s2 <<
"]" << std::endl;
1083 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
1089 if ( (s < s1) || (s > s2) )
1091 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1092 Xyce::dout() <<
"Incrementing fast time block for next interpolation." << std::endl;
1095 if (b1 == blockCount)
1100 if (b2 == blockCount)
1105 s2 = fastTimes[b1+1];
1108 if ((s < s1) || (s > s2))
1110 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1111 Xyce::dout() <<
"Searching for fast time block for next interpolation." << std::endl;
1114 for (
int j2=0 ; j2 < blockCount ; ++j2)
1116 if ((fastTimes[j2] <= s) && (s < fastTimes[j2+1]))
1122 if (b2 == blockCount)
1127 s2 = fastTimes[b1+1];
1130 if ((s < s1) || (s > s2))
1132 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
1133 msg +=
" Interpolator moved fast time block but new point is not in this block ";
1134 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1145 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1147 Xyce::dout() <<
"Interpolating in the block:" << std::endl;
1148 Xyce::dout() <<
"(t1,t2) = (" << t1 <<
"," << t2 <<
")" << std::endl;
1149 Xyce::dout() <<
"(s1,s2) = (" << s1 <<
"," << s2 <<
")" << std::endl;
1152 double denom = (t2-t1)*(s2-s1);
1153 double coeff0 = (t2-t)*(s2-s)/denom;
1154 double coeff1 = (t2-t)*(s-s1)/denom;
1155 double coeff2 = (t-t1)*(s2-s)/denom;
1156 double coeff3 = (t-t1)*(s-s1)/denom;
1157 (blockTmpSolVectorPtr->block(b1)).linearCombo(
1158 coeff0, blockTmpXn0APtr->block(b1),
1159 coeff1, blockTmpXn0APtr->block(b2),
1160 coeff2, blockTmpXn0BPtr->block(b1) );
1161 (blockTmpSolVectorPtr->block(b1)).update(
1162 coeff3, blockTmpXn0BPtr->block(b2), 1.0 );
1167 outputManagerAdapter.
tranOutput(t, blockTmpSolVectorPtr->block(b1),
1171 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1172 Xyce::dout() <<
"Interpolated to (t,phi(t)) = (" << t <<
"," << s <<
")" << std::endl;
1177 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1178 Xyce::dout() << Xyce::section_divider << std::endl;
1196 Linear::Vector * solnVecPtr,
1197 const bool doNotInterpolate,
1198 const std::vector<double> &outputInterpolationTimes,
1199 bool skipPrintLineOutput)
1201 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1203 Xyce::dout() << std::endl;
1204 Xyce::dout() << Xyce::section_divider << std::endl;
1206 " OneStep::printOutputSolution" << std::endl;
1207 Xyce::dout() <<
"usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
1212 bool dointerp =
true;
1225 if (doNotInterpolate)
1230 if (dointerp && !outputInterpolationTimes.empty())
1232 for (
unsigned int i=0;i<outputInterpolationTimes.size();++i)
1252 if (outputInterpolationTimes.empty() || doNotInterpolate)
1258 skipPrintLineOutput);
1261 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1262 Xyce::dout() << Xyce::section_divider << std::endl;
1277 Parallel::Machine comm,
1278 IO::InitialConditionsManager & initial_conditions_manager,
1279 const NodeNameMap & node_name_map,
1281 Linear::Vector * solnVecPtr,
1282 const double saveTime,
1283 const bool doNotInterpolate)
1285 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1287 Xyce::dout() << std::endl;
1288 Xyce::dout() << Xyce::section_divider << std::endl;
1289 Xyce::dout() <<
" OneStep::saveOutputSolution" << std::endl;
1294 bool dointerp =
true;
1298 initial_conditions_manager.outputDCOP(comm, node_name_map, *
ds.
currSolutionPtr);
1300 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1301 Xyce::dout() << Xyce::section_divider << std::endl;
1316 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1318 Xyce::dout() << std::endl;
1319 Xyce::dout() << Xyce::section_divider << std::endl;
1321 " OneStep::updateHistory" << std::endl;
1322 Xyce::dout() <<
"\n Before updates \n" << std::endl;
1325 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1326 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1327 Xyce::dout() << std::endl;
1331 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1332 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1333 Xyce::dout() << std::endl;
1337 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1338 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1339 Xyce::dout() << std::endl;
1341 Xyce::dout() << Xyce::section_divider << std::endl;
1374 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1376 Xyce::dout() <<
"\n After updates \n" << std::endl;
1377 Xyce::dout() <<
"\n newtonCorrectionPtr: " << std::endl;
1379 Xyce::dout() <<
"\n qnewtonCorrectionPtr: " << std::endl;
1383 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1384 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1385 Xyce::dout() << std::endl;
1389 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1390 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1391 Xyce::dout() << std::endl;
1393 Xyce::dout() <<
"\n sNewtonCorrectionPtr: " << std::endl;
1395 Xyce::dout() << std::endl;
1396 Xyce::dout() <<
"\n nextStatePtr: " << std::endl;
1398 Xyce::dout() << std::endl;
1401 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1402 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1403 Xyce::dout() << std::endl;
1405 Xyce::dout() << Xyce::section_divider << std::endl;
1422 for (
int ip=0; ip<numParams;++ip)
1424 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
1425 std::vector<Linear::Vector*> & dXdpHistory =
ds.
dXdpHistory[ip];
1434 *(dXdpHistory[2]) = *(dXdpHistory[1]);
1435 (dqdpHistory[2])->linearCombo(1.0, nextDfdpVec, -1.0, nextDbdpVec);
1438 (dXdpHistory[1])->linearCombo(1.0, nextDXdpVec, -1.0,*(dXdpHistory[0]));
1439 (dqdpHistory[1])->linearCombo(1.0, nextDqdpVec, -1.0,*(dqdpHistory[0]));
1441 *(dXdpHistory[0]) = nextDXdpVec;
1442 *(dqdpHistory[0]) = nextDqdpVec;
1445 Xyce::dout() <<
"dxdp history ip = " << ip <<
":\n";
1448 dXdpHistory[i]->printPetraObject(Xyce::dout());
1468 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1470 Xyce::dout() << std::endl;
1471 Xyce::dout() << Xyce::section_divider << std::endl;
1473 " OneStep::restoreHistory" << std::endl;
1475 Xyce::dout() <<
"\n sec.psi_[i] = " <<
sec.
psi_[i] << std::endl;
1478 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1479 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1480 Xyce::dout() << std::endl;
1484 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1485 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1486 Xyce::dout() << std::endl;
1490 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1491 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1492 Xyce::dout() << std::endl;
1494 Xyce::dout() << Xyce::section_divider << std::endl;
1510 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1512 Xyce::dout() << std::endl;
1513 Xyce::dout() << Xyce::section_divider << std::endl;
1514 Xyce::dout() <<
" OneStep::updateCoeffs" << std::endl;
1518 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1519 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1539 sec.
beta_[1] = temp1/temp2 + (temp1/temp2)*(temp1/temp2)/2;
1549 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1551 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1552 Xyce::dout() <<
" beta_[0] = " <<
sec.
beta_[0] << std::endl;
1553 Xyce::dout() <<
" beta_[1] = " <<
sec.
beta_[1] << std::endl;
1554 Xyce::dout() <<
" beta_[2] = " <<
sec.
beta_[2] << std::endl;
1555 Xyce::dout() <<
" beta_[3] = " <<
sec.
beta_[3] << std::endl;
1556 Xyce::dout() <<
" beta_[4] = " <<
sec.
beta_[4] << std::endl;
1557 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
1558 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
1559 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
1560 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
1561 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
1562 Xyce::dout() <<
" alphas_ = " <<
sec.
alphas_ << std::endl;
1563 Xyce::dout() <<
" alpha0_ = " <<
sec.
alpha0_ << std::endl;
1564 Xyce::dout() <<
" gamma_[0] = " <<
sec.
gamma_[0] << std::endl;
1565 Xyce::dout() <<
" gamma_[1] = " <<
sec.
gamma_[1] << std::endl;
1566 Xyce::dout() <<
" gamma_[2] = " <<
sec.
gamma_[2] << std::endl;
1567 Xyce::dout() <<
" gamma_[3] = " <<
sec.
gamma_[3] << std::endl;
1568 Xyce::dout() <<
" gamma_[4] = " <<
sec.
gamma_[4] << std::endl;
1569 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1570 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
1571 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
1572 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
1573 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
1574 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
1575 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
1576 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
1577 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
1578 Xyce::dout() <<
" sigma_[4] = " <<
sec.
sigma_[4] << std::endl;
1579 Xyce::dout() <<
" ck_ = " <<
sec.
ck_ << std::endl;
1580 Xyce::dout() << Xyce::section_divider << std::endl;
1607 double currentTimeStep;
1613 currentTimeStep = 0.1 * time_to_stop;
1641 if (rh>1.0) currentTimeStep = currentTimeStep/rh;
1668 Xyce::dout() <<
"ERROROPTION=1: DeltaT Grow = 2" <<
"\n" << std::endl
1669 <<
"ERROROPTION=1: DeltaT Cut = 0.125" <<
"\n" << std::endl
1670 <<
"ERROROPTION=1: NL MIN = " << tia_params.
NLmin <<
"\n" << std::endl
1671 <<
"ERROROPTION=1: NL MAX = " << tia_params.
NLmax <<
"\n" << std::endl
1672 <<
"ERROROPTION=1: DELMAX = " <<
sec.
maxTimeStep <<
"\n" << std::endl;
1717 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1719 Xyce::dout() << std::endl;
1720 Xyce::dout() << Xyce::section_divider << std::endl;
1722 " OneStep::initialize" << std::endl;
1723 Xyce::dout() <<
"\n xHistory: \n" << std::endl;
1724 (
ds.
xHistory[0])->printPetraObject(Xyce::dout());
1725 Xyce::dout() << std::endl;
1726 (
ds.
xHistory[1])->printPetraObject(Xyce::dout());
1727 Xyce::dout() << std::endl;
1728 Xyce::dout() <<
"\n qHistory: \n" << std::endl;
1729 (
ds.
qHistory[0])->printPetraObject(Xyce::dout());
1730 Xyce::dout() << std::endl;
1731 (
ds.
qHistory[1])->printPetraObject(Xyce::dout());
1732 Xyce::dout() << std::endl;
1733 Xyce::dout() <<
"\n sHistory: \n" << std::endl;
1734 (
ds.
sHistory[0])->printPetraObject(Xyce::dout());
1735 Xyce::dout() << std::endl;
1736 (
ds.
sHistory[1])->printPetraObject(Xyce::dout());
1737 Xyce::dout() << std::endl;
1738 Xyce::dout() <<
"\n" <<
"currentTimeStep = " << currentTimeStep <<
"\n" << std::endl;
1739 Xyce::dout() <<
"\n" <<
"time_to_stop = " << time_to_stop <<
"\n" << std::endl;
1740 Xyce::dout() << Xyce::section_divider << std::endl;
1757 for (
int ip=0; ip<numParams;++ip)
1759 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
1760 std::vector<Linear::Vector*> & dXdpHistory =
ds.
dXdpHistory[ip];
1766 *(dXdpHistory[0]) = *(currDxdpPtr);
1767 *(dXdpHistory[1]) = *(currDxdpPtr);
1770 *(dqdpHistory[0]) = *(currDqdpPtr);
1771 *(dqdpHistory[1]) = *(currDqdpPtr);
1838 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1840 Xyce::dout() << std::endl;
1841 Xyce::dout() << Xyce::section_divider << std::endl;
1842 Xyce::dout() <<
" OneStep::rejectStep" << std::endl;
1865 std::string msg =
"OneStep::rejectStep: ";
1866 msg +=
" Maximum number of local error test failures. ";
1867 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1906 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1911 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1912 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
1913 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
1914 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
1915 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
1916 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
1917 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1918 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
1919 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
1920 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
1921 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
1922 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
1923 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
1924 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
1925 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
1926 Xyce::dout() <<
" rr = " << rr << std::endl;
1927 Xyce::dout() <<
" Est_ = " <<
sec.
Est_ << std::endl;
1928 Xyce::dout() <<
" nef_ = " <<
sec.
nef_ << std::endl;
1929 Xyce::dout() <<
" newOrder_ = " <<
sec.
newOrder_ << std::endl;
1931 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
1937 std::string tmp =
" OneStep:rejectStep: Warning: Local error test failed with constant step-size.\n";
1938 Xyce::dout() << tmp << std::endl;
1961 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1963 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
1964 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
1984 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1986 Xyce::dout() << Xyce::section_divider << std::endl;
2021 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2023 Xyce::dout() << std::endl;
2024 Xyce::dout() << Xyce::section_divider << std::endl;
2026 Xyce::dout() <<
" OneStep::completeStep" << std::endl;
2051 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2054 Xyce::dout() <<
" rr = " << rr << std::endl;
2056 Xyce::dout() <<
" currentTime = " <<
sec.
currentTime << std::endl;
2057 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2058 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2059 Xyce::dout() <<
" minTimeStep = " <<
sec.
minTimeStep << std::endl;
2060 Xyce::dout() <<
" maxTimeStep = " <<
sec.
maxTimeStep << std::endl;
2100 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2103 Xyce::dout() <<
" r_hincr_ = " <<
sec.
r_hincr_ << std::endl;
2105 Xyce::dout() <<
" Est = " <<
sec.
Est_ << std::endl;
2106 Xyce::dout() <<
" raw rr = " << rr << std::endl;
2153 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2155 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2156 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2180 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2182 Xyce::dout() << Xyce::section_divider << std::endl;
2210 if (DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
2212 Xyce::dout() <<
"\n next state Ptr: \n" << std::endl;
2214 Xyce::dout() << std::endl;
2216 Xyce::dout() <<
"\n sn0: \n" << std::endl;
2217 ds.
sn0Ptr->printPetraObject(Xyce::dout());
2218 Xyce::dout() << std::endl;
2220 Xyce::dout() <<
"\n next State Deriv: \n" << std::endl;
2222 Xyce::dout() << std::endl;
2250 if (DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
2252 Xyce::dout() <<
"\n next store Ptr: \n" << std::endl;
2254 Xyce::dout() << std::endl;
2282 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2284 Xyce::dout() <<
"\n next lead current Ptr: \n" << std::endl;
2286 Xyce::dout() << std::endl;
2288 Xyce::dout() <<
"\n next lead current Q Ptr: \n" << std::endl;
2290 Xyce::dout() << std::endl;
2292 Xyce::dout() <<
"\n curr lead current Q Ptr: \n" << std::endl;
2294 Xyce::dout() << std::endl;
2328 if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
2329 Xyce::dout() << tle;
2344 Xyce::Report::UserWarning() <<
"Excessively small current time step, incorrectly returning with large value";
Linear::Vector * sNewtonCorrectionPtr
Linear::Vector * nextLeadCurrentQPtr
Linear::Vector * leadCurrentQn0Ptr
double timeStepForHistory2_
int newtonConvergenceStatus
std::vector< Linear::Vector * > currDQdxDXdpDerivPtrVector
void obtainSensitivityPredictors()
bool interpolateSolution(double timepoint, Linear::Vector *tmpSolVectorPtr, std::vector< Linear::Vector * > &historyVec)
double partialErrorNormSum()
Linear::Vector * tmpLeadDeltaVPtr
void updateSensitivityHistory()
std::vector< Linear::Vector * > nextDqdpPtrVector
Linear::Vector * currStateDerivPtr
bool printOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const TIAParams &tia_params, const double time, Linear::Vector *solnVecPtr, const bool doNotInterpolate, const std::vector< double > &outputInterpolationTimes, bool skipPrintLineOutput)
std::vector< double > sigma_
void initializeSensitivities()
Pure virtual class to augment a linear system.
void initialize(const TIAParams &tia_params)
int nIterations
Number of newton iterations.
std::vector< double > dOdpVec_
std::vector< double > scaled_dOdpVec_
std::vector< Linear::Vector * > nextDXdpPtrVector
Linear::Vector * tmpStaVectorPtr
Linear::Vector * currStorePtr
std::vector< double > scaled_dOdpAdjVec_
std::vector< Linear::Vector * > leadDeltaVHistory
void obtainSensitivityResiduals()
Linear::Vector * tmpSolVectorPtr
Linear::Vector * leadCurrentpn0Ptr
std::vector< Linear::Vector * > nextDbdpPtrVector
double partialSum_m2(int currentOrder)
int errorAnalysisOption
Error analysis option.
Linear::Vector * ston0Ptr
void rejectStep(const TIAParams &tia_params)
void setTwoLevelTimeInfo()
Linear::Vector * tmpStoVectorPtr
std::vector< Linear::Vector * > nextDfdpPtrVector
std::vector< Linear::Vector * > nextDQdxDXdpDerivPtrVector
std::vector< Linear::Vector * > qHistory
Linear::Vector * nextLeadDeltaVPtr
Linear::Vector * currStatePtr
std::vector< double > objectiveVec_
std::vector< Linear::Vector * > currDXdpPtrVector
double lastAttemptedTimeStep
std::vector< Linear::Vector * > leadCurrentHistory
bool constantTimeStepFlag
Constant time step integration flag.
void updateLeadCurrentVec()
bool printMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes)
Linear::Vector * leadCurrentn0Ptr
Linear::Vector * daeQVectorPtr
Linear::Vector * tmpLeadCurrentVectorPtr
double partialSum_p1(int currentOrder, int maxOrder)
void completeStep(const TIAParams &tia_params)
DataStore & ds
Reference to the TIA data-store object.
Linear::Vector * stopn0Ptr
StepErrorControl & sec
Reference to step-error control object.
Linear::Vector * leadCurrentQpn0Ptr
void setTimeStep(double newTimeStep)
double currentTimeStepRatio
Linear::Vector * daeFVectorPtr
Linear::Vector * qNewtonCorrectionPtr
Linear::Vector * currLeadCurrentQPtr
double leadingCoeff
Time-integration method leading coefficient value.
void getInitialQnorm(TwoLevelError &tle) const
Linear::Vector * nextStoreLeadCurrQDerivPtr
std::vector< Linear::Vector * > currDqdpDerivPtrVector
bool printWaMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes, const int phiGID)
static TimeIntegrationMethod * factory(const TIAParams &tia_params, StepErrorControl &step_error_control, DataStore &data_store)
std::vector< Linear::Vector * > leadCurrentQDerivHistory
Linear::Matrix * dFdxMatrixPtr
Linear::Matrix * JMatrixPtr
Linear::Vector * currLeadCurrentQDerivPtr
Linear::Vector * nextStatePtr
std::vector< Linear::Vector * > leadCurrentQHistory
std::vector< Linear::Vector * > nextDqdpDerivPtrVector
Linear::Vector * dFdxdVpVectorPtr
std::vector< std::vector< Linear::Vector * > > dqdpHistory
Linear::Vector * currLeadDeltaVPtr
std::vector< double > beta_
double delta_x_errorNorm_q1()
Linear::Vector * currStoreLeadCurrQPtr
int numberSuccessiveFailures
Linear::Vector * nextSolutionPtr
Linear::Vector * RHSVectorPtr
bool saveOutputSolution(Parallel::Machine comm, IO::InitialConditionsManager &initial_conditions_manager, const NodeNameMap &node_name_map, const TIAParams &tia_params, Linear::Vector *solnVecPtr, const double saveTime, const bool doNotInterpolate)
Linear::Vector * tmpXn0BPtr
Linear::Vector * nextStorePtr
Linear::Vector * stoQn0Ptr
std::vector< double > psi_
Linear::Vector * dQdxdVpVectorPtr
double currentTimeStepSum
bool interpolateMPDESolution(std::vector< double > &timepoint, Linear::Vector *tmpSolVectorPtr)
OneStep(const TIAParams &tiaP, StepErrorControl &secTmp, DataStore &dsTmp)
Linear::Vector * currLeadCurrentPtr
std::vector< double > dOdpAdjVec_
Linear::Vector * nextLeadCurrentQDerivPtr
void rejectStepForHabanero()
Linear::Vector * newtonCorrectionPtr
void loadFinalSensitivityDerivatives()
Linear::Vector * tmpLeadCurrentQDerivVectorPtr
Linear::Vector * tmpXn0APtr
Linear::Vector * currSolutionPtr
std::vector< Linear::Vector * > stoHistory
double timept_
Keep track of last interpolation point in printMPDEOutputSolution.
Linear::Vector * stoQpn0Ptr
Linear::Vector * nextStoreLeadCurrQPtr
Linear::Vector * currStoreLeadCurrQDerivPtr
Linear::Vector * nextStateDerivPtr
std::vector< Linear::Vector * > xHistory
std::vector< Linear::Vector * > sensRHSPtrVector
std::vector< double > alpha_
Linear::Matrix * dQdxMatrixPtr
double partialTimeDeriv() const
void tranOutput(double time, Linear::Vector &currSolutionPtr, Linear::Vector &stateVecPtr, Linear::Vector &storeVecPtr, Linear::Vector &lead_current_vector, Linear::Vector &junction_voltage_vector, Linear::Vector &lead_current_dqdt_vector, std::vector< double > &objectiveVec_, std::vector< double > &dOdpVec_, std::vector< double > &dOdpAdjVec_, std::vector< double > &scaled_dOdpVec_, std::vector< double > &scaled_dOdpAdjVec_, bool skipPrintLineOutput=false)
std::vector< Linear::Vector * > currDQdxDXdpPtrVector
double partialSum_m1(int currentOrder)
std::vector< std::vector< Linear::Vector * > > dXdpHistory
Linear::Vector * daeBVectorPtr
std::vector< Linear::Vector * > nextDQdxDXdpPtrVector
std::vector< Linear::Vector * > currDqdpPtrVector
std::vector< Linear::Vector * > stoLeadCurrQHistory
double partialQErrorNormSum()
std::vector< double > gamma_
void getTwoLevelError(TwoLevelError &tle) const
Linear::Vector * nextLeadCurrentPtr
std::vector< Linear::Vector * > sHistory