Пример #1
0
int
BeamEndContact3D::getResponse(int responseID, Information &eleInfo)
{
	// initialize variables
	Vector slaveForce(3);
	Vector masterForce(6);

	if (responseID == 1) {

		// forces on slave node
		slaveForce(0) = -mInternalForces(6);
		slaveForce(1) = -mInternalForces(7);
		slaveForce(2) = -mInternalForces(8);
		return eleInfo.setVector(slaveForce);
	
    } else if (responseID == 2) {

		// reactions (forces and moments) on master node
		for (int i = 0;  i < 3; i++) {

			masterForce(i)   = -mInternalForces(i);
			masterForce(i+3) = -mInternalForces(i+3);
		}
		return eleInfo.setVector(masterForce);

	} else {
		// otherwise response quantity is unknown for the BeamEndContact3D class
		opserr << "BeamEndContact3D::getResponse(int responseID = " << responseID << ", Information &eleInfo); "
		  << " unknown request" << endln;
		return -1;
	}
}
Пример #2
0
int
BeamContact2Dp::getResponse(int responseID, Information &eleInfo)
{
	// initialize variables
	Vector force(2);
	Vector frictForce(2);
	Vector slaveForce(2);
	Vector masterForce(6);

	// get contact "stress" vector
	Vector stress = theMaterial->getStress();

	if (responseID == 1) {

		// forces on slave node
		slaveForce(0) = -mInternalForces(6);
		slaveForce(1) = -mInternalForces(7);
		return eleInfo.setVector(slaveForce);
	
	} else if (responseID == 2) {

		// frictional force vector
		frictForce = stress(1)*mg_xi;
		return eleInfo.setVector(frictForce);

    } else if (responseID == 3) {
		
		// scalar contact forces
		force(0) = stress(0);
		force(1) = stress(1);
		return eleInfo.setVector(force);

	} else if (responseID == 4) {

		// reactions (forces and moments) on master nodes
		for (int i = 0;  i < 3; i++) {

			masterForce(i)   = -mInternalForces(i);
			masterForce(i+3) = -mInternalForces(i+3);
		}
		return eleInfo.setVector(masterForce);

	} else {
		// otherwise response quantity is unknown for the BeamContact2Dp class
		opserr << "BeamContact2Dp::getResponse(int responseID = " << responseID << ", Information &eleInfo); "
		  << " unknown request" << endln;
		return -1;
	}
}