MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
OutputHandler Class Reference

#include <output.h>

Inheritance diagram for OutputHandler:
Collaboration diagram for OutputHandler:

Public Types

enum  OutFiles {
  UNKNOWN = -1, FIRSTFILE = 0, OUTPUT = 0, STRNODES,
  ELECTRIC, ABSTRACT, INERTIA, JOINTS,
  FORCES, BEAMS, ROTORS, RESTART,
  RESTARTXSOL, AERODYNAMIC, HYDRAULIC, PRESNODES,
  LOADABLE, GENELS, PARTITION, AEROMODALS,
  REFERENCEFRAMES, LOG, AIRPROPS, PARAMETERS,
  EXTERNALS, MODAL, NETCDF, THERMALNODES,
  THERMALELEMENTS, PLATES, GRAVITY, DOFSTATS,
  DRIVECALLERS, TRACES, EIGENANALYSIS, LASTFILE
}
 

Public Member Functions

void SetCurrentStep (long Step)
 
void IncCurrentStep (void)
 
long GetCurrentStep (void) const
 
 OutputHandler (void)
 
 OutputHandler (const char *sFName, int iExtNum=-1)
 
void Init (const char *sFName, int iExtNum=-1)
 
virtual ~OutputHandler (void)
 
bool Open (const OutputHandler::OutFiles out)
 
bool Open (const int out, const std::string &postfix)
 
bool IsOpen (const OutputHandler::OutFiles out) const
 
bool UseDefaultPrecision (const OutputHandler::OutFiles out) const
 
bool UseScientific (const OutputHandler::OutFiles out) const
 
void SetText (const OutputHandler::OutFiles out)
 
void ClearText (void)
 
void ClearText (const OutputHandler::OutFiles out)
 
bool UseText (const OutputHandler::OutFiles out) const
 
void SetNetCDF (const OutputHandler::OutFiles out)
 
void ClearNetCDF (void)
 
void ClearNetCDF (const OutputHandler::OutFiles out)
 
bool UseNetCDF (const OutputHandler::OutFiles out) const
 
bool Close (const OutputHandler::OutFiles out)
 
bool OutputOpen (void)
 
bool RestartOpen (bool openResXSol=false)
 
bool PartitionOpen (void)
 
bool LogOpen (void)
 
std::ostream & Get (const OutputHandler::OutFiles f)
 
std::ostream & Output (void) const
 
std::ostream & StrNodes (void) const
 
std::ostream & Electric (void) const
 
std::ostream & Abstract (void) const
 
std::ostream & Inertia (void) const
 
std::ostream & Joints (void) const
 
std::ostream & Forces (void) const
 
std::ostream & Beams (void) const
 
std::ostream & Rotors (void) const
 
std::ostream & Restart (void) const
 
std::ostream & RestartXSol (void) const
 
std::ostream & Aerodynamic (void) const
 
std::ostream & Hydraulic (void) const
 
std::ostream & PresNodes (void) const
 
std::ostream & Loadable (void) const
 
std::ostream & Genels (void) const
 
std::ostream & Partition (void) const
 
std::ostream & AeroModals (void) const
 
std::ostream & ReferenceFrames (void) const
 
std::ostream & Log (void) const
 
std::ostream & AirProps (void) const
 
std::ostream & Parameters (void) const
 
std::ostream & Externals (void) const
 
std::ostream & Modal (void) const
 
std::ostream & ThermalNodes (void) const
 
std::ostream & ThermalElements (void) const
 
std::ostream & Plates (void) const
 
std::ostream & Gravity (void) const
 
std::ostream & DofStats (void) const
 
std::ostream & DriveCallers (void) const
 
std::ostream & Traces (void) const
 
std::ostream & Eigenanalysis (void) const
 
int iW (void) const
 
int iP (void) const
 
void SetWidth (int iNewWidth)
 
void SetPrecision (int iNewPrecision)
 
void SetExceptions (std::ios::iostate flags)
 
- Public Member Functions inherited from FileName
 FileName (const char *n=NULL, int i=0)
 
virtual ~FileName (void)
 
int iInit (const char *n, int i=0)
 
const char *const _sPutExt (const char *n)
 
const char *const sGet (void) const
 

Private Types

enum  {
  OUTPUT_NONE = 0x00U, OUTPUT_USE_DEFAULT_PRECISION = 0x01U, OUTPUT_USE_SCIENTIFIC = 0x02U, OUTPUT_MAY_USE_TEXT = 0x10U,
  OUTPUT_USE_TEXT = 0x20U, OUTPUT_MAY_USE_NETCDF = 0x40U, OUTPUT_USE_NETCDF = 0x80U, LAST
}
 

Private Member Functions

bool IsOpen (int out) const
 
bool UseDefaultPrecision (int out) const
 
bool UseScientific (int out) const
 
bool UseText (int out) const
 
bool UseNetCDF (int out) const
 
void OutputHandler_int (void)
 

Private Attributes

long currentStep
 
struct {
   std::ofstream *   pof
 
