List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
casadi::Fmu Class Reference

Interface to binary FMU. More...

#include <fmu.hpp>

Detailed Description

Can be shared between multiple CasADi functions.

Author
Joel Andersson
Date
2023

Extra doc: https://github.com/casadi/casadi/wiki/L_26s

Definition at line 59 of file fmu.hpp.

Inheritance diagram for casadi::Fmu:
Inheritance graph
[legend]
Collaboration diagram for casadi::Fmu:
Collaboration graph
[legend]

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
 
int init_mem (FmuMemory *m) const
 Initalize 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...
 
FmuInternaloperator-> ()
 
const FmuInternaloperator-> () const
 
FmuInternalget () 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 ()
 

Member Typedef Documentation

◆ base_type

Definition at line 103 of file shared_object.hpp.

◆ internal_base_type

Definition at line 102 of file shared_object.hpp.

Constructor & Destructor Documentation

◆ Fmu() [1/2]

casadi::Fmu::Fmu ( )

Definition at line 48 of file fmu.cpp.

48  {
49 }

◆ Fmu() [2/2]

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.

55  {
56  if (api == FmuApi::FMI2) {
57 #ifdef WITH_FMI2
58  // Create
59  own(new Fmu2(name, scheme_in, scheme_out, scheme, aux));
60 #else // WITH_FMI2
61  // No compilation support
62  casadi_error("CasADi was not compiled with WITH_FMI2=ON.");
63 #endif // WITH_FMI2
64  } else if (api == FmuApi::FMI3) {
65 #ifdef WITH_FMI3
66  // Create
67  own(new Fmu3(name, scheme_in, scheme_out, scheme, aux));
68 #else // WITH_FMI3
69  // No compilation support
70  casadi_error("CasADi was not compiled with WITH_FMI3=ON.");
71 #endif // WITH_FMI3
72  } else {
73  // Not supported
74  casadi_error("Unsupported FMU API: " + to_string(api));
75  }
76  // Initialize
77  try {
78  (*this)->init(dae);
79  (*this)->finalize();
80  } catch(std::exception& e) {
81  THROW_ERROR("init", e.what());
82  }
83 }
const std::string & name() const
Name of the instance.
Definition: fmu.cpp:97
std::string to_string(TypeFmi2 v)

References casadi::FMI2, casadi::FMI3, name(), casadi::GenericShared< SharedObject, SharedObjectInternal >::own(), and casadi::to_string().

Member Function Documentation

◆ __hash__()

casadi_int casadi::GenericShared< SharedObject , SharedObjectInternal >::__hash__
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 124 of file generic_shared_impl.hpp.

137  {
138  return reinterpret_cast<casadi_int>(get());
139  }

◆ all_nominal_in()

std::vector< double > casadi::Fmu::all_nominal_in ( size_t  ind) const

Definition at line 195 of file fmu.cpp.

195  {
196  try {
197  return (*this)->all_nominal_in(ind);
198  } catch(std::exception& e) {
199  THROW_ERROR("all_nominal_in", e.what());
200  }
201 }

Referenced by casadi::FmuFunction::get_nominal_in().

◆ all_nominal_out()

std::vector< double > casadi::Fmu::all_nominal_out ( size_t  ind) const

Definition at line 203 of file fmu.cpp.

203  {
204  try {
205  return (*this)->all_nominal_out(ind);
206  } catch(std::exception& e) {
207  THROW_ERROR("all_nominal_out", e.what());
208  }
209 }

Referenced by casadi::FmuFunction::get_nominal_in(), and casadi::FmuFunction::get_nominal_out().

◆ assign()

void casadi::GenericShared< SharedObject , SharedObjectInternal >::assign ( Internal *  node)
inherited

improper use will cause memory leaks!

Extra doc: https://github.com/casadi/casadi/wiki/L_at

Definition at line 97 of file generic_shared_impl.hpp.

75  {
76  node = node_;
77  }

