91 #ifdef USE_MULTITHREAD
93 unsigned int nThreads;
137 #ifdef USE_RUNTIME_LOADING
138 bool moduleInitialized;
139 #endif // USE_RUNTIME_LOADING
187 bool bFDJac(
void)
const;
188 #endif // MBDYN_FDJAC
214 const NcDim *m_Dim_Eig_iSize;
215 const NcDim *m_Dim_Eig_iComplex;
217 NcVar *Var_Eig_lStep;
218 NcVar *Var_Eig_dTime;
219 NcVar *Var_Eig_dCoef;
220 NcVar *Var_Eig_dAplus;
221 NcVar *Var_Eig_dAminus;
222 NcVar *Var_Eig_dAlpha;
238 template <
class T> T*
Cast(
Elem *pEl,
bool bActive =
false);
274 const char* sOutputFileName,
275 const char* sInputFileName,
276 bool bAbortAfterInput);
291 template <
class Tbase, Node::Type type>
293 template <
class Tder,
class Tbase, Node::Type type>
295 template <
class Tbase, Elem::Type type>
297 template <
class Tder,
class Tbase, Elem::Type type>
305 const integer& iStep = -1,
bool bServePending =
true);
421 const doublereal& dTimeStep,
bool force =
false)
const;
432 const unsigned uCurrEigSol,
433 const int iResultsPrecision);
437 const unsigned uCurrEigSol,
438 const int iMatrixPrecision);
442 const unsigned uCurrEigSol,
443 const int iMatrixPrecision);
447 const unsigned uCurrEigSol,
448 const int iMatrixPrecision);
454 const std::vector<bool>& vOut,
455 const unsigned uCurrEigSol,
456 const int iResultsPrecision);
459 const int iResultsPrecision);
471 virtual void Update(
void)
const;
500 std::map<int, UseSocket *> SocketUsers;
501 time_t SocketUsersTimeout;
503 void WaitSocketUsers(
void);
504 void DeleteSocketUsers(
void);
507 void RegisterSocketUser(UseSocket *pUS);
549 unsigned int uLabel,
int CurrType)
const = 0;
552 typedef std::map<std::string, DataManager::ElemRead *, ltstrcase>
ElemReadType;
596 eldata.
ElemContainer.push_back(ElemContainerType::value_type(uLabel, pE));
603 typedef std::map<std::string, ElemDataStructure *, ltstrcase> ElemDataMapType;
604 ElemDataMapType ElemDataMap;
637 unsigned int iDeriv)
const;
646 const std::string& sName,
656 template <
class Tbase, Elem::Type type>
657 Tbase *
pFindElem(
unsigned int uElem =
unsigned(-1))
const;
658 template <
class Tder,
class Tbase, Elem::Type type>
659 Tder *
pFindElem(
unsigned int uElem =
unsigned(-1))
const;
664 std::vector<doublereal>&
GetBufIn(
unsigned uL);
665 const std::vector<doublereal>&
GetBufOut(
unsigned uL)
const;
694 DataManager::ElemContainerType::const_iterator
begin(
Elem::Type t)
const;
695 DataManager::ElemContainerType::const_iterator
end(
Elem::Type t)
const;
704 unsigned int uLabel,
int CurrType)
const = 0;
707 typedef std::map<std::string, DataManager::NodeRead *, ltstrcase>
NodeReadType;
736 nodedata.
NodeContainer.push_back(NodeContainerType::value_type(uLabel, pN));
755 template <
class Tbase, Node::Type type>
756 Tbase *
pFindNode(
unsigned int uNode)
const;
757 template <
class Tder,
class Tbase, Node::Type type>
758 Tder *
pFindNode(
unsigned int uNode)
const;
771 DataManager::NodeContainerType::const_iterator
begin(
Node::Type t)
const;
772 DataManager::NodeContainerType::const_iterator
end(
Node::Type t)
const;
841 DataOut *pFirstDataOut;
843 } OutData[OutData::LASTDATAOUTTYPE];
848 void OutManager(
void);
849 void OutManagerDestructor(
void);
879 T *pT =
dynamic_cast<T *
>(pEl);
884 silent_cerr(
"unable to cast "
886 <<
"(" << pEl->
GetLabel() <<
") as \"" << mbdyn_demangle<T>() <<
"\" (not driven)" << std::endl);
891 pedantic_cerr(
"unable to cast "
893 <<
"(" << pEl->
GetLabel() <<
") as \"" << mbdyn_demangle<T>() <<
"\""
894 " (driven but currently inactive)" << std::endl);
898 pT =
dynamic_cast<T *
>(pDE->
pGetElem());
900 pedantic_cerr(
"unable to cast "
902 <<
"(" << pEl->
GetLabel() <<
") as \"" << mbdyn_demangle<T>() <<
"\""
903 " (driven but cast failed)" << std::endl);
910 template <
class Tbase, Node::Type type>
917 silent_cerr(
"DataManager::pFindNode: " <<
psNodeNames[type] <<
"(" << uNode <<
") not found" << std::endl);
921 Tbase *pNodeBase =
dynamic_cast<Tbase *
>(pNode);
922 if (pNodeBase == 0) {
923 silent_cerr(
"DataManager::pFindNode: unable to cast " <<
psNodeNames[type] <<
"(" << pNode->
GetLabel() <<
") "
924 "to \"" << mbdyn_demangle<Tbase>() <<
"\"" << std::endl);
931 template <
class Tder,
class Tbase, Node::Type type>
935 Tbase *pNodeBase = pFindNode<Tbase, type>(uNode);
936 if (pNodeBase == 0) {
940 Tder *pNodeDer =
dynamic_cast<Tder *
>(pNodeBase);
942 silent_cerr(
"DataManager::pFindNode: unable to cast " <<
psNodeNames[type] <<
"(" << pNodeBase->GetLabel() <<
") "
943 "from \"" << mbdyn_demangle<Tbase>() <<
"\" "
944 "to \"" << mbdyn_demangle<Tder>() <<
"\"" << std::endl);
951 template <
class Tbase, Elem::Type type>
958 silent_cerr(
"DataManager::pFindElem: " <<
psElemNames[type] <<
"(" << uElem <<
") not found" << std::endl);
962 Tbase *pElemBase =
dynamic_cast<Tbase *
>(pElem);
963 if (pElemBase == 0) {
964 silent_cerr(
"DataManager::pFindElem: unable to cast " <<
psElemNames[type] <<
"(" << pElem->
GetLabel() <<
") "
965 "to \"" << mbdyn_demangle<Tbase>() <<
"\"" << std::endl);
972 template <
class Tder,
class Tbase, Elem::Type type>
976 Tbase *pElemBase = pFindElem<Tbase, type>(uElem);
977 if (pElemBase == 0) {
981 Tder *pElemDer =
dynamic_cast<Tder *
>(pElemBase);
983 silent_cerr(
"DataManager::pFindElem: unable to cast " <<
psElemNames[type] <<
"(" << pElemBase->GetLabel() <<
") "
984 "from \"" << mbdyn_demangle<Tbase>() <<
"\" "
985 "to \"" << mbdyn_demangle<Tder>() <<
"\"" << std::endl);
992 template <
class Tbase, Node::Type type>
999 Tbase *pNodeBase =
dynamic_cast<Tbase *
>(pNode);
1000 if (pNodeBase == 0) {
1001 silent_cerr(
"DataManager::ReadNode: unable to cast " <<
psNodeNames[type] <<
"(" << pNode->
GetLabel() <<
") "
1002 "to \"" << mbdyn_demangle<Tbase>() <<
"\" at line " << HP.
GetLineData() << std::endl);
1009 template <
class Tder,
class Tbase, Node::Type type>
1013 Tbase *pNodeBase = ReadNode<Tbase, type>(HP);
1016 Tder *pNodeDer =
dynamic_cast<Tder *
>(pNodeBase);
1017 if (pNodeDer == 0) {
1018 silent_cerr(
"DataManager::ReadNode: unable to cast " <<
psNodeNames[type] <<
"(" << pNodeBase->GetLabel() <<
") "
1019 "from \"" << mbdyn_demangle<Tbase>() <<
"\" "
1020 "to \"" << mbdyn_demangle<Tder>() <<
"\" at line " << HP.
GetLineData() << std::endl);
1027 template <
class Tbase, Elem::Type type>
1034 Tbase *pElemBase =
dynamic_cast<Tbase *
>(pElem);
1035 if (pElemBase == 0) {
1036 silent_cerr(
"DataManager::ReadElem: unable to cast " <<
psElemNames[type] <<
"(" << pElem->
GetLabel() <<
") "
1037 "to \"" << mbdyn_demangle<Tbase>() <<
"\" at line " << HP.
GetLineData() << std::endl);
1044 template <
class Tder,
class Tbase, Elem::Type type>
1048 Tbase *pElemBase = ReadElem<Tbase, type>(HP);
1051 Tder *pElemDer =
dynamic_cast<Tder *
>(pElemBase);
1052 if (pElemBase == 0) {
1053 silent_cerr(
"DataManager::ReadElem: unable to cast " <<
psElemNames[type] <<
"(" << pElemBase->GetLabel() <<
") "
1054 "from \"" << mbdyn_demangle<Tbase>() <<
"\" "
1055 "to \"" << mbdyn_demangle<Tder>() <<
"\" at line " << HP.
GetLineData() << std::endl);
1098 mutable DataManager::ElemContainerType::const_iterator
m_CurrElem;
flag fReadOutput(MBDynParser &HP, const T &t) const
void SetScale(VectorHandler &XScale) const
bool IsConverged(void) const
integer iMaxWorkNumItemsJac
DataManager(MBDynParser &HP, unsigned OF, Solver *pS, doublereal dInitialTime, const char *sOutputFileName, const char *sInputFileName, bool bAbortAfterInput)
virtual void IDSetTest(NonlinearSolverTestRange *pResTest, NonlinearSolverTestRange *pSolTest, bool bFullResTest)
bool bOutputDriveCallers(void) const
void bSetInverseDynamics(bool b)
DofVecType::iterator DofIterator
Drive * pFindDrive(Drive::Type Typ, unsigned int uL) const
unsigned int iExpectedNum
ElemContainerType ElemContainer
void OutputEigParams(const doublereal &dTime, const doublereal &dCoef, const unsigned uCurrEigSol, const int iResultsPrecision)
std::vector< doublereal > & GetBufIn(unsigned uL)
VariableSubMatrixHandler * pWorkMatA
T * Cast(Elem *pEl, bool bActive=false)
#define MBDYN_EXCEPT_ARGS
const doublereal * GetBufOutRaw(unsigned uL) const
void NodeOutput(OutputHandler &OH) const
DofOwner::Type DofOwnerType
const doublereal & dGetInitialVelocityStiffness(void) const
OrientationDescription od
std::map< std::string, DataManager::ElemRead *, ltstrcase > ElemReadType
unsigned ConvergedRegister(void)
virtual DofOrder::Order GetEqType(int i) const
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
integer iMaxWorkNumRowsRes
const DataManager::ElemDataStructure(* pElemData)[Elem::LASTELEMTYPE]
struct DataManager::@29 DriveData[Drive::LASTDRIVETYPE]
void ReadControl(MBDynParser &HP, const char *sInputFileName)
void OutputEigOpen(const std::string &postfix)
bool OutputEigClose(void)
flag fGetDefaultOutputFlag(const Elem::Type &t) const
Elem ** InsertElem(ElemDataStructure &eldata, unsigned int uLabel, Elem *pE)
std::vector< Dof > DofVecType
MathParser & GetMathParser(void) const
doublereal dInitialPositionStiffness
bool EndOfSimulation(void) const
doublereal dGetTime(void) const
virtual bool GetBool(bool bDefval=false)
virtual const std::string & GetDofDescription(int i) const
virtual bool Output(long lStep, const doublereal &dTime, const doublereal &dTimeStep, bool force=false) const
virtual void BeforePredict(VectorHandler &X, VectorHandler &XP, VectorHandler &XPrev, VectorHandler &XPPrev) const
Converged_t m_IsConverged
void DofManagerDestructor(void)
MySubVectorHandler * pWorkVec
bool bDefaultOut(void) const
void ReadNodes(MBDynParser &HP)
void ConvergedSet(unsigned idx, Converged::State s)
doublereal dGetDefaultScale(DofOwner::Type t) const
void DriveTrace(OutputHandler &OH) const
const DriveHandler * pGetDrvHdl(void) const
virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef)
VariableSubMatrixHandler * pWorkMatB
void GetOutput(Elem::Type t, unsigned &, OrientationDescription &) const
doublereal * GetBufInRaw(unsigned uL)
const OutputHandler * pGetOutHdl(void) const
void SetOrientationDescription(OrientationDescription)
OrientationDescription ReadOptionalOrientationDescription(DataManager *pDM, MBDynParser &HP)
integer iMaxInitialIterations
void SetLoadableElemModule(std::string, const LoadableCalls *, ModuleInsertMode=MIM_FAIL)
virtual Elem::Type GetElemType(void) const =0
void OutputEigFullMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
void OutputEigGeometry(const unsigned uCurrSol, const int iResultsPrecision)
virtual void DerivativesUpdate(void) const
std::vector< DofOwner > DofOwners
std::map< std::string, const LoadableCalls * > MapOfLoadableElemHandlers
const std::vector< doublereal > & GetBufOut(unsigned uL) const
bool bIsStaticModel(void) const
void ElemOutput(OutputHandler &OH) const
OrientationDescription ReadOrientationDescription(MBDynParser &HP)
void InitialJointAssembly(void)
virtual DofOrder::Order GetDofType(int i) const
const LoadableCalls * GetLoadableElemModule(std::string) const
Elem * pChooseElem(Elem *p, unsigned int iDeriv) const
DataManager::ElemContainerType::const_iterator m_CurrElem
NodeContainerType NodeContainer
bool bDefaultOut(void) const
virtual void AfterConvergence(void) const
bool bGeneratesInertiaForces(void) const
bool bToBeUsedInAssembly(void) const
int ReadScalarDifferentialNode(MBDynParser &HP, unsigned int uLabel, Node::Type type, doublereal &dX, doublereal &dXP) const
int ReadScalarAlgebraicNode(MBDynParser &HP, unsigned int uLabel, Node::Type type, doublereal &dX) const
std::map< unsigned, ElemContainerType::iterator > ElemMapToListType
bool bSkipInitialJointAssembly
virtual void IDAfterConvergence(void) const
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
bool bIsUnique(void) const
virtual void AfterPredict(void) const
void ReadDrivers(MBDynParser &HP)
doublereal dReadScale(MBDynParser &HP, enum DofOwner::Type t) const
VectorHandler * pXPrimePrimeCurr
virtual void OutputEigPrepare(const integer iNumAnalyses, const integer iSize)
void SetValue(VectorHandler &X, VectorHandler &XP)
virtual void PrintSolution(const VectorHandler &Sol, integer iIterCnt) const
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
virtual Elem * Read(const DataManager *pDM, MBDynParser &HP, unsigned int uLabel, int CurrType) const =0
void SetOutput(Elem::Type t, unsigned, OrientationDescription)
std::ostream & GetOutFile(void) const
integer iMaxWorkNumRowsJac
std::pair< unsigned, Node * > KeyNodePair
DataManager::ElemContainerType::const_iterator begin(Elem::Type t) const
void IncElemCount(Elem::Type type)
void ElemManagerDestructor(void)
int iIDGetJointTotNumDofs(void) const
std::vector< Elem * > ElemVecType
DriveCaller * pOutputMeter
void NodeManagerDestructor(void)
virtual void MakeRestart(void)
DofOwner * pFirstDofOwner
virtual bool IsKeyWord(const char *sKeyWord)
doublereal dLastRestartTime
RigidBodyKinematics * pRBK
InitialAssemblyIterator(const DataManager::ElemDataStructure(*pED)[Elem::LASTELEMTYPE])
const VectorHandler * GetpXPCurr(void) const
virtual Elem * Read(const DataManager *pDM, MBDynParser &HP, unsigned int uLabel, int CurrType) const =0
void OutputEigSparseMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
struct DataManager::NodeDataStructure NodeData[Node::LASTNODETYPE]
void bSetStaticModel(bool b)
bool bDoesOmegaRotate(void) const
std::pair< unsigned, Elem * > KeyElemPair
virtual void OutputPrepare(void)
virtual void AssJac(MatrixHandler &JacHdl, doublereal dCoef)
std::vector< Converged::State > Converged_t
int iIDGetNodeTotNumDofs(void) const
integer iMaxWorkNumColsJac
void ReadElems(MBDynParser &HP)
VectorHandler * pXPrimeCurr
bool PushCurrData(const std::string &name, const TypedValue &value)
NamedValue * InsertSym(const char *const s, const Real &v, int redefine=0)
doublereal dInitialAssemblyTol
integer iRestartIterations
virtual clock_t GetCPUTime(void) const
DofVecType::const_iterator DofIterator_const
#define ASSERT(expression)
Elem ** ppFindElem(Elem::Type Typ, unsigned int uElem) const
VecIter< Elem * > ElemIter
OrientationDescription od
ElemMapToListType ElemMapToList
OrientationDescription GetOrientationDescription(void) const
bool PopCurrData(const std::string &name)
bool bInitialJointAssemblyToBeDone
const VectorHandler * GetpXCurr(void) const
VectorHandler * pLambdaCurr
doublereal dInitialVelocityStiffness
virtual void AssConstrJac(MatrixHandler &JacHdl)
const DofVecType & GetDofs(void) const
bool bOutput(ResType t) const
void SetTime(const doublereal &dTime, const doublereal &dTimeStep=-1., const integer &iStep=-1, bool bServePending=true)
InitialAssemblyElem * GetNext(void) const
Elem ** ReadOneElem(MBDynParser &HP, unsigned int uLabel, const std::string &sName, int CurrType)
const DataManager::ElemDataStructure & GetElemDataStructure(Elem::Type Typ) const
void ElemOutputPrepare(OutputHandler &OH)
void OutputEigenvectors(const VectorHandler *pBeta, const VectorHandler &R, const VectorHandler &I, const doublereal &dShiftR, const MatrixHandler *pVL, const MatrixHandler &VR, const std::vector< bool > &vOut, const unsigned uCurrEigSol, const int iResultsPrecision)
virtual void PrintResidual(const VectorHandler &Res, integer iIterCnt) const
const char * psNodeNames[]
OutputHandler::OutFiles OutFile
const RigidBodyKinematics * pGetRBK(void) const
std::ostream & Output(void) const
doublereal * pdRestartTimes
const char * psElemNames[]
const doublereal & dGetInitialPositionStiffness(void) const
void ToBeUsedInAssembly(bool b)
NodeMapToListType NodeMapToList
std::map< unsigned, NodeContainerType::iterator > NodeMapToListType
void SetBufOutRaw(unsigned uL, integer n, const doublereal *p)
std::ostream & GetLogFile(void) const
Node ** InsertNode(NodeDataStructure &nodedata, unsigned int uLabel, Node *pN)
const Solver * GetSolver(void) const
unsigned int iExpectedNum
OutputHandler::OutFiles OutFile
void GeneratesInertiaForces(bool b)
MBDynParser & GetMBDynParser(void) const
virtual void Update(void) const
void DriveOutput(OutputHandler &OH) const
std::ostream & Log(void) const
int datamanager_cleanup(void *)
void UsesAirProperties(bool b)
InitialAssemblyElem * GetFirst(void) const
void SetBufInRaw(unsigned uL, integer n, const doublereal *p)
void OutputOpen(const OutputHandler::OutFiles out)
struct DataManager::@30 DofData[DofOwner::LASTDOFTYPE]
std::map< std::string, DataManager::NodeRead *, ltstrcase > NodeReadType
virtual void AssMats(MatrixHandler &A_Hdl, MatrixHandler &B_Hdl)
virtual void AssConstrRes(VectorHandler &ResHdl, InverseDynamics::Order iOrder)
std::vector< Node * > NodeVecType
virtual Elem * pGetElem(void) const
bool bUsesAirProperties(void) const
std::list< KeyElemPair > ElemContainerType
Node ** ppFindNode(Node::Type Typ, unsigned int uNode) const
void NodeOutputPrepare(OutputHandler &OH)
virtual HighParser::ErrOut GetLineData(void) const
unsigned int GetLabel(void) const
struct DataManager::ElemDataStructure ElemData[Elem::LASTELEMTYPE]
void OutputEigNaiveMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
Node * pFindNode(Node::Type Typ, unsigned int uNode) const
Node * ReadNode(MBDynParser &HP, Node::Type type) const
DataManager::ElemContainerType::const_iterator end(Elem::Type t) const
virtual const std::string & GetEqDescription(int i) const
virtual ~DataManager(void)
VariableSubMatrixHandler * pWorkMat
std::list< KeyNodePair > NodeContainerType
ScalarDof ReadScalarDof(const DataManager *pDM, MBDynParser &HP, bool bDof, bool bOrder)
integer iGetNumDofs(void) const
virtual bool bIsActive(void) const
bool bIsInverseDynamics(void) const
bool bOutputAccelerations(void) const
int iIDGetTotNumDofs(void) const