Question about commitState()

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

Moderators: silvia, selimgunay, Moderators

Post Reply
buddhasarah
Posts: 93
Joined: Thu Feb 12, 2009 8:31 pm
Location: The University of Tokyo

Question about commitState()

Post by buddhasarah » Sat May 26, 2012 9:35 pm

Hello, I have a question about commitState(). As you can see in the code below, "theMaterial" points to "commitState()", but what class does this "commitState()" belong to and why the name of class does not need to be stated? Thank you in advance!
------------------------------------------------
Truss2D::commitState()
{
return theMaterial->commitState();
}

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Question about commitState()

Post by fmk » Fri Jun 01, 2012 3:50 pm

theMaterial is a pointer to a uniaxial material object (in the header file there is the line UniaxialMaterial *theMaterial).

that uniaxial material object has a method commitState in it's interface (its defined for all uniaxial materials, see the UniaxialMaterial.h file).

what this line of code is thus doing is telling the material object that the pointer points to to invoke that commitState method.

Post Reply