◆ can_be_instantiated_only_once_per_process()

bool casadi::Fmu::can_be_instantiated_only_once_per_process ( ) const

Definition at line 235 of file fmu.cpp.

235  {
236  try {
237  return (*this)->can_be_instantiated_only_once_per_process_;
238  } catch(std::exception& e) {
239  THROW_ERROR("can_be_instantiated_only_once_per_process", e.what());
240  }
241 }

Referenced by casadi::FmuFunction::check_mem_count().

◆ class_name()

std::string casadi::SharedObject::class_name ( ) const
inherited

◆ count_down()

void casadi::GenericShared< SharedObject , SharedObjectInternal >::count_down
protectedinherited

Definition at line 134 of file generic_shared_impl.hpp.

42  {
43 #ifdef WITH_EXTRA_CHECKS
44  casadi_assert_dev(Function::call_depth_==0);
45 #endif // WITH_EXTRA_CHECKS
46  if (!node) return;
47  if (node->weak_ref_) {
48 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
49  auto mutex = node->weak_ref_->get_mutex();
50  // Avoid triggering a delete while a weak_ref.shared_if_alive is being called
51  std::lock_guard<std::mutex> lock(*mutex);
52  // Could it be that this mutex is destroyed when the lock goes out of scope?
53 #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
54 
55  if (--static_cast<Internal*>(node)->count == 0) {
56  delete node;
57  node = nullptr;
58  }
59  } else {
60  if (--static_cast<Internal*>(node)->count == 0) {
61  delete node;
62  node = nullptr;
63  }
64  }
65  }

◆ count_up()

void casadi::GenericShared< SharedObject , SharedObjectInternal >::count_up
protectedinherited

Definition at line 133 of file generic_shared_impl.hpp.

32  {
33 #ifdef WITH_EXTRA_CHECKS
34  casadi_assert_dev(Function::call_depth_==0);
35 #endif // WITH_EXTRA_CHECKS
36 
37  if (node) static_cast<Internal*>(node)->count++;
38 
39  }

◆ create()

Fmu casadi::Fmu::create ( FmuInternal node)
static

Extra doc: https://github.com/casadi/casadi/wiki/L_27c

Definition at line 1322 of file fmu.cpp.

1322  {
1323  Fmu ret;
1324  ret.own(node);
1325  return ret;
1326 }
Fmu()
Default constructor.
Definition: fmu.cpp:48

References casadi::GenericShared< Shared, Internal >::own().

Referenced by deserialize().

◆ debug_repr()

std::string casadi::GenericShared< SharedObject , SharedObjectInternal >::debug_repr
inherited

Definition at line 113 of file generic_shared_impl.hpp.

80  {
81  if (node) {
82  return node->debug_repr(node);
83  } else {
84  return "NULL";
85  }
86  }
std::string debug_repr(const Internal *) const

◆ desc_in()

std::string casadi::Fmu::desc_in ( FmuMemory m,
size_t  id,
bool  more = true 
) const

Definition at line 211 of file fmu.cpp.

211  {
212  try {
213  return (*this)->desc_in(m, id, more);
214  } catch(std::exception& e) {
215  THROW_ERROR("desc_in", e.what());
216  }
217 }

Referenced by casadi::FmuFunction::check_hessian(), and casadi::FmuFunction::eval_task().

◆ deserialize()

Fmu casadi::Fmu::deserialize ( DeserializingStream s)
static

Extra doc: https://github.com/casadi/casadi/wiki/L_27e

Definition at line 1318 of file fmu.cpp.

1318  {
1320 }
static FmuInternal * deserialize(DeserializingStream &s)
Definition: fmu.cpp:1417
static Fmu create(FmuInternal *node)
Create from node.
Definition: fmu.cpp:1322

References create(), and casadi::FmuInternal::deserialize().

◆ disp()

void casadi::SharedObject::disp ( std::ostream &  stream,
bool  more = false 
) const
inherited

