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

#include <j2p.h>

Inheritance diagram for Elem2Param:
Collaboration diagram for Elem2Param:

Public Member Functions

 Elem2Param (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Elem2Param (void)
 
virtual void Bind (const Elem *pEl, unsigned int i)
 
virtual std::ostream & Restart (std::ostream &out) const
 
std::ostream & RestartBind (std::ostream &out) const
 
virtual const doublerealdGetDofValue (int iDof, int iOrder=0) const
 
virtual const doublerealdGetX (void) const
 
virtual void SetDofValue (const doublereal &dValue, unsigned int iDof, unsigned int iOrder=0)
 
virtual void SetValue (DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
 
- Public Member Functions inherited from ParameterNode
 ParameterNode (unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
 
virtual ~ParameterNode (void)
 
virtual Node::Type GetNodeType (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual void Output (OutputHandler &OH) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, const int iOrder)
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual unsigned int iGetNumPrivData (void) const
 
- Public Member Functions inherited from ScalarAlgebraicNode
 ScalarAlgebraicNode (unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
 
virtual ~ScalarAlgebraicNode (void)
 
virtual const doublerealdGetDofValuePrev (int iDof, int iOrder=0) const
 
virtual void SetX (const doublereal &d)
 
virtual void SetXPrime (const doublereal &d)
 
virtual const doublerealdGetXPrime (void) const
 
virtual void Update (const class VectorHandler &, const class VectorHandler &)
 
std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
- Public Member Functions inherited from ScalarNode
 ScalarNode (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ScalarNode (void)
 
- Public Member Functions inherited from Node
 Node (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Node (void)
 
const NodeGetNode (void) const
 
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 integer iGetFirstRowIndex (void) const
 
virtual integer iGetFirstColIndex (void) const
 
virtual doublereal dGetPrivData (unsigned int i) 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 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 std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- 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)
 
- 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))
 

Protected Attributes

const ElempElem
 
unsigned int iNum
 
- Protected Attributes inherited from ScalarAlgebraicNode
doublereal dX
 
doublereal dXPrev
 
- 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 Node
enum  Type {
  UNKNOWN = -1, ABSTRACT = 0, STRUCTURAL, ELECTRIC,
  THERMAL, PARAMETER, HYDRAULIC, LASTNODETYPE
}
 
- 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 }
 
- Protected Member Functions inherited from ScalarAlgebraicNode
virtual std::ostream & Output (std::ostream &out) const
 

Detailed Description

Definition at line 40 of file j2p.h.

Constructor & Destructor Documentation

Elem2Param::Elem2Param ( unsigned int  uL,
const DofOwner pDO,
flag  fOut 
)

Definition at line 40 of file j2p.cc.

References NO_OP.

41 : ParameterNode(uL, pDO, 0., fOut), pElem(0), iNum(0)
42 {
43  NO_OP;
44 }
ParameterNode(unsigned int uL, const DofOwner *pDO, doublereal dx, flag fOut)
Definition: node.cc:496
#define NO_OP
Definition: myassert.h:74
const Elem * pElem
Definition: j2p.h:42
unsigned int iNum
Definition: j2p.h:43
Elem2Param::~Elem2Param ( void  )
virtual

Definition at line 46 of file j2p.cc.

References NO_OP.

47 {
48  NO_OP;
49 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void Elem2Param::Bind ( const Elem pEl,
unsigned int  i 
)
virtual

Reimplemented in StrainGageParam.

Definition at line 53 of file j2p.cc.

References dGetDofValue(), Elem::GetElemType(), WithLabel::GetLabel(), SimulationEntity::iGetNumPrivData(), iNum, MBDYN_EXCEPT_ARGS, pElem, and psElemNames.

Referenced by StrainGageParam::Bind(), and DataManager::ReadElems().

54 {
55  if (pElem != 0) {
56  silent_cerr("Elem2Param::Bind(): parameter (" << GetLabel()
57  << ") is already bound to "
59  << " (" << pElem->GetLabel() << ')' << std::endl);
61  }
62 
63  if (i <= 0) {
64  silent_cerr("Elem2Param::Bind(): illegal value " << i
65  << " for " << psElemNames[pEl->GetElemType()]
66  << " (" << pEl->GetLabel() << ") private data"
67  << std::endl);
69  }
70 
71  iNum = i;
72 
73  if (iNum <= 0 || iNum > pEl->iGetNumPrivData()) {
74  silent_cerr("Elem2Param::Bind(): "
75  "wrong element private data number "
76  << iNum << " for " << psElemNames[pEl->GetElemType()]
77  << " (" << pEl->GetLabel() << ')' << std::endl);
79  }
80  pElem = pEl;
81 
82  dGetDofValue(1, 0);
83 }
virtual const doublereal & dGetDofValue(int iDof, int iOrder=0) const
Definition: j2p.h:78
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual Elem::Type GetElemType(void) const =0
const Elem * pElem
Definition: j2p.h:42
unsigned int iNum
Definition: j2p.h:43
virtual unsigned int iGetNumPrivData(void) const
Definition: simentity.cc:136
const char * psElemNames[]
Definition: enums.cc:39
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

const doublereal & Elem2Param::dGetDofValue ( int  iDof,
int  iOrder = 0 
) const
inlinevirtual

Reimplemented from ScalarAlgebraicNode.

Reimplemented in StrainGageParam.

Definition at line 78 of file j2p.h.

References ASSERT, and dGetX().

Referenced by Bind().

79 {
80  ASSERT(iDof == 1);
81  ASSERT(iOrder == 0);
82  return dGetX();
83 }
virtual const doublereal & dGetX(void) const
Definition: j2p.h:87
#define ASSERT(expression)
Definition: colamd.c:977

Here is the call graph for this function:

const doublereal & Elem2Param::dGetX ( void  ) const
inlinevirtual

Reimplemented from ScalarAlgebraicNode.

Reimplemented in StrainGageParam.

Definition at line 87 of file j2p.h.

References SimulationEntity::dGetPrivData(), ScalarAlgebraicNode::dX, iNum, and pElem.

Referenced by dGetDofValue(), and SetValue().

88 {
89  /* element could be undefined (yet) */
90  if (pElem != 0) {
92  }
93  return dX;
94 }
doublereal dX
Definition: node.h:405
const Elem * pElem
Definition: j2p.h:42
unsigned int iNum
Definition: j2p.h:43
virtual doublereal dGetPrivData(unsigned int i) const
Definition: simentity.cc:149

Here is the call graph for this function:

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

Implements Node.

Reimplemented in StrainGageParam.

Definition at line 87 of file j2p.cc.

References WithLabel::GetLabel().

88 {
89  //return out << "# Elem2Param is not implemented yet" << std::endl;
90  return out << " parameter: "
91  << GetLabel() << " ,element;" << std::endl;
92 }
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & Elem2Param::RestartBind ( std::ostream &  out) const

Definition at line 95 of file j2p.cc.

References WithLabel::GetLabel(), iNum, pElem, and psReadElemsElems.

96 {
97  //return out << "# Elem2Param is not implemented yet" << std::endl;
98  return out << " bind: "
99  << pElem ->GetLabel() <<", "
100  << psReadElemsElems[pElem -> GetElemType()] << ", "
101  << GetLabel() << ", " << iNum << ";"
102  << std::endl;
103 }
const Elem * pElem
Definition: j2p.h:42
unsigned int iNum
Definition: j2p.h:43
const char * psReadElemsElems[]
Definition: enums.cc:79
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void Elem2Param::SetDofValue ( const doublereal dValue,
unsigned int  iDof,
unsigned int  iOrder = 0 
)
virtual

Reimplemented from ScalarAlgebraicNode.

Definition at line 108 of file j2p.cc.

References NO_OP.

111 {
112  NO_OP;
113 }
#define NO_OP
Definition: myassert.h:74
void Elem2Param::SetValue ( DataManager pDM,
VectorHandler ,
VectorHandler ,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from ScalarAlgebraicNode.

Definition at line 116 of file j2p.cc.

References dGetX(), ScalarAlgebraicNode::dX, WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, and pElem.

119 {
120  if (pElem == 0) {
121  silent_cerr("ParameterNode(" << GetLabel()
122  << "): never bound" << std::endl);
124  }
125 
126  dX = dGetX();
127 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const doublereal & dGetX(void) const
Definition: j2p.h:87
doublereal dX
Definition: node.h:405
const Elem * pElem
Definition: j2p.h:42
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Member Data Documentation

unsigned int Elem2Param::iNum
protected

Definition at line 43 of file j2p.h.

Referenced by Bind(), dGetX(), StrainGageParam::dGetX(), and RestartBind().

const Elem* Elem2Param::pElem
protected

Definition at line 42 of file j2p.h.

Referenced by Bind(), dGetX(), StrainGageParam::dGetX(), RestartBind(), and SetValue().


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