45 const std::vector<unsigned int>& modeList,
46 std::vector<DriveCaller *>& f,
66 for (
unsigned i = 0; i <
f.size(); i++) {
96 for (
integer iCnt = 1; iCnt <= 6; iCnt++) {
108 for (
unsigned iMode = 0; iMode <
modeList.size(); iMode++) {
129 std::ostream& out = OH.
Forces();
134 out <<
" " <<
F <<
" " <<
M;
137 for (std::vector<DriveCaller *>::const_iterator i =
f.begin(); i !=
f.end(); ++i) {
138 out <<
" " << (*i)->
dGet();
151 std::vector<unsigned int> modeList;
153 const std::vector<unsigned int>& uModeList = pModal->
GetModeList();
154 std::vector<bool> gotIt(pModal->
uGetNModes());
159 int iNumModes = HP.
GetInt();
160 if (iNumModes <= 0 || iNumModes > pModal->
uGetNModes()) {
161 silent_cerr(
"ModalForce(" << uLabel <<
"): "
162 "illegal mode number " << iNumModes
166 modeList.resize(iNumModes);
168 for (
int i = 0; i < iNumModes; i++) {
171 silent_cerr(
"ModalForce(" << uLabel <<
"): "
172 "illegal mode " << iM
178 std::vector<unsigned int>::const_iterator
179 iv = std::find(uModeList.begin(), uModeList.end(), (
unsigned int)iM);
180 if (iv == uModeList.end()) {
181 silent_cerr(
"ModalForce(" << uLabel <<
"): "
182 "mode " << iM <<
" not active "
183 "in Modal(" << pModal->
GetLabel() <<
")"
187 int iModeIdx = iv - uModeList.begin();
189 if (gotIt[iModeIdx]) {
190 silent_cerr(
"ModalForce(" << uLabel <<
"): "
191 "mode " << iModeIdx <<
" already set "
196 modeList[i] = iModeIdx + 1;
197 gotIt[iModeIdx] =
true;
207 std::vector<DriveCaller *> f(modeList.size());
212 Mt =
new Mat3xN(modeList.size(), 0.);
213 Mr =
new Mat3xN(modeList.size(), 0.);
215 for (
unsigned i = 0; i < f.size(); i++) {
218 silent_cerr(
"ModalForce(" << uLabel <<
"): "
219 "unable to read DriveCaller for mode #" << i + 1
220 <<
" (mode number " << modeList[i] <<
") "
225 if (pNode && HP.
IsKeyWord(
"resultant")) {
226 for (
unsigned r = 1; r <= 3; r++) {
227 (*Mt)(r, i + 1) = HP.
GetReal();
230 for (
unsigned r = 1; r <= 3; r++) {
231 (*Mr)(r, i + 1) = HP.
GetReal();
239 ModalForce(uLabel, pModal, modeList, f, Mt, Mr, fOut));
flag fReadOutput(MBDynParser &HP, const T &t) const
const ModalNode * pGetModalNode(void) const
const Vec3 Zero3(0., 0., 0.)
virtual bool bToBeOutput(void) const
#define MBDYN_EXCEPT_ARGS
virtual void ResizeReset(integer)
virtual integer GetInt(integer iDefval=0)
virtual const Mat3x3 & GetRCurr(void) const
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
std::vector< unsigned int > modeList
integer uGetNModes(void) const
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
virtual void Output(OutputHandler &OH) const
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
Elem * ReadModalForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Vec3 GetVec(integer iCol) const
virtual bool IsKeyWord(const char *sKeyWord)
const doublereal & dGet(unsigned short int iRow) const
virtual integer iGetFirstMomentumIndex(void) const =0
#define ASSERT(expression)
std::vector< DriveCaller * > f
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual ~ModalForce(void)
integer iGetModalIndex(void) const
virtual void Put(integer iRow, const Vec3 &v)
ModalForce(unsigned int uL, const Modal *pmodal, const std::vector< unsigned int > &modeList, std::vector< DriveCaller * > &f, const Mat3xN *Mt, const Mat3xN *Mr, flag fOut)
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
DriveCaller * GetDriveCaller(bool bDeferred=false)
virtual HighParser::ErrOut GetLineData(void) const
unsigned int GetLabel(void) const
const std::vector< unsigned int > & GetModeList(void) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
std::ostream & Forces(void) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)