64 if (argc < 1 || argv[0] == NULL) {
65 silent_cerr(
"DofPlugIn::Read(): "
66 "illegal number of parameters #" << argc
72 if (argc < 2 || argv[1] == NULL) {
73 silent_cerr(
"DofPlugIn::Read(" << argv[0] <<
"): "
74 "illegal number of parameters " << argc
90 if (argc < 3 || argv[2] == NULL) {
91 silent_cerr(
"DofPlugIn::Read(" << argv[0] <<
","
93 "illegal number of parameters " << argc
103 if (argc < 3 || argv[2] == NULL) {
104 silent_cerr(
"DofPlugIn::Read(" << argv[0] <<
","
106 "illegal number of parameters " << argc
110 unsigned int iIndex =
ReadIndex(pNode, iMaxIndex, argv[2]);
112 if (argc < 4 || argv[3] == NULL) {
113 silent_cerr(
"DofPlugIn::Read(" << argv[0] <<
","
116 "illegal number of parameters " << argc
127 <<
"(" << pNode->
GetLabel() <<
"): "
128 "possibly allocating a NodeDof "
129 "that nobody will delete" << std::endl);
133 dof =
ScalarDof(dynamic_cast<ScalarNode *>(pNode), iOrder, 0);
136 if (argc == iParams + 1) {
137 char *parm = NULL, *p, *end;
141 for (p = parm; p != NULL; p = end) {
142 end = std::strchr(p,
'&');
143 while (end != NULL && end[-1] ==
'\\') {
144 end = std::strchr(end + 1,
'&');
152 char *v = std::strchr(p,
'=');
154 silent_cerr(
"dof plugin: missing \"=\" "
155 "in <param>=<value>" << std::endl);
163 if (strncasecmp(p,
"prev",
STRLENOF(
"prev")) == 0) {
164 if (strcasecmp(v,
"true") == 0) {
166 }
else if (strcasecmp(v,
"false") == 0) {
169 silent_cerr(
"dof plugin: "
170 "unknown mode for parameter "
171 "\"" << p <<
"=" << v <<
"\""
177 silent_cerr(
"dof plugin: unknown parameter "
178 "\"" << p <<
"=" << v <<
"\""
209 std::istringstream in(std::string(s) +
";");
213 silent_cerr(
"DofPlugIn::ReadLabel(" << s <<
"): invalid negative label" << std::endl);
230 if (i == Node::LASTNODETYPE) {
231 silent_cerr(
"unknown node type '" << s <<
"'" << std::endl);
236 <<
"(" << uLabel <<
") not defined" << std::endl);
246 if (i == 0 || i > iMaxIndex) {
247 silent_cerr(
"illegal index " << i <<
" for "
249 <<
"(" << pNode->
GetLabel() <<
")" << std::endl);
258 if (strcasecmp(s,
"differential") == 0) {
260 silent_cerr(
"cannot take differential value of "
263 "[" << iIndex <<
"]" << std::endl);
269 if (strcasecmp(s,
"algebraic") == 0) {
273 silent_cerr(
"unknown dof order '" << s <<
"'" << std::endl);
const char * sName(void) const
TypedValue::Type GetType(void) const
const char * psReadNodesNodes[]
#define MBDYN_EXCEPT_ARGS
DofPlugIn(MathParser &mp, DataManager *pDM)
#define SAFEDELETEARR(pnt)
const doublereal & dGetValuePrev(void) const
int Read(int argc, char *argv[])
virtual DofOrder::Order GetDofType(unsigned int i) const =0
unsigned int ReadLabel(const char *s)
#define ASSERT(expression)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual unsigned int iGetNumDof(void) const =0
const char * psNodeNames[]
TypedValue GetVal(void) const
virtual Node::Type GetNodeType(void) const =0
MathParser::PlugIn * dof_plugin(MathParser &mp, void *arg)
#define SAFESTRDUP(pnt, src)
Node * ReadNode(unsigned int uLabel, const char *s)
int ReadDofOrder(Node *pNode, unsigned int iIndex, const char *s)
unsigned int ReadIndex(Node *pNode, unsigned int iMaxIndex, const char *s)
unsigned int GetLabel(void) const
const doublereal & dGetValue(void) const
Node * pFindNode(Node::Type Typ, unsigned int uNode) const