Interface to binary FMU. More...
#include <fmu.hpp>
Can be shared between multiple CasADi functions.
Extra doc: https://github.com/casadi/casadi/wiki/L_26s


Public Types | |
| using | internal_base_type = SharedObjectInternal |
| using | base_type = SharedObject |
Public Member Functions | |
| Fmu () | |
| Default constructor. More... | |
| Fmu (const std::string &name, FmuApi api, const DaeBuilderInternal *dae, const std::vector< std::string > &scheme_in, const std::vector< std::string > &scheme_out, const std::map< std::string, std::vector< size_t >> &scheme, const std::vector< std::string > &aux) | |
| Importer factory. More... | |
| const std::string & | name () const |
| Name of the instance. More... | |
| const std::string & | instance_name () const |
| Name of the FMU. More... | |
| size_t | n_in () const |
| Get the number of scheme inputs. More... | |
| size_t | n_out () const |
| Get the number of scheme outputs. More... | |
| size_t | index_in (const std::string &n) const |
| size_t | index_out (const std::string &n) const |
| const std::vector< size_t > & | ired (size_t ind) const |
| const std::vector< size_t > & | ored (size_t ind) const |
| double | nominal_in (size_t ind) const |
| double | nominal_out (size_t ind) const |
| double | min_in (size_t ind) const |
| double | max_in (size_t ind) const |
| std::vector< double > | all_nominal_in (size_t ind) const |
| std::vector< double > | all_nominal_out (size_t ind) const |
| std::string | desc_in (FmuMemory *m, size_t id, bool more=true) const |
| bool | provides_directional_derivatives () const |
| Does the FMU provide support for forward directional derivatives. More... | |
| bool | provides_adjoint_derivatives () const |
| Does the FMU provide support for adjoint directional derivatives. More... | |
| bool | can_be_instantiated_only_once_per_process () const |
| Does the FMU declare restrictions on instantiation? More... | |
| Sparsity | jac_sparsity (const std::vector< size_t > &osub, const std::vector< size_t > &isub) const |
| Sparsity | jac_sparsity (size_t oind, size_t iind) const |
| Sparsity | hess_sparsity (const std::vector< size_t > &r, const std::vector< size_t > &c) const |
| Sparsity | hess_sparsity (size_t r, size_t c) const |
| FmuMemory * | alloc_mem (const FmuFunction &f) const |
| Create memory block. More... | |
| int | init_mem (FmuMemory *m) const |
| Initalize memory block. More... | |
| void | free_mem (void *mem) const |
| Free memory block. More... | |
| void | free_instance (void *instance) const |
| void | set (FmuMemory *m, size_t ind, const double *value) const |
| void | request (FmuMemory *m, size_t ind) const |
| int | eval (FmuMemory *m) const |
| void | get (FmuMemory *m, size_t ind, double *value) const |
| void | set_fwd (FmuMemory *m, casadi_int nseed, const casadi_int *id, const double *v) const |
| void | set_fwd (FmuMemory *m, size_t ind, const double *v) const |
| void | request_fwd (FmuMemory *m, casadi_int nsens, const casadi_int *id, const casadi_int *wrt_id) const |
| void | request_fwd (FmuMemory *m, casadi_int ind) const |
| int | eval_fwd (FmuMemory *m, bool independent_seeds) const |
| void | get_fwd (FmuMemory *m, casadi_int nsens, const casadi_int *id, double *v) const |
| void | get_fwd (FmuMemory *m, size_t ind, double *v) const |
| void | set_adj (FmuMemory *m, casadi_int nseed, const casadi_int *id, const double *v) const |
| void | set_adj (FmuMemory *m, size_t ind, const double *v) const |
| void | request_adj (FmuMemory *m, casadi_int nsens, const casadi_int *id, const casadi_int *wrt_id) const |
| void | request_adj (FmuMemory *m, casadi_int ind) const |
| int | eval_adj (FmuMemory *m) const |
| void | get_adj (FmuMemory *m, casadi_int nsens, const casadi_int *id, double *v) const |
| void | get_adj (FmuMemory *m, size_t ind, double *v) const |
| void | get_stats (FmuMemory *m, Dict *stats, const std::vector< std::string > &name_in, const InputStruct *in) const |
| Get stats. More... | |
| void | serialize (SerializingStream &s) const |
| Serialize an object. More... | |
| std::string | class_name () const |
| Get class name. More... | |
| void | disp (std::ostream &stream, bool more=false) const |
| Print a description of the object. More... | |
| std::string | get_str (bool more=false) const |
| Get string representation. More... | |
| void | print_ptr (std::ostream &stream=casadi::uout()) const |
| void | own (SharedObjectInternal *node) |
| void | assign (SharedObjectInternal *node) |
| Assign the node to a node class pointer without reference counting. More... | |
| casadi_int | getCount () const |
| Get the reference count. More... | |
| void | swap (GenericShared &other) |
| Swap content with another instance. More... | |
| std::string | debug_repr () const |
| bool | is_null () const |
| Is a null pointer? More... | |
| casadi_int | __hash__ () const |
| Returns a number that is unique for a given Node. More... | |
| GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
| Get a weak reference to the object. More... | |
| FmuInternal * | operator-> () |
| const FmuInternal * | operator-> () const |
| FmuInternal * | get () const |
Static Public Member Functions | |
| static std::string | type_name () |
| Get type name. More... | |
| static Fmu | create (FmuInternal *node) |
| Create from node. More... | |
| static Fmu | deserialize (DeserializingStream &s) |
| Deserialize with type disambiguation. More... | |
Protected Member Functions | |
| void | count_up () |
| void | count_down () |
|
inherited |
Definition at line 103 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file shared_object.hpp.
| casadi::Fmu::Fmu | ( | const std::string & | name, |
| FmuApi | api, | ||
| const DaeBuilderInternal * | dae, | ||
| const std::vector< std::string > & | scheme_in, | ||
| const std::vector< std::string > & | scheme_out, | ||
| const std::map< std::string, std::vector< size_t >> & | scheme, | ||
| const std::vector< std::string > & | aux | ||
| ) |
Definition at line 51 of file fmu.cpp.
References casadi::FMI2, casadi::FMI3, name(), casadi::GenericShared< SharedObject, SharedObjectInternal >::own(), and casadi::to_string().
|
inherited |
If the Object does not point to any node, "0" is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_av
Definition at line 123 of file generic_shared_impl.hpp.
| std::vector< double > casadi::Fmu::all_nominal_in | ( | size_t | ind | ) | const |
| std::vector< double > casadi::Fmu::all_nominal_out | ( | size_t | ind | ) | const |
Definition at line 211 of file fmu.cpp.
Referenced by casadi::FmuFunction::get_nominal_in(), and casadi::FmuFunction::get_nominal_out().
| FmuMemory * casadi::Fmu::alloc_mem | ( | const FmuFunction & | f | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2dn
Definition at line 93 of file fmu.cpp.
Referenced by casadi::FmuFunction::alloc_mem().
|
inherited |
improper use will cause memory leaks!
Extra doc: https://github.com/casadi/casadi/wiki/L_at
Definition at line 96 of file generic_shared_impl.hpp.
| bool casadi::Fmu::can_be_instantiated_only_once_per_process | ( | ) | const |
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_au
Definition at line 31 of file shared_object.cpp.
Referenced by casadi::FmuFunction::check_mem_count(), casadi::MXFunction::export_code_body(), and casadi::BlazingSplineFunction::merge().
|
protectedinherited |
Definition at line 133 of file generic_shared_impl.hpp.
|
protectedinherited |
Definition at line 132 of file generic_shared_impl.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_27c
Definition at line 1365 of file fmu.cpp.
References casadi::GenericShared< Shared, Internal >::own().
Referenced by deserialize().
|
inherited |
Definition at line 112 of file generic_shared_impl.hpp.
| std::string casadi::Fmu::desc_in | ( | FmuMemory * | m, |
| size_t | id, | ||
| bool | more = true |
||
| ) | const |
Definition at line 219 of file fmu.cpp.
Referenced by casadi::FmuFunction::check_hessian(), and casadi::FmuFunction::eval_task().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_27e
Definition at line 1361 of file fmu.cpp.
References create(), and casadi::FmuInternal::deserialize().
|
inherited |
Definition at line 35 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by casadi::Nlpsol::disp_more(), and casadi::CsparseInterface::nfact().
| int casadi::Fmu::eval | ( | FmuMemory * | m | ) | const |
| int casadi::Fmu::eval_adj | ( | FmuMemory * | m | ) | const |
| int casadi::Fmu::eval_fwd | ( | FmuMemory * | m, |
| bool | independent_seeds | ||
| ) | const |
| void casadi::Fmu::free_instance | ( | void * | instance | ) | const |
| void casadi::Fmu::free_mem | ( | void * | mem | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2dt
Definition at line 97 of file fmu.cpp.
Referenced by casadi::FmuFunction::free_mem().
| FmuInternal * casadi::Fmu::get | ( | ) | const |
Access functions of the node
Definition at line 101 of file fmu.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
Referenced by casadi::FmuFunction::eval_task().
| void casadi::Fmu::get | ( | FmuMemory * | m, |
| size_t | ind, | ||
| double * | value | ||
| ) | const |
| void casadi::Fmu::get_adj | ( | FmuMemory * | m, |
| casadi_int | nsens, | ||
| const casadi_int * | id, | ||
| double * | v | ||
| ) | const |
| void casadi::Fmu::get_adj | ( | FmuMemory * | m, |
| size_t | ind, | ||
| double * | v | ||
| ) | const |
| void casadi::Fmu::get_fwd | ( | FmuMemory * | m, |
| casadi_int | nsens, | ||
| const casadi_int * | id, | ||
| double * | v | ||
| ) | const |
| void casadi::Fmu::get_fwd | ( | FmuMemory * | m, |
| size_t | ind, | ||
| double * | v | ||
| ) | const |
| void casadi::Fmu::get_stats | ( | FmuMemory * | m, |
| Dict * | stats, | ||
| const std::vector< std::string > & | name_in, | ||
| const InputStruct * | in | ||
| ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26y
Definition at line 431 of file fmu.cpp.
Referenced by casadi::FmuFunction::get_stats().
|
inlineinherited |
Definition at line 91 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file generic_shared_impl.hpp.
| Sparsity casadi::Fmu::hess_sparsity | ( | const std::vector< size_t > & | r, |
| const std::vector< size_t > & | c | ||
| ) | const |
Definition at line 260 of file fmu.cpp.
Referenced by casadi::FmuFunction::get_jac_sparsity(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().
|
inline |
Definition at line 160 of file fmu.hpp.
| size_t casadi::Fmu::index_in | ( | const std::string & | n | ) | const |
| size_t casadi::Fmu::index_out | ( | const std::string & | n | ) | const |
| int casadi::Fmu::init_mem | ( | FmuMemory * | m | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26x
Definition at line 268 of file fmu.cpp.
Referenced by casadi::FmuFunction::init_mem().
| const std::string & casadi::Fmu::instance_name | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2ab
Definition at line 114 of file fmu.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by casadi::FmuFunction::check_mem_count().
| const std::vector< size_t > & casadi::Fmu::ired | ( | size_t | ind | ) | const |
Definition at line 155 of file fmu.cpp.
Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::get_sparsity_in(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().
|
inherited |
Definition at line 116 of file generic_shared_impl.hpp.
| Sparsity casadi::Fmu::jac_sparsity | ( | const std::vector< size_t > & | osub, |
| const std::vector< size_t > & | isub | ||
| ) | const |
Definition at line 251 of file fmu.cpp.
Referenced by casadi::FmuFunction::get_jac_sparsity(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().
|
inline |
Definition at line 152 of file fmu.hpp.
| double casadi::Fmu::max_in | ( | size_t | ind | ) | const |
| double casadi::Fmu::min_in | ( | size_t | ind | ) | const |
| size_t casadi::Fmu::n_in | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26v
Definition at line 123 of file fmu.cpp.
Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().
| size_t casadi::Fmu::n_out | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26w
Definition at line 131 of file fmu.cpp.
Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().
| const std::string & casadi::Fmu::name | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26u
Definition at line 105 of file fmu.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by Fmu().
| double casadi::Fmu::nominal_in | ( | size_t | ind | ) | const |
Definition at line 171 of file fmu.cpp.
Referenced by casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().
| double casadi::Fmu::nominal_out | ( | size_t | ind | ) | const |
| FmuInternal * casadi::Fmu::operator-> | ( | ) |
Access functions of the node
Definition at line 85 of file fmu.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
| const FmuInternal * casadi::Fmu::operator-> | ( | ) | const |
Access functions of the node
Definition at line 89 of file fmu.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
| const std::vector< size_t > & casadi::Fmu::ored | ( | size_t | ind | ) | const |
Definition at line 163 of file fmu.cpp.
Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::get_sparsity_in(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().
|
inherited |
Assign the node to a node class pointer (or null)
Definition at line 89 of file generic_shared_impl.hpp.
|
inherited |
Print the pointer to the internal class
Definition at line 43 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
| bool casadi::Fmu::provides_adjoint_derivatives | ( | ) | const |
Definition at line 235 of file fmu.cpp.
Referenced by casadi::FmuFunction::FmuFunction(), and casadi::FmuFunction::init().
| bool casadi::Fmu::provides_directional_derivatives | ( | ) | const |
Definition at line 227 of file fmu.cpp.
Referenced by casadi::FmuFunction::FmuFunction(), and casadi::FmuFunction::init().
| void casadi::Fmu::request | ( | FmuMemory * | m, |
| size_t | ind | ||
| ) | const |
| void casadi::Fmu::request_adj | ( | FmuMemory * | m, |
| casadi_int | ind | ||
| ) | const |
| void casadi::Fmu::request_adj | ( | FmuMemory * | m, |
| casadi_int | nsens, | ||
| const casadi_int * | id, | ||
| const casadi_int * | wrt_id | ||
| ) | const |
| void casadi::Fmu::request_fwd | ( | FmuMemory * | m, |
| casadi_int | ind | ||
| ) | const |
| void casadi::Fmu::request_fwd | ( | FmuMemory * | m, |
| casadi_int | nsens, | ||
| const casadi_int * | id, | ||
| const casadi_int * | wrt_id | ||
| ) | const |
| void casadi::Fmu::serialize | ( | SerializingStream & | s | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_27d
| void casadi::Fmu::set | ( | FmuMemory * | m, |
| size_t | ind, | ||
| const double * | value | ||
| ) | const |
| void casadi::Fmu::set_adj | ( | FmuMemory * | m, |
| casadi_int | nseed, | ||
| const casadi_int * | id, | ||
| const double * | v | ||
| ) | const |
| void casadi::Fmu::set_adj | ( | FmuMemory * | m, |
| size_t | ind, | ||
| const double * | v | ||
| ) | const |
| void casadi::Fmu::set_fwd | ( | FmuMemory * | m, |
| casadi_int | nseed, | ||
| const casadi_int * | id, | ||
| const double * | v | ||
| ) | const |
| void casadi::Fmu::set_fwd | ( | FmuMemory * | m, |
| size_t | ind, | ||
| const double * | v | ||
| ) | const |
|
inherited |
Definition at line 105 of file generic_shared_impl.hpp.
|
inlinestatic |
Extra doc: https://github.com/casadi/casadi/wiki/L_26t
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aw
Definition at line 130 of file generic_shared_impl.hpp.