Limit Curve Functions

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
ccharrin
Posts: 12
Joined: Wed May 23, 2012 1:52 pm
Location: Universtiy of Colorado at Boulder

Limit Curve Functions

Post by ccharrin »

Hi,

I have been working with the shear limit curve. When I execute the following lines in the checkElementState function, OpenSees crashes;

if (defType == 1) // maximum chord rotations
{

Response *theRotations =0; // integer element returns in setResponse

const char *r[1] = {"basicDeformations"}; // must be implemented in element

Vector *rotVec; //vector of chord rotations at beam-column ends

// set type of beam-column element response desired
theRotations = theElement->setResponse(r, 1, dummy);

// put element response in the vector of "myInfo"
result = theRotations->getResponse();

// access the myInfo vector containing the response (new for Version 1.2)
Information &theInfo = theRotations->getInformation();
rotVec = (theInfo.theVector);

deform = (fabs((*rotVec)(1)) > fabs((*rotVec)(2))) ?
fabs((*rotVec)(1)) : fabs((*rotVec)(2)); //use larger of two end rotations

}

To be more specific, OpenSees crashes when the following line is run;

result = theRotations->getResponse();

Does anyone have some insight into why this occurs?

-Cody
ccharrin
Posts: 12
Joined: Wed May 23, 2012 1:52 pm
Location: Universtiy of Colorado at Boulder

Re: Limit Curve Functions

Post by ccharrin »

I forgot to mention that the above lines are taken from the source code for the shear limit curve. ShearCurve.cpp
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Limit Curve Functions

Post by fmk »

if the code crashed right there it means that the pointer theRotations has either not been set correctly, not at all, or now points to something that got deleted.

given the code that preceded it, it means that the element returned nothing, i.e. 0, from the setResponse(). You are not checking for that condition in the code.
ccharrin
Posts: 12
Joined: Wed May 23, 2012 1:52 pm
Location: Universtiy of Colorado at Boulder

Re: Limit Curve Functions

Post by ccharrin »

Thank you fmk. That was the problem.
Post Reply