Debug

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

Moderators: silvia, selimgunay, Moderators

Post Reply
brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Debug

Post by brag006 » Tue Jan 07, 2014 11:53 am

I am trying to compile a debug version but I am getting an error in Domain.cpp in the pressure constraint.

bool
Domain::addPressure_Constraint(Pressure_Constraint *pConstraint)
{
#ifdef _G3DEBUG
// check the Node exists in the Domain
int nodeTag = pConstraint->getNodeConstrained();
Node *nodePtr = this->getNode(nodeTag);
if (nodePtr == 0) {
opserr << "Domain::addPressure_Constraint - cannot add as node with tag";
opserr << nodeTag << "does not exist in model\n";
return false;
}
#endif

It appears that Pressure_Constraint does not have a member function called getNodeConstrained. There was a private member called findNodeTag. I tried moving the member to public and then changed the line to as follows:
int nodeTag = pConstraint->findNodeTag();

But I need to pass the domain to this function. I didn't know how to do that.

brag006
Posts: 173
Joined: Wed Feb 15, 2012 1:26 pm
Location: University of Auckland

Re: Debug

Post by brag006 » Tue Jan 07, 2014 1:16 pm

It seems to have worked with this line:

int nodeTag = pConstraint->findNodeTag(this);

Is this a bug that needs to be fixed?

mhscott
Posts: 872
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Debug

Post by mhscott » Wed Jan 08, 2014 9:24 am

Yes, it is fixed now. We've been compiling without _G3DEBUG defined, so never noticed. Thanks!

Post Reply