Definition at line 35 of file shared_object.cpp.

35  {
36  if (is_null()) {
37  stream << "NULL";
38  } else {
39  (*this)->disp(stream, more);
40  }
41  }

References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().

Referenced by casadi::Nlpsol::disp_more(), and casadi::CsparseInterface::nfact().

◆ eval()

int casadi::Fmu::eval ( FmuMemory m) const

Definition at line 293 of file fmu.cpp.

293  {
294  try {
295  return (*this)->eval(m);
296  } catch(std::exception& e) {
297  THROW_ERROR("eval", e.what());
298  }
299 }

Referenced by casadi::FmuFunction::eval_task().

◆ eval_adj()

int casadi::Fmu::eval_adj ( FmuMemory m) const

Definition at line 399 of file fmu.cpp.

399  {
400  try {
401  return (*this)->eval_adj(m);
402  } catch(std::exception& e) {
403  THROW_ERROR("eval_adj", e.what());
404  }
405 }

Referenced by casadi::FmuFunction::eval_task().

◆ eval_fwd()

int casadi::Fmu::eval_fwd ( FmuMemory m,
bool  independent_seeds 
) const

Definition at line 342 of file fmu.cpp.

342  {
343  try {
344  return (*this)->eval_fwd(m, independent_seeds);
345  } catch(std::exception& e) {
346  THROW_ERROR("eval_fwd", e.what());
347  }
348 }

Referenced by casadi::FmuFunction::eval_task().

◆ free_instance()

void casadi::Fmu::free_instance ( void *  instance) const

Definition at line 269 of file fmu.cpp.

269  {
270  try {
271  return (*this)->free_instance(instance);
272  } catch(std::exception& e) {
273  THROW_ERROR("free_instance", e.what());
274  }
275 }

Referenced by casadi::FmuFunction::free_mem().

◆ get() [1/2]

FmuInternal * casadi::Fmu::get ( ) const

Access functions of the node

Definition at line 93 of file fmu.cpp.

93  {
94  return static_cast<FmuInternal*>(SharedObject::get());
95 }
SharedObjectInternal * get() const
Get a const pointer to the node.

References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().

Referenced by casadi::FmuFunction::eval_task().

◆ get() [2/2]

void casadi::Fmu::get ( FmuMemory m,
size_t  ind,
double *  value 
) const

Definition at line 301 of file fmu.cpp.

301  {
302  try {
303  return (*this)->get(m, id, value);
304  } catch(std::exception& e) {
305  THROW_ERROR("get", e.what());
306  }
307 }

References casadi::FmuInternal::get().

◆ get_adj() [1/2]

void casadi::Fmu::get_adj ( FmuMemory m,
casadi_int  nsens,
const casadi_int *  id,
double *  v 
) const

Definition at line 407 of file fmu.cpp.

407  {
408  try {
409  return (*this)->get_adj(m, nsens, id, v);
410  } catch(std::exception& e) {
411  THROW_ERROR("get_adj", e.what());
412  }
413 }

Referenced by casadi::FmuFunction::eval_task().

◆ get_adj() [2/2]

void casadi::Fmu::get_adj ( FmuMemory m,
size_t  ind,
double *  v 
) const

Definition at line 415 of file fmu.cpp.

415  {
416  try {
417  return (*this)->get_adj(m, ind, v);
418  } catch(std::exception& e) {
419  THROW_ERROR("get_adj", e.what());
420  }
421 }

◆ get_fwd() [1/2]

void casadi::Fmu::get_fwd ( FmuMemory m,
casadi_int  nsens,
const casadi_int *  id,
double *  v 
) const

Definition at line 350 of file fmu.cpp.

350  {
351  try {
352  return (*this)->get_fwd(m, nsens, id, v);
353  } catch(std::exception& e) {
354  THROW_ERROR("get_fwd", e.what());
355  }
356 }

