11#ifndef CL_FEM_CONTROLLER_HPP
12#define CL_FEM_CONTROLLER_HPP
41 Kernel * mKernel = nullptr ;
43 Mesh * mMesh = nullptr ;
44 Kernel * mKernel2 = nullptr ;
46 Mesh * mMesh2 = nullptr ;
65 uint mRunningTimeStep = 0 ;
66 uint mMeshTimeStep = 1 ;
78 uint mMinNumIterations = 2 ;
79 uint mMaxNumIterations = 100 ;
80 uint mIterationTarget = 20 ;
89 uint mDivergenceStrikes = 0 ;
101 uint mStallWindow = 5 ;
102 real mStallBand = 0.2 ;
110 uint mWatchdogWindow = 30 ;
111 uint mWatchdogWindow2 = 30 ;
122 uint mMinNumIterations2 = 2 ;
123 uint mMaxNumIterations2 = 100 ;
124 uint mIterationTarget2 = 20 ;
126 uint mMaxNumIterationsDiv = 10 ;
127 uint mNumIterationsDiv = 0;
137 bool mComputeConditioning = false ;
138 bool mComputeConditioning2 = false ;
146 bool mMumpsErrorAnalysis = false ;
147 bool mMumpsErrorAnalysis2 = false ;
151 bool mThermalDiagnosticsChecked = false ;
157 bool mParamsSet = false ;
167 real mOmegaNoiseBand = 0.05 ;
191 uint mNewtonTrustStreak = 0 ;
193 real mEpsilonSwitch = 1e-4 ;
194 real mRelativeEpsilonTarget = 1e-6 ;
199 real mAbsoluteEpsilonTarget = 0.0 ;
201 real mEpsilonSwitch2 = 1e-3 ;
202 real mRelativeEpsilonTarget2 = 1e-6 ;
203 real mAbsoluteEpsilonTarget2 = 0.0 ;
218 bool mThermalFrozen = false ;
221 bool mAdaptTimestep = true ;
222 real mSaveEvery = 0.0 ;
223 bool mLastSave = false ;
231 real mOmegaNewton = 1.0 ;
232 real mOmegaPicard = 1.0 ;
233 real mOmegaNewton2 = 1.0 ;
234 real mOmegaPicard2 = 1.0 ;
235 bool mJustPicard = false ;
236 bool mJustPicard2 = false ;
240 uint mThermalFlipCount = 0 ;
246 uint mAndersonDepth = 0 ;
247 uint mAndersonDepth2 = 0 ;
254 uint mAndersonCommits = 0 ;
255 uint mAndersonCommits2 = 0 ;
263 bool mForceNewton = false ;
264 bool mNewtonEscalated = false ;
273 bool mForceNewton2 = false ;
274 bool mNewtonEscalated2 = false ;
284 real mOmegaMin = 0.001 ;
285 real mOmegaMax = 1.0 ;
286 real mOmegaMin2 = 0.1 ;
287 real mOmegaMax2 = 1.0 ;
291 Timer * mTimer = nullptr ;
318 uint mThermalFlatCount = 0 ;
319 bool mThermalStalled = false ;
327 bool mMagneticHitTarget = false ;
334 bool mMagBodyRanLastTrip = true ;
336 bool mTripExit = false ;
342 uint mBestEpsilonIteration = 0 ;
343 uint mBestEpsilonIteration2 = 0 ;
349 uint mSolverFailCount = 0 ;
355 bool mUseLegacyTimestepControl = false ;
363 real mCtrlKp = 0.15 ;
364 real mCtrlKi = 0.30 ;
371 real mCtrlErr0 = 1.0 ;
372 real mCtrlErr1 = 1.0 ;
373 real mCtrlErr2 = 1.0 ;
381 uint mPostFailureHold = 0 ;
382 uint mPostFailureHoldSteps = 2 ;
390 uint mFloorRetries = 0 ;
391 uint mFloorEscalationCap = 4 ;
400 uint mMaxFloorRetries = 20 ;
404 uint mMaxNumIterationsDeck = 100 ;
405 uint mMaxNumIterations2Deck = 100 ;
406 uint mWatchdogWindowDeck = 30 ;
407 uint mWatchdogWindow2Deck = 30 ;
414 bool mAllowRestart = true ;
417 uint mIteration = 0 ;
418 uint mIteration2 = 0 ;
419 uint mIterationTime = 0 ;
420 uint mIteration0 = 0 ;
421 uint mIteration02 = 0 ;
422 uint mEigenAnalysisTime = 0 ;
423 uint mPostprocesingTime = 0 ;
450 real mDeltaTimeMin = 1e-10 ;
451 bool mReset = false ;
452 bool mResetThermal = false ;
453 bool mFirstFlip = false ;
454 bool mFirstFlip2 = false ;
456 bool mIsFullyCoupled = true ;
457 real mCouplingFactor = 1 ;
460 Cell < PhysicalBoundaryCondition * > mCircuitCurrentBCs ;
461 Cell < PhysicalBoundaryCondition * > mCircuitVoltageBCs ;
465 bool mFirstIVSave = true ;
479 real mLastJJcMax = 0. ;
485 bool mBoxSectionOpen = false ;
491 bool mPostProcessed = false ;
526 finalize(
const bool aPostProcess =
true );
548 save(
const std::string & aFilename );
551 save_IV(
const std::string & aFilename );
613 impose_voltage_bcs();
621 dump_system_if_requested(
DofManager * aDofMgr,
628 int mDumpCountMagnetic = 0 ;
629 int mDumpCountThermal = 0 ;
636 magnetic_stagnation_forces_reset();
651 watchdog_magnetic(
const real aOmega );
654 watchdog_thermal(
const real aOmega );
660 void anderson_commit_magnetic();
661 void anderson_discard_magnetic();
662 void anderson_clear_magnetic();
663 void anderson_commit_thermal();
664 void anderson_clear_thermal();
673 try_escalate_to_newton();
680 try_escalate_thermal_to_newton();
692 compute_circuit_current() ;
695 compute_conditioning();
712 arm_conditioning_magnetic();
715 arm_conditioning_thermal();
718 capture_conditioning_magnetic();
721 capture_conditioning_thermal();
728 setup_thermal_eigen();
736 check_magnetic_diagnostics();
740 check_thermal_diagnostics();
761 check_iterative_solver_headroom(
763 const real aNonlinTol,
764 const char * aFieldName )
const ;
779 check_compression_headroom(
781 const real aNonlinTol,
782 const char * aFieldName )
const ;
794 synchronize_history_fields(
797 const uint aStepCount,
798 const string & aPath,
799 const char * aEquationName );
805 print_line(
const real aOmega,
const real aOmega2 );
808 print_line_magnetic(
const real aOmega );
811 print_line_thermal(
const real aOmega );
820 print_thermal_stall_warning();
842 print_physics_stats();
877 return mTimeStepping;
Definition cl_Circuit.hpp:20
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
High-resolution wall-clock timing.
Definition cl_Timer.hpp:28
void create_iv_names()
names the I/U pair of every abstract dof: after the deck label of the terminal condition that drives ...
Definition cl_FEM_Controller.cpp:4118
void solve_thermal()
Definition cl_FEM_Controller.cpp:2068
EulerMethod euler_method() const
Definition cl_FEM_Controller.hpp:875
void set_circuit(Circuit *aCircuit)
Definition cl_FEM_Controller.cpp:5161
Kernel * thermal_kernel()
Definition cl_FEM_Controller.hpp:868
const real & time() const
Definition cl_FEM_Controller.cpp:143
bool is_fullycoupled() const
Definition cl_FEM_Controller.cpp:4076
void save_IV(const std::string &aFilename)
Definition cl_FEM_Controller.cpp:4209
void save(const std::string &aFilename)
Definition cl_FEM_Controller.cpp:4088
void solve_magnetic()
Definition cl_FEM_Controller.cpp:2047
bool reset() const
Definition cl_FEM_Controller.cpp:4082
Controller(Kernel *aKernel, Kernel *aKernel2=nullptr)
Definition cl_FEM_Controller.cpp:76
const real & time_thermal() const
Definition cl_FEM_Controller.cpp:149
real simulation_time() const
Definition cl_FEM_Controller.cpp:5131
void initialize_magnetic()
Definition cl_FEM_Controller.cpp:329
void set_params(const input::Section *aSection)
Definition cl_FEM_Controller.cpp:4319
void save_memdump(const string &aPath)
Definition cl_FEM_Controller.cpp:5259
void set_thermal_kernel(Kernel *aKernel)
Definition cl_FEM_Controller.cpp:5068
void initialize_thermal()
Definition cl_FEM_Controller.cpp:440
bool solve_circuit()
Definition cl_FEM_Controller.cpp:2565
Kernel * kernel()
Definition cl_FEM_Controller.hpp:861
real epsilon() const
Definition cl_FEM_Controller.cpp:155
uint iteration() const
Definition cl_FEM_Controller.cpp:161
void initialize_timestep()
Definition cl_FEM_Controller.cpp:167
Circuit * circuit()
Definition cl_FEM_Controller.hpp:854
void load_memdump(const string &aPath)
Definition cl_FEM_Controller.cpp:5349
void finalize(const bool aPostProcess=true)
Definition cl_FEM_Controller.cpp:3059
void solve_coupled()
Definition cl_FEM_Controller.cpp:973
this class creates the DOFs based on the passed equation object.
Definition cl_FEM_DofManager.hpp:55
Base class for transient problems.
Definition cl_IWG_Timestep.hpp:33
Top-level orchestrator; owns the mesh, materials, boundary conditions and DOF managers.
Definition cl_FEM_Kernel.hpp:50
Definition cl_IFB_LINE3.hpp:21
SolverAlgorithm
Definition en_FEM_SolverAlgorithm.hpp:20
@ Picard
Definition en_FEM_SolverAlgorithm.hpp:23
USER GUIDES:
Definition cl_Capacitor.cpp:16
EulerMethod
Definition en_SolverEnums.hpp:47
@ BackwardDifference1
Definition en_SolverEnums.hpp:52
unsigned int uint
Definition typedefs.hpp:30
int proc_t
Definition commtypes.hpp:29
double real
Definition typedefs.hpp:36
#define BELFEM_REAL_MAX
Definition typedefs.hpp:81
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87