/* Simulation code for PW_PowerSystem generated by the OpenModelica Compiler v1.12.0-dev-77-g56dc448 (32-bit). */
#if !defined(PW_PowerSystem__MODEL_H)
#define PW_PowerSystem__MODEL_H
#include "openmodelica.h"
#include "openmodelica_func.h"
#include "simulation_data.h"
#include "simulation/simulation_info_json.h"
#include "simulation/simulation_runtime.h"
#include "util/omc_error.h"
#include "simulation/solver/model_help.h"
#include "simulation/solver/delay.h"
#include "simulation/solver/linearSystem.h"
#include "simulation/solver/nonlinearSystem.h"
#include "simulation/solver/mixedSystem.h"

#include <string.h>

#include "PW_PowerSystem_functions.h"

#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE_index 0
#define Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance_index 1
#define Modelica_Electrical_Machines_Losses_BrushParameters_index 2
#define Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters_index 3
#define Modelica_Electrical_Machines_Losses_CoreParameters_index 4
#define Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters_index 5
#define Modelica_Electrical_Machines_Losses_FrictionParameters_index 6
#define Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters_index 7
#define Modelica_Electrical_Machines_Losses_StrayLoadParameters_index 8
#define Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters_index 9
#define Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop_index 10

extern void PW_PowerSystem_callExternalObjectConstructors(DATA *data, threadData_t *threadData);
extern void PW_PowerSystem_callExternalObjectDestructors(DATA *_data, threadData_t *threadData);
#if !defined(OMC_NUM_NONLINEAR_SYSTEMS) || OMC_NUM_NONLINEAR_SYSTEMS>0
#endif
#if !defined(OMC_NUM_LINEAR_SYSTEMS) || OMC_NUM_LINEAR_SYSTEMS>0
extern void PW_PowerSystem_initialLinearSystem(int nLinearSystems, LINEAR_SYSTEM_DATA *data);
#endif
#if !defined(OMC_NUM_MIXED_SYSTEMS) || OMC_NUM_MIXED_SYSTEMS>0
#endif
#if !defined(OMC_NO_STATESELECTION)
extern void PW_PowerSystem_initializeStateSets(int nStateSets, STATE_SET_DATA* statesetData, DATA *data);
#endif
extern int PW_PowerSystem_functionAlgebraics(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_function_storeDelayed(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_updateBoundVariableAttributes(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_functionInitialEquations(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_functionInitialEquations_lambda0(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_functionRemovedInitialEquations(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_updateBoundParameters(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_checkForAsserts(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_function_ZeroCrossingsEquations(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_function_ZeroCrossings(DATA *data, threadData_t *threadData, double* gout);
extern int PW_PowerSystem_function_updateRelations(DATA *data, threadData_t *threadData, int evalZeroCross);
extern int PW_PowerSystem_checkForDiscreteChanges(DATA *data, threadData_t *threadData);
extern const char* PW_PowerSystem_zeroCrossingDescription(int i, int **out_EquationIndexes);
extern const char* PW_PowerSystem_relationDescription(int i);
extern void PW_PowerSystem_function_initSample(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_initialAnalyticJacobianG(void* data, threadData_t *threadData);
extern int PW_PowerSystem_initialAnalyticJacobianA(void* data, threadData_t *threadData);
extern int PW_PowerSystem_initialAnalyticJacobianB(void* data, threadData_t *threadData);
extern int PW_PowerSystem_initialAnalyticJacobianC(void* data, threadData_t *threadData);
extern int PW_PowerSystem_initialAnalyticJacobianD(void* data, threadData_t *threadData);
extern int PW_PowerSystem_functionJacG_column(void* data, threadData_t *threadData);
extern int PW_PowerSystem_functionJacA_column(void* data, threadData_t *threadData);
extern int PW_PowerSystem_functionJacB_column(void* data, threadData_t *threadData);
extern int PW_PowerSystem_functionJacC_column(void* data, threadData_t *threadData);
extern int PW_PowerSystem_functionJacD_column(void* data, threadData_t *threadData);
extern const char* PW_PowerSystem_linear_model_frame(void);
extern const char* PW_PowerSystem_linear_model_datarecovery_frame(void);
extern int PW_PowerSystem_mayer(DATA* data, modelica_real** res, short *);
extern int PW_PowerSystem_lagrange(DATA* data, modelica_real** res, short *, short *);
extern int PW_PowerSystem_pickUpBoundsForInputsInOptimization(DATA* data, modelica_real* min, modelica_real* max, modelica_real*nominal, modelica_boolean *useNominal, char ** name, modelica_real * start, modelica_real * startTimeOpt);
extern int PW_PowerSystem_setInputData(DATA *data, const modelica_boolean file);
extern int PW_PowerSystem_getTimeGrid(DATA *data, modelica_integer * nsi, modelica_real**t);
extern void PW_PowerSystem_function_initSynchronous(DATA * data, threadData_t *threadData);
extern void PW_PowerSystem_function_updateSynchronous(DATA * data, threadData_t *threadData, long i);
extern int PW_PowerSystem_function_equationsSynchronous(DATA * data, threadData_t *threadData, long i);
extern void PW_PowerSystem_read_input_fmu(MODEL_DATA* modelData, SIMULATION_INFO* simulationData);
extern void PW_PowerSystem_function_savePreSynchronous(DATA *data, threadData_t *threadData);
extern int PW_PowerSystem_inputNames(DATA* data, char ** names);
extern int PW_PowerSystem_initializeDAEmodeData(DATA *data, DAEMODE_DATA*);
extern int PW_PowerSystem_functionLocalKnownVars(DATA*, threadData_t*);

#include "PW_PowerSystem_literals.h"




#if defined(HPCOM) && !defined(_OPENMP)
  #error "HPCOM requires OpenMP or the results are wrong"
#endif
#if defined(_OPENMP)
  #include <omp.h>
#else
  /* dummy omp defines */
  #define omp_get_max_threads() 1
#endif

#endif


