MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
dataman.h File Reference
#include <iostream>
#include <list>
#include <map>
#include <string>
#include "myassert.h"
#include "mynewmem.h"
#include "except.h"
#include "demangle.h"
#include "mbpar.h"
#include "constltp.h"
#include "shape.h"
#include "solman.h"
#include "submat.h"
#include "veciter.h"
#include "elem.h"
#include "driven.h"
#include "output.h"
#include "drive.h"
#include "tpldrive.h"
#include "node.h"
#include "strnode.h"
#include "elecnode.h"
#include "solverdiagnostics.h"
#include "nonlin.h"
#include "linsol.h"
#include "converged.h"
#include "invdyn.h"
#include "datamanforward.h"
Include dependency graph for dataman.h:

Go to the source code of this file.

Classes

class  DataManager
 
struct  DataManager::ElemRead
 
struct  DataManager::ElemDataStructure
 
struct  DataManager::NodeRead
 
struct  DataManager::NodeDataStructure
 
class  InitialAssemblyIterator
 

Functions

int datamanager_cleanup (void *)
 
ScalarDof ReadScalarDof (const DataManager *pDM, MBDynParser &HP, bool bDof, bool bOrder)
 
OrientationDescription ReadOrientationDescription (MBDynParser &HP)
 
OrientationDescription ReadOptionalOrientationDescription (DataManager *pDM, MBDynParser &HP)
 

Function Documentation

int datamanager_cleanup ( void *  )

Definition at line 914 of file dataman.cc.

References DataManager::Cleanup().

Referenced by DataManager::DataManager().

915 {
916  int rc = 0;
917 
918  if (data != 0) {
919  DataManager *pDM = (DataManager *)data;
920 
921  silent_cerr("DataManager cleanup" << std::endl);
922 
923  rc = pDM->Cleanup();
924  }
925 
926  return rc;
927 }
int Cleanup(void)
Definition: dataman.cc:668

Here is the call graph for this function:

OrientationDescription ReadOptionalOrientationDescription ( DataManager pDM,
MBDynParser HP 
)

Definition at line 2531 of file dataman3.cc.

References EULER_123, IncludeParser::GetLineData(), DataManager::GetOrientationDescription(), HighParser::IsKeyWord(), ReadOrientationDescription(), and UNKNOWN_ORIENTATION_DESCRIPTION.

Referenced by ReadAerodynamicCustomOutput(), ReadBeamCustomOutput(), ReadStructNode(), and MBDynParser::Reference_int().

2532 {
2534 
2535  if (HP.IsKeyWord("orientation" "description")) {
2536  dod = ReadOrientationDescription(HP);
2537 
2538  } else if (pDM != 0) {
2539  /* get a sane default */
2540  dod = pDM->GetOrientationDescription();
2541 
2542  } else {
2543  dod = EULER_123;
2544  silent_cerr("Warning, data manager not defined yet, "
2545  "using default orientation (\"euler 123\") "
2546  "at line " << HP.GetLineData() << std::endl);
2547  }
2548 
2549  return dod;
2550 }
OrientationDescription ReadOrientationDescription(MBDynParser &HP)
Definition: dataman3.cc:2502
OrientationDescription
Definition: matvec3.h:1597
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
OrientationDescription GetOrientationDescription(void) const
Definition: dataman.cc:857
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

OrientationDescription ReadOrientationDescription ( MBDynParser HP)

Definition at line 2502 of file dataman3.cc.

References EULER_123, EULER_313, EULER_321, IncludeParser::GetLineData(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, ORIENTATION_MATRIX, ORIENTATION_VECTOR, and UNKNOWN_ORIENTATION_DESCRIPTION.

Referenced by Eu2PhiDCR::Read(), DataManager::ReadControl(), and ReadOptionalOrientationDescription().

2503 {
2505 
2506  if (HP.IsKeyWord("euler" "123")) {
2507  dod = EULER_123;
2508 
2509  } else if (HP.IsKeyWord("euler" "313")) {
2510  dod = EULER_313;
2511 
2512  } else if (HP.IsKeyWord("euler" "321")) {
2513  dod = EULER_321;
2514 
2515  } else if (HP.IsKeyWord("orientation" "vector")) {
2516  dod = ORIENTATION_VECTOR;
2517 
2518  } else if (HP.IsKeyWord("orientation" "matrix")) {
2519  dod = ORIENTATION_MATRIX;
2520 
2521  } else {
2522  silent_cerr("Unknown orientation description "
2523  "at line " << HP.GetLineData() << std::endl);
2525  }
2526 
2527  return dod;
2528 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
OrientationDescription
Definition: matvec3.h:1597
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

ScalarDof ReadScalarDof ( const DataManager pDM,
MBDynParser HP,
bool  bDof,
bool  bOrder 
)

Definition at line 2423 of file dataman3.cc.

References DEBUGLCOUT, DofOrder::DIFFERENTIAL, GetDofOrder(), SimulationEntity::GetDofType(), HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetWord(), SimulationEntity::iGetNumDof(), MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, DataManager::pFindNode(), psNodeNames, psReadNodesNodes, SAFENEWWITHCONSTRUCTOR, and Node::UNKNOWN.

Referenced by DofDCR::Read(), ReadBulk(), ReadElectric(), ReadForce(), ReadGenel(), DataManager::ReadNodes(), and ReadScalarValue().

2424 {
2425  /* tabella delle parole chiave */
2426  KeyTable KDof(HP, psReadNodesNodes);
2427 
2428  /* Label del nodo */
2429  int iNode = HP.GetInt();
2430  if (iNode < 0) {
2431  silent_cerr("ReadScalarDof: invalid node label " << iNode
2432  << " at line " << HP.GetLineData() << std::endl);
2434  }
2435 
2436  unsigned uNode = unsigned(iNode);
2437  DEBUGLCOUT(MYDEBUG_INPUT, "Linked to Node " << uNode << std::endl);
2438 
2439  /* Tipo del nodo */
2440  Node::Type Type = Node::Type(HP.GetWord());
2441  if (Type == Node::UNKNOWN) {
2442  silent_cerr("ReadScalarDof: unknown node type "
2443  "at line " << HP.GetLineData() << std::endl);
2445  }
2446  DEBUGLCOUT(MYDEBUG_INPUT, "Node type: " << psNodeNames[Type] << std::endl);
2447 
2448  /* verifica di esistenza del nodo */
2449  Node* pNode = pDM->pFindNode(Type, uNode);
2450  if (pNode == 0) {
2451  silent_cerr(psNodeNames[Type] << "(" << uNode << ") not defined"
2452  " at line " << HP.GetLineData() << std::endl);
2454  }
2455 
2456  /* si procura il numero di dof del nodo */
2457  unsigned int iMaxIndex = pNode->iGetNumDof();
2458  DEBUGLCOUT(MYDEBUG_INPUT, "max index: " << iMaxIndex << std::endl);
2459 
2460  if (bDof && iMaxIndex == 0) {
2461  silent_cerr(psNodeNames[Type] << "(" << uNode << ") must have dofs "
2462  "at line " << HP.GetLineData() << std::endl);
2464  }
2465 
2466  /* se il nodo ha piu' di un dof, chiede quale dof si desidera */
2467  unsigned int iIndex = 1;
2468  if (iMaxIndex > 1) {
2469  iIndex = HP.GetInt();
2470  if (iIndex < 1 || iIndex > iMaxIndex) {
2471  silent_cerr("Illegal index " << iIndex << ", "
2472  << psNodeNames[Type] << "(" << uNode << ") "
2473  "has only " << iMaxIndex << " dofs "
2474  "at line " << HP.GetLineData() << std::endl);
2476  }
2477  DEBUGLCOUT(MYDEBUG_INPUT, "index: " << iIndex << std::endl);
2478  }
2479 
2480  /* se e' richiesto l'order del dof e se il dof e' differenziale ... */
2481  int iOrder = 0;
2482  if (bOrder && pNode->iGetNumDof() > 0
2483  && pNode->GetDofType(iIndex-1) == DofOrder::DIFFERENTIAL)
2484  {
2485  iOrder = GetDofOrder(HP, pNode, iIndex);
2486  }
2487  DEBUGLCOUT(MYDEBUG_INPUT, "order: " << iOrder << std::endl);
2488 
2489  /* se il nodo non e' scalare, alloca un Node2Scalar che lo wrappa */
2490  if (iMaxIndex > 1) {
2491  NodeDof nd(iIndex - 1, pNode);
2492 
2493  pNode = 0;
2494  /* Chi dealloca questa memoria? ci vorrebbe l'handle */
2496  }
2497 
2498  return ScalarDof(dynamic_cast<ScalarNode *>(pNode), iOrder, iIndex);
2499 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: node.h:67
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
Type
Definition: node.h:71
virtual DofOrder::Order GetDofType(unsigned int i) const =0
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
static int GetDofOrder(MBDynParser &HP, Node *pNode, int iIndex)
Definition: dataman3.cc:2360
virtual unsigned int iGetNumDof(void) const =0
const char * psNodeNames[]
Definition: enums.cc:372
virtual int GetWord(void)
Definition: parser.cc:1083
Definition: node.h:578
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
Node * pFindNode(Node::Type Typ, unsigned int uNode) const
Definition: nodeman.cc:179
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244

Here is the call graph for this function: