198 DEBUGCOUT(
"Entering DataManager::ElemManagerDestructor()" << std::endl);
202 DEBUGCOUT(
"deleting assembly structure, SubMatrix B" << std::endl);
207 DEBUGCOUT(
"deleting assembly structure, SubMatrix A" << std::endl);
212 DEBUGCOUT(
"deleting assembly structure, SubVector" << std::endl);
216 for (ElemVecType::iterator p =
Elems.begin(); p !=
Elems.end(); ++p) {
219 <<
"(" << (*p)->GetLabel() <<
")"
239 DEBUGCOUT(
"deleting drivers structure" << std::endl);
250 unsigned iTotElem = 0;
257 DEBUGCOUT(
"iTotElem = " << iTotElem << std::endl);
264 Elems.resize(iTotElem);
270 for (
unsigned iCnt = 0; iCnt < iTotElem; iCnt++) {
275 silent_cerr(
"warning, no elements are defined" << std::endl);
305 for (
int iCnt = 0; iCnt < Drive::LASTDRIVETYPE-1; iCnt++) {
312 DEBUGCERR(
"warning, no drivers are defined" << std::endl);
344 iNumRows = std::abs(iNumRows);
347 const integer iNumItems = iNumRows * iNumCols;
394 DEBUGCOUT(
"Entering DataManager::AssJac()" << std::endl);
407 DEBUGCOUT(
"Entering DataManager::AssJac()" << std::endl);
414 if (JacHdl(r,
c) != 0.) {
415 silent_cerr(
"JacHdl(" << r <<
"," <<
c <<
")="
416 << JacHdl(r,
c) << std::endl);
418 JacHdl(r,
c) = std::numeric_limits<doublereal>::epsilon();
427 JacHdl += pTmpEl->
AssJac(WorkMat, dCoef,
431 silent_cerr(
"AssJac: divide by zero "
440 silent_cerr(JacHdl << std::endl);
449 DEBUGCOUT(
"Entering DataManager::AssMats()" << std::endl);
464 DEBUGCOUT(
"Entering DataManager::AssMats()" << std::endl);
488 pTmpEl->
AssMats(WorkMatA, WorkMatB,
500 DEBUGCOUT(
"Entering AssRes()" << std::endl);
510 DEBUGCOUT(
"Entering AssRes()" << std::endl);
513 bool ChangedEqStructure(
false);
517 ResHdl += pTmpEl->
AssRes(WorkVec, dCoef,
522 ChangedEqStructure =
true;
525 silent_cerr(
"AssRes: divide by zero "
539 if (ChangedEqStructure) {
556 OutputHandler::AttrValVec attrs(1);
557 attrs[0] = OutputHandler::AttrVal(
"description", std::string(
ElemData[et].Desc) +
" elements labels");
559 OutputHandler::NcDimVec dim(1);
560 dim[0] = OH.CreateDim(std::string(
ElemData[et].ShortDesc) +
"_elem_labels_dim", iNumElems);
562 NcVar *VarLabels = OH.CreateVar(std::string(
"elem.") +
ElemData[et].ShortDesc, ncInt, attrs, dim);
565 for (
unsigned i = 0; i < unsigned(iNumElems); i++, p++) {
567 const long l = p->second->GetLabel();
568 VarLabels->
put(&l, 1);
602 pTmpEl->
Output(OH, X, XP);
611 if (
ElemData[Typ].bIsUnique() && uL == (
unsigned)(-1)) {
612 if (!
ElemData[Typ].ElemMapToList.empty()) {
619 if (p ==
ElemData[Typ].ElemMapToList.end()) {
623 return p->second->second;
631 if (
ElemData[Typ].bIsUnique() && uL == (
unsigned)(-1)) {
632 if (!
ElemData[Typ].ElemMapToList.empty()) {
641 if (p ==
ElemData[Typ].ElemMapToList.end()) {
645 return const_cast<Elem **
>(&p->second->second);
651 unsigned int iDeriv)
const
655 if (
ElemData[Typ].bIsUnique() && uL == (
unsigned)(-1)) {
656 if (!
ElemData[Typ].ElemMapToList.empty()) {
665 if (p ==
ElemData[Typ].ElemMapToList.end()) {
683 ASSERT(dynamic_cast<ElemWithDofs *>(p) != NULL);
687 ASSERT(dynamic_cast<ElemGravityOwner *>(p) != NULL);
691 ASSERT(dynamic_cast<AerodynamicElem *>(p) != NULL);
695 ASSERT(dynamic_cast<InitialAssemblyElem *>(p) != NULL);
710 silent_cerr(
"FileDrive(" << uL <<
"): "
711 "no file drivers defined" << std::endl);
716 silent_cerr(
"FileDrive(" << uL <<
"): "
717 "file drivers can only be dereferenced "
718 "after the \"drivers\" block" << std::endl);
740 m_FirstType(
Elem::UNKNOWN),
741 m_CurrType(
Elem::UNKNOWN)
745 while (!(*
pElemData)[iCnt].bToBeUsedInAssembly()
746 || (*
pElemData)[iCnt].ElemContainer.empty())
748 if (++iCnt >= Elem::LASTELEMTYPE) {
755 ASSERT(iCnt < Elem::LASTELEMTYPE);
756 ASSERT((*
pElemData)[iCnt].ElemContainer.begin() != (*pElemData)[iCnt].ElemContainer.end());
803 }
while (!(*
pElemData)[iCnt].bToBeUsedInAssembly()
804 || (*
pElemData)[iCnt].ElemContainer.empty());
806 ASSERT((*
pElemData)[iCnt].ElemContainer.begin() != (*pElemData)[iCnt].ElemContainer.end());
808 m_CurrElem = (*pElemData)[iCnt].ElemContainer.begin();
824 <<
"(" <<
m_CurrElem->second->GetLabel() <<
")"
825 " is not subjected to initial assembly"
integer iMaxWorkNumItemsJac
Drive * pFindDrive(Drive::Type Typ, unsigned int uL) const
unsigned int iExpectedNum
ElemContainerType ElemContainer
virtual integer iGetNumCols(void) const =0
NcBool set_cur(long c0=-1, long c1=-1, long c2=-1, long c3=-1, long c4=-1)
VariableSubMatrixHandler * pWorkMatA
#define MBDYN_EXCEPT_ARGS
DofOwner::Type DofOwnerType
bool bGetNext(T &TReturn) const
bool UseNetCDF(int out) const
OrientationDescription od
integer iMaxWorkNumRowsRes
const DataManager::ElemDataStructure(* pElemData)[Elem::LASTELEMTYPE]
struct DataManager::@29 DriveData[Drive::LASTDRIVETYPE]
flag fGetDefaultOutputFlag(const Elem::Type &t) const
#define SAFEDELETEARR(pnt)
MySubVectorHandler * pWorkVec
virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef)
VariableSubMatrixHandler * pWorkMatB
virtual Elem::Type GetElemType(void) const =0
void ElemOutput(OutputHandler &OH) const
Elem * pChooseElem(Elem *p, unsigned int iDeriv) const
DataManager::ElemContainerType::const_iterator m_CurrElem
bool bDefaultOut(void) const
virtual void Reset(void)=0
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
T * pLabelSearch(T **const p, int iSize, unsigned int uL)
integer iMaxWorkNumRowsJac
void ElemManagerDestructor(void)
InitialAssemblyIterator(const DataManager::ElemDataStructure(*pED)[Elem::LASTELEMTYPE])
virtual void AssJac(MatrixHandler &JacHdl, doublereal dCoef)
integer iMaxWorkNumColsJac
VectorHandler * pXPrimeCurr
bool IsOpen(int out) const
virtual void OutputPrepare(OutputHandler &OH)
#define ASSERT(expression)
Elem ** ppFindElem(Elem::Type Typ, unsigned int uElem) const
VecIter< Elem * > ElemIter
ElemMapToListType ElemMapToList
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
InitialAssemblyElem * GetNext(void) const
void ElemOutputPrepare(OutputHandler &OH)
static std::stack< cleanup * > c
virtual void PrintResidual(const VectorHandler &Res, integer iIterCnt) const
void Init(const T *p, unsigned i)
OutputHandler::OutFiles OutFile
virtual void Output(OutputHandler &OH) const
const char * psElemNames[]
void ToBeUsedInAssembly(bool b)
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
virtual void AssMats(VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
void GeneratesInertiaForces(bool b)
#define SAFENEWARR(pnt, item, sz)
void UsesAirProperties(bool b)
bool bGetFirst(T &TReturn) const
InitialAssemblyElem * GetFirst(void) const
virtual void AssMats(MatrixHandler &A_Hdl, MatrixHandler &B_Hdl)
virtual Elem * pGetElem(void) const
unsigned int GetLabel(void) const
struct DataManager::ElemDataStructure ElemData[Elem::LASTELEMTYPE]
#define DEBUGLCOUT(level, msg)
NcBool put(const ncbyte *vals, long c0=0, long c1=0, long c2=0, long c3=0, long c4=0)
VariableSubMatrixHandler * pWorkMat
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)=0
virtual integer iGetNumRows(void) const =0
const char * psDriveNames[]