   unsigned   flags
 
OutData [LASTFILE]
 
std::ofstream ofOutput
 
std::ofstream ofStrNodes
 
std::ofstream ofElectric
 
std::ofstream ofAbstract
 
std::ofstream ofInertia
 
std::ofstream ofJoints
 
std::ofstream ofForces
 
std::ofstream ofBeams
 
std::ofstream ofRotors
 
std::ofstream ofRestart
 
std::ofstream ofRestartXSol
 
std::ofstream ofAerodynamic
 
std::ofstream ofHydraulic
 
std::ofstream ofPresNodes
 
std::ofstream ofLoadable
 
std::ofstream ofGenels
 
std::ofstream ofPartition
 
std::ofstream ofAeroModals
 
std::ofstream ofReferenceFrames
 
std::ofstream ofLog
 
std::ofstream ofAirProps
 
std::ofstream ofParameters
 
std::ofstream ofExternals
 
std::ofstream ofModal
 
std::ofstream ofThermalNodes
 
std::ofstream ofThermalElements
 
std::ofstream ofPlates
 
std::ofstream ofGravity
 
std::ofstream ofDofStats
 
std::ofstream ofDriveCallers
 
std::ofstream ofTraces
 
std::ofstream ofEigenanalysis
 
int iCurrWidth
 
int iCurrPrecision
 
int nCurrRestartFile
 

Detailed Description

Definition at line 65 of file output.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
OUTPUT_NONE 
OUTPUT_USE_DEFAULT_PRECISION 
OUTPUT_USE_SCIENTIFIC 
OUTPUT_MAY_USE_TEXT 
OUTPUT_USE_TEXT 
OUTPUT_MAY_USE_NETCDF 
OUTPUT_USE_NETCDF 
LAST 

Definition at line 123 of file output.h.

Enumerator
UNKNOWN 
FIRSTFILE 
OUTPUT 
STRNODES 
ELECTRIC 
ABSTRACT 
INERTIA 
JOINTS 
FORCES 
BEAMS 
ROTORS 
RESTART 
RESTARTXSOL 
AERODYNAMIC 
HYDRAULIC 
PRESNODES 
LOADABLE 
GENELS 
PARTITION 
AEROMODALS 
REFERENCEFRAMES 
LOG 
AIRPROPS 
PARAMETERS 
EXTERNALS 
MODAL 
NETCDF 
THERMALNODES 
THERMALELEMENTS 
PLATES 
GRAVITY 
DOFSTATS 
DRIVECALLERS 
TRACES 
EIGENANALYSIS 
LASTFILE 

Definition at line 67 of file output.h.

67  {
68  UNKNOWN = -1,
69  FIRSTFILE = 0,
70  OUTPUT = 0, // 0
71  STRNODES,
72  ELECTRIC,
73  ABSTRACT,
74  INERTIA,
75  JOINTS, // 5
76  FORCES,
77  BEAMS,
78  ROTORS,
79  RESTART,
80  RESTARTXSOL, // 10
82  HYDRAULIC,
83  PRESNODES,
84  LOADABLE,
85  GENELS, // 15
86  PARTITION,
87  AEROMODALS,
89  LOG,
90  AIRPROPS, // 20
91  PARAMETERS,
92  EXTERNALS,
93  MODAL,
94  NETCDF,
95  THERMALNODES, // 25
97  PLATES,
98  GRAVITY,
99  DOFSTATS,
100  DRIVECALLERS, // 30
101  TRACES,
102  EIGENANALYSIS, // NOTE: ALWAYS LAST!
103  LASTFILE // 33
104  };

Constructor & Destructor Documentation

OutputHandler::OutputHandler ( void  )

Definition at line 87 of file output.cc.

References OutputHandler_int().

88 : FileName(NULL),
89 #ifdef USE_NETCDF
90 m_DimTime(0),
91 m_DimV1(0),
92 m_DimV3(0),
93 m_pBinFile(0),
94 #endif /* USE_NETCDF */
98 {
100 }
void OutputHandler_int(void)
Definition: output.cc:121
int nCurrRestartFile
Definition: output.h:186
const int iDefaultWidth
Definition: output.cc:46
FileName(const char *n=NULL, int i=0)
Definition: fn_UNIX.cc:41
int iCurrWidth
Definition: output.h:184
int iCurrPrecision
Definition: output.h:185
const int iDefaultPrecision
Definition: output.cc:47

Here is the call graph for this function:

OutputHandler::OutputHandler ( const char *  sFName,
int  iExtNum = -1 
)

Definition at line 103 of file output.cc.

References Init(), and OutputHandler_int().

104 : FileName(sFName, iExtNum),
105 #ifdef USE_NETCDF
106 m_DimTime(0),
107 m_DimV1(0),
108 m_DimV3(0),
109 m_pBinFile(0),
110 #endif /* USE_NETCDF */
114 {
116  Init(sFName, iExtNum);
117 }
void OutputHandler_int(void)
Definition: output.cc:121
int nCurrRestartFile
Definition: output.h:186
const int iDefaultWidth
Definition: output.cc:46
FileName(const char *n=NULL, int i=0)
Definition: fn_UNIX.cc:41
void Init(const char *sFName, int iExtNum=-1)
Definition: output.cc:267
int iCurrWidth
Definition: output.h:184
int iCurrPrecision
Definition: output.h:185
const int iDefaultPrecision
Definition: output.cc:47

Here is the call graph for this function:

OutputHandler::~OutputHandler ( void  )
virtual

Definition at line 276 of file output.cc.

References IsOpen(), LASTFILE, NETCDF, and OutData.

277 {
278  for (int iCnt = 0; iCnt < LASTFILE; iCnt++) {
279  if (IsOpen(iCnt)) {
280 #ifdef USE_NETCDF
281  if (iCnt == NETCDF) {
282  if (m_pBinFile != 0) {
283  delete m_pBinFile;
284  }
285 
286  } else
287 #endif /* USE_NETCDF */
288  {
289  OutData[iCnt].pof->exceptions(std::ios::iostate(0));
290  OutData[iCnt].pof->close();
291  }
292  }
293  }
294 }
struct OutputHandler::@34 OutData[LASTFILE]
bool IsOpen(int out) const
Definition: output.cc:395

Here is the call graph for this function:

Member Function Documentation

std::ostream & OutputHandler::Abstract ( void  ) const
inline

Definition at line 429 of file output.h.

References ABSTRACT, ASSERT, IsOpen(), and ofAbstract.

Referenced by ScalarNode::Output().

430 {
432  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofAbstract));
433 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofAbstract
Definition: output.h:154

Here is the call graph for this function:

std::ostream & OutputHandler::Aerodynamic ( void  ) const
inline

Definition at line 485 of file output.h.

References AERODYNAMIC, ASSERT, IsOpen(), and ofAerodynamic.

Referenced by AircraftInstruments::Output(), GenericAerodynamicForce::Output(), AerodynamicBody::Output(), AerodynamicBeam::Output(), and AerodynamicBeam2::Output().

486 {
488  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofAerodynamic));
489 }
std::ofstream ofAerodynamic
Definition: output.h:162
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::AeroModals ( void  ) const
inline

Definition at line 527 of file output.h.

References AEROMODALS, ASSERT, IsOpen(), and ofAeroModals.

Referenced by AerodynamicModal::Output().

528 {
530  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofAeroModals));
531 }
std::ofstream ofAeroModals
Definition: output.h:168
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::AirProps ( void  ) const
inline

Definition at line 552 of file output.h.

References AIRPROPS, ASSERT, IsOpen(), and ofAirProps.

Referenced by AirProperties::Output().

553 {
555  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofAirProps));
556 }
std::ofstream ofAirProps
Definition: output.h:171
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Beams ( void  ) const
inline

Definition at line 457 of file output.h.

References ASSERT, BEAMS, IsOpen(), and ofBeams.

Referenced by HBeam::Output(), Beam2::Output(), and Beam::Output().

458 {
459  ASSERT(IsOpen(BEAMS));
460  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofBeams));
461 }
std::ofstream ofBeams
Definition: output.h:158
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void OutputHandler::ClearNetCDF ( void  )

Definition at line 510 of file output.cc.

References FIRSTFILE, flags, LASTFILE, OutData, OUTPUT_MAY_USE_NETCDF, and OUTPUT_USE_NETCDF.

511 {
512  for (int out = FIRSTFILE; out < LASTFILE; out++) {
513  if (OutData[out].flags & OUTPUT_MAY_USE_NETCDF) {
514  OutData[out].flags &= ~OUTPUT_USE_NETCDF;
515  }
516  }
517 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
void OutputHandler::ClearNetCDF ( const OutputHandler::OutFiles  out)

Definition at line 520 of file output.cc.

References flags, MBDYN_EXCEPT_ARGS, OutData, OUTPUT_MAY_USE_NETCDF, and OUTPUT_USE_NETCDF.

521 {
522  if (!(OutData[out].flags & OUTPUT_MAY_USE_NETCDF)) {
524  }
525 
526  OutData[out].flags &= ~OUTPUT_USE_NETCDF;
527 }
unsigned flags
Definition: output.h:139
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
struct OutputHandler::@34 OutData[LASTFILE]
void OutputHandler::ClearText ( void  )

Definition at line 465 of file output.cc.

References FIRSTFILE, flags, LASTFILE, OutData, OUTPUT_MAY_USE_TEXT, and OUTPUT_USE_TEXT.

Referenced by DataManager::ReadControl().

466 {
467  for (int out = FIRSTFILE; out < LASTFILE; out++) {
468  if (OutData[out].flags & OUTPUT_MAY_USE_TEXT) {
469  OutData[out].flags &= ~OUTPUT_USE_TEXT;
470  }
471  }
472 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
void OutputHandler::ClearText ( const OutputHandler::OutFiles  out)

Definition at line 475 of file output.cc.

References flags, MBDYN_EXCEPT_ARGS, OutData, OUTPUT_MAY_USE_TEXT, and OUTPUT_USE_TEXT.

476 {
477  if (!(OutData[out].flags & OUTPUT_MAY_USE_TEXT)) {
479  }
480 
481  OutData[out].flags &= ~OUTPUT_USE_TEXT;
482 }
unsigned flags
Definition: output.h:139
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
struct OutputHandler::@34 OutData[LASTFILE]
bool OutputHandler::Close ( const OutputHandler::OutFiles  out)

Definition at line 536 of file output.cc.

References IsOpen(), NETCDF, and OutData.

Referenced by DataManager::MakeRestart(), and DataManager::OutputEigClose().

537 {
538  if (!IsOpen(out)) {
539  return false;
540  }
541 
542 #ifdef USE_NETCDF
543  if (out == NETCDF) {
544  m_pBinFile->close();
545 
546  } else
547 #endif /* USE_NETCDF */
548  {
549  // Chiude lo stream
550  OutData[out].pof->close();
551  }
552 
553  return true;
554 }
struct OutputHandler::@34 OutData[LASTFILE]
bool IsOpen(int out) const
Definition: output.cc:395

Here is the call graph for this function:

std::ostream & OutputHandler::DofStats ( void  ) const
inline

Definition at line 594 of file output.h.

References ASSERT, DOFSTATS, IsOpen(), and ofDofStats.

Referenced by DataManager::DofOwnerInit(), and DataManager::InitialJointAssembly().

595 {
597  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofDofStats));
598 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofDofStats
Definition: output.h:179

Here is the call graph for this function:

std::ostream & OutputHandler::DriveCallers ( void  ) const
inline

Definition at line 601 of file output.h.

References ASSERT, DRIVECALLERS, IsOpen(), and ofDriveCallers.

Referenced by DriveCaller::Output().

602 {
604  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofDriveCallers));
605 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofDriveCallers
Definition: output.h:180

Here is the call graph for this function:

std::ostream & OutputHandler::Eigenanalysis ( void  ) const
inline

Definition at line 615 of file output.h.

References ASSERT, EIGENANALYSIS, IsOpen(), and ofEigenanalysis.

Referenced by DataManager::OutputEigenvectors(), DataManager::OutputEigFullMatrices(), DataManager::OutputEigGeometry(), DataManager::OutputEigNaiveMatrices(), DataManager::OutputEigParams(), and DataManager::OutputEigSparseMatrices().

616 {
618  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofEigenanalysis));
619 }
std::ofstream ofEigenanalysis
Definition: output.h:182
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Electric ( void  ) const
inline

Definition at line 408 of file output.h.

References ASSERT, ELECTRIC, IsOpen(), and ofElectric.

Referenced by ElectricNode::Output().

409 {
411  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofElectric));
412 }
std::ofstream ofElectric
Definition: output.h:153
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Externals ( void  ) const
inline

Definition at line 566 of file output.h.

References ASSERT, EXTERNALS, IsOpen(), and ofExternals.

567 {
569  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofExternals));
570 }
std::ofstream ofExternals
Definition: output.h:173
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Forces ( void  ) const
inline
std::ostream & OutputHandler::Genels ( void  ) const
inline

Definition at line 513 of file output.h.

References ASSERT, GENELS, IsOpen(), and ofGenels.

Referenced by GenelClamp::Output(), GenelStateSpaceSISO::Output(), GenelDistance::Output(), and GenelStateSpaceMIMO::Output().

514 {
515  ASSERT(IsOpen(GENELS));
516  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofGenels));
517 }
std::ofstream ofGenels
Definition: output.h:166
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Get ( const OutputHandler::OutFiles  f)
inline

Definition at line 382 of file output.h.

References ASSERT, IsOpen(), LASTFILE, and OutData.

Referenced by ThermalNode::Output().

383 {
384  ASSERT(f > -1 && f < LASTFILE);
385  ASSERT(IsOpen(f));
386  return *(OutData[f].pof);
387 }
struct OutputHandler::@34 OutData[LASTFILE]
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Gravity ( void  ) const
inline

Definition at line 587 of file output.h.

References ASSERT, GRAVITY, IsOpen(), and ofGravity.

Referenced by UniformGravity::Output(), and CentralGravity::Output().

588 {
590  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofGravity));
591 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofGravity
Definition: output.h:178

Here is the call graph for this function:

std::ostream & OutputHandler::Hydraulic ( void  ) const
inline

Definition at line 492 of file output.h.

References ASSERT, HYDRAULIC, IsOpen(), and ofHydraulic.

Referenced by MinorLoss::Output(), Pipe::Output(), Control_valve::Output(), Actuator::Output(), Accumulator::Output(), ThreeWayMinorLoss::Output(), Dynamic_pipe::Output(), Tank::Output(), Control_valve2::Output(), Orifice::Output(), DynamicPipe::Output(), Dynamic_control_valve::Output(), Pressure_flow_control_valve::Output(), Pressure_valve::Output(), and Flow_valve::Output().

493 {
495  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofHydraulic));
496 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofHydraulic
Definition: output.h:163

Here is the call graph for this function:

void OutputHandler::IncCurrentStep ( void  )
inline

Definition at line 113 of file output.h.

References currentStep.

Referenced by DataManager::Output().

113  {
114  currentStep++;
115  };
long currentStep
Definition: output.h:107
std::ostream & OutputHandler::Inertia ( void  ) const
inline

Definition at line 436 of file output.h.

References ASSERT, INERTIA, IsOpen(), and ofInertia.

Referenced by AutomaticStructDispElem::Output(), and AutomaticStructElem::Output().

437 {
439  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofInertia));
440 }
std::ofstream ofInertia
Definition: output.h:155
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void OutputHandler::Init ( const char *  sFName,
int  iExtNum = -1 
)

Definition at line 267 of file output.cc.

References FileName::iInit(), LogOpen(), and OutputOpen().

Referenced by OutputHandler().

268 {
269  FileName::iInit(sFName, iExtNum);
270 
271  OutputOpen();
272  LogOpen();
273 }
bool LogOpen(void)
Definition: output.cc:637
int iInit(const char *n, int i=0)
Definition: fn_UNIX.cc:63
bool OutputOpen(void)
Definition: output.cc:557

Here is the call graph for this function:

int OutputHandler::iP ( void  ) const
inline

Definition at line 629 of file output.h.

References iCurrPrecision.

630 {
631  return iCurrPrecision;
632 }
int iCurrPrecision
Definition: output.h:185
bool OutputHandler::IsOpen ( int  out) const
private

Definition at line 395 of file output.cc.

References ASSERT, LASTFILE, and UNKNOWN.

Referenced by Abstract(), Aerodynamic(), AeroModals(), AirProps(), Beams(), Close(), DofStats(), DriveCallers(), DataManager::DriveOutput(), DataManager::DriveTrace(), Eigenanalysis(), Electric(), DataManager::ElemOutputPrepare(), Externals(), Forces(), Genels(), Get(), Gravity(), Hydraulic(), Inertia(), Joints(), Loadable(), Log(), LogOpen(), Modal(), DataManager::NodeOutputPrepare(), Open(), Output(), DataManager::OutputEigOpen(), DataManager::OutputOpen(), AbsoluteDispForce::OutputPrepare(), AbsoluteInternalDispForce::OutputPrepare(), AutomaticStructDispElem::OutputPrepare(), Aerodynamic2DElem< iNN >::OutputPrepare(), StructDispNode::OutputPrepare(), Beam2::OutputPrepare(), AbsoluteForce::OutputPrepare(), AutomaticStructElem::OutputPrepare(), Wheel4::OutputPrepare(), FollowerForce::OutputPrepare(), Beam::OutputPrepare(), AbsoluteCouple::OutputPrepare(), DataManager::OutputPrepare(), FollowerCouple::OutputPrepare(), AbsoluteInternalForce::OutputPrepare(), FollowerInternalForce::OutputPrepare(), AbsoluteInternalCouple::OutputPrepare(), FollowerInternalCouple::OutputPrepare(), StructNode::OutputPrepare(), Joint::OutputPrepare_int(), Inertia::OutputPrepare_int(), Parameters(), Partition(), PartitionOpen(), Plates(), PresNodes(), ReferenceFrames(), Restart(), RestartOpen(), RestartXSol(), Rotors(), SetPrecision(), SetWidth(), StrNodes(), ThermalElements(), ThermalNodes(), Traces(), and ~OutputHandler().

396 {
399 
400  return IsOpen(OutputHandler::OutFiles(out));
401 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
bool OutputHandler::IsOpen ( const OutputHandler::OutFiles  out) const

Definition at line 404 of file output.cc.

References NETCDF, and OutData.

405 {
406 #ifdef USE_NETCDF
407  if (out == NETCDF) {
408  return m_pBinFile == 0 ? false : m_pBinFile->is_valid();
409  }
410 #endif /* USE_NETCDF */
411 
412  return OutData[out].pof == 0 ? false : OutData[out].pof->is_open();
413 }
struct OutputHandler::@34 OutData[LASTFILE]
int OutputHandler::iW ( void  ) const
inline

Definition at line 623 of file output.h.

References iCurrWidth.

624 {
625  return iCurrWidth;
626 }
int iCurrWidth
Definition: output.h:184
std::ostream & OutputHandler::Joints ( void  ) const
inline

Definition at line 443 of file output.h.

References ASSERT, IsOpen(), JOINTS, and ofJoints.

Referenced by GimbalRotationJoint::Output(), LinearAccelerationJoint::Output(), DriveDisplacementJoint::Output(), DriveHingeJoint::Output(), ViscousBody::Output(), LinearVelocityJoint::Output(), InLineJoint::Output(), DistanceJoint::Output(), UniversalHingeJoint::Output(), PrismaticJoint::Output(), SphericalHingeJoint::Output(), DeformableAxialJoint::Output(), InPlaneJoint::Output(), DeformableDispJoint::Output(), RodBezier::Output(), DeformableHingeJoint::Output(), DeformableJoint::Output(), Rod::Output(), Brake::Output(), AngularAccelerationJoint::Output(), PlaneHingeJoint::Output(), BeamSliderJoint::Output(), AngularVelocityJoint::Output(), InLineWithOffsetJoint::Output(), ContactJoint::Output(), DistanceJointWithOffset::Output(), UniversalRotationJoint::Output(), PinJoint::Output(), TotalEquation::Output(), InPlaneWithOffsetJoint::Output(), TotalJoint::Output(), DriveDisplacementPinJoint::Output(), UniversalPinJoint::Output(), PlaneRotationJoint::Output(), ClampJoint::Output(), TotalReaction::Output(), TotalPinJoint::Output(), AxialRotationJoint::Output(), PlanePinJoint::Output(), and DeformableHingeJoint::OutputInv().

444 {
445  ASSERT(IsOpen(JOINTS));
446  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofJoints));
447 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofJoints
Definition: output.h:156

Here is the call graph for this function:

std::ostream & OutputHandler::Loadable ( void  ) const
inline
std::ostream & OutputHandler::Log ( void  ) const
inline

Definition at line 541 of file output.h.

References ASSERT, IsOpen(), LOG, and ofLog.

Referenced by DataManager::DofOwnerInit(), DataManager::GetLogFile(), DataManager::ReadControl(), and DataManager::ReadOneElem().

542 {
543 #ifdef DEBUG_COUT
544  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(cout));
545 #else
546  ASSERT(IsOpen(LOG));
547  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofLog));
548 #endif
549 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofLog
Definition: output.h:170

Here is the call graph for this function:

bool OutputHandler::LogOpen ( void  )

Definition at line 637 of file output.cc.

References ASSERT, IsOpen(), LOG, and Open().

Referenced by Init().

638 {
639  ASSERT(!IsOpen(LOG));
640  return Open(LOG);
641 }
bool Open(const OutputHandler::OutFiles out)
Definition: output.cc:298
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Modal ( void  ) const
inline

Definition at line 573 of file output.h.

References ASSERT, IsOpen(), MODAL, and ofModal.

Referenced by Modal::Output().

574 {
575  ASSERT(IsOpen(MODAL));
576  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofModal));
577 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofModal
Definition: output.h:174

Here is the call graph for this function:

bool OutputHandler::Open ( const OutputHandler::OutFiles  out)

Definition at line 298 of file output.cc.

References FileName::_sPutExt(), NcFile::Fill, iCurrPrecision, IsOpen(), MBDYN_EXCEPT_ARGS, NETCDF, OutData, pof, psExt, NcFile::Replace, UseDefaultPrecision(), UseScientific(), and UseText().

Referenced by DataManager::DataManager(), DataManager::DofOwnerInit(), DataManager::InitialJointAssembly(), LogOpen(), DataManager::OutputEigOpen(), OutputOpen(), DataManager::OutputOpen(), DataManager::OutputPrepare(), and PartitionOpen().

299 {
300 #ifdef USE_NETCDF
301  if (out == NETCDF && !IsOpen(out)) {
302  m_pBinFile = new NcFile(_sPutExt((char*)(psExt[NETCDF])), NcFile::Replace);
303  m_pBinFile->set_fill(NcFile::Fill);
304 
305  if (!m_pBinFile->is_valid()) {
306  silent_cerr("NetCDF file is invalid" << std::endl);
307  throw ErrFile(MBDYN_EXCEPT_ARGS);
308  }
309 
310  // Let's define some dimensions which could be useful
311  m_DimTime = CreateDim("time");
312  m_DimV1 = CreateDim("vec1", 1);
313  m_DimV3 = CreateDim("vec3", 3);
314 
315  } else
316 #endif /* USE_NETCDF */
317  {
318  if (!IsOpen(out)) {
319  const char *fname = _sPutExt(psExt[out]);
320 
321  // Apre lo stream
322  OutData[out].pof->open(fname);
323 
324  if (!(*OutData[out].pof)) {
325  silent_cerr("Unable to open file "
326  "\"" << fname << "\"" << std::endl);
327  throw ErrFile(MBDYN_EXCEPT_ARGS);
328  }
329 
330  if (UseText(out)) {
331  // Setta la formattazione dei campi
332  if (UseDefaultPrecision(out)) {
333  OutData[out].pof->precision(iCurrPrecision);
334  }
335 
336  // Setta la notazione
337  if (UseScientific(out)) {
338  OutData[out].pof->setf(std::ios::scientific);
339  }
340  }
341  }
342 
343  return true;
344  }
345 
346  return false;
347 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const char *const _sPutExt(const char *n)
Definition: fn_UNIX.cc:161
bool UseScientific(int out) const
Definition: output.cc:416
struct OutputHandler::@34 OutData[LASTFILE]
const char * psExt[]
Definition: output.cc:49
std::ofstream * pof
Definition: output.h:138
bool IsOpen(int out) const
Definition: output.cc:395
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
int iCurrPrecision
Definition: output.h:185
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

bool OutputHandler::Open ( const int  out,
const std::string &  postfix 
)

Definition at line 350 of file output.cc.

References EXT_SEP, iCurrPrecision, IsOpen(), MBDYN_EXCEPT_ARGS, OutData, pof, psExt, FileName::sGet(), UseDefaultPrecision(), UseScientific(), and UseText().

351 {
352  if (UseText(out) && !IsOpen(out)) {
353  std::string sCurrFileName = sGet();
354  std::stringstream fname_ss;
355 
356  unsigned uExtIdx = sCurrFileName.find_last_of(EXT_SEP);
357 
358  if (uExtIdx != std::string::npos) {
359  fname_ss << sCurrFileName.substr(0, uExtIdx);
360 
361  } else {
362  fname_ss << sCurrFileName;
363  }
364 
365  fname_ss << postfix << psExt[out] << std::ends;
366 
367  const std::string fname = fname_ss.str();
368 
369  // Opens the stream
370  OutData[out].pof->open(fname.c_str());
371 
372  if (!(*OutData[out].pof)) {
373  silent_cerr("Unable to open file "
374  "\"" << fname << "\"" << std::endl);
375  throw ErrFile(MBDYN_EXCEPT_ARGS);
376  }
377 
378  // Sets the field format
379  if (UseDefaultPrecision(out)) {
380  OutData[out].pof->precision(iCurrPrecision);
381  }
382 
383  // Sets the notation
384  if (UseScientific(out)) {
385  OutData[out].pof->setf(std::ios::scientific);
386  }
387 
388  return true;
389  }
390 
391  return false;
392 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const char *const sGet(void) const
Definition: fn_UNIX.cc:200
bool UseScientific(int out) const
Definition: output.cc:416
struct OutputHandler::@34 OutData[LASTFILE]
const char * psExt[]
Definition: output.cc:49
std::ofstream * pof
Definition: output.h:138
const char EXT_SEP
Definition: filename.h:63
bool IsOpen(int out) const
Definition: output.cc:395
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
int iCurrPrecision
Definition: output.h:185
bool UseText(int out) const
Definition: output.cc:446

Here is the call graph for this function:

std::ostream & OutputHandler::Output ( void  ) const
inline

Definition at line 390 of file output.h.

References ASSERT, IsOpen(), ofOutput, and OUTPUT.

Referenced by DataManager::GetOutFile().

391 {
392 #ifdef DEBUG_COUT
393  return const_cast<std::ostream &>(cout);
394 #else
395  ASSERT(IsOpen(OUTPUT));
396  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofOutput));
397 #endif
398 }
std::ofstream ofOutput
Definition: output.h:151
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void OutputHandler::OutputHandler_int ( void  )
private

Definition at line 121 of file output.cc.

References ABSTRACT, AERODYNAMIC, AEROMODALS, AIRPROPS, BEAMS, currentStep, DOFSTATS, DRIVECALLERS, EIGENANALYSIS, ELECTRIC, EXTERNALS, FORCES, GENELS, GRAVITY, HYDRAULIC, INERTIA, JOINTS, LOADABLE, LOG, MODAL, NETCDF, ofAbstract, ofAerodynamic, ofAeroModals, ofAirProps, ofBeams, ofDofStats, ofDriveCallers, ofEigenanalysis, ofElectric, ofExternals, ofForces, ofGenels, ofGravity, ofHydraulic, ofInertia, ofJoints, ofLoadable, ofLog, ofModal, ofOutput, ofParameters, ofPartition, ofPlates, ofPresNodes, ofReferenceFrames, ofRestart, ofRestartXSol, ofRotors, ofStrNodes, ofThermalElements, ofThermalNodes, ofTraces, OutData, OUTPUT, OUTPUT_MAY_USE_NETCDF, OUTPUT_MAY_USE_TEXT, OUTPUT_USE_DEFAULT_PRECISION, OUTPUT_USE_SCIENTIFIC, OUTPUT_USE_TEXT, PARAMETERS, PARTITION, PLATES, PRESNODES, REFERENCEFRAMES, RESTART, RESTARTXSOL, ROTORS, STRNODES, THERMALELEMENTS, THERMALNODES, and TRACES.

Referenced by OutputHandler().

122 {
125  OutData[OUTPUT].pof = &ofOutput;
126 
130  OutData[STRNODES].pof = &ofStrNodes;
131 
134  OutData[ELECTRIC].pof= &ofElectric;
135 
139 
143 
146  OutData[ABSTRACT].pof = &ofAbstract;
147 
151  OutData[INERTIA].pof = &ofInertia;
152 
156  OutData[JOINTS].pof = &ofJoints;
157 
161  OutData[FORCES].pof = &ofForces;
162 
166  OutData[BEAMS].pof = &ofBeams;
167 
170  OutData[ROTORS].pof = &ofRotors;
171 
174  OutData[RESTART].pof = &ofRestart;
175 
176  OutData[RESTARTXSOL].flags = 0
179 
184 
187  OutData[HYDRAULIC].pof = &ofHydraulic;
188 
191  OutData[PRESNODES].pof = &ofPresNodes;
192 
196  OutData[LOADABLE].pof = &ofLoadable;
197 
200  OutData[GENELS].pof = &ofGenels;
201 
204  OutData[PARTITION].pof = &ofPartition;
205 
209 
213 
214  OutData[LOG].flags = 0
216  OutData[LOG].pof = &ofLog;
217 
220  OutData[AIRPROPS].pof = &ofAirProps;
221 
225 
228  OutData[EXTERNALS].pof = &ofExternals;
229 
232  OutData[MODAL].pof = &ofModal;
233 
237  OutData[PLATES].pof = &ofPlates;
238 
241  OutData[GRAVITY].pof = &ofGravity;
242 
244  OutData[DOFSTATS].pof = &ofDofStats;
245 
249 
252  OutData[TRACES].pof = &ofTraces;
253 
257 
258  OutData[NETCDF].flags = 0
260  OutData[NETCDF].pof = 0;
261 
262  currentStep = 0;
263 }
std::ofstream ofRestartXSol
Definition: output.h:161
std::ofstream ofPlates
Definition: output.h:177
std::ofstream ofGenels
Definition: output.h:166
std::ofstream ofAeroModals
Definition: output.h:168
std::ofstream ofBeams
Definition: output.h:158
std::ofstream ofInertia
Definition: output.h:155
long currentStep
Definition: output.h:107
std::ofstream ofAerodynamic
Definition: output.h:162
std::ofstream ofTraces
Definition: output.h:181
std::ofstream ofExternals
Definition: output.h:173
std::ofstream ofEigenanalysis
Definition: output.h:182
std::ofstream ofPresNodes
Definition: output.h:164
std::ofstream ofThermalElements
Definition: output.h:176
std::ofstream ofOutput
Definition: output.h:151
std::ofstream ofThermalNodes
Definition: output.h:175
std::ofstream ofAirProps
Definition: output.h:171
std::ofstream ofReferenceFrames
Definition: output.h:169
std::ofstream ofForces
Definition: output.h:157
std::ofstream ofElectric
Definition: output.h:153
std::ofstream ofRotors
Definition: output.h:159
struct OutputHandler::@34 OutData[LASTFILE]
std::ofstream ofParameters
Definition: output.h:172
std::ofstream ofDofStats
Definition: output.h:179
std::ofstream ofDriveCallers
Definition: output.h:180
std::ofstream ofRestart
Definition: output.h:160
std::ofstream ofLog
Definition: output.h:170
std::ofstream ofHydraulic
Definition: output.h:163
std::ofstream ofGravity
Definition: output.h:178
std::ofstream ofStrNodes
Definition: output.h:152
std::ofstream ofPartition
Definition: output.h:167
std::ofstream ofLoadable
Definition: output.h:165
std::ofstream ofJoints
Definition: output.h:156
std::ofstream ofModal
Definition: output.h:174
std::ofstream ofAbstract
Definition: output.h:154
bool OutputHandler::OutputOpen ( void  )

Definition at line 557 of file output.cc.

References Open(), and OUTPUT.

Referenced by Init().

558 {
559  return Open(OUTPUT);
560 }
bool Open(const OutputHandler::OutFiles out)
Definition: output.cc:298

Here is the call graph for this function:

std::ostream & OutputHandler::Parameters ( void  ) const
inline

Definition at line 559 of file output.h.

References ASSERT, IsOpen(), ofParameters, and PARAMETERS.

Referenced by ParameterNode::Output().

560 {
562  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofParameters));
563 }
std::ofstream ofParameters
Definition: output.h:172
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Partition ( void  ) const
inline

Definition at line 520 of file output.h.

References ASSERT, IsOpen(), ofPartition, and PARTITION.

521 {
523  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofPartition));
524 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofPartition
Definition: output.h:167

Here is the call graph for this function:

bool OutputHandler::PartitionOpen ( void  )

Definition at line 630 of file output.cc.

References ASSERT, IsOpen(), Open(), and PARTITION.

631 {
633  return Open(PARTITION);
634 }
bool Open(const OutputHandler::OutFiles out)
Definition: output.cc:298
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Plates ( void  ) const
inline

Definition at line 580 of file output.h.

References ASSERT, IsOpen(), ofPlates, and PLATES.

Referenced by Membrane4EAS::Output(), Shell4EAS::Output(), and Shell4EASANS::Output().

581 {
582  ASSERT(IsOpen(PLATES));
583  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofPlates));
584 }
std::ofstream ofPlates
Definition: output.h:177
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::PresNodes ( void  ) const
inline

Definition at line 499 of file output.h.

References ASSERT, IsOpen(), ofPresNodes, and PRESNODES.

Referenced by PressureNode::Output().

500 {
502  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofPresNodes));
503 }
std::ofstream ofPresNodes
Definition: output.h:164
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::ReferenceFrames ( void  ) const
inline

Definition at line 534 of file output.h.

References ASSERT, IsOpen(), ofReferenceFrames, and REFERENCEFRAMES.

Referenced by DataManager::DataManager().

535 {
537  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofReferenceFrames));
538 }
std::ofstream ofReferenceFrames
Definition: output.h:169
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Restart ( void  ) const
inline

Definition at line 471 of file output.h.

References ASSERT, IsOpen(), ofRestart, and RESTART.

Referenced by DataManager::MakeRestart().

472 {
474  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofRestart));
475 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofRestart
Definition: output.h:160

Here is the call graph for this function:

bool OutputHandler::RestartOpen ( bool  openResXSol = false)

Definition at line 563 of file output.cc.

References FileName::_sPutExt(), ASSERT, iCurrPrecision, IsOpen(), MBDYN_EXCEPT_ARGS, nCurrRestartFile, OutData, pof, RESTART, RESTARTXSOL, SAFEDELETEARR, SAFENEWARR, STRLENOF, UseDefaultPrecision(), and UseScientific().

Referenced by DataManager::MakeRestart().

564 {
565  if (!IsOpen(RESTART)) {
566  char *resExt = NULL;
567  int n = nCurrRestartFile > 0 ?
568  (int)log10(nCurrRestartFile) + 1 : 1;
569  int lenExt = STRLENOF(".")
570  + n
571  + STRLENOF(".rst")
572  + 1;
573 
574  SAFENEWARR(resExt, char, lenExt);
575  snprintf(resExt, lenExt, ".%.*d.rst", n, nCurrRestartFile);
576  /* Apre lo stream */
577  OutData[RESTART].pof->open(_sPutExt(resExt));
578 
579  if(!(*OutData[RESTART].pof)) {
580  std::cerr << "Unable to open file '" << _sPutExt(resExt)
581  << '\'' << std::endl;
582  throw ErrFile(MBDYN_EXCEPT_ARGS);
583  }
584  SAFEDELETEARR(resExt);
585 
586  /* Setta la formattazione dei campi */
588  OutData[RESTART].pof->precision(iCurrPrecision);
589  }
590 
591  /* Setta la notazione */
592  if(UseScientific(RESTART)) {
593  OutData[RESTART].pof->setf(std::ios::scientific);
594  }
595 
596  if (openResXSol) {
598 
599  char *resXSolExt = NULL;
600  int n = nCurrRestartFile > 0 ?
601  (int)log10(nCurrRestartFile) + 1 : 1;
602  int lenXSolExt = STRLENOF(".")
603  + n
604  + STRLENOF(".rst.X")
605  + 1;
606 
607  SAFENEWARR(resXSolExt, char, lenXSolExt);
608  snprintf(resXSolExt, lenXSolExt, ".%.*d.rst.X", n, nCurrRestartFile);
609  /* Apre lo stream */
610  OutData[RESTARTXSOL].pof->open(_sPutExt(resXSolExt));
611  if(!(*OutData[RESTARTXSOL].pof)) {
612  std::cerr << "Unable to open file '" << _sPutExt(resExt)
613  << '\'' << std::endl;
614  throw ErrFile(MBDYN_EXCEPT_ARGS);
615  }
616  SAFEDELETEARR(resXSolExt);
617  /* non occorre settare la precisione e il formato
618  perche' il file e' binario */
619  }
620 
622 
623  return false;
624  }
625 
626  return true;
627 }
int nCurrRestartFile
Definition: output.h:186
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const char *const _sPutExt(const char *n)
Definition: fn_UNIX.cc:161
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
bool UseScientific(int out) const
Definition: output.cc:416
struct OutputHandler::@34 OutData[LASTFILE]
std::ofstream * pof
Definition: output.h:138
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
#define STRLENOF(s)
Definition: mbdyn.h:166
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
int iCurrPrecision
Definition: output.h:185

Here is the call graph for this function:

std::ostream & OutputHandler::RestartXSol ( void  ) const
inline

Definition at line 478 of file output.h.

References ASSERT, IsOpen(), ofRestartXSol, and RESTART.

Referenced by DataManager::MakeRestart().

479 {
481  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofRestartXSol));
482 }
std::ofstream ofRestartXSol
Definition: output.h:161
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Rotors ( void  ) const
inline

Definition at line 464 of file output.h.

References ASSERT, IsOpen(), ofRotors, and ROTORS.

Referenced by Rotor::Output(), DynamicInflowRotor::Output(), and PetersHeRotor::Output().

465 {
466  ASSERT(IsOpen(ROTORS));
467  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofRotors));
468 }
std::ofstream ofRotors
Definition: output.h:159
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

void OutputHandler::SetCurrentStep ( long  Step)
inline

Definition at line 110 of file output.h.

References currentStep.

110  {
111  currentStep = Step;
112  };
long currentStep
Definition: output.h:107
void OutputHandler::SetExceptions ( std::ios::iostate  flags)

Definition at line 678 of file output.cc.

References LASTFILE, OutData, and pof.

Referenced by DataManager::DataManager().

679 {
680  for (int iCnt = 0; iCnt < LASTFILE; iCnt++) {
681  if(OutData[iCnt].pof) {
682  OutData[iCnt].pof->exceptions(flags);
683  }
684  }
685 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
std::ofstream * pof
Definition: output.h:138
void OutputHandler::SetNetCDF ( const OutputHandler::OutFiles  out)

Definition at line 500 of file output.cc.

References flags, MBDYN_EXCEPT_ARGS, OutData, OUTPUT_MAY_USE_NETCDF, and OUTPUT_USE_NETCDF.

Referenced by DataManager::ReadControl().

501 {
502  if (!(OutData[out].flags & OUTPUT_MAY_USE_NETCDF)) {
504  }
505 
506  OutData[out].flags |= OUTPUT_USE_NETCDF;
507 }
unsigned flags
Definition: output.h:139
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
struct OutputHandler::@34 OutData[LASTFILE]
void OutputHandler::SetPrecision ( int  iNewPrecision)

Definition at line 663 of file output.cc.

References ASSERT, iCurrPrecision, iCurrWidth, IsOpen(), iWidth, LASTFILE, OutData, and UseDefaultPrecision().

Referenced by DataManager::ReadControl().

664 {
665  ASSERT(iNewPrecision > 0);
666  if (iNewPrecision > 0) {
667  iCurrPrecision = iNewPrecision;
668  iCurrWidth = iNewPrecision + iWidth;
669  for (int iCnt = 0; iCnt < LASTFILE; iCnt++) {
670  if (UseDefaultPrecision(iCnt) && IsOpen(iCnt)) {
671  OutData[iCnt].pof->width(iCurrWidth);
672  OutData[iCnt].pof->precision(iCurrPrecision);
673  }
674  }
675  }
676 }
const int iWidth
Definition: output.cc:644
struct OutputHandler::@34 OutData[LASTFILE]
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
int iCurrWidth
Definition: output.h:184
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
int iCurrPrecision
Definition: output.h:185

Here is the call graph for this function:

void OutputHandler::SetText ( const OutputHandler::OutFiles  out)

Definition at line 455 of file output.cc.

References flags, MBDYN_EXCEPT_ARGS, OutData, OUTPUT_MAY_USE_TEXT, and OUTPUT_USE_TEXT.

456 {
457  if (!(OutData[out].flags & OUTPUT_MAY_USE_TEXT)) {
459  }
460 
461  OutData[out].flags |= OUTPUT_USE_TEXT;
462 }
unsigned flags
Definition: output.h:139
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
struct OutputHandler::@34 OutData[LASTFILE]
void OutputHandler::SetWidth ( int  iNewWidth)

Definition at line 647 of file output.cc.

References ASSERT, iCurrPrecision, iCurrWidth, IsOpen(), iWidth, LASTFILE, OutData, and UseDefaultPrecision().

648 {
649  ASSERT(iNewWidth > iWidth);
650  if (iNewWidth > iWidth) {
651  iCurrWidth = iNewWidth;
653  for (int iCnt = 0; iCnt < LASTFILE; iCnt++) {
654  if (UseDefaultPrecision(iCnt) && IsOpen(iCnt)) {
655  OutData[iCnt].pof->width(iCurrWidth);
656  OutData[iCnt].pof->precision(iCurrPrecision);
657  }
658  }
659  }
660 }
const int iWidth
Definition: output.cc:644
struct OutputHandler::@34 OutData[LASTFILE]
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
int iCurrWidth
Definition: output.h:184
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
int iCurrPrecision
Definition: output.h:185

Here is the call graph for this function:

std::ostream & OutputHandler::StrNodes ( void  ) const
inline

Definition at line 401 of file output.h.

References ASSERT, IsOpen(), ofStrNodes, and STRNODES.

Referenced by StructDispNode::Output(), and StructNode::Output().

402 {
404  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofStrNodes));
405 }
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977
std::ofstream ofStrNodes
Definition: output.h:152

Here is the call graph for this function:

std::ostream & OutputHandler::ThermalElements ( void  ) const
inline

Definition at line 422 of file output.h.

References ASSERT, IsOpen(), ofThermalElements, and THERMALELEMENTS.

423 {
425  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofThermalElements));
426 }
std::ofstream ofThermalElements
Definition: output.h:176
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::ThermalNodes ( void  ) const
inline

Definition at line 415 of file output.h.

References ASSERT, IsOpen(), ofThermalNodes, and THERMALNODES.

416 {
418  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofThermalNodes));
419 }
std::ofstream ofThermalNodes
Definition: output.h:175
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

std::ostream & OutputHandler::Traces ( void  ) const
inline

Definition at line 608 of file output.h.

References ASSERT, IsOpen(), ofTraces, and TRACES.

Referenced by DriveCaller::Trace().

609 {
610  ASSERT(IsOpen(TRACES));
611  return const_cast<std::ostream &>(dynamic_cast<const std::ostream &>(ofTraces));
612 }
std::ofstream ofTraces
Definition: output.h:181
bool IsOpen(int out) const
Definition: output.cc:395
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

bool OutputHandler::UseDefaultPrecision ( int  out) const
private

Definition at line 431 of file output.cc.

References ASSERT, LASTFILE, and UNKNOWN.

Referenced by Open(), RestartOpen(), SetPrecision(), and SetWidth().

432 {
435 
437 }
#define ASSERT(expression)
Definition: colamd.c:977
bool UseDefaultPrecision(int out) const
Definition: output.cc:431
bool OutputHandler::UseDefaultPrecision ( const OutputHandler::OutFiles  out) const

Definition at line 440 of file output.cc.

References flags, OutData, and OUTPUT_USE_DEFAULT_PRECISION.

441 {
443 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
bool OutputHandler::UseNetCDF ( int  out) const
private

Definition at line 491 of file output.cc.

References ASSERT, LASTFILE, and UNKNOWN.

Referenced by DataManager::ElemOutputPrepare(), DataManager::NodeOutputPrepare(), AbsoluteDispForce::Output(), InLineJoint::Output(), PrismaticJoint::Output(), SphericalHingeJoint::Output(), DeformableDispJoint::Output(), DeformableHingeJoint::Output(), DeformableJoint::Output(), Rod::Output(), Inertia::Output(), AbsoluteInternalDispForce::Output(), AutomaticStructDispElem::Output(), PlaneHingeJoint::Output(), UniversalRotationJoint::Output(), TotalJoint::Output(), StructDispNode::Output(), AbsoluteForce::Output(), Beam2::Output(), AutomaticStructElem::Output(), PlaneRotationJoint::Output(), Wheel4::Output(), FollowerForce::Output(), Beam::Output(), AbsoluteCouple::Output(), DataManager::Output(), TotalPinJoint::Output(), FollowerCouple::Output(), AxialRotationJoint::Output(), AbsoluteInternalForce::Output(), FollowerInternalForce::Output(), AbsoluteInternalCouple::Output(), FollowerInternalCouple::Output(), StructNode::Output(), Aerodynamic2DElem< iNN >::Output_int(), DataManager::OutputEigenvectors(), DataManager::OutputEigFullMatrices(), DataManager::OutputEigGeometry(), DataManager::OutputEigNaiveMatrices(), DataManager::OutputEigParams(), DataManager::OutputEigPrepare(), DataManager::OutputEigSparseMatrices(), AbsoluteDispForce::OutputPrepare(), InLineJoint::OutputPrepare(), PrismaticJoint::OutputPrepare(), Inertia::OutputPrepare(), SphericalHingeJoint::OutputPrepare(), DeformableDispJoint::OutputPrepare(), DeformableHingeJoint::OutputPrepare(), DeformableJoint::OutputPrepare(), Rod::OutputPrepare(), AbsoluteInternalDispForce::OutputPrepare(), AutomaticStructDispElem::OutputPrepare(), PlaneHingeJoint::OutputPrepare(), UniversalRotationJoint::OutputPrepare(), TotalJoint::OutputPrepare(), Aerodynamic2DElem< iNN >::OutputPrepare(), StructDispNode::OutputPrepare(), Beam2::OutputPrepare(), AbsoluteForce::OutputPrepare(), AutomaticStructElem::OutputPrepare(), PlaneRotationJoint::OutputPrepare(), Wheel4::OutputPrepare(), FollowerForce::OutputPrepare(), Beam::OutputPrepare(), AbsoluteCouple::OutputPrepare(), DataManager::OutputPrepare(), TotalPinJoint::OutputPrepare(), FollowerCouple::OutputPrepare(), AxialRotationJoint::OutputPrepare(), AbsoluteInternalForce::OutputPrepare(), FollowerInternalForce::OutputPrepare(), AbsoluteInternalCouple::OutputPrepare(), FollowerInternalCouple::OutputPrepare(), and StructNode::OutputPrepare().

492 {
495 
496  return UseNetCDF(OutputHandler::OutFiles(out));
497 }
bool UseNetCDF(int out) const
Definition: output.cc:491
#define ASSERT(expression)
Definition: colamd.c:977
bool OutputHandler::UseNetCDF ( const OutputHandler::OutFiles  out) const

Definition at line 530 of file output.cc.

References flags, OutData, and OUTPUT_USE_NETCDF.

531 {
532  return (OutData[out].flags & OUTPUT_USE_NETCDF);
533 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
bool OutputHandler::UseScientific ( int  out) const
private

Definition at line 416 of file output.cc.

References ASSERT, LASTFILE, and UNKNOWN.

Referenced by Open(), and RestartOpen().

417 {
420 
422 }
bool UseScientific(int out) const
Definition: output.cc:416
#define ASSERT(expression)
Definition: colamd.c:977
bool OutputHandler::UseScientific ( const OutputHandler::OutFiles  out) const

Definition at line 425 of file output.cc.

References flags, OutData, and OUTPUT_USE_SCIENTIFIC.

426 {
427  return (OutData[out].flags & OUTPUT_USE_SCIENTIFIC);
428 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]
bool OutputHandler::UseText ( int  out) const
private

Definition at line 446 of file output.cc.

References ASSERT, LASTFILE, and UNKNOWN.

Referenced by Open(), HydrodynamicPlainBearing::Output(), InlineFriction::Output(), AbsoluteDispForce::Output(), asynchronous_machine::Output(), InLineJoint::Output(), PrismaticJoint::Output(), SphericalHingeJoint::Output(), DeformableDispJoint::Output(), ModalMappingExt::Output(), DeformableHingeJoint::Output(), DeformableJoint::Output(), StructExtForce::Output(), Inertia::Output(), StructMappingExtForce::Output(), AbsoluteInternalDispForce::Output(), AutomaticStructDispElem::Output(), PlaneHingeJoint::Output(), UniformGravity::Output(), AbstractForce::Output(), ModalExt::Output(), CentralGravity::Output(), UniversalRotationJoint::Output(), TotalJoint::Output(), AbstractInternalForce::Output(), StructDispNode::Output(), AbsoluteForce::Output(), Beam2::Output(), AutomaticStructElem::Output(), Membrane4EAS::Output(), PlaneRotationJoint::Output(), AerodynamicBody::Output(), Wheel4::Output(), FollowerForce::Output(), Beam::Output(), Shell4EAS::Output(), AbsoluteCouple::Output(), Shell4EASANS::Output(), AerodynamicBeam::Output(), TotalPinJoint::Output(), FollowerCouple::Output(), AxialRotationJoint::Output(), DriveCaller::Output(), AerodynamicBeam2::Output(), AbsoluteInternalForce::Output(), FollowerInternalForce::Output(), AbsoluteInternalCouple::Output(), FollowerInternalCouple::Output(), StructNode::Output(), DataManager::OutputEigenvectors(), DataManager::OutputEigFullMatrices(), DataManager::OutputEigGeometry(), DataManager::OutputEigNaiveMatrices(), DataManager::OutputEigParams(), DataManager::OutputEigSparseMatrices(), and DriveCaller::Trace().

447 {
450 
451  return UseText(OutputHandler::OutFiles(out));
452 }
#define ASSERT(expression)
Definition: colamd.c:977
bool UseText(int out) const
Definition: output.cc:446
bool OutputHandler::UseText ( const OutputHandler::OutFiles  out) const

Definition at line 485 of file output.cc.

References flags, OutData, and OUTPUT_USE_TEXT.

486 {
487  return (OutData[out].flags & OUTPUT_USE_TEXT);
488 }
unsigned flags
Definition: output.h:139
struct OutputHandler::@34 OutData[LASTFILE]

Member Data Documentation

long OutputHandler::currentStep
private

Definition at line 107 of file output.h.

Referenced by GetCurrentStep(), IncCurrentStep(), OutputHandler_int(), and SetCurrentStep().

unsigned OutputHandler::flags
int OutputHandler::iCurrPrecision
private

Definition at line 185 of file output.h.

Referenced by iP(), Open(), RestartOpen(), SetPrecision(), and SetWidth().

int OutputHandler::iCurrWidth
private

Definition at line 184 of file output.h.

Referenced by iW(), SetPrecision(), and SetWidth().

int OutputHandler::nCurrRestartFile
private

Definition at line 186 of file output.h.

Referenced by RestartOpen().

std::ofstream OutputHandler::ofAbstract
private

Definition at line 154 of file output.h.

Referenced by Abstract(), and OutputHandler_int().

std::ofstream OutputHandler::ofAerodynamic
private

Definition at line 162 of file output.h.

Referenced by Aerodynamic(), and OutputHandler_int().

std::ofstream OutputHandler::ofAeroModals
private

Definition at line 168 of file output.h.

Referenced by AeroModals(), and OutputHandler_int().

std::ofstream OutputHandler::ofAirProps
private

Definition at line 171 of file output.h.

Referenced by AirProps(), and OutputHandler_int().

std::ofstream OutputHandler::ofBeams
private

Definition at line 158 of file output.h.

Referenced by Beams(), and OutputHandler_int().

std::ofstream OutputHandler::ofDofStats
private

Definition at line 179 of file output.h.

Referenced by DofStats(), and OutputHandler_int().

std::ofstream OutputHandler::ofDriveCallers
private

Definition at line 180 of file output.h.

Referenced by DriveCallers(), and OutputHandler_int().

std::ofstream OutputHandler::ofEigenanalysis
private

Definition at line 182 of file output.h.

Referenced by Eigenanalysis(), and OutputHandler_int().

std::ofstream OutputHandler::ofElectric
private

Definition at line 153 of file output.h.

Referenced by Electric(), and OutputHandler_int().

std::ofstream OutputHandler::ofExternals
private

Definition at line 173 of file output.h.

Referenced by Externals(), and OutputHandler_int().

std::ofstream OutputHandler::ofForces
private

Definition at line 157 of file output.h.

Referenced by Forces(), and OutputHandler_int().

std::ofstream OutputHandler::ofGenels
private

Definition at line 166 of file output.h.

Referenced by Genels(), and OutputHandler_int().

std::ofstream OutputHandler::ofGravity
private

Definition at line 178 of file output.h.

Referenced by Gravity(), and OutputHandler_int().

std::ofstream OutputHandler::ofHydraulic
private

Definition at line 163 of file output.h.

Referenced by Hydraulic(), and OutputHandler_int().

std::ofstream OutputHandler::ofInertia
private

Definition at line 155 of file output.h.

Referenced by Inertia(), and OutputHandler_int().

std::ofstream OutputHandler::ofJoints
private

Definition at line 156 of file output.h.

Referenced by Joints(), and OutputHandler_int().

std::ofstream OutputHandler::ofLoadable
private

Definition at line 165 of file output.h.

Referenced by Loadable(), and OutputHandler_int().

std::ofstream OutputHandler::ofLog
private

Definition at line 170 of file output.h.

Referenced by Log(), and OutputHandler_int().

std::ofstream OutputHandler::ofModal
private

Definition at line 174 of file output.h.

Referenced by Modal(), and OutputHandler_int().

std::ofstream OutputHandler::ofOutput
private

Definition at line 151 of file output.h.

Referenced by Output(), and OutputHandler_int().

std::ofstream OutputHandler::ofParameters
private

Definition at line 172 of file output.h.

Referenced by OutputHandler_int(), and Parameters().

std::ofstream OutputHandler::ofPartition
private

Definition at line 167 of file output.h.

Referenced by OutputHandler_int(), and Partition().

std::ofstream OutputHandler::ofPlates
private

Definition at line 177 of file output.h.

Referenced by OutputHandler_int(), and Plates().

std::ofstream OutputHandler::ofPresNodes
private

Definition at line 164 of file output.h.

Referenced by OutputHandler_int(), and PresNodes().

std::ofstream OutputHandler::ofReferenceFrames
private

Definition at line 169 of file output.h.

Referenced by OutputHandler_int(), and ReferenceFrames().

std::ofstream OutputHandler::ofRestart
private

Definition at line 160 of file output.h.

Referenced by OutputHandler_int(), and Restart().

std::ofstream OutputHandler::ofRestartXSol
private

Definition at line 161 of file output.h.

Referenced by OutputHandler_int(), and RestartXSol().

std::ofstream OutputHandler::ofRotors
private

Definition at line 159 of file output.h.

Referenced by OutputHandler_int(), and Rotors().

std::ofstream OutputHandler::ofStrNodes
private

Definition at line 152 of file output.h.

Referenced by OutputHandler_int(), and StrNodes().

std::ofstream OutputHandler::ofThermalElements
private

Definition at line 176 of file output.h.

Referenced by OutputHandler_int(), and ThermalElements().

std::ofstream OutputHandler::ofThermalNodes
private

Definition at line 175 of file output.h.

Referenced by OutputHandler_int(), and ThermalNodes().

std::ofstream OutputHandler::ofTraces
private

Definition at line 181 of file output.h.

Referenced by OutputHandler_int(), and Traces().

std::ofstream* OutputHandler::pof

Definition at line 138 of file output.h.

Referenced by Open(), RestartOpen(), and SetExceptions().


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