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

#include <genfilt.h>

Inheritance diagram for GenelStateSpaceSISO:
Collaboration diagram for GenelStateSpaceSISO:

Public Member Functions

 GenelStateSpaceSISO (unsigned int uLabel, const DofOwner *pDO, const ScalarDof &y, ScalarValue *u, unsigned int Order, doublereal *pE, doublereal *pA, doublereal *pB, doublereal *pC, doublereal D, bool bBalance, doublereal *pdX0, doublereal *pdXP0, flag fOutput)
 
virtual ~GenelStateSpaceSISO (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual Genel::Type GetGenelType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void Output (OutputHandler &OH) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Genel
 Genel (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Genel (void)
 
virtual Elem::Type GetElemType (void) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
virtual void SetInitialValue (VectorHandler &X)
 

Protected Attributes

ScalarDof SD_y
 
ScalarValueSV_u
 
unsigned int iNumDofs
 
doublerealpdE
 
doublerealpdA
 
doublerealpdB
 
doublerealpdC
 
doublereal dD
 
doublerealpdX
 
doublerealpdXP
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Additional Inherited Members

- Public Types inherited from Genel
enum  Type {
  UNKNOWN = -1, SWASHPLATE = 0, ROTORTRIM, CLAMP,
  DISTANCE, SPRING, SPRINGSUPPORT, CROSSSPRINGSUPPORT,
  SPRINGDAMPER, SPRINGDAMPERSUPPORT, CROSSSPRINGDAMPERSUPPORT, MASS,
  SCALARFILTER, STATESPACESISO, STATESPACEMIMO, LASTGENELTYPE
}
 
- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 

Detailed Description

Definition at line 42 of file genfilt.h.

Constructor & Destructor Documentation

GenelStateSpaceSISO::GenelStateSpaceSISO ( unsigned int  uLabel,
const DofOwner pDO,
const ScalarDof y,
ScalarValue u,
unsigned int  Order,
doublereal pE,
doublereal pA,
doublereal pB,
doublereal pC,
doublereal  D,
bool  bBalance,
doublereal pdX0,
doublereal pdXP0,
flag  fOutput 
)

Definition at line 49 of file genfilt.cc.

References ASSERT, DEBUGCOUT, iNumDofs, ScalarDof::iOrder, pdA, pdB, pdC, pdE, pdX, pdXP, SAFENEWARR, and SD_y.

63 : Elem(uLabel, fOutput),
64 Genel(uLabel, pDO, fOutput),
65 SD_y(y), SV_u(u),
67 pdE(pE), pdA(pA), pdB(pB), pdC(pC), dD(D),
68 pdX(0), pdXP(0)
69 {
70  ASSERT(Order > 0);
71  ASSERT(pdA != 0);
72  ASSERT(pdB != 0);
73  ASSERT(pdC != 0);
74  ASSERT(SD_y.iOrder == 0);
75  DEBUGCOUT("GenelStateSpaceSISO " << uLabel
76  << ", NumDofs: " << iNumDofs << std::endl);
77 
78 #ifdef USE_LAPACK
79  // try balancing the matrix?
80  if (bBalance) {
81  char JOB = 'S';
82  integer N = Order;
83  integer LDA = Order;
84  integer LDB = Order;
85  integer ILO;
86  integer IHI;
87  integer INFO;
88 
89  std::vector<doublereal> RSCALE(Order);
90  std::vector<doublereal> LSCALE(Order);
91 
92  if (pdE != 0) {
93  std::vector<doublereal> WORK(6*Order);
94 
95  (void)__FC_DECL__(dggbal)(&JOB, &N, pdA, &LDA,
96  pdE, &LDB, &ILO, &IHI,
97  &LSCALE[0], &RSCALE[0], &WORK[0], &INFO);
98 
99  } else {
100  (void)__FC_DECL__(dgebal)(&JOB, &N, pdA, &LDA,
101  &ILO, &IHI, &RSCALE[0], &INFO);
102 
103  for (unsigned i = 0; i < Order; i++) {
104  LSCALE[i] = 1./RSCALE[i];
105  }
106  }
107 
108  if (INFO != 0) {
109  silent_cout("GenelStateSpaceSISO(" << uLabel << "): "
110  "balancing failed (ignored)" << std::endl);
111 
112  } else {
113  for (unsigned i = 0; i < Order; i++) {
114  pdB[i] *= RSCALE[i];
115  pdC[i] *= LSCALE[i];
116  }
117  }
118  }
119 #endif // USE_LAPACK
120 
122  pdXP = pdX + Order;
123 
124  for (unsigned i = 0; i < 2*Order; i++) {
125  pdX[i] = 0.;
126  }
127 
128  if (pdX0) {
129  for (unsigned i = 0; i < Order; i++) {
130  pdX[i] = pdX0[i];
131  }
132 
133  if (pdXP0) {
134  for (unsigned i = 0; i < Order; i++) {
135  pdXP[i] = pdXP0[i];
136  }
137  }
138  }
139 }
ScalarValue * SV_u
Definition: genfilt.h:45
doublereal * pdX
Definition: genfilt.h:55
flag fOutput
Definition: output.h:658
int iOrder
Definition: node.h:710
doublereal dD
Definition: genfilt.h:53
doublereal * pdA
Definition: genfilt.h:50
unsigned int iNumDofs
Definition: genfilt.h:47
#define DEBUGCOUT(msg)
Definition: myassert.h:232
doublereal * pdXP
Definition: genfilt.h:56
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
Order
Definition: shapefnc.h:42
ScalarDof SD_y
Definition: genfilt.h:44
Genel(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: genel.cc:44
doublereal * pdC
Definition: genfilt.h:52
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdE
Definition: genfilt.h:49
doublereal * pdB
Definition: genfilt.h:51
GenelStateSpaceSISO::~GenelStateSpaceSISO ( void  )
virtual

Definition at line 141 of file genfilt.cc.

References pdA, pdB, pdC, pdE, pdX, SAFEDELETE, SAFEDELETEARR, and SV_u.

142 {
143  if (pdX != 0) {
145  }
146 
147  if (pdC != 0) {
149  }
150 
151  if (pdB != 0) {
153  }
154 
155  if (pdA != 0) {
157  }
158 
159  if (pdE != 0) {
161  }
162 
163  if (SV_u != 0) {
164  SAFEDELETE(SV_u);
165  }
166 }
ScalarValue * SV_u
Definition: genfilt.h:45
doublereal * pdX
Definition: genfilt.h:55
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdA
Definition: genfilt.h:50
doublereal * pdC
Definition: genfilt.h:52
doublereal * pdE
Definition: genfilt.h:49
doublereal * pdB
Definition: genfilt.h:51
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

VariableSubMatrixHandler & GenelStateSpaceSISO::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler ,
const VectorHandler  
)
virtual

Implements Elem.

Definition at line 204 of file genfilt.cc.

References DEBUGCOUT, Node::iGetFirstColIndex(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), FullSubMatrixHandler::IncCoef(), iNumDofs, ScalarDof::iOrder, pdA, pdB, pdC, pdE, ScalarDof::pNode, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), FullSubMatrixHandler::ResizeReset(), SD_y, VariableSubMatrixHandler::SetFull(), SV_u, and WorkSpaceDim().

208 {
209  DEBUGCOUT("Entering GenelStateSpaceSISO::AssJac()" << std::endl);
210 
211  FullSubMatrixHandler& WM = WorkMat.SetFull();
212  integer iNumRows = 0;
213  integer iNumCols = 0;
214  WorkSpaceDim(&iNumRows, &iNumCols);
215  WM.ResizeReset(iNumRows, iNumCols);
216 
217  integer iRowIndex_y = SD_y.pNode->iGetFirstRowIndex() + 1;
218  integer iColIndex_y = SD_y.pNode->iGetFirstColIndex() + 1;
219  integer iFirstIndex = iGetFirstIndex();
220 
221  WM.PutRowIndex(iNumRows, iRowIndex_y);
222  WM.PutColIndex(iNumCols, iColIndex_y);
223 
224  // inputs may contribute to the Jacobian matrix
225  ScalarDofValue *SDV_u = dynamic_cast<ScalarDofValue *>(SV_u);
226  if (SDV_u != 0) {
227  ScalarDof& SD_u = dynamic_cast<ScalarDof &>(*SV_u);
228  integer iColIndex_u = SD_u.pNode->iGetFirstRowIndex() + 1;
229  integer iIdx_u = iNumCols - 1;
230 
231  WM.PutColIndex(iIdx_u, iColIndex_u);
232 
233  doublereal dd;
234  if (SD_u.iOrder == 0) {
235  dd = dCoef;
236  } else {
237  dd = 1.;
238  }
239 
240  doublereal *pdb = pdB - 1;
241  for (unsigned int i = iNumDofs; i > 0; i--) {
242  WM.PutCoef(i, iIdx_u, pdb[i]*dd);
243  }
244  }
245 
246  WM.PutCoef(iNumRows, iNumCols, dCoef);
247 
248  doublereal* pda = pdA + iNumDofs*iNumDofs - 1;
249  doublereal* pdc = pdC - 1;
250  if (pdE) {
251  doublereal* pde = pdE + iNumDofs*iNumDofs - 1;
252 
253  for (unsigned int i = iNumDofs; i > 0; i--) {
254  WM.PutRowIndex(i, iFirstIndex + i);
255  WM.PutColIndex(i, iFirstIndex + i);
256  WM.PutCoef(iNumRows, i, -pdc[i]*dCoef);
257  pde -= iNumDofs;
258  pda -= iNumDofs;
259  for (unsigned int j = iNumDofs; j > 0; j--) {
260  /* Attenzione: si assume A orientata per righe:
261  * a_11, a_12, ..., a_1n, a_21, ..., a_2n, ..., a_nn */
262  WM.PutCoef(i, j, pde[j] - pda[j]*dCoef);
263  }
264  }
265 
266  } else {
267  for (unsigned int i = iNumDofs; i > 0; i--) {
268  WM.PutRowIndex(i, iFirstIndex + i);
269  WM.PutColIndex(i, iFirstIndex + i);
270  WM.PutCoef(iNumRows, i, -pdc[i]*dCoef);
271  pda -= iNumDofs;
272  for (unsigned int j = iNumDofs; j > 0; j--) {
273  /* Attenzione: si assume A orientata per righe:
274  * a_11, a_12, ..., a_1n, a_21, ..., a_2n, ..., a_nn */
275  WM.PutCoef(i, j, -pda[j]*dCoef);
276  }
277  WM.IncCoef(i, i, 1.);
278  }
279  }
280 
281  return WorkMat;
282 }
ScalarValue * SV_u
Definition: genfilt.h:45
ScalarNode * pNode
Definition: node.h:708
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
int iOrder
Definition: node.h:710
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: genfilt.cc:191
doublereal * pdA
Definition: genfilt.h:50
unsigned int iNumDofs
Definition: genfilt.h:47
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
ScalarDof SD_y
Definition: genfilt.h:44
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
doublereal * pdC
Definition: genfilt.h:52
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdE
Definition: genfilt.h:49
doublereal * pdB
Definition: genfilt.h:51
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

SubVectorHandler & GenelStateSpaceSISO::AssRes ( SubVectorHandler WorkVec,
doublereal  ,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 287 of file genfilt.cc.

References dD, DEBUGCOUT, ScalarValue::dGetValue(), ScalarNode::dGetX(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), iNumDofs, pdA, pdB, pdC, pdE, pdX, pdXP, ScalarDof::pNode, VectorHandler::PutCoef(), SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), SD_y, SV_u, and WorkSpaceDim().

291 {
292  DEBUGCOUT("Entering GenelStateSpaceSISO::AssRes()" << std::endl);
293 
294  integer iNumRows = 0;
295  integer iNumCols = 0;
296  WorkSpaceDim(&iNumRows, &iNumCols);
297  WorkVec.ResizeReset(iNumRows);
298 
299  integer iRowIndex_y = SD_y.pNode->iGetFirstRowIndex()+1;
300  integer iFirstIndex = iGetFirstIndex();
301 
302  doublereal y = SD_y.pNode->dGetX();
303  doublereal u = SV_u->dGetValue();
304 
305  WorkVec.PutRowIndex(iNumRows, iRowIndex_y);
306 
307  doublereal* pdx = pdX - 1;
308  doublereal* pdxp = pdXP - 1;
309  doublereal* pdc = pdC - 1;
310  doublereal d = dD*u - y;
311  for (unsigned int i = iNumDofs; i > 0; i--) {
312  WorkVec.PutRowIndex(i, iFirstIndex + i);
313  pdx[i] = XCurr(iFirstIndex + i);
314  pdxp[i] = XPrimeCurr(iFirstIndex + i);
315  d += pdc[i]*pdx[i];
316  }
317 
318  WorkVec.PutCoef(iNumRows, d);
319 
320  doublereal* pda = pdA + iNumDofs*iNumDofs;
321  doublereal* pdb = pdB;
322  pdxp = pdXP;
323  pdx = pdX;
324  if (pdE) {
325  doublereal *pde = pdE + iNumDofs*iNumDofs;
326  for (unsigned int i = iNumDofs; i-- > 0; ) {
327  d = pdb[i]*u;
328  pde -= iNumDofs;
329  pda -= iNumDofs;
330  for (unsigned int j = iNumDofs; j-- > 0; ) {
331  d += pda[j]*pdx[j] - pde[j]*pdxp[j];
332  }
333  WorkVec.PutCoef(i + 1, d);
334  }
335 
336  } else {
337  for (unsigned int i = iNumDofs; i-- > 0; ) {
338  d = pdb[i]*u - pdxp[i];
339  pda -= iNumDofs;
340  for (unsigned int j = iNumDofs; j-- > 0; ) {
341  d += pda[j]*pdx[j];
342  }
343  WorkVec.PutCoef(i + 1, d);
344  }
345  }
346 
347  return WorkVec;
348 }
ScalarValue * SV_u
Definition: genfilt.h:45
ScalarNode * pNode
Definition: node.h:708
doublereal * pdX
Definition: genfilt.h:55
virtual doublereal dGetValue(void) const =0
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual const doublereal & dGetX(void) const =0
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: genfilt.cc:191
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
doublereal dD
Definition: genfilt.h:53
doublereal * pdA
Definition: genfilt.h:50
unsigned int iNumDofs
Definition: genfilt.h:47
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
doublereal * pdXP
Definition: genfilt.h:56
ScalarDof SD_y
Definition: genfilt.h:44
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
doublereal * pdC
Definition: genfilt.h:52
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdE
Definition: genfilt.h:49
doublereal * pdB
Definition: genfilt.h:51

Here is the call graph for this function:

void GenelStateSpaceSISO::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
virtual

Reimplemented from Elem.

Definition at line 398 of file genfilt.cc.

References ScalarDof::pNode, SD_y, and SV_u.

399  {
400  unsigned iNodes = 1;
401  if (dynamic_cast<NodeDof *>(SV_u)) {
402  iNodes++;
403  }
404  connectedNodes.resize(iNodes);
405  connectedNodes[0] = SD_y.pNode;
406  if (dynamic_cast<NodeDof *>(SV_u)) {
407  connectedNodes[1] = dynamic_cast<NodeDof *>(SV_u)->pNode;
408  }
409 }
ScalarValue * SV_u
Definition: genfilt.h:45
ScalarNode * pNode
Definition: node.h:708
ScalarDof SD_y
Definition: genfilt.h:44
Definition: node.h:578
DofOrder::Order GenelStateSpaceSISO::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 176 of file genfilt.cc.

References ASSERT, DofOrder::DIFFERENTIAL, and iNumDofs.

177 {
178  ASSERT(i < iNumDofs);
179  return DofOrder::DIFFERENTIAL;
180 }
unsigned int iNumDofs
Definition: genfilt.h:47
#define ASSERT(expression)
Definition: colamd.c:977
virtual Genel::Type GenelStateSpaceSISO::GetGenelType ( void  ) const
inlinevirtual

Implements Genel.

Definition at line 81 of file genfilt.h.

References Genel::STATESPACESISO.

81  {
82  return Genel::STATESPACESISO;
83  };
unsigned int GenelStateSpaceSISO::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 169 of file genfilt.cc.

References iNumDofs.

170 {
171  return iNumDofs;
172 }
unsigned int iNumDofs
Definition: genfilt.h:47
void GenelStateSpaceSISO::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 382 of file genfilt.cc.

References ToBeOutput::bToBeOutput(), OutputHandler::Genels(), WithLabel::GetLabel(), iNumDofs, pdX, and pdXP.

383 {
384  if (bToBeOutput()) {
385  std::ostream &out(OH.Genels());
386  out << std::setw(8) << GetLabel();
387  for (unsigned int i = 0; i < iNumDofs; i++) {
388  out << " " << pdX[i];
389  }
390  for (unsigned int i = 0; i < iNumDofs; i++) {
391  out << " " << pdXP[i];
392  }
393  out << "\n";
394  }
395 }
std::ostream & Genels(void) const
Definition: output.h:513
doublereal * pdX
Definition: genfilt.h:55
virtual bool bToBeOutput(void) const
Definition: output.cc:890
unsigned int iNumDofs
Definition: genfilt.h:47
doublereal * pdXP
Definition: genfilt.h:56
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & GenelStateSpaceSISO::Restart ( std::ostream &  out) const
virtual

Reimplemented from Genel.

Definition at line 184 of file genfilt.cc.

185 {
186  return out << "GenelStateSpaceSISO: not implemented yet!" << std::endl;
187 }
void GenelStateSpaceSISO::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 351 of file genfilt.cc.

References ScalarValue::dGetValue(), DofOwnerOwner::iGetFirstIndex(), iNumDofs, pdA, pdB, pdE, pdX, pdXP, and SV_u.

354 {
355  integer iFirstIndex = iGetFirstIndex() + 1;
356 
357  if (pdE == 0) {
358  doublereal u = SV_u->dGetValue();
359  doublereal* pda = pdA + iNumDofs*iNumDofs;
360  doublereal* pdb = pdB;
361 
362  for (unsigned int i = iNumDofs; i-- > 0; ) {
363  pdXP[i] = pdb[i]*u;
364  pda -= iNumDofs;
365  for (unsigned int j = iNumDofs; j-- > 0; ) {
366  pdXP[i] += pda[j]*pdX[j];
367  }
368  }
369  }
370 
371  for (unsigned i = 0; i < iNumDofs; i++) {
372  X(iFirstIndex + i) = pdX[i];
373  XP(iFirstIndex + i) = pdXP[i];
374  }
375 }
ScalarValue * SV_u
Definition: genfilt.h:45
doublereal * pdX
Definition: genfilt.h:55
virtual doublereal dGetValue(void) const =0
doublereal * pdA
Definition: genfilt.h:50
unsigned int iNumDofs
Definition: genfilt.h:47
doublereal * pdXP
Definition: genfilt.h:56
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdE
Definition: genfilt.h:49
doublereal * pdB
Definition: genfilt.h:51

Here is the call graph for this function:

void GenelStateSpaceSISO::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 191 of file genfilt.cc.

References iNumDofs, and SV_u.

Referenced by AssJac(), and AssRes().

192 {
193  *piNumRows = iNumDofs + 1;
194  *piNumCols = iNumDofs + 1;
195 
196  // inputs may contribute to the Jacobian matrix
197  if (dynamic_cast<ScalarDofValue *>(SV_u) != 0) {
198  *piNumCols += 1;
199  }
200 }
ScalarValue * SV_u
Definition: genfilt.h:45
unsigned int iNumDofs
Definition: genfilt.h:47

Member Data Documentation

doublereal GenelStateSpaceSISO::dD
protected

Definition at line 53 of file genfilt.h.

Referenced by AssRes().

unsigned int GenelStateSpaceSISO::iNumDofs
protected
doublereal* GenelStateSpaceSISO::pdA
protected

Definition at line 50 of file genfilt.h.

Referenced by AssJac(), AssRes(), GenelStateSpaceSISO(), SetValue(), and ~GenelStateSpaceSISO().

doublereal* GenelStateSpaceSISO::pdB
protected

Definition at line 51 of file genfilt.h.

Referenced by AssJac(), AssRes(), GenelStateSpaceSISO(), SetValue(), and ~GenelStateSpaceSISO().

doublereal* GenelStateSpaceSISO::pdC
protected

Definition at line 52 of file genfilt.h.

Referenced by AssJac(), AssRes(), GenelStateSpaceSISO(), and ~GenelStateSpaceSISO().

doublereal* GenelStateSpaceSISO::pdE
protected

Definition at line 49 of file genfilt.h.

Referenced by AssJac(), AssRes(), GenelStateSpaceSISO(), SetValue(), and ~GenelStateSpaceSISO().

doublereal* GenelStateSpaceSISO::pdX
protected

Definition at line 55 of file genfilt.h.

Referenced by AssRes(), GenelStateSpaceSISO(), Output(), SetValue(), and ~GenelStateSpaceSISO().

doublereal* GenelStateSpaceSISO::pdXP
protected

Definition at line 56 of file genfilt.h.

Referenced by AssRes(), GenelStateSpaceSISO(), Output(), and SetValue().

ScalarDof GenelStateSpaceSISO::SD_y
protected

Definition at line 44 of file genfilt.h.

Referenced by AssJac(), AssRes(), GenelStateSpaceSISO(), and GetConnectedNodes().

ScalarValue* GenelStateSpaceSISO::SV_u
protected

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