48 unsigned uLabel,
const DofOwner *pDO,
56 silent_cout(
"help text here" << std::endl);
65 std::string UClocation;
70 if (!strcmp(
simType,
"cosimulation")){
73 else if (!strcmp(
simType,
"import")){
77 silent_cout(
"Unsupported Simulation Type. "
78 "Available options:\n"
84 silent_cerr(
"keyword \"type\" expected");
88 double relativeTolerance;
90 relativeTolerance = HP.
GetReal();
92 relativeTolerance = 0.001;
104 silent_cout(
"Model defined as co-simulation.\n");
106 silent_cout(
"Model defined as import.\n");
114 if(
status==jm_status_error){
115 silent_cerr(
"Failed to uncompress FMU. Exiting\n");
119 silent_cout(
"FMU uncompressed successfully \n");
131 silent_cout(
"Version "<<
version<<
"\n");
146 double dTol = pDM->
GetSolver()->dGetTolerance();
158 silent_cout(
"Initialized as slave\n");
171 silent_cout(
"Variable "<<i->first<<
" is not of type input\n");
175 if (dynamic_cast<const PrivDriveCaller*>(i->second) != NULL){
184 silent_cout(
"No FMU input was defined in input file. \n");
224 out << std::setw(4) <<
currState[i] <<
" ";
261 silent_cout(__func__);
303 for(
int j=numOfContinousStates+1; j<=numOfContinousStates +
privDriveLength; j++){
332 silent_cout(__func__);
348 currState[i] = XCurr(iFirstIndex + i + 1);
388 unsigned int idx = 0;
391 silent_cout(__func__);
438 return out <<
"# ModuleFMU: not implemented" << std::endl;
505 if (!
SetUDE(
"FMU", rf1)) {
508 silent_cerr(
"ModuleFMU: "
509 "module_init(" << module_name <<
") "
510 "failed" << std::endl);
flag fReadOutput(MBDynParser &HP, const T &t) const
void setup_callbacks(jm_callbacks *callbacks)
virtual int GetNumOfEventIndicators(void)=0
DofOrder::Order GetEqType(unsigned int i) const
virtual unsigned int iGetInitialNumDof(void) const
virtual void InitializeAsSlave(const char *, double, double)=0
virtual void SetValuesByVariable(const std::string, double)=0
void PutColIndex(integer iSubCol, integer iCol)
virtual void GetStateDerivatives(double *)=0
virtual bool bToBeOutput(void) const
#define MBDYN_EXCEPT_ARGS
virtual void GetStates(double *)=0
virtual void ResizeReset(integer)
virtual void CSPropogate(double tcur, double dt)=0
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
FullSubMatrixHandler & SetFull(void)
DofOrder::Order GetDofType(unsigned int i) const
doublereal dGetTime(void) const
fmu::SimulationTypes SIMTYPE
fmi_version_enu_t version
unsigned int iGetNumDof(void) const
unsigned int iGetNumPrivData(void) const
virtual void GetDirectionalDerivatives(FullMatrixHandler *, int *, int, double *)=0
ModuleFMU(unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
std::vector< Hint * > Hints
virtual void Resize(integer iNewRows, integer iNewCols)
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
virtual void EventIndicatorInit(void)=0
virtual void SetTime(double time)=0
virtual const doublereal & dGetCoef(integer iRow, integer iCol) const
strDriveCon drivesContainer
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual bool SupportsDirectionalDerivatives()=0
doublereal dGetPrivData(unsigned int i) const
std::string UncompressLocation(const char *location)
unsigned int iGetPrivDataIdx(const char *s) const
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
virtual int GetRefValueFromString(const char *s)=0
virtual bool IsKeyWord(const char *sKeyWord)
std::ostream & Loadable(void) const
virtual double GetStateFromRefValue(unsigned int i)=0
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
int iGetNumConnectedNodes(void) const
jm_status_enu_t fmi_zip_unzip(const char *zip_file_path, const char *output_folder, jm_callbacks *callbacks)
Uncompress a zip file.
#define ASSERT(expression)
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
virtual void ImportCreateDLL(void)=0
virtual void ResizeReset(integer, integer)
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
virtual void Initialize(double dTol, double time, double rTol)=0
virtual std::string GetString(const std::string &sDefVal)
fmi_import_context_t * context
virtual bool IsStringWithDelims(enum Delims Del=DEFAULTDELIM)
void PutRowIndex(integer iSubRow, integer iRow)
intDriveCon privDrivesIndex
bool SetUDE(const std::string &s, UserDefinedElemRead *rude)
virtual void Output(OutputHandler &OH) const
std::ostream & Restart(std::ostream &out) const
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
const Solver * GetSolver(void) const
DriveCaller * GetDriveCaller(bool bDeferred=false)
int module_init(const char *module_name, void *pdm, void *php)
This function registers our user defined element for the math parser.
virtual bool CheckInput(const std::string)=0
virtual void SetOutputFlag(flag f=flag(1))
virtual integer iGetFirstIndex(void) const
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
virtual void parseXML(fmi_import_context_t *context, const char *dirPath)=0
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
virtual void setCallBackFunction()=0
virtual doublereal dGetInitialTimeStep(void) const
virtual int GetNumOfVar(void)=0
virtual void SetStates(double *states)=0
virtual int GetNumOfContinousStates(void)=0
int * jacobianInputVector
double * stateDerivatives
virtual doublereal GetReal(const doublereal &dDefval=0.0)