47 #include <Xyce_config.h>
56 #include <N_ERH_ErrorMgr.h>
57 #include <N_LAS_BlockVector.h>
58 #include <N_LAS_Matrix.h>
59 #include <N_LAS_System.h>
60 #include <N_LAS_Vector.h>
61 #include <N_PDS_Comm.h>
62 #include <N_PDS_Manager.h>
67 #include <N_UTL_Diagnostic.h>
68 #include <N_UTL_FeatureTest.h>
69 #include <N_UTL_MachDepParams.h>
89 TimeIntegrationMethod *
95 return new OneStep(tia_params, step_error_control, data_store);
115 timeStepForHistory2_(0.0)
161 if (DEBUG_TIME && isActive(Diag::TIME_PREDICTOR))
163 Xyce::dout().width(21); Xyce::dout().precision(13); Xyce::dout().setf(std::ios::scientific);
164 Xyce::dout() << std::endl;
165 Xyce::dout() << Xyce::section_divider << std::endl;
167 " OneStep::obtainPredictor" << std::endl;
169 Xyce::dout() <<
"\n sec.nscsco_: " <<
sec.
nscsco_ << std::endl;
171 Xyce::dout() <<
"\n sec.beta_[" << i <<
"] = " <<
sec.
beta_[i] <<
"\n" << std::endl;
174 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
175 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
176 Xyce::dout() << std::endl;
180 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
181 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
182 Xyce::dout() << std::endl;
186 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
187 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
188 Xyce::dout() << std::endl;
192 Xyce::dout() <<
"\n stoHistory["<< i <<
"]: \n" << std::endl;
194 Xyce::dout() << std::endl;
198 Xyce::dout() <<
"\n stoLeadCurrQHistory["<< i <<
"]: \n" << std::endl;
200 Xyce::dout() << std::endl;
202 Xyce::dout() <<
"\n xn0: \n" << std::endl;
203 ds.
xn0Ptr->printPetraObject(Xyce::dout());
204 Xyce::dout() << std::endl;
205 Xyce::dout() <<
"\n qn0: \n" << std::endl;
206 ds.
qn0Ptr->printPetraObject(Xyce::dout());
207 Xyce::dout() << std::endl;
208 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
209 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
210 Xyce::dout() << std::endl;
211 Xyce::dout() <<
"\n sn0: \n" << std::endl;
212 ds.
sn0Ptr->printPetraObject(Xyce::dout());
213 Xyce::dout() << std::endl;
214 Xyce::dout() <<
"\n spn0: \n" << std::endl;
215 ds.
spn0Ptr->printPetraObject(Xyce::dout());
216 Xyce::dout() << std::endl;
217 Xyce::dout() <<
"\n stoQn0Ptr: \n" << std::endl;
219 Xyce::dout() << std::endl;
220 Xyce::dout() <<
"\n stoQpn0Ptr: \n" << std::endl;
222 Xyce::dout() << std::endl;
223 Xyce::dout() << Xyce::section_divider << std::endl;
262 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
264 Xyce::dout() << std::endl;
265 Xyce::dout() << Xyce::section_divider << std::endl;
267 " OneStep::obtainResidual" << std::endl;
268 Xyce::dout() <<
"\n t = " <<
sec.
nextTime <<
"\n" << std::endl;
269 Xyce::dout() <<
"\n solution: \n" << std::endl;
271 Xyce::dout() <<
"\n daeQVector: \n" << std::endl;
273 Xyce::dout() <<
"\n qn0: \n" << std::endl;
274 ds.
qn0Ptr->printPetraObject(Xyce::dout());
275 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
276 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
278 Xyce::dout() <<
"\n daeFVector: \n" << std::endl;
281 Xyce::dout() <<
"\n dQdt-vector: \n" << std::endl;
283 Xyce::dout() << std::endl;
317 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
319 Xyce::dout() <<
"\n Residual-vector: \n" << std::endl;
320 Xyce::dout() <<
"-(qpn0-(sec.alpha_s/h)*(Q-qn0)+F-B) \n" << std::endl;
322 Xyce::dout() << Xyce::section_divider << std::endl;
323 Xyce::dout() << std::endl;
338 for (
int ip=0; ip<numParams;++ip)
348 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
362 nextDqdpDerivVec.linearCombo(1.0,dqdpVec,-1.0, *(dqdpHistory[0]));
364 nextDqdpDerivVec.linearCombo(-1.0,currDqdpDerivVec,1.0,nextDqdpDerivVec);
366 RHSVec.linearCombo(0.5,nextDqdpDerivVec,+0.5,dfdpVec);
367 RHSVec.linearCombo(1.0,RHSVec,-0.5,dbdpVec);
372 nextDqdpDerivVec.linearCombo(1.0,dqdpVec,-1.0, *(dqdpHistory[0]));
375 RHSVec.linearCombo(1.0,nextDqdpDerivVec,+1.0,dfdpVec);
376 RHSVec.linearCombo(1.0,RHSVec,-1.0,dbdpVec);
384 RHSVec.linearCombo(1.0,RHSVec, qscalar, currDQdxDXdpVec);
389 RHSVec.linearCombo(1.0,RHSVec, 0.5, currDQdxDXdpDerivVec);
393 Xyce::dout() <<
"obtainSensitivityResiduals: RHS Vector, ip = " << ip <<
":\n";
394 RHSVec.printPetraObject(Xyce::dout());
411 for (
int ip=0; ip<numParams;++ip)
422 nextDQdxDXdpDerivVec.putScalar(0.0);
423 nextDQdxDXdpDerivVec.linearCombo(2.0,nextDQdxDXdpVec,-2.0,currDQdxDXdpVec);
424 nextDQdxDXdpDerivVec.scale(1.0/dt);
425 nextDQdxDXdpDerivVec.linearCombo(-1.0,currDQdxDXdpDerivVec,1.0,nextDQdxDXdpDerivVec);
429 nextDQdxDXdpDerivVec.putScalar(0.0);
430 nextDQdxDXdpDerivVec.linearCombo(1.0,nextDQdxDXdpVec,-1.0,currDQdxDXdpVec);
431 nextDQdxDXdpDerivVec.scale(1.0/dt);
446 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
448 Xyce::dout() << std::endl;
449 Xyce::dout() << Xyce::section_divider << std::endl;
451 " OneStep::obtainJacobian" << std::endl;
470 Jac.linearCombo( qscalar, dQdx, fscalar, dFdx );
472 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
474 Xyce::dout() <<
"fscalar = " << fscalar <<
" qscalar = " << qscalar << std::endl;
476 Xyce::dout() <<
"\n dFdx:" <<std::endl;
477 dFdx.printPetraObject(Xyce::dout());
478 Xyce::dout() <<
"\n dQdx:" <<std::endl;
479 dQdx.printPetraObject(Xyce::dout());
480 Xyce::dout() <<
"\n Total Jacobian:" <<std::endl;
481 Jac.printPetraObject(Xyce::dout());
487 Xyce::dout() << Xyce::section_divider << std::endl;
488 Xyce::dout() << std::endl;
500 Linear::Vector * tmpSolVectorPtr, std::vector<Linear::Vector*> & historyVec)
506 *tmpSolVectorPtr = *(historyVec[0]);
508 if( -dtr < 2 * Util::MachineDependentParams::MachinePrecision() )
518 tmpSolVectorPtr->linearCombo(1.0,*tmpSolVectorPtr,dtr,*(historyVec[1]));
541 Linear::Vector * tmpSolVectorPtr)
543 Linear::BlockVector * blockTempSolVectorPtr =
544 dynamic_cast<Linear::BlockVector*
>(tmpSolVectorPtr);
545 if (blockTempSolVectorPtr == NULL)
547 std::string msg =
"OneStep::interpolateMPDESolution: ";
548 msg +=
"Linear::Vector tmpSolVectorPtr is not of type Linear::BlockVector";
549 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
555 int numblocks = timepoint.size();
556 int blockCount = blockTempSolVectorPtr->blockCount();
557 if (numblocks > blockCount)
559 std::string msg =
"OneStep::interpolateMPDESolution: ";
560 msg +=
"Number of time points requested is greater than number of fast time points in MPDE block vector";
561 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
574 tfuzz = 100 * uround * (tn + hh);
575 tp = tn - hused - tfuzz;
576 for (
int i=0; i<numblocks ; ++i)
578 if ( (timepoint[i] - tp)*hh < 0.0 )
584 Linear::Vector * solVectorPtr;
585 Linear::Vector * xHistoryVectorPtr;
587 for (
int i=0; i < numblocks ; ++i)
589 if ((kused == 0) || (timepoint[i] == tn)) { kord = 1; }
590 else { kord = kused; }
591 solVectorPtr = &(blockTempSolVectorPtr->block(i));
593 delt = timepoint[i] - tn;
595 for (
int j=1 ; j <= kord ; ++j)
599 Linear::BlockVector * blockXHistoryVectorPtr =
600 dynamic_cast<Linear::BlockVector*>(
ds.
xHistory[j]);
601 if (blockXHistoryVectorPtr == NULL)
603 Xyce::Report::DevelFatal0().in(
"OneStep::interpolateMPDESolution") <<
"Linear::Vector ds.xHistory[j] is not of type Linear::BlockVector\n j = " << j;
606 xHistoryVectorPtr = &(blockXHistoryVectorPtr->block(i));
607 solVectorPtr->linearCombo(1.0,*solVectorPtr,c,*xHistoryVectorPtr);
624 Linear::Vector * solnVecPtr,
625 const std::vector<double> & fastTimes )
627 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
629 Xyce::dout() << std::endl;
630 Xyce::dout() << Xyce::section_divider << std::endl;
632 " OneStep::printMPDEOutputSolution" << std::endl;
639 double beg_of_output_time_interval = lasttime;
640 double end_of_output_time_interval = tn;
641 double start_time = max(lasttime,beg_of_output_time_interval);
642 double stop_time = min(tn,end_of_output_time_interval);
643 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
645 Xyce::dout() <<
"timestep = " << timestep << std::endl;
646 Xyce::dout() <<
"lasttime = " << lasttime << std::endl;
647 Xyce::dout() <<
"tn = " << tn << std::endl;
648 Xyce::dout() <<
"beg_of_output_time_interval = " << beg_of_output_time_interval << std::endl;
649 Xyce::dout() <<
"end_of_output_time_interval = " << end_of_output_time_interval << std::endl;
650 Xyce::dout() <<
"start_time = " << start_time << std::endl;
651 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
654 Linear::BlockVector * blockTmpSolVectorPtr =
656 if (blockTmpSolVectorPtr == NULL)
658 std::string msg =
"OneStep::printMPDEOutputSolution: ";
659 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
660 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
663 int blockCount = blockTmpSolVectorPtr->blockCount();
666 double T2 = fastTimes.back();
668 double charcross = fmod(start_time,T2);
672 for (
int i=0 ; i<=blockCount ; ++i)
674 if (fastTimes[i] >= charcross)
682 std::string msg =
"OneStep::printMPDEOutputSolution: ";
683 msg +=
"Cannot find where characteristic curve crosses fast time slice at start_time";
684 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
687 std::vector<double> h2(blockCount,0);
688 for (
int j=0 ; j < blockCount ; ++j)
690 h2[j] = fastTimes[j+1] - fastTimes[j];
692 std::vector<double> ti;
694 double first_interp = start_time - charcross + fastTimes[s_ind_0];
695 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
697 Xyce::dout() <<
"first_interp = " << first_interp << std::endl;
700 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
702 double eps = fabs(start_time)*1.0e-6;
703 if ( fabs(first_interp-
timept_) <= eps )
705 first_interp += h2[s_ind_0];
707 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
708 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
710 Xyce::dout() <<
"Moving first_interp forward to avoid duplicate outputs: " << first_interp << std::endl;
714 double t = first_interp;
715 while (t <= stop_time)
720 if (sn >= blockCount) { sn = 0; }
722 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
724 Xyce::dout() <<
"T2 = " << T2 << std::endl;
725 Xyce::dout() <<
"charcross = " << charcross << std::endl;
726 Xyce::dout() <<
"s_ind_0 = " << s_ind_0 << std::endl;
727 Xyce::dout() <<
"Expecting to interpolate the following points:" << std::endl;
728 unsigned int numinterp = ti.size();
729 for (
unsigned int i=0 ; i < numinterp ; ++i)
731 Xyce::dout() << ti[i] << std::endl;
733 Xyce::dout() <<
"Total of " << numinterp <<
" points" << std::endl;
737 unsigned int tinum = ti.size();
738 int total_interp = 0;
739 std::vector<double> timepoint_vec(blockCount,stop_time);
740 int num_interp_this_cycle = 0;
742 for (
unsigned int i=0; i < tinum ; ++i)
744 timepoint_vec[s_ind] = ti[i];
745 num_interp_this_cycle++;
747 if (s_ind >= blockCount) { s_ind = 0; };
749 if ((s_ind == s_ind_0) || (i == tinum-1))
754 for (
int j=0 ; j < num_interp_this_cycle ; ++j)
758 timept_, blockTmpSolVectorPtr->block(s),
764 if (s >= blockCount) { s = 0; }
765 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
766 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
768 num_interp_this_cycle = 0;
771 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
772 Xyce::dout() <<
"Total of " << total_interp <<
" points" << std::endl;
775 eps = fabs(stop_time)*1.0e-8;
777 if (fabs(
timept_ - stop_time) >= eps)
779 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
781 Xyce::dout() <<
"Previous timept = " <<
timept_ << std::endl;
782 Xyce::dout() <<
"Expecting to interpolate the following point: " << stop_time << std::endl;
784 Linear::Vector* tmpSolnVecPtr = solnVecPtr;
791 Linear::BlockVector * blockTmpSolnVecPtr =
792 dynamic_cast<Linear::BlockVector*
>(tmpSolnVecPtr);
793 Linear::BlockVector * blockTmpVecPtr =
794 dynamic_cast<Linear::BlockVector*
>(tmpVecPtr);
795 if (blockTmpSolnVecPtr == NULL)
797 std::string msg =
"OneStep::printMPDEOutputSolution: ";
798 msg +=
"Linear::Vector tmpSolnVecPtr is not of type Linear::BlockVector";
799 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
802 if (blockTmpVecPtr == NULL)
804 std::string msg =
"OneStep::printMPDEOutputSolution: ";
805 msg +=
"Linear::Vector tmpVecPtr is not of type Linear::BlockVector";
806 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
811 charcross = fmod(stop_time,T2);
814 if( charcross < fastTimes[0] )
817 s_ind_1 = blockCount-1;
821 for (
int i=blockCount-1 ; i>=0 ; --i)
823 if (fastTimes[i] <= charcross)
832 std::string msg =
"OneStep::printMPDEOutputSolution: ";
833 msg +=
"Cannot find where characteristic curve crosses fast time slice at stop_time";
834 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
839 double coeff_sm = fastTimes[sp]-charcross;
840 double coeff_sp = charcross-fastTimes[sm];
841 if (sp == blockCount) { sp = 0; }
842 double dt = h2[s_ind_1];
844 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
846 Xyce::dout() <<
"charcross = " << charcross << std::endl;
847 Xyce::dout() <<
"s_ind_1 = " << s_ind_1 << std::endl;
848 Xyce::dout() <<
"sp = " << sp << std::endl;
849 Xyce::dout() <<
"sm = " << sm << std::endl;
850 Xyce::dout() <<
"dt = " << dt << std::endl;
851 Xyce::dout() <<
"timept = " <<
timept_ << std::endl;
852 Xyce::dout() <<
"coeff_sm = " << coeff_sm << std::endl;
853 Xyce::dout() <<
"coeff_sp = " << coeff_sp << std::endl;
855 blockTmpVecPtr->block(0).linearCombo(
856 coeff_sm/dt, blockTmpSolnVecPtr->block(sm),
857 coeff_sp/dt, blockTmpSolnVecPtr->block(sp)
863 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
864 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
866 else if(DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
868 Xyce::dout() <<
"No further interpolation required." << std::endl;
871 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
872 Xyce::dout() << Xyce::section_divider << std::endl;
888 Linear::Vector * solnVecPtr,
889 const std::vector<double> & fastTimes,
892 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
894 Xyce::dout() << std::endl;
895 Xyce::dout() << Xyce::section_divider << std::endl;
897 " OneStep::printWaMPDEOutputSolution" << std::endl;
904 double beg_of_output_time_interval = lasttime;
905 double end_of_output_time_interval = tn;
906 double start_time = max(lasttime,beg_of_output_time_interval);
907 double stop_time = min(tn,end_of_output_time_interval);
908 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
910 Xyce::dout() <<
"start_time = " << start_time << std::endl;
911 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
936 Linear::BlockVector * blockTmpSolVectorPtr =
938 Linear::BlockVector * blockTmpXn0APtr =
940 Linear::BlockVector * blockTmpXn0BPtr =
942 if (blockTmpSolVectorPtr == NULL)
944 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
945 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
946 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
949 if (blockTmpXn0APtr == NULL)
951 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
952 msg +=
"Linear::Vector ds.tmpXn0APtr is not of type Linear::BlockVector";
953 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
956 if (blockTmpXn0BPtr == NULL)
958 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
959 msg +=
"Linear::Vector ds.tmpXn0BPtr is not of type Linear::BlockVector";
960 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
963 int phiLID = blockTmpSolVectorPtr->pmap()->globalToLocalIndex(phiGID);
967 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
969 Xyce::dout() <<
" sec.usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
970 Xyce::dout() <<
" sec.currentTime_ = " <<
sec.
currentTime << std::endl;
971 Xyce::dout() <<
" lasttime = " << lasttime << std::endl;
979 timeA = lasttime + hh*i;
983 std::string msg =
"interpolateSolution returned false!";
984 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0,msg);
993 timeB = lasttime + hh*(i+1);
995 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
997 Xyce::dout() <<
"Interpolating in [ " << timeA <<
", " << timeB <<
" ]" << std::endl;
998 Xyce::dout() <<
"timeA = " << timeA << std::endl;
999 Xyce::dout() <<
"timeB = " << timeB << std::endl;
1003 std::vector<double> t1vals;
1004 double T2 = fastTimes.back();
1005 int blockCount = blockTmpSolVectorPtr->blockCount();
1006 double h2 = T2/blockCount;
1007 double tval = timeA+h2;
1008 while (tval <= timeB)
1010 t1vals.push_back(tval);
1014 double eps = fabs(timeB)*1.0e-8;
1015 if ( (t1vals.size() == 0) || (fabs(t1vals.back() - timeB) >= eps) )
1017 t1vals.push_back(timeB);
1019 std::vector<double> t2vals, phiAB(2);
1020 std::vector<double> tmpPhiAB(2, 0.0);
1026 blockTmpSolVectorPtr->pmap()->pdsComm().sumAll( &tmpPhiAB[0], &phiAB[0], 2 );
1028 double phiA = phiAB[0], phiB = phiAB[1];
1029 for (
unsigned int j=0 ; j<t1vals.size() ; ++j)
1031 double phi = (1/(timeB-timeA))*(phiA*(timeB-t1vals[j])+phiB*(t1vals[j]-timeA));
1032 t2vals.push_back(fmod(phi,T2));
1034 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1036 Xyce::dout() <<
"t1vals = " << std::endl;
1037 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
1039 Xyce::dout() << t1vals[j] << std::endl;
1041 Xyce::dout() <<
"phi(" << timeA <<
") = " << phiA << std::endl;
1042 Xyce::dout() <<
"phi(" << timeB <<
") = " << phiB << std::endl;
1043 Xyce::dout() <<
"t2vals = " << std::endl;
1044 for (
unsigned int j=0 ; j< t2vals.size() ; ++j)
1046 Xyce::dout() << t2vals[j] << std::endl;
1054 double t = t1vals[0];
1055 double s = t2vals[0];
1059 for (
int j=0 ; j < blockCount ; ++j)
1061 if ((fastTimes[j] <= s) && (s < fastTimes[j+1]))
1067 if (b2 == blockCount)
1071 double s1 = fastTimes[b1];
1072 double s2 = fastTimes[b1+1];
1073 if ((s < s1) || (s > s2))
1075 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
1076 msg +=
" Interpolator cannot find a fast time block containing the first point ";
1077 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1079 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1080 Xyce::dout() <<
"Found s = " << s <<
" in block " << b1 <<
" with boundary = [" << s1 <<
"," << s2 <<
"]" << std::endl;
1082 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
1088 if ( (s < s1) || (s > s2) )
1090 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1091 Xyce::dout() <<
"Incrementing fast time block for next interpolation." << std::endl;
1094 if (b1 == blockCount)
1099 if (b2 == blockCount)
1104 s2 = fastTimes[b1+1];
1107 if ((s < s1) || (s > s2))
1109 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1110 Xyce::dout() <<
"Searching for fast time block for next interpolation." << std::endl;
1113 for (
int j2=0 ; j2 < blockCount ; ++j2)
1115 if ((fastTimes[j2] <= s) && (s < fastTimes[j2+1]))
1121 if (b2 == blockCount)
1126 s2 = fastTimes[b1+1];
1129 if ((s < s1) || (s > s2))
1131 std::string msg =
"OneStep::printWaMPDEOutputSolution: ";
1132 msg +=
" Interpolator moved fast time block but new point is not in this block ";
1133 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1144 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1146 Xyce::dout() <<
"Interpolating in the block:" << std::endl;
1147 Xyce::dout() <<
"(t1,t2) = (" << t1 <<
"," << t2 <<
")" << std::endl;
1148 Xyce::dout() <<
"(s1,s2) = (" << s1 <<
"," << s2 <<
")" << std::endl;
1151 double denom = (t2-t1)*(s2-s1);
1152 double coeff0 = (t2-t)*(s2-s)/denom;
1153 double coeff1 = (t2-t)*(s-s1)/denom;
1154 double coeff2 = (t-t1)*(s2-s)/denom;
1155 double coeff3 = (t-t1)*(s-s1)/denom;
1156 (blockTmpSolVectorPtr->block(b1)).linearCombo(
1157 coeff0, blockTmpXn0APtr->block(b1),
1158 coeff1, blockTmpXn0APtr->block(b2),
1159 coeff2, blockTmpXn0BPtr->block(b1) );
1160 (blockTmpSolVectorPtr->block(b1)).update(
1161 coeff3, blockTmpXn0BPtr->block(b2), 1.0 );
1166 outputManagerAdapter.
tranOutput(t, blockTmpSolVectorPtr->block(b1),
1170 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1171 Xyce::dout() <<
"Interpolated to (t,phi(t)) = (" << t <<
"," << s <<
")" << std::endl;
1176 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1177 Xyce::dout() << Xyce::section_divider << std::endl;
1195 Linear::Vector * solnVecPtr,
1196 const bool doNotInterpolate,
1197 const std::vector<double> &outputInterpolationTimes,
1198 bool skipPrintLineOutput)
1200 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1202 Xyce::dout() << std::endl;
1203 Xyce::dout() << Xyce::section_divider << std::endl;
1205 " OneStep::printOutputSolution" << std::endl;
1206 Xyce::dout() <<
"usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
1211 bool dointerp =
true;
1224 if (doNotInterpolate)
1229 if (dointerp && !outputInterpolationTimes.empty())
1231 for (
unsigned int i=0;i<outputInterpolationTimes.size();++i)
1250 if (outputInterpolationTimes.empty() || doNotInterpolate)
1256 skipPrintLineOutput);
1259 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1260 Xyce::dout() << Xyce::section_divider << std::endl;
1277 Linear::Vector * solnVecPtr,
1278 const double saveTime,
1279 const bool doNotInterpolate)
1281 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1283 Xyce::dout() << std::endl;
1284 Xyce::dout() << Xyce::section_divider << std::endl;
1285 Xyce::dout() <<
" OneStep::saveOutputSolution" << std::endl;
1290 bool dointerp =
true;
1295 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1296 Xyce::dout() << Xyce::section_divider << std::endl;
1311 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1313 Xyce::dout() << std::endl;
1314 Xyce::dout() << Xyce::section_divider << std::endl;
1316 " OneStep::updateHistory" << std::endl;
1317 Xyce::dout() <<
"\n Before updates \n" << std::endl;
1320 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1321 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1322 Xyce::dout() << std::endl;
1326 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1327 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1328 Xyce::dout() << std::endl;
1332 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1333 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1334 Xyce::dout() << std::endl;
1336 Xyce::dout() << Xyce::section_divider << std::endl;
1369 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1371 Xyce::dout() <<
"\n After updates \n" << std::endl;
1372 Xyce::dout() <<
"\n newtonCorrectionPtr: " << std::endl;
1374 Xyce::dout() <<
"\n qnewtonCorrectionPtr: " << std::endl;
1378 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1379 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1380 Xyce::dout() << std::endl;
1384 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1385 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1386 Xyce::dout() << std::endl;
1388 Xyce::dout() <<
"\n sNewtonCorrectionPtr: " << std::endl;
1390 Xyce::dout() << std::endl;
1391 Xyce::dout() <<
"\n nextStatePtr: " << std::endl;
1393 Xyce::dout() << std::endl;
1396 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1397 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1398 Xyce::dout() << std::endl;
1400 Xyce::dout() << Xyce::section_divider << std::endl;
1417 for (
int ip=0; ip<numParams;++ip)
1419 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
1420 std::vector<Linear::Vector*> & dXdpHistory =
ds.
dXdpHistory[ip];
1429 *(dXdpHistory[2]) = *(dXdpHistory[1]);
1430 (dqdpHistory[2])->linearCombo(1.0, nextDfdpVec, -1.0, nextDbdpVec);
1433 (dXdpHistory[1])->linearCombo(1.0, nextDXdpVec, -1.0,*(dXdpHistory[0]));
1434 (dqdpHistory[1])->linearCombo(1.0, nextDqdpVec, -1.0,*(dqdpHistory[0]));
1436 *(dXdpHistory[0]) = nextDXdpVec;
1437 *(dqdpHistory[0]) = nextDqdpVec;
1440 Xyce::dout() <<
"dxdp history ip = " << ip <<
":\n";
1443 dXdpHistory[i]->printPetraObject(Xyce::dout());
1463 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1465 Xyce::dout() << std::endl;
1466 Xyce::dout() << Xyce::section_divider << std::endl;
1468 " OneStep::restoreHistory" << std::endl;
1470 Xyce::dout() <<
"\n sec.psi_[i] = " <<
sec.
psi_[i] << std::endl;
1473 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1474 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1475 Xyce::dout() << std::endl;
1479 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1480 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1481 Xyce::dout() << std::endl;
1485 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1486 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1487 Xyce::dout() << std::endl;
1489 Xyce::dout() << Xyce::section_divider << std::endl;
1505 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1507 Xyce::dout() << std::endl;
1508 Xyce::dout() << Xyce::section_divider << std::endl;
1509 Xyce::dout() <<
" OneStep::updateCoeffs" << std::endl;
1513 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1514 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1534 sec.
beta_[1] = temp1/temp2 + (temp1/temp2)*(temp1/temp2)/2;
1544 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1546 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1547 Xyce::dout() <<
" beta_[0] = " <<
sec.
beta_[0] << std::endl;
1548 Xyce::dout() <<
" beta_[1] = " <<
sec.
beta_[1] << std::endl;
1549 Xyce::dout() <<
" beta_[2] = " <<
sec.
beta_[2] << std::endl;
1550 Xyce::dout() <<
" beta_[3] = " <<
sec.
beta_[3] << std::endl;
1551 Xyce::dout() <<
" beta_[4] = " <<
sec.
beta_[4] << std::endl;
1552 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
1553 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
1554 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
1555 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
1556 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
1557 Xyce::dout() <<
" alphas_ = " <<
sec.
alphas_ << std::endl;
1558 Xyce::dout() <<
" alpha0_ = " <<
sec.
alpha0_ << std::endl;
1559 Xyce::dout() <<
" gamma_[0] = " <<
sec.
gamma_[0] << std::endl;
1560 Xyce::dout() <<
" gamma_[1] = " <<
sec.
gamma_[1] << std::endl;
1561 Xyce::dout() <<
" gamma_[2] = " <<
sec.
gamma_[2] << std::endl;
1562 Xyce::dout() <<
" gamma_[3] = " <<
sec.
gamma_[3] << std::endl;
1563 Xyce::dout() <<
" gamma_[4] = " <<
sec.
gamma_[4] << std::endl;
1564 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1565 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
1566 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
1567 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
1568 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
1569 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
1570 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
1571 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
1572 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
1573 Xyce::dout() <<
" sigma_[4] = " <<
sec.
sigma_[4] << std::endl;
1574 Xyce::dout() <<
" ck_ = " <<
sec.
ck_ << std::endl;
1575 Xyce::dout() << Xyce::section_divider << std::endl;
1603 double currentTimeStep;
1609 currentTimeStep = 0.1 * time_to_stop;
1617 #ifdef Xyce_INCOMPLETE_2LEVEL_NORMS
1618 double dnorm_q = 0.0;
1642 if (rh>1.0) currentTimeStep = currentTimeStep/rh;
1669 Xyce::dout() <<
"ERROROPTION=1: DeltaT Grow = 2" <<
"\n" << std::endl
1670 <<
"ERROROPTION=1: DeltaT Cut = 0.125" <<
"\n" << std::endl
1671 <<
"ERROROPTION=1: NL MIN = " << tia_params.
NLmin <<
"\n" << std::endl
1672 <<
"ERROROPTION=1: NL MAX = " << tia_params.
NLmax <<
"\n" << std::endl
1673 <<
"ERROROPTION=1: DELMAX = " <<
sec.
maxTimeStep <<
"\n" << std::endl;
1708 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1710 Xyce::dout() << std::endl;
1711 Xyce::dout() << Xyce::section_divider << std::endl;
1713 " OneStep::initialize" << std::endl;
1714 Xyce::dout() <<
"\n xHistory: \n" << std::endl;
1715 (
ds.
xHistory[0])->printPetraObject(Xyce::dout());
1716 Xyce::dout() << std::endl;
1717 (
ds.
xHistory[1])->printPetraObject(Xyce::dout());
1718 Xyce::dout() << std::endl;
1719 Xyce::dout() <<
"\n qHistory: \n" << std::endl;
1720 (
ds.
qHistory[0])->printPetraObject(Xyce::dout());
1721 Xyce::dout() << std::endl;
1722 (
ds.
qHistory[1])->printPetraObject(Xyce::dout());
1723 Xyce::dout() << std::endl;
1724 Xyce::dout() <<
"\n sHistory: \n" << std::endl;
1725 (
ds.
sHistory[0])->printPetraObject(Xyce::dout());
1726 Xyce::dout() << std::endl;
1727 (
ds.
sHistory[1])->printPetraObject(Xyce::dout());
1728 Xyce::dout() << std::endl;
1729 Xyce::dout() <<
"\n" <<
"currentTimeStep = " << currentTimeStep <<
"\n" << std::endl;
1730 Xyce::dout() <<
"\n" <<
"time_to_stop = " << time_to_stop <<
"\n" << std::endl;
1731 Xyce::dout() << Xyce::section_divider << std::endl;
1748 for (
int ip=0; ip<numParams;++ip)
1750 std::vector<Linear::Vector*> & dqdpHistory =
ds.
dqdpHistory[ip];
1751 std::vector<Linear::Vector*> & dXdpHistory =
ds.
dXdpHistory[ip];
1757 *(dXdpHistory[0]) = *(currDxdpPtr);
1758 *(dXdpHistory[1]) = *(currDxdpPtr);
1761 *(dqdpHistory[0]) = *(currDqdpPtr);
1762 *(dqdpHistory[1]) = *(currDqdpPtr);
1778 double time_to_stop = sec.stopTime - sec.currentTime;
1782 *(ds.xHistory[0]) = *(ds.currSolutionPtr);
1783 (ds.xHistory[1])->putScalar(0.0);
1786 *(ds.qHistory[0]) = *(ds.daeQVectorPtr);
1787 (ds.qHistory[1])->linearCombo(1.0, *(ds.daeFVectorPtr), -1.0, *(ds.daeBVectorPtr));
1788 (ds.qHistory[1])->scale(-sec.currentTimeStep);
1791 *(ds.sHistory[0]) = *(ds.nextStatePtr);
1792 (ds.sHistory[1])->putScalar(0.0);
1795 sec.numberOfSteps_ = 0;
1797 sec.psi_[0] = sec.currentTimeStep;
1798 sec.cj_ = 1/sec.psi_[0];
1841 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1843 Xyce::dout() << std::endl;
1844 Xyce::dout() << Xyce::section_divider << std::endl;
1845 Xyce::dout() <<
" OneStep::rejectStep" << std::endl;
1873 std::string msg =
"OneStep::rejectStep: ";
1874 msg +=
" Maximum number of local error test failures. ";
1875 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1898 #ifndef Xyce_USE_Q_NORM
1922 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1927 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1928 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
1929 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
1930 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
1931 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
1932 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
1933 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1934 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
1935 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
1936 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
1937 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
1938 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
1939 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
1940 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
1941 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
1942 Xyce::dout() <<
" sigma_[4] = " <<
sec.
sigma_[4] << std::endl;
1943 Xyce::dout() <<
" rr = " << rr << std::endl;
1944 Xyce::dout() <<
" r_factor_ = " <<
sec.
r_factor_ << std::endl;
1945 Xyce::dout() <<
" r_safety_ = " <<
sec.
r_safety_ << std::endl;
1946 Xyce::dout() <<
" Est_ = " <<
sec.
Est_ << std::endl;
1947 Xyce::dout() <<
" nef_ = " <<
sec.
nef_ << std::endl;
1948 Xyce::dout() <<
" r_fudge_ = " <<
sec.
r_fudge_ << std::endl;
1949 Xyce::dout() <<
" newOrder_ = " <<
sec.
newOrder_ << std::endl;
1951 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
1957 std::string tmp =
" OneStep:rejectStep: Warning: Local error test failed with constant step-size.\n";
1958 Xyce::dout() << tmp << std::endl;
1981 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1983 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
1984 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2004 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2006 Xyce::dout() << Xyce::section_divider << std::endl;
2041 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2043 Xyce::dout() << std::endl;
2044 Xyce::dout() << Xyce::section_divider << std::endl;
2046 Xyce::dout() <<
" OneStep::completeStep" << std::endl;
2071 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2074 Xyce::dout() <<
" rr = " << rr << std::endl;
2076 Xyce::dout() <<
" currentTime = " <<
sec.
currentTime << std::endl;
2077 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2078 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2079 Xyce::dout() <<
" minTimeStep = " <<
sec.
minTimeStep << std::endl;
2080 Xyce::dout() <<
" maxTimeStep = " <<
sec.
maxTimeStep << std::endl;
2120 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2123 Xyce::dout() <<
" r_safety = " <<
sec.
r_safety_ << std::endl;
2124 Xyce::dout() <<
" r_fudge_ = " <<
sec.
r_fudge_ << std::endl;
2125 Xyce::dout() <<
" r_hincr_ = " <<
sec.
r_hincr_ << std::endl;
2127 Xyce::dout() <<
" Est = " <<
sec.
Est_ << std::endl;
2128 Xyce::dout() <<
" raw rr = " << rr << std::endl;
2175 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2177 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2178 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2203 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2205 Xyce::dout() << Xyce::section_divider << std::endl;
2234 if (DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
2236 Xyce::dout() <<
"\n next state Ptr: \n" << std::endl;
2238 Xyce::dout() << std::endl;
2240 Xyce::dout() <<
"\n sn0: \n" << std::endl;
2241 ds.
sn0Ptr->printPetraObject(Xyce::dout());
2242 Xyce::dout() << std::endl;
2244 Xyce::dout() <<
"\n next State Deriv: \n" << std::endl;
2246 Xyce::dout() << std::endl;
2274 if (DEBUG_TIME && isActive(Diag::TIME_DUMP_SOLUTION_ARRAYS))
2276 Xyce::dout() <<
"\n next store Ptr: \n" << std::endl;
2278 Xyce::dout() << std::endl;
2307 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2309 Xyce::dout() <<
"\n next lead current Ptr: \n" << std::endl;
2311 Xyce::dout() << std::endl;
2344 if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
2345 Xyce::dout() << tle;
2360 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()
Linear::Vector * qErrWtVecPtr
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
ScalarT Xycemax(ScalarT f1, ScalarT f2)
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)
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
bool saveOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const TIAParams &tia_params, Linear::Vector *solnVecPtr, const double saveTime, const bool doNotInterpolate)
Linear::Vector * daeFVectorPtr
Linear::Vector * qNewtonCorrectionPtr
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)
Linear::Matrix * dFdxMatrixPtr
Linear::Matrix * JMatrixPtr
Linear::Vector * currLeadCurrentQDerivPtr
Linear::Vector * nextStatePtr
std::vector< Linear::Vector * > leadCurrentQHistory
void tranOutput(double time, Linear::Vector &currSolutionPtr, Linear::Vector &stateVecPtr, Linear::Vector &storeVecPtr, Linear::Vector &lead_current_vector, Linear::Vector &junction_voltage_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 * > 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
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 * 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
void outputDCOP(const Linear::Vector &solution)
std::vector< Linear::Vector * > sensRHSPtrVector
void setTwoLevelTimeInfo(const TimeIntInfo &tiInfo)
std::vector< double > alpha_
Linear::Matrix * dQdxMatrixPtr
double partialTimeDeriv() const
std::vector< Linear::Vector * > currDQdxDXdpPtrVector
double partialSum_m1(int currentOrder)
ScalarT Xycemin(ScalarT f1, ScalarT f2)
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