46 #include <Xyce_config.h>
51 #include <N_DEV_ExternDevice.h>
52 #include <N_ERH_ErrorMgr.h>
53 #include <N_LAS_Matrix.h>
54 #include <N_LAS_Vector.h>
57 #include <N_PDS_MPI.h>
58 #include <N_PDS_Serial.h>
61 #include <N_UTL_BreakPoint.h>
62 #include <N_UTL_Timer.h>
80 bool daeStateDerivFlag)
87 daeStateDerivFlag_(daeStateDerivFlag)
116 std::vector<double> & dfdpVec,
117 std::vector<double> & dqdpVec,
118 std::vector<double> & dbdpVec,
119 std::vector<int> & FindicesVec,
120 std::vector<int> & QindicesVec,
121 std::vector<int> & BindicesVec)
const
157 bool bsuccess =
true;
187 bsuccess = bsuccess && tmpBool;
220 bsuccess = bsuccess && tmpBool;
276 bool bsuccess =
true;
297 bsuccess = bsuccess && tmpBool;
328 const Linear::Vector& input,
329 Linear::Vector& result)
331 bool bsuccess =
true;
346 bsuccess = bsuccess && tmpBool;
376 bool bsuccess =
true;
396 bool bsuccess =
true;
449 (std::vector<int> & numINodes)
463 (
int iSubProblem,
int iCouple, Linear::Vector * dfdvPtr)
465 return deviceManager_.loadCouplingRHS (iSubProblem, iCouple, dfdvPtr);
477 (
int iSubProblem,
int iCouple,
const Linear::Vector * dxdvPtr)
479 return deviceManager_.calcCouplingTerms (iSubProblem, iCouple, dxdvPtr);
504 const std::vector<std::string> & paramNames,
505 const std::vector<double> & paramVals)
509 for (Device::InstanceVector::const_iterator it = extern_devices.begin(); it != extern_devices.end(); ++it)
511 Device::ExternDevice::Instance &extern_device =
static_cast<Device::ExternDevice::Instance &
>(*(*it));
513 extern_device.homotopyStepSuccess (paramNames, paramVals);
529 for (Device::InstanceVector::const_iterator it = extern_devices.begin(); it != extern_devices.end(); ++it)
531 Device::ExternDevice::Instance &extern_device =
static_cast<Device::ExternDevice::Instance &
>(*(*it));
533 extern_device.homotopyStepFailure ();
bool setParam(const std::string &name, double val, bool overrideOriginal=false)
Linear::Vector * lastSolutionPtr
Util::Timer * jacobianTimerPtr_
Linear::Vector * nextLeadCurrentQPtr
void getAnalyticSensitivities(std::string &name, std::vector< double > &dfdpVec, std::vector< double > &dqdpVec, std::vector< double > &dbdpVec, std::vector< int > &FindicesVec, std::vector< int > &QindicesVec, std::vector< int > &BindicesVec)
TimeIntg::DataStore & ds_
bool loadCouplingRHS(int iSubProblem, int iCouple, Linear::Vector *dfdvPtr)
Linear::Vector * lastLeadDeltaVPtr
Pure virtual class to augment a linear system.
const InstanceVector & getDevices(ModelTypeId model_type_id) const
bool analyticSensitivitiesAvailable(std::string &name)
TimeIntg::WorkingIntegrationMethod & wim_
virtual bool loadDAEVectors(Linear::Vector *nextSolVectorPtr, Linear::Vector *currSolVectorPtr, Linear::Vector *lastSolVectorPtr, Linear::Vector *nextStaVectorPtr, Linear::Vector *currStaVectorPtr, Linear::Vector *lastStaVectorPtr, Linear::Vector *StaDerivVectorPtr, Linear::Vector *nextStoVectorPtr, Linear::Vector *currStoVectorPtr, Linear::Vector *lastStoVectorPtr, Linear::Vector *stoLeadCurrQVectorPtr, Linear::Vector *nextLeadFVectorPtr, Linear::Vector *currLeadFVectorPtr, Linear::Vector *lastLeadFVectorPtr, Linear::Vector *nextLeadQVectorPtr, Linear::Vector *nextJunctionVVectorPtr, Linear::Vector *currJunctionVVectorPtr, Linear::Vector *lastJunctionVVectorPtr, Linear::Vector *QVectorPtr, Linear::Vector *FVectorPtr, Linear::Vector *BVectorPtr, Linear::Vector *dFdxdVpVectorPtr, Linear::Vector *dQdxdVpVectorPtr)
bool applyJacobian(const Linear::Vector &input, Linear::Vector &result)
virtual ~NonlinearEquationLoader()
virtual bool applyDAEMatrices(Linear::Vector *tmpSolVectorPtr, Linear::Vector *tmpStaVectorPtr, Linear::Vector *tmpStaDerivVectorPtr, Linear::Vector *tmpStoVectorPtr, const Linear::Vector &tmpVecVectorPtr, Linear::Vector *tmpdQdxVecVectorPtr, Linear::Vector *tmpdFdxVecVectorPtr)
Linear::Vector * currStorePtr
Linear::Vector * lastStatePtr
bool disablePDEContinuation()
bool getParamAndReduce(Parallel::Machine comm, const std::string &name, double &val) const
bool innerDevicesConverged(Parallel::Machine comm)
int getHomotopyBlockSize() const
Linear::Vector * nextLeadDeltaVPtr
Linear::Vector * currStatePtr
bool allDevicesConverged(Parallel::Machine comm)
bool disablePDEContinuation()
bool setParam(std::string &name, double val, bool overrideOriginal=false)
Linear::Vector * daeQVectorPtr
Device::DeviceMgr & deviceManager_
Util::Timer * residualTimerPtr_
Linear::Vector * lastLeadCurrentPtr
bool calcCouplingTerms(int iSubProblem, int iCouple, const Linear::Vector *dxdvPtr)
NonlinearEquationLoader(TimeIntg::DataStore &ds, Loader &loader, Device::DeviceMgr &device_manager, TimeIntg::WorkingIntegrationMethod &wim, bool daeStateDerivFlag)
Linear::Vector * daeFVectorPtr
bool loadFinalSensitivityDerivatives()
void getAnalyticSensitivities(std::string &name, std::vector< double > &dfdpVec, std::vector< double > &dqdpVec, std::vector< double > &dbdpVec, std::vector< int > &FindicesVec, std::vector< int > &QindicesVec, std::vector< int > &BindicesVec) const
void loadFinalSensitivityDerivatives()
void homotopyStepFailure()
Linear::Matrix * dFdxMatrixPtr
bool loadSensitivityResiduals()
int getHomotopyBlockSize() const
Linear::Vector * nextStatePtr
bool allDevicesConverged(Parallel::Machine comm) const
Linear::Vector * dFdxdVpVectorPtr
virtual bool loadDAEMatrices(Linear::Vector *tmpSolVectorPtr, Linear::Vector *tmpStaVectorPtr, Linear::Vector *tmpStaDerivVectorPtr, Linear::Vector *tmpStoVectorPtr, Linear::Matrix *tmpdQdxMatrixPtr, Linear::Matrix *tmpdFdxMatrixPtr)
virtual bool updateState(Linear::Vector *nextSolVectorPtr, Linear::Vector *currSolVectorPtr, Linear::Vector *lastSolVectorPtr, Linear::Vector *nextStaVectorPtr, Linear::Vector *currStaVectorPtr, Linear::Vector *lastStaVectorPtr, Linear::Vector *nextStoVectorPtr, Linear::Vector *currStoVectorPtr, Linear::Vector *lastStoVectorPtr)
Linear::Vector * currLeadDeltaVPtr
void homotopyStepSuccess(const std::vector< std::string > ¶mNames, const std::vector< double > ¶mVals)
void setVoltageLimiterStatus(bool voltageLimterStatus)
void setVoltageLimiterStatus(bool voltageLimterStatus)
bool devicesConverged(Parallel::Machine comm, const InstanceVector &extern_devices)
bool getVoltageLimiterStatus()
Linear::Vector * nextSolutionPtr
void obtainSensitivityResiduals()
Linear::Vector * nextStorePtr
Linear::Vector * dQdxdVpVectorPtr
Linear::Vector * currLeadCurrentPtr
Linear::Vector * lastStorePtr
bool getParamAndReduce(Parallel::Machine comm, const DeviceMgr &device_manager, const std::string &name, double &val)
bool analyticSensitivitiesAvailable(const std::string &name)
Linear::Vector * dQdxVecVectorPtr
Linear::Vector * currSolutionPtr
void getNumInterfaceNodes(std::vector< int > &numINodes)
void applyJacobian(const Linear::Vector &input, Linear::Vector &result)
int enablePDEContinuation()
Linear::Vector * dFdxVecVectorPtr
Linear::Vector * nextStoreLeadCurrQPtr
int enablePDEContinuation()
std::vector< DeviceInstance * > InstanceVector
Linear::Vector * nextStateDerivPtr
bool getVoltageLimiterStatus()
Linear::Matrix * dQdxMatrixPtr
bool isLinearSystem() const
Device::DeviceMgr & deviceManager_
Device manager.
Linear::Vector * daeBVectorPtr
Linear::Vector * nextLeadCurrentPtr