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_MachDepParams.h>
69 #include <N_UTL_Diagnostic.h>
70 #include <N_UTL_FeatureTest.h>
86 TimeIntegrationMethod *
129 return pow(stepadjust, 1.0 / 3.0);
193 if (DEBUG_TIME && isActive(Diag::TIME_PREDICTOR))
195 Xyce::dout().width(21);
196 Xyce::dout().precision(13);
197 Xyce::dout().setf(std::ios::scientific);
198 Xyce::dout() << std::endl;
199 Xyce::dout() << Xyce::section_divider << std::endl;
200 Xyce::dout() <<
" BackwardDifferentiation15::obtainPredictor" << std::endl;
202 Xyce::dout() <<
"\n sec.nscsco_: " <<
sec.
nscsco_ << std::endl;
204 Xyce::dout() <<
"\n sec.beta_[" << i <<
"] = " <<
sec.
beta_[i] <<
"\n" << std::endl;
207 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
208 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
209 Xyce::dout() << std::endl;
213 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
214 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
215 Xyce::dout() << std::endl;
219 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
220 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
221 Xyce::dout() << std::endl;
223 Xyce::dout() <<
"\n xn0: \n" << std::endl;
224 ds.
xn0Ptr->printPetraObject(Xyce::dout());
225 Xyce::dout() << std::endl;
226 Xyce::dout() <<
"\n qn0: \n" << std::endl;
227 ds.
qn0Ptr->printPetraObject(Xyce::dout());
228 Xyce::dout() << std::endl;
229 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
230 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
231 Xyce::dout() << std::endl;
232 Xyce::dout() <<
"\n sn0: \n" << std::endl;
233 ds.
sn0Ptr->printPetraObject(Xyce::dout());
234 Xyce::dout() << std::endl;
235 Xyce::dout() <<
"\n spn0: \n" << std::endl;
236 ds.
spn0Ptr->printPetraObject(Xyce::dout());
237 Xyce::dout() << std::endl;
238 Xyce::dout() <<
"\n stoQn0Ptr: \n" << std::endl;
240 Xyce::dout() << std::endl;
241 Xyce::dout() <<
"\n stoQpn0Ptr: \n" << std::endl;
243 Xyce::dout() << std::endl;
244 Xyce::dout() << Xyce::section_divider << std::endl;
269 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
271 Xyce::dout() << std::endl;
272 Xyce::dout() << Xyce::section_divider << std::endl;
273 Xyce::dout() <<
" BackwardDifferentiation15::obtainResidual" << std::endl;
274 Xyce::dout() <<
"\n t = " <<
sec.
nextTime <<
"\n" << std::endl;
275 Xyce::dout() <<
"\n solution: \n" << std::endl;
277 Xyce::dout() <<
"\n daeQVector: \n" << std::endl;
279 Xyce::dout() <<
"\n qn0: \n" << std::endl;
280 ds.
qn0Ptr->printPetraObject(Xyce::dout());
281 Xyce::dout() <<
"\n qpn0: \n" << std::endl;
282 ds.
qpn0Ptr->printPetraObject(Xyce::dout());
284 Xyce::dout() <<
"\n daeFVector: \n" << std::endl;
287 Xyce::dout() <<
"\n dQdt-vector: \n" << std::endl;
289 Xyce::dout() << std::endl;
310 if (DEBUG_TIME && isActive(Diag::TIME_RESIDUAL))
312 Xyce::dout() <<
"\n Residual-vector: \n" << std::endl;
313 Xyce::dout() <<
"-(qpn0-(sec.alpha_s/h)*(Q-qn0)+F-B) \n" << std::endl;
315 Xyce::dout() << Xyce::section_divider << std::endl;
316 Xyce::dout() << std::endl;
342 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
344 Xyce::dout() << std::endl;
345 Xyce::dout() << Xyce::section_divider << std::endl;
346 Xyce::dout() <<
" BackwardDifferentiation15::obtainJacobian" << std::endl;
363 Jac.linearCombo( qscalar, dQdx, 1.0, dFdx );
365 if (DEBUG_TIME && isActive(Diag::TIME_JACOBIAN))
367 Xyce::dout() <<
"\n dFdx:" <<std::endl;
368 dFdx.printPetraObject(Xyce::dout());
369 Xyce::dout() <<
"\n Total Jacobian:" <<std::endl;
370 Jac.printPetraObject(Xyce::dout());
376 Xyce::dout() << Xyce::section_divider << std::endl;
377 Xyce::dout() << std::endl;
394 Linear::Vector * tmpSolVectorPtr, std::vector<Linear::Vector*> & historyVec)
414 double uround = Util::MachineDependentParams::MachinePrecision();
416 tfuzz = 100 * uround * (tn + hh);
417 tp = tn - hused - tfuzz;
419 if ( (timepoint - tp)*hh < 0.0 )
422 *tmpSolVectorPtr = *(historyVec[0]);
424 if ( (kused == 0) || (timepoint == tn) )
427 delt = timepoint - tn;
429 for (
int j=1 ; j <= kord ; ++j)
433 tmpSolVectorPtr->linearCombo(1.0,*tmpSolVectorPtr,c,*(historyVec[j]));
456 Linear::Vector * tmpSolVectorPtr)
458 Linear::BlockVector * blockTempSolVectorPtr =
459 dynamic_cast<Linear::BlockVector*
>(tmpSolVectorPtr);
460 if (blockTempSolVectorPtr == NULL)
462 std::string msg =
"BackwardDifferentiation15::interpolateMPDESolution: ";
463 msg +=
"Linear::Vector tmpSolVectorPtr is not of type Linear::BlockVector";
464 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
470 int numblocks = timepoint.size();
471 int blockCount = blockTempSolVectorPtr->blockCount();
472 if (numblocks > blockCount)
474 std::string msg =
"BackwardDifferentiation15::interpolateMPDESolution: ";
475 msg +=
"Number of time points requested is greater than number of fast time points in MPDE block vector";
476 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
489 tfuzz = 100 * uround * (tn + hh);
490 tp = tn - hused - tfuzz;
491 for (
int i=0; i<numblocks ; ++i)
493 if ( (timepoint[i] - tp)*hh < 0.0 )
499 Linear::Vector * solVectorPtr;
500 Linear::Vector * xHistoryVectorPtr;
502 for (
int i=0; i < numblocks ; ++i)
504 if ((kused == 0) || (timepoint[i] == tn)) { kord = 1; }
505 else { kord = kused; }
506 solVectorPtr = &(blockTempSolVectorPtr->block(i));
508 delt = timepoint[i] - tn;
510 for (
int j=1 ; j <= kord ; ++j)
514 Linear::BlockVector * blockXHistoryVectorPtr =
515 dynamic_cast<Linear::BlockVector*>(
ds.
xHistory[j]);
516 if (blockXHistoryVectorPtr == NULL)
518 Xyce::Report::DevelFatal0().in(
"BackwardDifferentiation15::interpolateMPDESolution") <<
"Linear::Vector ds.xHistory[j] is not of type Linear::BlockVector\n j = " << j;
521 xHistoryVectorPtr = &(blockXHistoryVectorPtr->block(i));
522 solVectorPtr->linearCombo(1.0,*solVectorPtr,c,*xHistoryVectorPtr);
539 Linear::Vector * solnVecPtr,
540 const std::vector<double> & fastTimes )
542 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
544 Xyce::dout() << std::endl;
545 Xyce::dout() << Xyce::section_divider << std::endl;
546 Xyce::dout() <<
" BackwardDifferentiation15::printMPDEOutputSolution" << std::endl;
553 double beg_of_output_time_interval = lasttime;
554 double end_of_output_time_interval = tn;
555 double start_time = std::max(lasttime,beg_of_output_time_interval);
556 double stop_time = std::min(tn,end_of_output_time_interval);
557 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
559 Xyce::dout() <<
"timestep = " << timestep << std::endl;
560 Xyce::dout() <<
"lasttime = " << lasttime << std::endl;
561 Xyce::dout() <<
"tn = " << tn << std::endl;
562 Xyce::dout() <<
"beg_of_output_time_interval = " << beg_of_output_time_interval << std::endl;
563 Xyce::dout() <<
"end_of_output_time_interval = " << end_of_output_time_interval << std::endl;
564 Xyce::dout() <<
"start_time = " << start_time << std::endl;
565 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
568 Linear::BlockVector * blockTmpSolVectorPtr =
571 if (blockTmpSolVectorPtr == NULL)
573 std::string msg =
"BackwardDifferentiation15::printMPDEOutputSolution: ";
574 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
575 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
578 int blockCount = blockTmpSolVectorPtr->blockCount();
581 double T2 = fastTimes.back();
583 double charcross = fmod(start_time,T2);
587 for (
int i=0 ; i<=blockCount ; ++i)
589 if (fastTimes[i] >= charcross)
597 std::string msg =
"BackwardDifferentiation15::printMPDEOutputSolution: ";
598 msg +=
"Cannot find where characteristic curve crosses fast time slice at start_time";
599 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
602 std::vector<double> h2(blockCount,0);
603 for (
int j=0 ; j < blockCount ; ++j)
605 h2[j] = fastTimes[j+1] - fastTimes[j];
607 std::vector<double> ti;
609 double first_interp = start_time - charcross + fastTimes[s_ind_0];
610 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
612 Xyce::dout() <<
"first_interp = " << first_interp << std::endl;
615 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
617 double eps = fabs(start_time)*1.0e-6;
618 if ( fabs(first_interp-
timept_) <= eps )
620 first_interp += h2[s_ind_0];
622 if (s_ind_0 == blockCount) { s_ind_0 = 0; };
623 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
625 Xyce::dout() <<
"Moving first_interp forward to avoid duplicate outputs: " << first_interp << std::endl;
629 double t = first_interp;
630 while (t <= stop_time)
635 if (sn >= blockCount) { sn = 0; }
637 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
639 Xyce::dout() <<
"T2 = " << T2 << std::endl;
640 Xyce::dout() <<
"charcross = " << charcross << std::endl;
641 Xyce::dout() <<
"s_ind_0 = " << s_ind_0 << std::endl;
642 Xyce::dout() <<
"Expecting to interpolate the following points:" << std::endl;
643 unsigned int numinterp = ti.size();
644 for (
unsigned int i=0 ; i < numinterp ; ++i)
646 Xyce::dout() << ti[i] << std::endl;
648 Xyce::dout() <<
"Total of " << numinterp <<
" points" << std::endl;
652 unsigned int tinum = ti.size();
653 int total_interp = 0;
654 std::vector<double> timepoint_vec(blockCount,stop_time);
655 int num_interp_this_cycle = 0;
657 for (
unsigned int i=0; i < tinum ; ++i)
659 timepoint_vec[s_ind] = ti[i];
660 num_interp_this_cycle++;
662 if (s_ind >= blockCount) { s_ind = 0; };
664 if ((s_ind == s_ind_0) || (i == tinum-1))
669 for (
int j=0 ; j < num_interp_this_cycle ; ++j)
673 timept_, blockTmpSolVectorPtr->block(s),
679 if (s >= blockCount) { s = 0; }
680 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
681 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
683 num_interp_this_cycle = 0;
686 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
687 Xyce::dout() <<
"Total of " << total_interp <<
" points" << std::endl;
690 eps = fabs(stop_time)*1.0e-8;
692 if (fabs(
timept_ - stop_time) >= eps)
694 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
696 Xyce::dout() <<
"Previous timept = " <<
timept_ << std::endl;
697 Xyce::dout() <<
"Expecting to interpolate the following point: " << stop_time << std::endl;
700 Linear::Vector* tmpSolnVecPtr = solnVecPtr;
707 Linear::BlockVector * blockTmpSolnVecPtr =
708 dynamic_cast<Linear::BlockVector*
>(tmpSolnVecPtr);
709 Linear::BlockVector * blockTmpVecPtr =
710 dynamic_cast<Linear::BlockVector*
>(tmpVecPtr);
711 if (blockTmpSolnVecPtr == NULL)
713 std::string msg =
"BackwardDifferentiation15::printMPDEOutputSolution: ";
714 msg +=
"Linear::Vector tmpSolnVecPtr is not of type Linear::BlockVector";
715 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
718 if (blockTmpVecPtr == NULL)
720 std::string msg =
"BackwardDifferentiation15::printMPDEOutputSolution: ";
721 msg +=
"Linear::Vector tmpVecPtr is not of type Linear::BlockVector";
722 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
727 charcross = fmod(stop_time,T2);
730 if( charcross < fastTimes[0] )
733 s_ind_1 = blockCount-1;
737 for (
int i=blockCount-1 ; i>=0 ; --i)
739 if (fastTimes[i] <= charcross)
748 std::string msg =
"BackwardDifferentiation15::printMPDEOutputSolution: ";
749 msg +=
"Cannot find where characteristic curve crosses fast time slice at stop_time";
750 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
755 double coeff_sm = fastTimes[sp]-charcross;
756 double coeff_sp = charcross-fastTimes[sm];
757 if (sp == blockCount) { sp = 0; }
758 double dt = h2[s_ind_1];
760 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
762 Xyce::dout() <<
"charcross = " << charcross << std::endl;
763 Xyce::dout() <<
"s_ind_1 = " << s_ind_1 << std::endl;
764 Xyce::dout() <<
"sp = " << sp << std::endl;
765 Xyce::dout() <<
"sm = " << sm << std::endl;
766 Xyce::dout() <<
"dt = " << dt << std::endl;
767 Xyce::dout() <<
"timept = " <<
timept_ << std::endl;
768 Xyce::dout() <<
"coeff_sm = " << coeff_sm << std::endl;
769 Xyce::dout() <<
"coeff_sp = " << coeff_sp << std::endl;
772 blockTmpVecPtr->block(0).linearCombo(
773 coeff_sm/dt, blockTmpSolnVecPtr->block(sm),
774 coeff_sp/dt, blockTmpSolnVecPtr->block(sp)
777 timept_, blockTmpVecPtr->block(0),
782 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
783 Xyce::dout() <<
"Interpolated to t = " <<
timept_ << std::endl;
786 else if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
788 Xyce::dout() <<
"No further interpolation required." << std::endl;
791 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
792 Xyce::dout() << Xyce::section_divider << std::endl;
809 Linear::Vector * solnVecPtr,
810 const std::vector<double> & fastTimes,
813 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
815 Xyce::dout() << std::endl;
816 Xyce::dout() << Xyce::section_divider << std::endl;
817 Xyce::dout() <<
" BackwardDifferentiation15::printWaMPDEOutputSolution" << std::endl;
824 double beg_of_output_time_interval = lasttime;
825 double end_of_output_time_interval = tn;
826 double start_time = std::max(lasttime,beg_of_output_time_interval);
827 double stop_time = std::min(tn,end_of_output_time_interval);
829 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
831 Xyce::dout() <<
"start_time = " << start_time << std::endl;
832 Xyce::dout() <<
"stop_time = " << stop_time << std::endl;
857 Linear::BlockVector * blockTmpSolVectorPtr =
859 Linear::BlockVector * blockTmpXn0APtr =
861 Linear::BlockVector * blockTmpXn0BPtr =
863 if (blockTmpSolVectorPtr == NULL)
865 std::string msg =
"BackwardDifferentiation15::printWaMPDEOutputSolution: ";
866 msg +=
"Linear::Vector ds.tmpSolVectorPtr is not of type Linear::BlockVector";
867 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
870 if (blockTmpXn0APtr == NULL)
872 std::string msg =
"BackwardDifferentiation15::printWaMPDEOutputSolution: ";
873 msg +=
"Linear::Vector ds.tmpXn0APtr is not of type Linear::BlockVector";
874 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
877 if (blockTmpXn0BPtr == NULL)
879 std::string msg =
"BackwardDifferentiation15::printWaMPDEOutputSolution: ";
880 msg +=
"Linear::Vector ds.tmpXn0BPtr is not of type Linear::BlockVector";
881 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
884 int phiLID = blockTmpSolVectorPtr->pmap()->globalToLocalIndex(phiGID);
888 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
890 Xyce::dout() <<
" sec.usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
891 Xyce::dout() <<
" sec.currentTime_ = " <<
sec.
currentTime << std::endl;
892 Xyce::dout() <<
" lasttime = " << lasttime << std::endl;
900 timeA = lasttime + hh*i;
904 std::string msg =
"interpolateSolution returned false!";
905 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0,msg);
914 timeB = lasttime + hh*(i+1);
916 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
918 Xyce::dout() <<
"Interpolating in [ " << timeA <<
", " << timeB <<
" ]" << std::endl;
919 Xyce::dout() <<
"timeA = " << timeA << std::endl;
920 Xyce::dout() <<
"timeB = " << timeB << std::endl;
924 std::vector<double> t1vals;
925 double T2 = fastTimes.back();
926 int blockCount = blockTmpSolVectorPtr->blockCount();
927 double h2 = T2/blockCount;
928 double tval = timeA+h2;
929 while (tval <= timeB)
931 t1vals.push_back(tval);
935 double eps = fabs(timeB)*1.0e-8;
936 if ( (t1vals.size() == 0) || (fabs(t1vals.back() - timeB) >= eps) )
938 t1vals.push_back(timeB);
940 std::vector<double> t2vals, phiAB(2);
941 std::vector<double> tmpPhiAB(2, 0.0);
947 blockTmpSolVectorPtr->pmap()->pdsComm().sumAll( &tmpPhiAB[0], &phiAB[0], 2 );
949 double phiA = phiAB[0], phiB = phiAB[1];
950 for (
unsigned int j=0 ; j<t1vals.size() ; ++j)
952 double phi = (1/(timeB-timeA))*(phiA*(timeB-t1vals[j])+phiB*(t1vals[j]-timeA));
953 t2vals.push_back(fmod(phi,T2));
955 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
957 Xyce::dout() <<
"t1vals = " << std::endl;
958 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
960 Xyce::dout() << t1vals[j] << std::endl;
962 Xyce::dout() <<
"phi(" << timeA <<
") = " << phiA << std::endl;
963 Xyce::dout() <<
"phi(" << timeB <<
") = " << phiB << std::endl;
964 Xyce::dout() <<
"t2vals = " << std::endl;
965 for (
unsigned int j=0 ; j< t2vals.size() ; ++j)
967 Xyce::dout() << t2vals[j] << std::endl;
975 double t = t1vals[0];
976 double s = t2vals[0];
980 for (
int j=0 ; j < blockCount ; ++j)
982 if ((fastTimes[j] <= s) && (s < fastTimes[j+1]))
988 if (b2 == blockCount)
992 double s1 = fastTimes[b1];
993 double s2 = fastTimes[b1+1];
994 if ((s < s1) || (s > s2))
996 std::string msg =
"BackwardDifferentiation15::printWaMPDEOutputSolution: ";
997 msg +=
" Interpolator cannot find a fast time block containing the first point ";
998 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1000 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1002 Xyce::dout() <<
"Found s = " << s <<
" in block " << b1;
1003 Xyce::dout() <<
" with boundary = [" << s1 <<
"," << s2 <<
"]" << std::endl;
1006 for (
unsigned int j=0 ; j < t1vals.size() ; ++j)
1012 if ( (s < s1) || (s > s2) )
1014 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1015 Xyce::dout() <<
"Incrementing fast time block for next interpolation." << std::endl;
1018 if (b1 == blockCount)
1023 if (b2 == blockCount)
1028 s2 = fastTimes[b1+1];
1031 if ((s < s1) || (s > s2))
1033 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1034 Xyce::dout() <<
"Searching for fast time block for next interpolation." << std::endl;
1037 for (
int j2=0 ; j2 < blockCount ; ++j2)
1039 if ((fastTimes[j2] <= s) && (s < fastTimes[j2+1]))
1045 if (b2 == blockCount)
1050 s2 = fastTimes[b1+1];
1053 if ((s < s1) || (s > s2))
1055 std::string msg =
"BackwardDifferentiation15::printWaMPDEOutputSolution: ";
1056 msg +=
" Interpolator moved fast time block but new point is not in this block ";
1057 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL_0, msg);
1068 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1070 Xyce::dout() <<
"Interpolating in the block:" << std::endl;
1071 Xyce::dout() <<
"(t1,t2) = (" << t1 <<
"," << t2 <<
")" << std::endl;
1072 Xyce::dout() <<
"(s1,s2) = (" << s1 <<
"," << s2 <<
")" << std::endl;
1075 double denom = (t2-t1)*(s2-s1);
1076 double coeff0 = (t2-t)*(s2-s)/denom;
1077 double coeff1 = (t2-t)*(s-s1)/denom;
1078 double coeff2 = (t-t1)*(s2-s)/denom;
1079 double coeff3 = (t-t1)*(s-s1)/denom;
1080 (blockTmpSolVectorPtr->block(b1)).linearCombo(
1081 coeff0, blockTmpXn0APtr->block(b1),
1082 coeff1, blockTmpXn0APtr->block(b2),
1083 coeff2, blockTmpXn0BPtr->block(b1) );
1084 (blockTmpSolVectorPtr->block(b1)).update(
1085 coeff3, blockTmpXn0BPtr->block(b2), 1.0 );
1091 t, blockTmpSolVectorPtr->block(b1),
1096 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1097 Xyce::dout() <<
"Interpolated to (t,phi(t)) = (" << t <<
"," << s <<
")" << std::endl;
1102 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1103 Xyce::dout() << Xyce::section_divider << std::endl;
1122 Linear::Vector * solnVecPtr,
1123 const bool doNotInterpolate,
1124 const std::vector<double> & outputInterpolationTimes,
1125 bool skipPrintLineOutput)
1127 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1129 Xyce::dout() << std::endl;
1130 Xyce::dout() << Xyce::section_divider << std::endl;
1131 Xyce::dout() <<
" BackwardDifferentiation15::printOutputSolution" << std::endl;
1132 Xyce::dout() <<
"usedOrder_ = " <<
sec.
usedOrder_ << std::endl;
1137 bool dointerp =
true;
1149 if (doNotInterpolate)
1154 if (dointerp && !outputInterpolationTimes.empty())
1156 for (
unsigned int i=0;i<outputInterpolationTimes.size();++i)
1168 skipPrintLineOutput);
1175 double timept = lasttime + hh*i;
1186 skipPrintLineOutput);
1188 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1189 Xyce::dout() <<
"Interpolated to t = " << timept << std::endl;
1196 if (outputInterpolationTimes.empty() || doNotInterpolate)
1201 skipPrintLineOutput);
1203 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1204 Xyce::dout() << Xyce::section_divider << std::endl;
1220 Parallel::Machine comm,
1221 IO::InitialConditionsManager & initial_conditions_manager,
1222 const NodeNameMap & node_name_map,
1224 Linear::Vector * solnVecPtr,
1225 const double saveTime,
1226 const bool doNotInterpolate)
1228 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1230 Xyce::dout() << std::endl;
1231 Xyce::dout() << Xyce::section_divider << std::endl;
1232 Xyce::dout() <<
" BackwardDifferentiation15::saveOutputSolution" << std::endl;
1237 bool dointerp =
true;
1249 if (doNotInterpolate)
1258 initial_conditions_manager.outputDCOP(comm, node_name_map, *
ds.
tmpSolVectorPtr);
1263 initial_conditions_manager.outputDCOP(comm, node_name_map, *solnVecPtr);
1266 if (DEBUG_TIME && isActive(Diag::TIME_OUTPUT))
1267 Xyce::dout() << Xyce::section_divider << std::endl;
1348 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1350 Xyce::dout() << std::endl;
1351 Xyce::dout() << Xyce::section_divider << std::endl;
1353 " BackwardDifferentiation15::updateHistory" << std::endl;
1354 Xyce::dout() <<
"\n Before updates \n" << std::endl;
1357 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1358 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1359 Xyce::dout() << std::endl;
1363 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1364 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1365 Xyce::dout() << std::endl;
1369 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1370 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1371 Xyce::dout() << std::endl;
1373 Xyce::dout() << Xyce::section_divider << std::endl;
1436 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1438 Xyce::dout() <<
"\n After updates \n" << std::endl;
1439 Xyce::dout() <<
"\n newtonCorrectionPtr: " << std::endl;
1441 Xyce::dout() <<
"\n qnewtonCorrectionPtr: " << std::endl;
1445 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1446 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1447 Xyce::dout() << std::endl;
1451 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1452 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1453 Xyce::dout() << std::endl;
1455 Xyce::dout() <<
"\n sNewtonCorrectionPtr: " << std::endl;
1457 Xyce::dout() << std::endl;
1458 Xyce::dout() <<
"\n nextStatePtr: " << std::endl;
1460 Xyce::dout() << std::endl;
1463 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1464 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1465 Xyce::dout() << std::endl;
1467 Xyce::dout() << Xyce::section_divider << std::endl;
1495 if (DEBUG_TIME && isActive(Diag::TIME_HISTORY))
1497 Xyce::dout() << std::endl;
1498 Xyce::dout() << Xyce::section_divider << std::endl;
1500 " BackwardDifferentiation15::restoreHistory" << std::endl;
1502 Xyce::dout() <<
"\n sec.psi_[i] = " <<
sec.
psi_[i] << std::endl;
1505 Xyce::dout() <<
"\n xHistory["<< i <<
"]: \n" << std::endl;
1506 (
ds.
xHistory[i])->printPetraObject(Xyce::dout());
1507 Xyce::dout() << std::endl;
1511 Xyce::dout() <<
"\n qHistory["<< i <<
"]: \n" << std::endl;
1512 (
ds.
qHistory[i])->printPetraObject(Xyce::dout());
1513 Xyce::dout() << std::endl;
1517 Xyce::dout() <<
"\n sHistory["<< i <<
"]: \n" << std::endl;
1518 (
ds.
sHistory[i])->printPetraObject(Xyce::dout());
1519 Xyce::dout() << std::endl;
1521 Xyce::dout() << Xyce::section_divider << std::endl;
1537 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1539 Xyce::dout() << std::endl;
1540 Xyce::dout() << Xyce::section_divider << std::endl;
1541 Xyce::dout() <<
" BackwardDifferentiation15::updateCoeffs" << std::endl;
1545 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1546 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1586 if (DEBUG_TIME && isActive(Diag::TIME_COEFFICIENTS))
1588 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
1589 Xyce::dout() <<
" beta_[0] = " <<
sec.
beta_[0] << std::endl;
1590 Xyce::dout() <<
" beta_[1] = " <<
sec.
beta_[1] << std::endl;
1591 Xyce::dout() <<
" beta_[2] = " <<
sec.
beta_[2] << std::endl;
1592 Xyce::dout() <<
" beta_[3] = " <<
sec.
beta_[3] << std::endl;
1593 Xyce::dout() <<
" beta_[4] = " <<
sec.
beta_[4] << std::endl;
1594 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
1595 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
1596 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
1597 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
1598 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
1599 Xyce::dout() <<
" alphas_ = " <<
sec.
alphas_ << std::endl;
1600 Xyce::dout() <<
" alpha0_ = " <<
sec.
alpha0_ << std::endl;
1601 Xyce::dout() <<
" gamma_[0] = " <<
sec.
gamma_[0] << std::endl;
1602 Xyce::dout() <<
" gamma_[1] = " <<
sec.
gamma_[1] << std::endl;
1603 Xyce::dout() <<
" gamma_[2] = " <<
sec.
gamma_[2] << std::endl;
1604 Xyce::dout() <<
" gamma_[3] = " <<
sec.
gamma_[3] << std::endl;
1605 Xyce::dout() <<
" gamma_[4] = " <<
sec.
gamma_[4] << std::endl;
1606 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
1607 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
1608 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
1609 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
1610 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
1611 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
1612 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
1613 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
1614 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
1615 Xyce::dout() <<
" sigma_[4] = " <<
sec.
sigma_[4] << std::endl;
1616 Xyce::dout() <<
" ck_ = " <<
sec.
ck_ << std::endl;
1617 Xyce::dout() << Xyce::section_divider << std::endl;
1646 double currentTimeStep;
1649 currentTimeStep = 0.1 * time_to_stop;
1671 if (rh>1.0) currentTimeStep = currentTimeStep/rh;
1739 if (DEBUG_TIME &&isActive(Diag::TIME_HISTORY))
1741 Xyce::dout() << std::endl;
1742 Xyce::dout() << Xyce::section_divider << std::endl;
1743 Xyce::dout() <<
" BackwardDifferentiation15::initialize" << std::endl;
1744 Xyce::dout() <<
"\n xHistory: \n" << std::endl;
1745 (
ds.
xHistory[0])->printPetraObject(Xyce::dout());
1746 Xyce::dout() << std::endl;
1747 (
ds.
xHistory[1])->printPetraObject(Xyce::dout());
1748 Xyce::dout() << std::endl;
1749 Xyce::dout() <<
"\n qHistory: \n" << std::endl;
1750 (
ds.
qHistory[0])->printPetraObject(Xyce::dout());
1751 Xyce::dout() << std::endl;
1752 (
ds.
qHistory[1])->printPetraObject(Xyce::dout());
1753 Xyce::dout() << std::endl;
1754 Xyce::dout() <<
"\n sHistory: \n" << std::endl;
1755 (
ds.
sHistory[0])->printPetraObject(Xyce::dout());
1756 Xyce::dout() << std::endl;
1757 (
ds.
sHistory[1])->printPetraObject(Xyce::dout());
1758 Xyce::dout() << std::endl;
1759 Xyce::dout() <<
"\n" <<
"currentTimeStep = " << currentTimeStep <<
"\n" << std::endl;
1760 Xyce::dout() <<
"\n" <<
"time_to_stop = " << time_to_stop <<
"\n" << std::endl;
1761 Xyce::dout() << Xyce::section_divider << std::endl;
1840 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1842 Xyce::dout() << std::endl;
1843 Xyce::dout() << Xyce::section_divider << std::endl;
1844 Xyce::dout() <<
" BackwardDifferentiation15::checkReduceOrder" << std::endl;
1853 double dnorm = dnorm_x;
1859 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1861 Xyce::dout() <<
" Est_= " <<
sec.
Est_ << std::endl;
1862 Xyce::dout() <<
" Ek_= " <<
sec.
Ek_ << std::endl;
1863 Xyce::dout() <<
" dnorm = " << dnorm << std::endl;
1865 Xyce::dout() <<
" Tk_= " <<
sec.
Tk_ << std::endl;
1876 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1878 Xyce::dout() <<
" Ekm1_= " <<
sec.
Ekm1_ << std::endl;
1879 Xyce::dout() <<
" Tkm1_= " <<
sec.
Tkm1_ << std::endl;
1898 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1901 Xyce::dout() <<
" Tkm1_= " <<
sec.
Tkm1_ << std::endl;
1902 Xyce::dout() <<
" Tk_= " <<
sec.
Tk_ << std::endl;
1910 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1912 Xyce::dout() <<
" newOrder = " <<
sec.
newOrder_ << std::endl;
1913 Xyce::dout() << Xyce::section_divider << std::endl;
1944 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1946 Xyce::dout() << std::endl;
1947 Xyce::dout() << Xyce::section_divider << std::endl;
1948 Xyce::dout() <<
" BackwardDifferentiation15::rejectStep" << std::endl;
1972 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1973 Xyce::dout() <<
"rejectStep 1" << std::endl;
1986 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1987 Xyce::dout() <<
"rejectStep 2" << std::endl;
1993 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
1994 Xyce::dout() <<
"rejectStep 3" << std::endl;
2001 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2002 Xyce::dout() <<
"rejectStep 4" << std::endl;
2008 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2009 Xyce::dout() <<
"rejectStep 5" << std::endl;
2016 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2017 Xyce::dout() <<
"rejectStep 6" << std::endl;
2019 if (DEBUG_TIME && isActive(Diag::TIME_STEP) && isActive(Diag::TIME_COEFFICIENTS))
2024 Xyce::dout() <<
" nscsco_ = " <<
sec.
nscsco_ << std::endl;
2025 Xyce::dout() <<
" alpha_[0] = " <<
sec.
alpha_[0] << std::endl;
2026 Xyce::dout() <<
" alpha_[1] = " <<
sec.
alpha_[1] << std::endl;
2027 Xyce::dout() <<
" alpha_[2] = " <<
sec.
alpha_[2] << std::endl;
2028 Xyce::dout() <<
" alpha_[3] = " <<
sec.
alpha_[3] << std::endl;
2029 Xyce::dout() <<
" alpha_[4] = " <<
sec.
alpha_[4] << std::endl;
2030 Xyce::dout() <<
" psi_[0] = " <<
sec.
psi_[0] << std::endl;
2031 Xyce::dout() <<
" psi_[1] = " <<
sec.
psi_[1] << std::endl;
2032 Xyce::dout() <<
" psi_[2] = " <<
sec.
psi_[2] << std::endl;
2033 Xyce::dout() <<
" psi_[3] = " <<
sec.
psi_[3] << std::endl;
2034 Xyce::dout() <<
" psi_[4] = " <<
sec.
psi_[4] << std::endl;
2035 Xyce::dout() <<
" sigma_[0] = " <<
sec.
sigma_[0] << std::endl;
2036 Xyce::dout() <<
" sigma_[1] = " <<
sec.
sigma_[1] << std::endl;
2037 Xyce::dout() <<
" sigma_[2] = " <<
sec.
sigma_[2] << std::endl;
2038 Xyce::dout() <<
" sigma_[3] = " <<
sec.
sigma_[3] << std::endl;
2039 Xyce::dout() <<
" sigma_[4] = " <<
sec.
sigma_[4] << std::endl;
2040 Xyce::dout() <<
" rr = " << rr << std::endl;
2041 Xyce::dout() <<
" r_factor_ = " <<
sec.
r_factor_ << std::endl;
2042 Xyce::dout() <<
" r_safety_ = " <<
sec.
r_safety_ << std::endl;
2043 Xyce::dout() <<
" Est_ = " <<
sec.
Est_ << std::endl;
2044 Xyce::dout() <<
" r_fudge_ = " <<
sec.
r_fudge_ << std::endl;
2045 Xyce::dout() <<
" newOrder_ = " <<
sec.
newOrder_ << std::endl;
2047 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2052 std::string tmp =
" BackwardDifferentiation15:rejectStep: Warning: Local error test failed with constant step-size.\n";
2053 Xyce::dout() << tmp << std::endl;
2075 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2077 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2078 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2098 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2100 Xyce::dout() << Xyce::section_divider << std::endl;
2128 enum {TIAAction_UNSET, TIAAction_LOWER, TIAAction_MAINTAIN, TIAAction_RAISE};
2137 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2139 Xyce::dout() << std::endl;
2140 Xyce::dout() << Xyce::section_divider << std::endl;
2141 Xyce::dout() <<
" BackwardDifferentiation15::completeStep" << std::endl;
2173 int action = TIAAction_UNSET;
2175 action = TIAAction_LOWER;
2177 action = TIAAction_MAINTAIN;
2182 action = TIAAction_MAINTAIN;
2188 double dnorm = dnorm_x;
2195 action = TIAAction_MAINTAIN;
2197 action = TIAAction_RAISE;
2202 action = TIAAction_LOWER;
2204 action = TIAAction_MAINTAIN;
2206 action = TIAAction_RAISE;
2211 action = TIAAction_RAISE;
2215 action = TIAAction_MAINTAIN;
2217 if (action == TIAAction_RAISE)
2222 else if (action == TIAAction_LOWER)
2242 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2245 Xyce::dout() <<
" r_safety = " <<
sec.
r_safety_ << std::endl;
2246 Xyce::dout() <<
" r_fudge_ = " <<
sec.
r_fudge_ << std::endl;
2247 Xyce::dout() <<
" r_hincr_ = " <<
sec.
r_hincr_ << std::endl;
2249 Xyce::dout() <<
" Est = " <<
sec.
Est_ << std::endl;
2250 Xyce::dout() <<
" Ekp1_ = " <<
sec.
Ekp1_ << std::endl;
2251 Xyce::dout() <<
" Ekm1_ = " <<
sec.
Ekm1_ << std::endl;
2252 Xyce::dout() <<
" Tkp1_ = " <<
sec.
Tkp1_ << std::endl;
2253 Xyce::dout() <<
" raw rr = " << rr << std::endl;
2268 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2271 Xyce::dout() <<
" rr = " << rr << std::endl;
2273 Xyce::dout() <<
" currentTime = " <<
sec.
currentTime << std::endl;
2274 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2275 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2276 Xyce::dout() <<
" minTimeStep = " <<
sec.
minTimeStep << std::endl;
2277 Xyce::dout() <<
" maxTimeStep = " <<
sec.
maxTimeStep << std::endl;
2311 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2313 Xyce::dout() <<
" nextTime = " <<
sec.
nextTime << std::endl;
2314 Xyce::dout() <<
" newTimeStep_ = " << newTimeStep_ << std::endl;
2335 if (DEBUG_TIME && isActive(Diag::TIME_STEP))
2337 Xyce::dout() << Xyce::section_divider << std::endl;
2431 if (DEBUG_TIME && isActive(Diag::TIME_ERROR))
2432 Xyce::dout() << tle;
2447 Xyce::Report::UserWarning() <<
"Excessively small current time step, incorrectly returning with large value";
Linear::Vector * sNewtonCorrectionPtr
BackwardDifferentiation15(const TIAParams &tia_params, StepErrorControl &step_error_control, DataStore &data_store)
Linear::Vector * nextLeadCurrentQPtr
Linear::Vector * leadCurrentQn0Ptr
double delta_x_errorNorm_p1()
int newtonConvergenceStatus
void completeStep(const TIAParams &tia_params)
double partialErrorNormSum()
Linear::Vector * tmpLeadDeltaVPtr
std::vector< double > sigma_
Linear::Vector * stoNewtonCorrectionPtr
Pure virtual class to augment a linear system.
std::vector< double > dOdpVec_
std::vector< double > scaled_dOdpVec_
void updateLeadCurrentVec()
StepErrorControl & sec
Reference to step-error control object.
void getInitialQnorm(TwoLevelError &tle) const
Linear::Vector * tmpStaVectorPtr
Linear::Vector * currStorePtr
std::vector< double > scaled_dOdpAdjVec_
std::vector< Linear::Vector * > leadDeltaVHistory
Linear::Vector * tmpSolVectorPtr
double delta_x_errorNorm_m1()
Linear::Vector * leadCurrentpn0Ptr
Linear::Vector * leadCurrentNewtonCorrectionPtr
double partialSum_m2(int currentOrder)
int errorAnalysisOption
Error analysis option.
bool interpolateSolution(double timepoint, Linear::Vector *tmpSolVectorPtr, std::vector< Linear::Vector * > &historyVec)
Linear::Vector * ston0Ptr
Linear::Vector * tmpStoVectorPtr
Linear::Vector * leadCurrentQDerivn0Ptr
double computeExpoStepAdjust(double stepadjust)
std::vector< Linear::Vector * > qHistory
Linear::Vector * currStatePtr
std::vector< double > objectiveVec_
double lastAttemptedTimeStep
std::vector< Linear::Vector * > leadCurrentHistory
bool constantTimeStepFlag
Constant time step integration flag.
void obtainSensitivityResiduals()
Linear::Vector * leadDeltaVn0Ptr
Linear::Vector * leadCurrentn0Ptr
Linear::Vector * daeQVectorPtr
Linear::Vector * tmpLeadCurrentVectorPtr
bool printWaMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes, const int phiGID)
void getTwoLevelError(TwoLevelError &tle) const
double partialSum_p1(int currentOrder, int maxOrder)
void initialize(const TIAParams &tia_params)
Linear::Vector * stopn0Ptr
Linear::Vector * leadCurrentQpn0Ptr
void setTimeStep(double newTimeStep)
double currentTimeStepRatio
Linear::Vector * daeFVectorPtr
double leadingCoeff
Time-integration method leading coefficient value.
Linear::Vector * qNewtonCorrectionPtr
Linear::Vector * currLeadCurrentQPtr
void setTwoLevelTimeInfo()
Linear::Vector * nextStoreLeadCurrQDerivPtr
Linear::Vector * leadCurrentQNewtonCorrectionPtr
std::vector< Linear::Vector * > leadCurrentQDerivHistory
Linear::Matrix * dFdxMatrixPtr
Linear::Matrix * JMatrixPtr
static TimeIntegrationMethod * factory(const TIAParams &tia_params, StepErrorControl &step_error_control, DataStore &data_store)
Linear::Vector * currLeadCurrentQDerivPtr
Linear::Vector * nextStatePtr
std::vector< Linear::Vector * > leadCurrentQHistory
bool printMPDEOutputSolution(Analysis::OutputMgrAdapter &outputManagerAdapter, const double time, Linear::Vector *solnVecPtr, const std::vector< double > &fastTimes)
Linear::Vector * dFdxdVpVectorPtr
Linear::Vector * currLeadDeltaVPtr
std::vector< double > beta_
double delta_x_errorNorm_q1()
Linear::Vector * currStoreLeadCurrQPtr
int numberSuccessiveFailures
Linear::Vector * stoLeadCurrQNewtonCorrectionPtr
bool interpolateMPDESolution(std::vector< double > &timepoint, Linear::Vector *tmpSolVectorPtr)
Linear::Vector * nextSolutionPtr
Linear::Vector * RHSVectorPtr
double delta_x_errorNorm_m2()
Linear::Vector * tmpXn0BPtr
Linear::Vector * nextStorePtr
Linear::Vector * stoQn0Ptr
void rejectStep(const TIAParams &tia_params)
std::vector< double > psi_
double timept_
Keep track of last interpolation point in printMPDEOutputSolution.
Linear::Vector * dQdxdVpVectorPtr
double partialTimeDeriv() const
double currentTimeStepSum
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)
Linear::Vector * currLeadCurrentPtr
std::vector< double > dOdpAdjVec_
Linear::Vector * nextLeadCurrentQDerivPtr
Linear::Vector * newtonCorrectionPtr
Linear::Vector * tmpLeadCurrentQDerivVectorPtr
Linear::Vector * tmpXn0APtr
Linear::Vector * currSolutionPtr
std::vector< Linear::Vector * > stoHistory
Linear::Vector * leadCurrentQDerivNewtonCorrectionPtr
Linear::Vector * stoQpn0Ptr
Linear::Vector * nextStoreLeadCurrQPtr
Linear::Vector * nextStateDerivPtr
std::vector< Linear::Vector * > xHistory
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)
std::vector< double > alpha_
Linear::Matrix * dQdxMatrixPtr
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)
double partialSum_m1(int currentOrder)
Linear::Vector * daeBVectorPtr
Linear::Vector * leadDeltaVpn0Ptr
void rejectStepForHabanero()
Linear::Vector * leadDeltaVNewtonCorrectionPtr
std::vector< Linear::Vector * > stoLeadCurrQHistory
double partialQErrorNormSum()
std::vector< double > gamma_
DataStore & ds
Reference to the TIA data-store object.
Linear::Vector * nextLeadCurrentPtr
std::vector< Linear::Vector * > sHistory