Referenced by casadi::FmuFunction::eval_task().

◆ get_fwd() [2/2]

void casadi::Fmu::get_fwd ( FmuMemory m,
size_t  ind,
double *  v 
) const

Definition at line 358 of file fmu.cpp.

358  {
359  try {
360  return (*this)->get_fwd(m, ind, v);
361  } catch(std::exception& e) {
362  THROW_ERROR("get_fwd", e.what());
363  }
364 }

◆ get_stats()

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 423 of file fmu.cpp.

424  {
425  try {
426  return (*this)->get_stats(m, stats, name_in, in);
427  } catch(std::exception& e) {
428  THROW_ERROR("get_stats", e.what());
429  }
430 }

Referenced by casadi::FmuFunction::get_stats().

◆ get_str()

std::string casadi::SharedObject::get_str ( bool  more = false) const
inlineinherited

Definition at line 91 of file shared_object.hpp.

91  {
92  std::stringstream ss;
93  disp(ss, more);
94  return ss.str();
95  }
void disp(std::ostream &stream, bool more=false) const
Print a description of the object.

◆ getCount()

casadi_int casadi::GenericShared< SharedObject , SharedObjectInternal >::getCount
inherited

Definition at line 103 of file generic_shared_impl.hpp.

127  {
128  return (*this)->getCount();
129  }

◆ hess_sparsity() [1/2]

Sparsity casadi::Fmu::hess_sparsity ( const std::vector< size_t > &  r,
const std::vector< size_t > &  c 
) const

Definition at line 252 of file fmu.cpp.

252  {
253  try {
254  return (*this)->hess_sparsity(r, c);
255  } catch(std::exception& e) {
256  THROW_ERROR("hess_sparsity", e.what());
257  }
258 }

Referenced by casadi::FmuFunction::get_jac_sparsity(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().

◆ hess_sparsity() [2/2]

Sparsity casadi::Fmu::hess_sparsity ( size_t  r,
size_t  c 
) const
inline

Definition at line 159 of file fmu.hpp.

159  {
160  return hess_sparsity(ired(r), ired(c));
161  }
Sparsity hess_sparsity(const std::vector< size_t > &r, const std::vector< size_t > &c) const
Definition: fmu.cpp:252
const std::vector< size_t > & ired(size_t ind) const
Definition: fmu.cpp:147

◆ index_in()

size_t casadi::Fmu::index_in ( const std::string &  n) const

Definition at line 131 of file fmu.cpp.

131  {
132  try {
133  return (*this)->index_in(n);
134  } catch(std::exception& e) {
135  THROW_ERROR("index_in", e.what());
136  }
137 }

◆ index_out()

size_t casadi::Fmu::index_out ( const std::string &  n) const

Definition at line 139 of file fmu.cpp.

139  {
140  try {
141  return (*this)->index_out(n);
142  } catch(std::exception& e) {
143  THROW_ERROR("index_out", e.what());
144  }
145 }

◆ init_mem()

int casadi::Fmu::init_mem ( FmuMemory m) const

Extra doc: https://github.com/casadi/casadi/wiki/L_26x

Definition at line 260 of file fmu.cpp.

260  {
261  try {
262  return (*this)->init_mem(m);
263  } catch(std::exception& e) {
264  THROW_ERROR("init_mem", e.what());
265  return 1;
266  }
267 }

Referenced by casadi::FmuFunction::init_mem().

◆ instance_name()

const std::string & casadi::Fmu::instance_name ( ) const

Extra doc: https://github.com/casadi/casadi/wiki/L_2ab

Definition at line 106 of file fmu.cpp.

106  {
107  if (is_null()) {
108  static std::string null = "null";
109  return null;
110  } else {
111  return (*this)->instance_name_;
112  }
113 }

References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().

Referenced by casadi::FmuFunction::check_mem_count().

◆ ired()

const std::vector< size_t > & casadi::Fmu::ired ( size_t  ind) const

Definition at line 147 of file fmu.cpp.

147  {
148  try {
149  return (*this)->ired_.at(ind);
150  } catch(std::exception& e) {
151  THROW_ERROR("ired", e.what());
152  }
153 }

Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::get_sparsity_in(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().

◆ is_null()

Definition at line 117 of file generic_shared_impl.hpp.

109  {
110  return node==nullptr;
111  }

◆ jac_sparsity() [1/2]

Sparsity casadi::Fmu::jac_sparsity ( const std::vector< size_t > &  osub,
const std::vector< size_t > &  isub 
) const

Definition at line 243 of file fmu.cpp.

244  {
245  try {
246  return (*this)->jac_sparsity(osub, isub);
247  } catch(std::exception& e) {
248  THROW_ERROR("jac_sparsity", e.what());
249  }
250 }

Referenced by casadi::FmuFunction::get_jac_sparsity(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().

◆ jac_sparsity() [2/2]

Sparsity casadi::Fmu::jac_sparsity ( size_t  oind,
size_t  iind 
) const
inline

Definition at line 151 of file fmu.hpp.

151  {
152  return jac_sparsity(ored(oind), ired(iind));
153  }
const std::vector< size_t > & ored(size_t ind) const
Definition: fmu.cpp:155
Sparsity jac_sparsity(const std::vector< size_t > &osub, const std::vector< size_t > &isub) const
Definition: fmu.cpp:243

◆ max_in()

double casadi::Fmu::max_in ( size_t  ind) const

Definition at line 187 of file fmu.cpp.

187  {
188  try {
189  return (*this)->max_in_.at(ind);
190  } catch(std::exception& e) {
191  THROW_ERROR("max_in", e.what());
192  }
193 }

Referenced by casadi::FmuFunction::eval_task().

◆ min_in()

double casadi::Fmu::min_in ( size_t  ind) const

Definition at line 179 of file fmu.cpp.

179  {
180  try {
181  return (*this)->min_in_.at(ind);
182  } catch(std::exception& e) {
183  THROW_ERROR("min_in", e.what());
184  }
185 }

Referenced by casadi::FmuFunction::eval_task().

◆ n_in()

size_t casadi::Fmu::n_in ( ) const

Extra doc: https://github.com/casadi/casadi/wiki/L_26v

Definition at line 115 of file fmu.cpp.

115  {
116  try {
117  return (*this)->n_in();
118  } catch(std::exception& e) {
119  THROW_ERROR("n_in", e.what());
120  }
121 }

Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().

◆ n_out()

size_t casadi::Fmu::n_out ( ) const

Extra doc: https://github.com/casadi/casadi/wiki/L_26w

Definition at line 123 of file fmu.cpp.

123  {
124  try {
125  return (*this)->n_out();
126  } catch(std::exception& e) {
127  THROW_ERROR("n_out", e.what());
128  }
129 }

Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().

◆ name()

const std::string & casadi::Fmu::name ( ) const

Extra doc: https://github.com/casadi/casadi/wiki/L_26u

Definition at line 97 of file fmu.cpp.

97  {
98  if (is_null()) {
99  static std::string null = "null";
100  return null;
101  } else {
102  return (*this)->name_;
103  }
104 }

References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().

Referenced by Fmu().

◆ nominal_in()

double casadi::Fmu::nominal_in ( size_t  ind) const

Definition at line 163 of file fmu.cpp.

163  {
164  try {
165  return (*this)->nominal_in_.at(ind);
166  } catch(std::exception& e) {
167  THROW_ERROR("nominal_in", e.what());
168  }
169 }

Referenced by casadi::FmuFunction::eval_task(), and casadi::FmuFunction::init().

◆ nominal_out()

double casadi::Fmu::nominal_out ( size_t  ind) const

Definition at line 171 of file fmu.cpp.

171  {
172  try {
173  return (*this)->nominal_out_.at(ind);
174  } catch(std::exception& e) {
175  THROW_ERROR("nominal_out", e.what());
176  }
177 }

◆ operator->() [1/2]

FmuInternal * casadi::Fmu::operator-> ( )

Access functions of the node

Definition at line 85 of file fmu.cpp.

85  {
86  return static_cast<FmuInternal*>(SharedObject::operator->());
87 }
SharedObjectInternal * operator->() const
Access a member function or object.

References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().

◆ operator->() [2/2]

const FmuInternal * casadi::Fmu::operator-> ( ) const

Access functions of the node

Definition at line 89 of file fmu.cpp.

89  {
90  return static_cast<const FmuInternal*>(SharedObject::operator->());
91 }

References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().

◆ ored()

const std::vector< size_t > & casadi::Fmu::ored ( size_t  ind) const

Definition at line 155 of file fmu.cpp.

155  {
156  try {
157  return (*this)->ored_.at(ind);
158  } catch(std::exception& e) {
159  THROW_ERROR("ored", e.what());
160  }
161 }

Referenced by casadi::FmuFunction::eval(), casadi::FmuFunction::get_sparsity_in(), casadi::FmuFunction::get_sparsity_out(), and casadi::FmuFunction::init().

◆ own()

void casadi::GenericShared< SharedObject , SharedObjectInternal >::own ( Internal *  node)
inherited

Assign the node to a node class pointer (or null)

Definition at line 90 of file generic_shared_impl.hpp.

◆ print_ptr()

void casadi::SharedObject::print_ptr ( std::ostream &  stream = casadi::uout()) const
inherited

Print the pointer to the internal class

Definition at line 43 of file shared_object.cpp.

43  {
44  stream << get();
45  }

References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().

◆ provides_adjoint_derivatives()

bool casadi::Fmu::provides_adjoint_derivatives ( ) const

Definition at line 227 of file fmu.cpp.

227  {
228  try {
229  return (*this)->provides_adjoint_derivatives_;
230  } catch(std::exception& e) {
231  THROW_ERROR("provides_adjoint_derivatives", e.what());
232  }
233 }

Referenced by casadi::FmuFunction::FmuFunction(), and casadi::FmuFunction::init().

◆ provides_directional_derivatives()

bool casadi::Fmu::provides_directional_derivatives ( ) const

Definition at line 219 of file fmu.cpp.

219  {
220  try {
221  return (*this)->provides_directional_derivatives_;
222  } catch(std::exception& e) {
223  THROW_ERROR("provides_directional_derivatives", e.what());
224  }
225 }

Referenced by casadi::FmuFunction::FmuFunction(), and casadi::FmuFunction::init().

◆ request()

void casadi::Fmu::request ( FmuMemory m,
size_t  ind 
) const

Definition at line 285 of file fmu.cpp.

285  {
286  try {
287  return (*this)->request(m, ind);
288  } catch(std::exception& e) {
289  THROW_ERROR("request", e.what());
290  }
291 }

Referenced by casadi::FmuFunction::eval_task().

◆ request_adj() [1/2]

void casadi::Fmu::request_adj ( FmuMemory m,
casadi_int  ind 
) const

Definition at line 391 of file fmu.cpp.

391  {
392  try {
393  return (*this)->request_adj(m, ind);
394  } catch(std::exception& e) {
395  THROW_ERROR("request_adj", e.what());
396  }
397 }

◆ request_adj() [2/2]

void casadi::Fmu::request_adj ( FmuMemory m,
casadi_int  nsens,
const casadi_int *  id,
const casadi_int *  wrt_id 
) const

Definition at line 382 of file fmu.cpp.

383  {
384  try {
385  return (*this)->request_adj(m, nsens, id, wrt_id);
386  } catch(std::exception& e) {
387  THROW_ERROR("request_adj", e.what());
388  }
389 }

Referenced by casadi::FmuFunction::eval_task().

◆ request_fwd() [1/2]

void casadi::Fmu::request_fwd ( FmuMemory m,
casadi_int  ind 
) const

Definition at line 334 of file fmu.cpp.

334  {
335  try {
336  return (*this)->request_fwd(m, ind);
337  } catch(std::exception& e) {
338  THROW_ERROR("request_fwd", e.what());
339  }
340 }

◆ request_fwd() [2/2]

void casadi::Fmu::request_fwd ( FmuMemory m,
casadi_int  nsens,
const casadi_int *  id,
const casadi_int *  wrt_id 
) const

Definition at line 325 of file fmu.cpp.

326  {
327  try {
328  return (*this)->request_fwd(m, nsens, id, wrt_id);
329  } catch(std::exception& e) {
330  THROW_ERROR("request_fwd", e.what());
331  }
332 }

Referenced by casadi::FmuFunction::eval_task().

◆ serialize()

void casadi::Fmu::serialize ( SerializingStream s) const

Extra doc: https://github.com/casadi/casadi/wiki/L_27d

Definition at line 1314 of file fmu.cpp.

1314  {
1315  return (*this)->serialize(s);
1316 }

◆ set()

void casadi::Fmu::set ( FmuMemory m,
size_t  ind,
const double *  value 
) const

Definition at line 277 of file fmu.cpp.

277  {
278  try {
279  return (*this)->set(m, ind, value);
280  } catch(std::exception& e) {
281  THROW_ERROR("set", e.what());
282  }
283 }

Referenced by casadi::FmuFunction::eval_task().

◆ set_adj() [1/2]

void casadi::Fmu::set_adj ( FmuMemory m,
casadi_int  nseed,
const casadi_int *  id,
const double *  v 
) const

Definition at line 366 of file fmu.cpp.

366  {
367  try {
368  return (*this)->set_adj(m, nseed, id, v);
369  } catch(std::exception& e) {
370  THROW_ERROR("set_adj", e.what());
371  }
372 }

Referenced by casadi::FmuFunction::eval_task().

◆ set_adj() [2/2]

void casadi::Fmu::set_adj ( FmuMemory m,
size_t  ind,
const double *  v 
) const

Definition at line 374 of file fmu.cpp.

374  {
375  try {
376  return (*this)->set_adj(m, ind, v);
377  } catch(std::exception& e) {
378  THROW_ERROR("set_adj", e.what());
379  }
380 }

◆ set_fwd() [1/2]

void casadi::Fmu::set_fwd ( FmuMemory m,
casadi_int  nseed,
const casadi_int *  id,
const double *  v 
) const

Definition at line 309 of file fmu.cpp.

309  {
310  try {
311  return (*this)->set_fwd(m, nseed, id, v);
312  } catch(std::exception& e) {
313  THROW_ERROR("set_fwd", e.what());
314  }
315 }

Referenced by casadi::FmuFunction::eval_task().

◆ set_fwd() [2/2]

void casadi::Fmu::set_fwd ( FmuMemory m,
size_t  ind,
const double *  v 
) const

Definition at line 317 of file fmu.cpp.

317  {
318  try {
319  return (*this)->set_fwd(m, ind, v);
320  } catch(std::exception& e) {
321  THROW_ERROR("set_fwd", e.what());
322  }
323 }

◆ swap()

Definition at line 106 of file generic_shared_impl.hpp.

120  {
121  GenericShared<Shared, Internal> temp = *this;
122  *this = other;
123  other = temp;
124  }

◆ type_name()

static std::string casadi::Fmu::type_name ( )
inlinestatic

Extra doc: https://github.com/casadi/casadi/wiki/L_26t

Definition at line 66 of file fmu.hpp.

66 {return "Fmu";}

◆ weak()

Extra doc: https://github.com/casadi/casadi/wiki/L_aw

Definition at line 131 of file generic_shared_impl.hpp.

132  {
133  return (*this)->weak();
134  }

The documentation for this class was generated from the following files: