#include <mbdynFMI.h>
|
void | parseXML (fmi_import_context_t *context, const char *dirPath) |
|
void | setCallBackFunction () |
|
| fmu1 (fmi_import_context_t *text, int type) |
|
void | ImportCreateDLL (void) |
|
bool | CheckInput (const std::string) |
|
int | GetNumOfContinousStates (void) |
|
int | GetNumOfEventIndicators (void) |
|
int | GetNumOfVar (void) |
|
void | Initialize (double dTol, double time, double rTol) |
|
void | EventIndicatorInit (void) |
|
void | SetRelativeTol (double dTol) |
|
void | SetTime (double time) |
|
void | SetStates (double *states) |
|
void | SetValuesByVariable (const std::string, double) |
|
int | GetRefValueFromString (const char *s) |
|
double | GetStateFromRefValue (unsigned int i) |
|
void | GetStateDerivatives (double *) |
|
void | GetStates (double *) |
|
void | GetDirectionalDerivatives (FullMatrixHandler *, int *, int, double *) |
|
bool | SupportsDirectionalDerivatives () |
|
bool | CheckInterrupts (double, double *) |
|
void | InitializeAsSlave (const char *location, double tstart, double tend) |
|
void | CSPropogate (double tcur, double dt) |
|
virtual | ~fmu1 (void) |
|
| fmu (fmi_import_context_t *text, int type) |
|
virtual | ~fmu (void) |
|
Definition at line 115 of file mbdynFMI.h.
fmu1::fmu1 |
( |
fmi_import_context_t * |
text, |
|
|
int |
type |
|
) |
| |
|
inline |
Definition at line 143 of file mbdynFMI.h.
References NO_OP.
fmu(fmi_import_context_t *text, int type)
bool fmu1::CheckInput |
( |
const std::string |
s | ) |
|
|
virtual |
Implements fmu.
Definition at line 598 of file mbdynFMI.cc.
References v.
599 v = fmi1_import_get_variable_by_name(
fmu, s.c_str());
601 silent_cout(s.c_str()<<
" is not defined in XML, hence ");
605 return ((fmi1_import_get_causality(
v))==0);
fmi1_import_variable_t * v
bool fmu1::CheckInterrupts |
( |
double |
currTime, |
|
|
double * |
states |
|
) |
| |
|
virtual |
void fmu1::CSPropogate |
( |
double |
tcur, |
|
|
double |
dt |
|
) |
| |
|
virtual |
void fmu1::EventIndicatorInit |
( |
void |
| ) |
|
|
virtual |
void fmu1::GetDirectionalDerivatives |
( |
FullMatrixHandler * |
jacobian, |
|
|
int * |
vector, |
|
|
int |
vectorLength, |
|
|
double * |
seedVector |
|
) |
| |
|
virtual |
int fmu1::GetNumOfContinousStates |
( |
void |
| ) |
|
|
virtual |
int fmu1::GetNumOfEventIndicators |
( |
void |
| ) |
|
|
virtual |
Implements fmu.
Definition at line 572 of file mbdynFMI.cc.
573 return fmi1_import_get_number_of_event_indicators(
fmu);
int fmu1::GetNumOfVar |
( |
void |
| ) |
|
|
virtual |
Implements fmu.
Definition at line 689 of file mbdynFMI.cc.
690 fmi1_import_variable_list_t* vl;
691 vl = fmi1_import_get_variable_list(
fmu);
692 return fmi1_import_get_variable_list_size(vl);
int fmu1::GetRefValueFromString |
( |
const char * |
s | ) |
|
|
virtual |
Implements fmu.
Definition at line 646 of file mbdynFMI.cc.
References v.
647 v = fmi1_import_get_variable_by_name(
fmu, s);
648 return static_cast<int>(fmi1_import_get_variable_vr(
v));
fmi1_import_variable_t * v
void fmu1::GetStateDerivatives |
( |
double * |
derivatives | ) |
|
|
virtual |
double fmu1::GetStateFromRefValue |
( |
unsigned int |
i | ) |
|
|
virtual |
void fmu1::GetStates |
( |
double * |
states | ) |
|
|
virtual |
void fmu1::ImportCreateDLL |
( |
void |
| ) |
|
|
virtual |
void fmu1::Initialize |
( |
double |
dTol, |
|
|
double |
time, |
|
|
double |
rTol |
|
) |
| |
|
virtual |
Implements fmu.
Definition at line 533 of file mbdynFMI.cc.
References currTime, eventInfo, fmistatus, intermediateResults, jmstatus, and STATUSCHECK.
535 fmi1_boolean_t tolControlled = fmi1_true;
538 dTol = fmi1_import_get_default_experiment_tolerance(
fmu);
539 tolControlled = fmi1_false;
545 jmstatus = fmi1_import_instantiate_model(
fmu,
"Test ME model instance");
555 fmi1_capi_load_dll(
fmu->capi);
561 fmi1_boolean_t loggingOn = fmi1_true;
563 fmi1_boolean_t loggingOn = fmi1_false;
566 fmi1_capi_instantiate_model(
fmu->capi,
"noName", fmi1_import_get_GUID(
fmu), loggingOn);
569 silent_cout(
"FMU Initialized\n");
fmi1_event_info_t eventInfo
fmi1_boolean_t intermediateResults
void fmu1::InitializeAsSlave |
( |
const char * |
location, |
|
|
double |
tstart, |
|
|
double |
tend |
|
) |
| |
|
virtual |
Implements fmu.
Definition at line 733 of file mbdynFMI.cc.
References fmistatus, jmstatus, and STATUSCHECK.
734 std::stringstream resourceLocation;
735 std::string strLocation = location;
737 resourceLocation <<
"file://" << strLocation;
738 jmstatus = fmi1_import_instantiate_slave(
fmu,
"Test CS model instance", resourceLocation.str().c_str(),
"", 0.0, fmi1_false, fmi1_false);
741 fmistatus = fmi1_import_initialize_slave(
fmu, 1.0, fmi1_false, 10.0);
void fmu1::parseXML |
( |
fmi_import_context_t * |
context, |
|
|
const char * |
dirPath |
|
) |
| |
|
virtual |
Implements fmu.
Definition at line 500 of file mbdynFMI.cc.
References MBDYN_EXCEPT_ARGS.
501 fmu = fmi1_import_parse_xml(
context, dirPath);
503 silent_cout(
"Error parsing XML\n");
506 silent_cout(
"XML Parsed successfully\n");
#define MBDYN_EXCEPT_ARGS
fmi_import_context_t * context
void fmu1::setCallBackFunction |
( |
| ) |
|
|
virtual |
Implements fmu.
Definition at line 510 of file mbdynFMI.cc.
References callBackFunctions.
514 silent_cout(
"Callback Functions Set.\n");
fmi1_callback_functions_t callBackFunctions
void fmu1::SetRelativeTol |
( |
double |
dTol | ) |
|
|
virtual |
void fmu1::SetStates |
( |
double * |
states | ) |
|
|
virtual |
void fmu1::SetTime |
( |
double |
time | ) |
|
|
virtual |
void fmu1::SetValuesByVariable |
( |
const std::string |
s, |
|
|
double |
value |
|
) |
| |
|
virtual |
Implements fmu.
Definition at line 610 of file mbdynFMI.cc.
References fmistatus, MBDYN_EXCEPT_ARGS, STATUSCHECK, and v.
611 fmi1_value_reference_t ref;
612 fmi1_variable_alias_kind_enu_t aliasKind;
613 fmi1_base_type_enu_t baseType;
615 fmi1_import_variable_t*
v = fmi1_import_get_variable_by_name(
fmu, s.c_str());
617 ref = fmi1_import_get_variable_vr(v);
618 aliasKind = fmi1_import_get_variable_alias_kind(v);
619 baseType = fmi1_import_get_variable_base_type(v);
621 if (aliasKind == fmi1_variable_is_negated_alias){
622 if(baseType != fmi1_base_type_bool){
626 value = (
bool)!value;
630 if (baseType == fmi1_base_type_real){
633 else if (baseType == fmi1_base_type_int){
634 fmistatus = fmi1_import_set_integer(
fmu, &ref, 1, (
const int*)&value);
636 else if (baseType == fmi1_base_type_bool){
637 fmistatus = fmi1_import_set_boolean(
fmu, &ref, 1, (
const fmi1_boolean_t*)&value);
640 silent_cerr(
"Input type not Supported");
fmi1_import_variable_t * v
#define MBDYN_EXCEPT_ARGS
bool fmu1::SupportsDirectionalDerivatives |
( |
| ) |
|
|
virtual |
fmi1_callback_functions_t fmu1::callBackFunctions |
|
private |
fmi1_real_t fmu1::currTime |
|
private |
fmi1_real_t* fmu1::eventIndicators |
|
private |
fmi1_real_t* fmu1::eventIndicatorsPrev |
|
private |
fmi1_event_info_t fmu1::eventInfo |
|
private |
fmi1_status_t fmu1::fmistatus |
|
private |
Definition at line 120 of file mbdynFMI.h.
Referenced by CheckInterrupts(), CSPropogate(), EventIndicatorInit(), GetStateDerivatives(), GetStateFromRefValue(), GetStates(), Initialize(), InitializeAsSlave(), SetStates(), SetTime(), SetValuesByVariable(), and ~fmu1().
fmi1_boolean_t fmu1::intermediateResults |
|
private |
jm_status_enu_t fmu1::jmstatus |
|
private |
size_t fmu1::nEventIndicators |
|
private |
int fmu1::numOfContStates |
|
private |
fmi1_real_t fmu1::relativeTolerance |
|
private |
fmi1_import_variable_t* fmu1::v |
|
private |
fmi1_value_reference_t* fmu1::vrs |
|
private |
The documentation for this class was generated from the following files: