OPS Procedure

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
CMiculas
Posts: 26
Joined: Wed Oct 25, 2017 6:23 am
Location: University of Coimbra

OPS Procedure

Post by CMiculas »

Dear Community,

I would like to consider a new structural element with 4 nodes, 11 springs and 12 degrees of freedom.
I believe that there are some mistakes in the OPS procedure that I wrote at the beginning of the .cpp file, since I obtain this error:

UniaxialMaterial *getUniaxialMaterial(int tag) - none found with tag: 261909344
WARNING: material 261909344 is not defined.
TclElementCommand -- unable to create element of type : SPPlastic

There is not mat tag (261909344)!?


The OPS procedure is:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

static int numSPP = 0;

void* OPS_SPPlastic()
{

Element *theSPPanel = 0;

int numRemainingArgs = OPS_GetNumRemainingInputArgs();

if (numRemainingArgs == 0)
{
theSPPanel = new SPPlastic();
return theSPPanel;
}

if (numRemainingArgs != 16)
{
opserr << "WARNING insufficient arguments\n";
opserr << "Want: element SPPlastic eleTag? node1? node2? node3? node4? matTag1? matTag2? matTag3?\n";
opserr << "matTag4? matTag5? matTag6? matTag7? matTag8? matTag9? matTag10? matTag11?\n";
numSPP++;
//return 0;
}

int iData[16];
int numData;

numData = 5;
if (OPS_GetIntInput(&numData, iData) != 0)
{
opserr << "WARNING invalid element data\n";
return 0;
}



UniaxialMaterial* mats[11];
for (int i = 0; i < 11; i++)
{

mats[i] = OPS_getUniaxialMaterial(iData[5+i]);

if (mats[i] == 0)
{
opserr<<"WARNING: material "<< iData[5+i] <<" is not defined.\n";
return 0;
}
}

theSPPanel = new SPPlastic(iData[0],iData[1],iData[2],iData[3],iData[4],
*mats[0],*mats[1],*mats[2],*mats[3],*mats[4],
*mats[5],*mats[6],*mats[7],*mats[8],*mats[9],
*mats[10]);

if (theSPPanel == 0)
{
opserr << "WARNING ran out of memory creating element with tag " << iData[0] << endln;

for (int i = 0; i < 11; i++)
{
delete mats[i];
return 0;
}
}

return theSPPanel;
}

Any ideas?
Post Reply