MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
module-octave.cc File Reference
#include <mbconfig.h>
Include dependency graph for module-octave.cc:

Go to the source code of this file.

Functions

bool mbdyn_octave_set (void)
 
int module_init (const char *module_name, void *pdm, void *php)
 This function registers our user defined element for the math parser. More...
 

Function Documentation

bool mbdyn_octave_set ( void  )

Definition at line 5603 of file module-octave.cc.

References SetCL1D(), SetCL3D(), SetCL6D(), SetDC1D(), SetDC3D(), SetDC3x3D(), SetDC6D(), SetDC6x6D(), SetDriveCallerData(), SetSF(), and SetUDE().

Referenced by InitDriveCallerData(), and module_init().

5604 {
5605 #ifdef USE_OCTAVE
5606  using namespace oct;
5607 
5608  DriveCallerRead *rf = new OctaveDCR;
5609  if (!SetDriveCallerData("octave", rf)) {
5610  delete rf;
5611  return false;
5612  }
5613 
5614  OctaveTDCR<doublereal>* const rf1D = new OctaveTDCR<doublereal>;
5615  if (!SetDC1D("octave", rf1D)) {
5616  delete rf1D;
5617  return false;
5618  }
5619 
5620  OctaveTDCR<Vec3>* const rf3D = new OctaveTDCR<Vec3>;
5621  if (!SetDC3D("octave", rf3D)) {
5622  delete rf3D;
5623  return false;
5624  }
5625 
5626  OctaveTDCR<Vec6>* const rf6D = new OctaveTDCR<Vec6>;
5627  if (!SetDC6D("octave", rf6D)) {
5628  delete rf6D;
5629  return false;
5630  }
5631 
5632  OctaveTDCR<Mat3x3>* const rf3x3D = new OctaveTDCR<Mat3x3>;
5633  if (!SetDC3x3D("octave", rf3x3D)) {
5634  delete rf3x3D;
5635  return false;
5636  }
5637 
5638  OctaveTDCR<Mat6x6>* const rf6x6D = new OctaveTDCR<Mat6x6>;
5639  if (!SetDC6x6D("octave", rf6x6D)) {
5640  delete rf6x6D;
5641  return false;
5642  }
5643 
5644  rf = new DerivativeDCR;
5645  if (!SetDriveCallerData("derivative", rf)) {
5646  delete rf;
5647  return false;
5648  }
5649 
5650  ScalarFunctionRead* rsf = new OctaveSFR;
5651  if (!SetSF("octave", rsf)) {
5652  delete rsf;
5653  return false;
5654  }
5655 
5657  if (!SetUDE("octave", urf)) {
5658  delete urf;
5659  return false;
5660  }
5661 
5662  ConstitutiveLawRead<doublereal, doublereal> *rfcl1D = new OctaveCLR<doublereal, doublereal>;
5663  if (!SetCL1D("octave", rfcl1D)) {
5664  delete rfcl1D;
5665  return false;
5666  }
5667 
5668  ConstitutiveLawRead<Vec3, Mat3x3> *rfcl3D = new OctaveCLR<Vec3, Mat3x3>;
5669  if (!SetCL3D("octave", rfcl3D)) {
5670  delete rfcl3D;
5671  return false;
5672  }
5673 
5674  ConstitutiveLawRead<Vec6, Mat6x6> *rfcl6D = new OctaveCLR<Vec6, Mat6x6>;
5675  if (!SetCL6D("octave", rfcl6D)) {
5676  delete rfcl6D;
5677  return false;
5678  }
5679 #else
5680  pedantic_cerr("warning: MBDyn has been configured without octave support\n"
5681  "warning: module-octave is not available in this version of MBDyn" << std::endl);
5682 #endif
5683 
5684  // Return true also if USE_OCTAVE is not enabled
5685  // This prevents one assertion to fail in userelem.cc if built as a static module
5686  return true;
5687 }
bool SetDriveCallerData(const char *name, DriveCallerRead *rf)
Definition: drive_.cc:1324
bool SetDC3x3D(const char *name, TplDriveCallerRead< Mat3x3 > *rf)
bool SetDC6D(const char *name, TplDriveCallerRead< Vec6 > *rf)
bool SetDC3D(const char *name, TplDriveCallerRead< Vec3 > *rf)
bool SetDC1D(const char *name, TplDriveCallerRead< doublereal > *rf)
bool SetCL3D(const char *name, ConstitutiveLawRead< Vec3, Mat3x3 > *rf)
bool SetCL1D(const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
bool SetCL6D(const char *name, ConstitutiveLawRead< Vec6, Mat6x6 > *rf)
bool SetSF(const std::string &s, const ScalarFunctionRead *rf)
bool SetUDE(const std::string &s, UserDefinedElemRead *rude)
Definition: userelem.cc:97
bool SetDC6x6D(const char *name, TplDriveCallerRead< Mat6x6 > *rf)

Here is the call graph for this function:

int module_init ( const char *  module_name,
void *  pdm,
void *  php 
)

This function registers our user defined element for the math parser.

It is called when the "module load" statement appears in the input file.

Definition at line 5692 of file module-octave.cc.

References mbdyn_octave_set().

5693 {
5694  if (!mbdyn_octave_set()) {
5695  silent_cerr("octave: "
5696  "module_init(" << module_name << ") "
5697  "failed" << std::endl);
5698  return -1;
5699  }
5700 
5701  return 0;
5702 }
bool mbdyn_octave_set(void)

Here is the call graph for this function: