44 #if defined(USE_RUNTIME_LOADING) && defined(HAVE_LTDL_H)
46 #endif // USE_RUNTIME_LOADING && HAVE_LTDL_H
94 const char* sOutputFileName,
95 const char* sInputFileName,
96 bool bAbortAfterInput)
99 #ifdef USE_MULTITHREAD
103 MathPar(HP.GetMathParser()),
105 DrvHdl(HP.GetMathParser()),
106 OutHdl(sOutputFileName, 0),
107 pXCurr(0), pXPrimeCurr(0),
113 bOutputFrames(
false),
114 bOutputAccels(
false),
115 bOutputDriveCaller(
false),
122 CurrSolver(pS->GetLinearSolver()),
127 iIDNodeTotNumDofs(0),
128 iIDJointTotNumDofs(0),
129 #
if defined(USE_RUNTIME_LOADING)
130 moduleInitialized(
false),
132 uPrintFlags(PRINT_NONE),
135 iRestartIterations(0),
141 dLastRestartTime(dInitialTime),
153 bNetCDFnoText(
false),
170 SocketUsersTimeout(0),
177 iMaxWorkNumRowsRes(1),
178 iMaxWorkNumRowsJac(1),
179 iMaxWorkNumColsJac(1),
180 iMaxWorkNumItemsJac(1),
225 SetTime(dInitialTime, 0., 0,
false);
239 const char* sKeyWords[] = {
267 if (CurrDesc != BEGIN) {
269 silent_cerr(
"<begin> expected at line "
277 silent_cerr(
"<begin: control data;> expected at line "
314 if (CurrDesc != BEGIN) {
316 silent_cerr(
"<begin> expected at line "
324 silent_cerr(
"<begin: nodes;> expected at line "
336 silent_cerr(
"warning, no nodes are defined" << std::endl);
347 bool bGotDrivers =
false;
349 if (CurrDesc != BEGIN) {
351 silent_cerr(
"\"begin\" expected at line "
359 silent_cerr(
"\"begin: drivers;\" expected at line "
373 DEBUGCERR(
"warning, no drivers are defined" << std::endl);
383 if (!
Elems.empty()) {
384 if (CurrDesc != BEGIN) {
386 silent_cerr(
"\"begin\" expected at line "
398 silent_cerr(
"got unexpected \"begin: drivers;\" "
400 <<
"(hint: define \"file drivers\" in \"control data\" block)"
407 silent_cerr(
"\"begin: elements;\" expected at line "
423 silent_cerr(
"warning, no elements are defined" << std::endl);
438 for (NodeContainerType::const_iterator n =
NodeData[i].NodeContainer.begin();
441 if (n->second->bToBeOutput()) {
454 for (ElemContainerType::const_iterator e =
ElemData[i].ElemContainer.begin();
457 if (e->second->bToBeOutput()) {
467 for (MBDynParser::DCType::const_iterator i = DC.begin(); i != DC.end(); ++i) {
468 if (i->second->fToBeTraced()) {
474 for (MBDynParser::DCType::const_iterator i = DC.begin(); i != DC.end(); ++i) {
475 if (i->second->bToBeOutput()) {
486 std::cout <<
"DofType " << i <<
" "
488 "n. of owners: " <<
DofData[i].iNum
494 std::cout <<
"NodeType " << i <<
" "
502 std::cout <<
"Element Type " << i <<
" "
510 std::cout <<
"DriveType " << i <<
" "
518 if (bAbortAfterInput) {
519 silent_cout(
"Only input is required" << std::endl);
538 if (
ElemData[i].bToBeUsedInAssembly() && !
ElemData[i].ElemContainer.empty()) {
550 silent_cout(
"Skipping initial joints assembly" << std::endl);
554 silent_cout(
"No initial assembly is required since no joints are defined"
573 std::cout <<
"DofType " << i <<
':' << std::endl;
574 for (
int j = 0; j <
DofData[i].iNum; j++) {
575 std::cout <<
"DofOwner " << j <<
", n. of dofs: "
604 for (
int iCnt = 0; iCnt <
iTotDofs; iCnt++) {
605 std::cout <<
"Dof " << std::setw(4) << iCnt+1 <<
": order "
606 <<
Dofs[iCnt].Order << std::endl;
645 #endif // MBDYN_FDJAC
660 #if defined(USE_RUNTIME_LOADING)
661 if (moduleInitialized) {
664 #endif // USE_RUNTIME_LOADING
696 return (
ResMode & t) ?
true :
false;
701 silent_cout(
"Making restart file ..." << std::endl);
704 time_t tCurrTime(time(0));
706 << ctime(&tCurrTime) << std::endl << std::endl;
709 <<
"# uncomment this line to use the default integrator" << std::endl
710 <<
" integrator: multistep;" << std::endl
711 <<
"end: data;" << std::endl << std::endl
712 <<
"# the following block contains data for the multistep integrator"
721 if (!
NodeData[iCnt].NodeContainer.empty()) {
732 <<
DriveData[iCnt].iNum <<
';' << std::endl;
738 if (!
ElemData[iCnt].ElemContainer.empty()) {
755 <<
"# comment this line if the model is to be modified!" << std::endl
756 <<
" skip initial joint assembly;" << std::endl
757 <<
"# uncomment the following lines to improve the satisfaction of constraints"
764 OutHdl.
Restart() <<
"# uncomment this line if restart file is to be made again"
766 <<
" # make restart file;" << std::endl
767 <<
"# remember: it will replace the present file if you don't change its name"
769 <<
" default output: none";
784 OutHdl.
Restart() <<
"end: control data;" << std::endl << std::endl;
788 for (NodeVecType::const_iterator n =
Nodes.begin(); n !=
Nodes.end(); ++n) {
803 <<
" # file driver " << (*ppTmpDrv)->GetLabel()
804 <<
" is required" << std::endl;
807 OutHdl.
Restart() <<
"end: drivers;" << std::endl << std::endl;
812 for (ElemVecType::const_iterator e =
Elems.begin();
813 e !=
Elems.end(); ++e)
889 DataManager::NodeContainerType::const_iterator
895 DataManager::NodeContainerType::const_iterator
901 DataManager::ElemContainerType::const_iterator
907 DataManager::ElemContainerType::const_iterator
921 silent_cerr(
"DataManager cleanup" << std::endl);
std::ostream & ReferenceFrames(void) const
DataManager(MBDynParser &HP, unsigned OF, Solver *pS, doublereal dInitialTime, const char *sOutputFileName, const char *sInputFileName, bool bAbortAfterInput)
bool PopCurrData(const std::string &name)
bool bOutputDriveCallers(void) const
#define DEBUG_LEVEL_MATCH(level)
MathParser::PlugIn * node_priv_plugin(MathParser &mp, void *arg)
ElemContainerType ElemContainer
const bool bDefaultSkipInitialJointAssembly(false)
#define MBDYN_EXCEPT_ARGS
#define DEBUGCOUTFNAME(fname)
virtual doublereal * pdGetVec(void) const =0
void module_finalize(void)
NamedValue * InsertSym(const char *const s, const Real &v, int redefine=0)
int mbdyn_cleanup_register(mbdyn_cleanup_f handler, void ***datapp)
const DCType & GetDriveCallerContainer(void) const
OrientationDescription od
void SetDrvHdl(DriveHandler *)
struct DataManager::@29 DriveData[Drive::LASTDRIVETYPE]
void ReadControl(MBDynParser &HP, const char *sInputFileName)
void OutputEigOpen(const std::string &postfix)
int RegisterNameSpace(NameSpace *ns)
doublereal dInitialPositionStiffness
bool Close(const OutputHandler::OutFiles out)
void DofManagerDestructor(void)
#define SAFEDELETEARR(pnt)
void ReadNodes(MBDynParser &HP)
void GetOutput(Elem::Type t, unsigned &, OrientationDescription &) const
void SetOrientationDescription(OrientationDescription)
integer iMaxInitialIterations
std::vector< DofOwner > DofOwners
void InitialJointAssembly(void)
virtual integer iGetSize(void) const =0
std::ostream & Restart(std::ostream &out, DataManager::eRestart type) const
const char * psReadControlDrivers[]
NodeContainerType NodeContainer
bool Open(const OutputHandler::OutFiles out)
bool bSkipInitialJointAssembly
void ReadDrivers(MBDynParser &HP)
const bool bDefaultInitialJointAssemblyToBeMade(false)
void SetOutput(Elem::Type t, unsigned, OrientationDescription)
std::map< unsigned, const DriveCaller * > DCType
DataManager::ElemContainerType::const_iterator begin(Elem::Type t) const
void ElemManagerDestructor(void)
DriveCaller * pOutputMeter
void NodeManagerDestructor(void)
virtual void MakeRestart(void)
RigidBodyKinematics * pRBK
struct DataManager::NodeDataStructure NodeData[Node::LASTNODETYPE]
void SetExceptions(std::ios::iostate flags)
const char * psDofOwnerNames[]
void DestroyGustData(void)
void ReadElems(MBDynParser &HP)
int datamanager_cleanup(void *data)
VectorHandler * pXPrimeCurr
bool PushCurrData(const std::string &name, const TypedValue &value)
NamedValue * InsertSym(const char *const s, const Real &v, int redefine=0)
virtual MathParser & GetMathParser(void)
doublereal dInitialAssemblyTol
bool IsOpen(int out) const
#define ASSERT(expression)
OrientationDescription od
std::ostream & RestartXSol(void) const
OrientationDescription GetOrientationDescription(void) const
bool PopCurrData(const std::string &name)
bool bInitialJointAssemblyToBeDone
const char * psReadControlNodes[]
doublereal dInitialVelocityStiffness
const doublereal dDefaultInitialStiffness
bool bOutput(ResType t) const
const bool bDefaultOmegaRotates(false)
void SetTime(const doublereal &dTime, const doublereal &dTimeStep=-1., const integer &iStep=-1, bool bServePending=true)
const integer iDefaultMaxInitialIterations
std::ostream & Restart(void) const
NameSpace * GetNameSpace(const std::string &name) const
const char * psNodeNames[]
MathParser::PlugIn * elem_priv_plugin(MathParser &mp, void *arg)
bool PushCurrData(const std::string &name, const TypedValue &value)
const char * psElemNames[]
virtual int GetWord(void)
MathParser::PlugIn * dof_plugin(MathParser &mp, void *arg)
const char * psReadControlElems[]
void DestroyDriveData(void)
const doublereal dDefaultInitialAssemblyTol
void OutputOpen(const OutputHandler::OutFiles out)
struct DataManager::@30 DofData[DofOwner::LASTDOFTYPE]
int RegisterPlugIn(const char *name, MathParser::PlugIn *(*)(MathParser &, void *), void *arg)
virtual HighParser::ErrOut GetLineData(void) const
Table & GetSymbolTable(void) const
struct DataManager::ElemDataStructure ElemData[Elem::LASTELEMTYPE]
DataManager::ElemContainerType::const_iterator end(Elem::Type t) const
#define DEBUGLCOUT(level, msg)
bool RestartOpen(bool openResXSol=false)
virtual ~DataManager(void)
void OutputFrames(std::ostream &out) const
bool bOutputAccelerations(void) const
const char * psDriveNames[]