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 60 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
 
FmuMemoryalloc_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...
 
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 50 of file fmu.cpp.

50  {
51 }

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

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

148  {
149  return reinterpret_cast<casadi_int>(get());
150  }

◆ all_nominal_in()

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

Definition at line 205 of file fmu.cpp.

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

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

213  {
214  try {
215  return (*this)->all_nominal_out(ind);
216  } catch(std::exception& e) {
217  THROW_ERROR("all_nominal_out", e.what());
218  }
219 }

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

◆ alloc_mem()

FmuMemory * casadi::Fmu::alloc_mem ( const FmuFunction f) const

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

Definition at line 95 of file fmu.cpp.

95  {
96  return (*this)->alloc_mem(f);
97 }

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

◆ 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 96 of file generic_shared_impl.hpp.

86  {
87  node = node_;
88  }

◆ can_be_instantiated_only_once_per_process()

bool casadi::Fmu::can_be_instantiated_only_once_per_process ( ) const

Definition at line 245 of file fmu.cpp.

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

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 133 of file generic_shared_impl.hpp.

46  {
47 #ifdef WITH_EXTRA_CHECKS
48  casadi_assert_dev(Function::call_depth_==0);
49 #endif // WITH_EXTRA_CHECKS
50  if (!node) return;
51 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
52  GenericWeakRef<Shared, Internal>* weak_ref =
53  node->weak_ref_.load(std::memory_order_acquire);
54 #else
55  GenericWeakRef<Shared, Internal>* weak_ref = node->weak_ref_;
56 #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
57  if (weak_ref) {
58 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
59  // get_mutex() returns a shared_ptr copy, so the mutex outlives this lock
60  // even if delete node (below) destroys the WeakRefInternal holding it
61  auto mutex = weak_ref->get_mutex();
62  // Avoid triggering a delete while a weak_ref.shared_if_alive is being called
63  std::lock_guard<std::mutex> lock(*mutex);
64 #endif // CASADI_WITH_THREADSAFE_SYMBOLICS
65 
66  if (--static_cast<Internal*>(node)->count == 0) {
67  delete node;
68  node = nullptr;
69  }
70  } else {
71  if (--static_cast<Internal*>(node)->count == 0) {
72  delete node;
73  node = nullptr;
74  }
75  }
76  }

◆ count_up()

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

Definition at line 132 of file generic_shared_impl.hpp.

36  {
37 #ifdef WITH_EXTRA_CHECKS
38  casadi_assert_dev(Function::call_depth_==0);
39 #endif // WITH_EXTRA_CHECKS
40 
41  if (node) static_cast<Internal*>(node)->count++;
42 
43  }

◆ create()

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

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

Definition at line 1491 of file fmu.cpp.

1491  {
1492  Fmu ret;
1493  ret.own(node);
1494  return ret;
1495 }
Fmu()
Default constructor.
Definition: fmu.cpp:50

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

Referenced by deserialize().

◆ debug_repr()

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

Definition at line 112 of file generic_shared_impl.hpp.

91  {
92  if (node) {
93  return node->debug_repr(node);
94  } else {
95  return "NULL";
96  }
97  }
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 221 of file fmu.cpp.

221  {
222  try {
223  return (*this)->desc_in(m, id, more);
224  } catch(std::exception& e) {
225  THROW_ERROR("desc_in", e.what());
226  }
227 }

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

◆ deserialize()

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

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

Definition at line 1487 of file fmu.cpp.

1487  {
1489 }
static FmuInternal * deserialize(DeserializingStream &s)
Definition: fmu.cpp:1594
static Fmu create(FmuInternal *node)
Create from node.
Definition: fmu.cpp:1491

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

303  {
304  try {
305  return (*this)->eval(m);
306  } catch(std::exception& e) {
307  THROW_ERROR("eval", e.what());
308  }
309 }

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

◆ eval_adj()

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

Definition at line 409 of file fmu.cpp.

409  {
410  try {
411  return (*this)->eval_adj(m);
412  } catch(std::exception& e) {
413  THROW_ERROR("eval_adj", e.what());
414  }
415 }

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

◆ eval_fwd()

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

Definition at line 352 of file fmu.cpp.

352  {
353  try {
354  return (*this)->eval_fwd(m, independent_seeds);
355  } catch(std::exception& e) {
356  THROW_ERROR("eval_fwd", e.what());
357  }
358 }

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

◆ free_instance()

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

Definition at line 279 of file fmu.cpp.

279  {
280  try {
281  (*this)->free_instance(instance);
282  } catch(std::exception& e) {
283  THROW_ERROR("free_instance", e.what());
284  }
285 }

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

◆ free_mem()

void casadi::Fmu::free_mem ( void *  mem) const

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

Definition at line 99 of file fmu.cpp.

99  {
100  (*this)->free_mem(mem);
101 }

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

◆ get() [1/2]

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

Access functions of the node

Definition at line 103 of file fmu.cpp.

103  {
104  return static_cast<FmuInternal*>(SharedObject::get());
105 }
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 311 of file fmu.cpp.

311  {
312  try {
313  (*this)->get(m, id, value);
314  } catch(std::exception& e) {
315  THROW_ERROR("get", e.what());
316  }
317 }

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

417  {
418  try {
419  (*this)->get_adj(m, nsens, id, v);
420  } catch(std::exception& e) {
421  THROW_ERROR("get_adj", e.what());
422  }
423 }

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

425  {
426  try {
427  (*this)->get_adj(m, ind, v);
428  } catch(std::exception& e) {
429  THROW_ERROR("get_adj", e.what());
430  }
431 }

◆ get_fwd() [1/2]

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

Definition at line 360 of file fmu.cpp.

360  {
361  try {
362  (*this)->get_fwd(m, nsens, id, v);
363  } catch(std::exception& e) {
364  THROW_ERROR("get_fwd", e.what());
365  }
366 }

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

368  {
369  try {
370  (*this)->get_fwd(m, ind, v);
371  } catch(std::exception& e) {
372  THROW_ERROR("get_fwd", e.what());
373  }
374 }

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

434  {
435  try {
436  (*this)->get_stats(m, stats, name_in, in);
437  } catch(std::exception& e) {
438  THROW_ERROR("get_stats", e.what());
439  }
440 }

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 102 of file generic_shared_impl.hpp.

138  {
139  return (*this)->getCount();
140  }

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

262  {
263  try {
264  return (*this)->hess_sparsity(r, c);
265  } catch(std::exception& e) {
266  THROW_ERROR("hess_sparsity", e.what());
267  }
268 }

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 160 of file fmu.hpp.

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

◆ index_in()

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

Definition at line 141 of file fmu.cpp.

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

◆ index_out()

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

Definition at line 149 of file fmu.cpp.

149  {
150  try {
151  return (*this)->index_out(n);
152  } catch(std::exception& e) {
153  THROW_ERROR("index_out", e.what());
154  }
155 }

◆ init_mem()

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

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

Definition at line 270 of file fmu.cpp.

270  {
271  try {
272  return (*this)->init_mem(m);
273  } catch(std::exception& e) {
274  THROW_ERROR("init_mem", e.what());
275  return 1;
276  }
277 }

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

116  {
117  if (is_null()) {
118  static std::string null = "null";
119  return null;
120  } else {
121  return (*this)->instance_name_;
122  }
123 }

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

157  {
158  try {
159  return (*this)->ired_.at(ind);
160  } catch(std::exception& e) {
161  THROW_ERROR("ired", e.what());
162  }
163 }

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

◆ is_null()

Definition at line 116 of file generic_shared_impl.hpp.

120  {
121  return node==nullptr;
122  }

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

254  {
255  try {
256  return (*this)->jac_sparsity(osub, isub);
257  } catch(std::exception& e) {
258  THROW_ERROR("jac_sparsity", e.what());
259  }
260 }

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 152 of file fmu.hpp.

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

◆ max_in()

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

Definition at line 197 of file fmu.cpp.

197  {
198  try {
199  return (*this)->max_in_.at(ind);
200  } catch(std::exception& e) {
201  THROW_ERROR("max_in", e.what());
202  }
203 }

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

◆ min_in()

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

Definition at line 189 of file fmu.cpp.

189  {
190  try {
191  return (*this)->min_in_.at(ind);
192  } catch(std::exception& e) {
193  THROW_ERROR("min_in", e.what());
194  }
195 }

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

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

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

133  {
134  try {
135  return (*this)->n_out();
136  } catch(std::exception& e) {
137  THROW_ERROR("n_out", e.what());
138  }
139 }

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

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

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

Referenced by Fmu().

◆ nominal_in()

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

Definition at line 173 of file fmu.cpp.

173  {
174  try {
175  return (*this)->nominal_in_.at(ind);
176  } catch(std::exception& e) {
177  THROW_ERROR("nominal_in", e.what());
178  }
179 }

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

◆ nominal_out()

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

Definition at line 181 of file fmu.cpp.

181  {
182  try {
183  return (*this)->nominal_out_.at(ind);
184  } catch(std::exception& e) {
185  THROW_ERROR("nominal_out", e.what());
186  }
187 }

◆ operator->() [1/2]

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

Access functions of the node

Definition at line 87 of file fmu.cpp.

87  {
88  return static_cast<FmuInternal*>(SharedObject::operator->());
89 }
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 91 of file fmu.cpp.

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

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

◆ ored()

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

Definition at line 165 of file fmu.cpp.

165  {
166  try {
167  return (*this)->ored_.at(ind);
168  } catch(std::exception& e) {
169  THROW_ERROR("ored", e.what());
170  }
171 }

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

237  {
238  try {
239  return (*this)->provides_adjoint_derivatives_;
240  } catch(std::exception& e) {
241  THROW_ERROR("provides_adjoint_derivatives", e.what());
242  }
243 }

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

◆ provides_directional_derivatives()

bool casadi::Fmu::provides_directional_derivatives ( ) const

Definition at line 229 of file fmu.cpp.

229  {
230  try {
231  return (*this)->provides_directional_derivatives_;
232  } catch(std::exception& e) {
233  THROW_ERROR("provides_directional_derivatives", e.what());
234  }
235 }

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

◆ request()

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

Definition at line 295 of file fmu.cpp.

295  {
296  try {
297  (*this)->request(m, ind);
298  } catch(std::exception& e) {
299  THROW_ERROR("request", e.what());
300  }
301 }

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

◆ request_adj() [1/2]

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

Definition at line 401 of file fmu.cpp.

401  {
402  try {
403  (*this)->request_adj(m, ind);
404  } catch(std::exception& e) {
405  THROW_ERROR("request_adj", e.what());
406  }
407 }

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

393  {
394  try {
395  (*this)->request_adj(m, nsens, id, wrt_id);
396  } catch(std::exception& e) {
397  THROW_ERROR("request_adj", e.what());
398  }
399 }

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

◆ request_fwd() [1/2]

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

Definition at line 344 of file fmu.cpp.

344  {
345  try {
346  (*this)->request_fwd(m, ind);
347  } catch(std::exception& e) {
348  THROW_ERROR("request_fwd", e.what());
349  }
350 }

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

336  {
337  try {
338  (*this)->request_fwd(m, nsens, id, wrt_id);
339  } catch(std::exception& e) {
340  THROW_ERROR("request_fwd", e.what());
341  }
342 }

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

1483  {
1484  (*this)->serialize(s);
1485 }

◆ set()

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

Definition at line 287 of file fmu.cpp.

287  {
288  try {
289  (*this)->set(m, ind, value);
290  } catch(std::exception& e) {
291  THROW_ERROR("set", e.what());
292  }
293 }

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

376  {
377  try {
378  (*this)->set_adj(m, nseed, id, v);
379  } catch(std::exception& e) {
380  THROW_ERROR("set_adj", e.what());
381  }
382 }

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

384  {
385  try {
386  (*this)->set_adj(m, ind, v);
387  } catch(std::exception& e) {
388  THROW_ERROR("set_adj", e.what());
389  }
390 }

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

319  {
320  try {
321  (*this)->set_fwd(m, nseed, id, v);
322  } catch(std::exception& e) {
323  THROW_ERROR("set_fwd", e.what());
324  }
325 }

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

327  {
328  try {
329  (*this)->set_fwd(m, ind, v);
330  } catch(std::exception& e) {
331  THROW_ERROR("set_fwd", e.what());
332  }
333 }

◆ swap()

Definition at line 105 of file generic_shared_impl.hpp.

131  {
132  GenericShared<Shared, Internal> temp = *this;
133  *this = other;
134  other = temp;
135  }

◆ type_name()

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

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

Definition at line 67 of file fmu.hpp.

67 {return "Fmu";}

◆ weak()

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

Definition at line 130 of file generic_shared_impl.hpp.

143  {
144  return (*this)->weak();
145  }

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