本文整理汇总了C++中connectedExternalNodes函数的典型用法代码示例。如果您正苦于以下问题:C++ connectedExternalNodes函数的具体用法?C++ connectedExternalNodes怎么用?C++ connectedExternalNodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了connectedExternalNodes函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: connectedExternalNodes
void
ElasticBeam2d::Print(OPS_Stream &s, int flag)
{
// to update forces!
this->getResistingForce();
if (flag == -1) {
int eleTag = this->getTag();
s << "EL_BEAM\t" << eleTag << "\t";
s << 0 << "\t" << 0 << "\t" << connectedExternalNodes(0) << "\t" << connectedExternalNodes(1) ;
s << "0\t0.0000000\n";
} else {
this->getResistingForce();
s << "\nElasticBeam2d: " << this->getTag() << endln;
s << "\tConnected Nodes: " << connectedExternalNodes ;
s << "\tCoordTransf: " << theCoordTransf->getTag() << endln;
s << "\tmass density: " << rho << ", cMass: " << cMass << endln;
double P = q(0);
double M1 = q(1);
double M2 = q(2);
double L = theCoordTransf->getInitialLength();
double V = (M1+M2)/L;
s << "\tEnd 1 Forces (P V M): " << -P+p0[0]
<< " " << V+p0[1] << " " << M1 << endln;
s << "\tEnd 2 Forces (P V M): " << P
<< " " << -V+p0[2] << " " << M2 << endln;
}
}
开发者ID:cix1,项目名称:OpenSees,代码行数:28,代码来源:ElasticBeam2d.cpp
示例2: connectedExternalNodes
ZeroLengthContact2D::ZeroLengthContact2D(int tag,
int Nd1, int Nd2,
double Knormal, double Ktangent,
double frictionRatio, const Vector& normal )
:Element(tag,ELE_TAG_ZeroLengthContact2D),
connectedExternalNodes(numberNodes),
N(2*numberNodes), T(2*numberNodes), ContactNormal(2),
Ki(0), load(0)
{
// ensure the connectedExternalNode ID is of correct size & set values
if (connectedExternalNodes.Size() != 2)
opserr << "FATAL ZeroLength::setUp - failed to create an ID of correct size\n";
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
// assign Kn, Kt, fs
Kn = Knormal;
Kt = Ktangent;
fs = frictionRatio;
// assign outward contact normal of master block
ContactNormal(0) = normal(0)/normal.Norm();
ContactNormal(1) = normal(1)/normal.Norm();
// set stick point cords in LOCAL basis
stickPt = 0;
// initialized contact flag be zero
ContactFlag=0;
gap_n = 0 ;
lambda =0; // add for augmented lagrange
pressure=0; // add for augmented lagrange
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:34,代码来源:ZeroLengthContact2D.cpp
示例3: connectedExternalNodes
// Construct element with one unidirectional material (numMaterials1d=1)
CoupledZeroLength::CoupledZeroLength(int tag,
int Nd1, int Nd2,
UniaxialMaterial &theMat,
int direction1, int direction2,
int doRayleigh)
:Element(tag,ELE_TAG_CoupledZeroLength),
connectedExternalNodes(2),
dimension(0), numDOF(0), transformation(3,3), useRayleighDamping(doRayleigh),
theMatrix(0), theVector(0),
theMaterial(0), dirn1(direction1), dirn2(direction2), d0(0), v0(0)
{
// allocate memory for numMaterials1d uniaxial material models
theMaterial = theMat.getCopy();
if ( theMaterial == 0) {
opserr << "FATAL CoupledZeroLength::CoupledZeroLength - failed to create a 1d material\n";
exit(-1);
}
// initialize uniaxial materials and directions and check for valid values
if (direction1 < 0 || direction1 > 5 || direction2 < 0 || direction2 > 5) {
opserr << "FATAL: CoupledZeroLength::CoupledZeroLength - invalid diection\n";
exit(-1);
}
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
dX = 0.0;
dY = 0.0;
fX = 0.0;
fY = 0.0;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:32,代码来源:CoupledZeroLength.cpp
示例4: connectedExternalNodes
void YamamotoBiaxialHDR::Print(OPS_Stream &s, int flag)
{
if (flag == 0) {
// print everything
s << "Element: " << this->getTag();
s << " type: YamamotoBiaxialHDR iNode: " << connectedExternalNodes(0);
s << " jNode: " << connectedExternalNodes(1) << endln;
s << "Input parameters: " << endln;
s << " Tp: " << tp << endln;
s << " DDo: " << ddo << endln;
s << " DDi: " << ddi << endln;
s << " Hr: " << hr << endln;
s << " Cr: " << cr << endln;
s << " Cs: " << cs << endln;
// determine resisting forces in global system
//s << " resisting force: " << this->getResistingForce() << endln;
//s << " Disp-x: " << this->getStrain(0) << endln;
//s << " Force-x: " << this->getStress(0) << endln;
//s << " Stiff-x: " << this->getTangent(0) << endln;
//s << " StiffInit-x: " << this->getInitialTangent(0) << endln;
//s << " Disp-y: " << this->getStrain(1) << endln;
//s << " Force-y: " << this->getStress(1) << endln;
//s << " Stiff-y: " << this->getTangent(1) << endln;
//s << " StiffInit-y: " << this->getInitialTangent(1) << endln;
} else if (flag == 1) {
// does nothing
}
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:32,代码来源:YamamotoBiaxialHDR.cpp
示例5: connectedExternalNodes
void
TPB1D::Print(OPS_Stream &s, int flag)
{
// compute the strain and axial force in the member
if (flag == 0) { // print everything
s << "Element: " << this->getTag();
s << " type: TPB1D iNode: " << connectedExternalNodes(0);
s << " jNode: " << connectedExternalNodes(1) << endln;
s << " direction: " << direction << "\n";
opserr << " mu1: " << mu[0] << endln;
opserr << " mu2: " << mu[1]<< endln;
opserr << " mu3: " << mu[2]<< endln;
opserr << " R1: " << R[0]<< endln;
opserr << " R2: " << R[1]<< endln;
opserr << " R3: " << R[2]<< endln;
opserr << " h1: " << h[0]<< endln;
opserr << " h2: " << h[1]<< endln;
opserr << " h3: " << h[2]<< endln;
opserr << " D1: " << D[0]<< endln;
opserr << " D2: " << D[1]<< endln;
opserr << " D3: " << D[2]<< endln;
opserr << " d1: " << d[0]<< endln;
opserr << " d2: " << d[1]<< endln;
opserr << " d3: " << d[2]<< endln;
s << "\tMaterial: \n";
s << *(theMaterial);
}
}
开发者ID:lge88,项目名称:OpenSees,代码行数:33,代码来源:TPB1D.cpp
示例6: connectedExternalNodes
void GenericClient::Print(OPS_Stream &s, int flag)
{
int i;
if (flag == OPS_PRINT_CURRENTSTATE) {
// print everything
s << "Element: " << this->getTag() << endln;
s << " type: GenericClient" << endln;
for (i=0; i<numExternalNodes; i++ )
s << " Node" << i+1 << ": " << connectedExternalNodes(i);
s << endln;
s << " ipAddress: " << machineInetAddr
<< ", ipPort: " << port << endln;
s << " addRayleigh: " << addRayleigh << endln;
// determine resisting forces in global system
s << " resisting force: " << this->getResistingForce() << endln;
}
if (flag == OPS_PRINT_PRINTMODEL_JSON) {
s << "\t\t\t{";
s << "\"name\": " << this->getTag() << ", ";
s << "\"type\": \"GenericClient\", ";
s << "\"nodes\": [";
for (i = 0; i < numExternalNodes - 1; i++)
s << connectedExternalNodes(i) << ", ";
s << connectedExternalNodes(numExternalNodes) << "], ";
s << "\"ipAddress\": " << machineInetAddr << ", ";
s << "\"ipPort\": " << port << ", ";
s << "\"addRayleigh\": " << addRayleigh << "}";
}
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:30,代码来源:GenericClient.cpp
示例7: connectedExternalNodes
void
Truss2::Print(OPS_Stream &s, int flag)
{
// compute the strain and axial force in the member
double strain, force;
strain = theMaterial->getStrain();
force = A * theMaterial->getStress();
if (flag == 0) { // print everything
s << "Element: " << this->getTag();
s << " type: Truss2 iNode: " << connectedExternalNodes(0);
s << " jNode: " << connectedExternalNodes(1);
s << " Area: " << A << " Mass/Length: " << rho;
s << " \n\t strain: " << strain;
s << " axial load: " << force;
if (L != 0.0) {
int numDOF2 = numDOF/2;
double temp;
for (int i = 0; i < dimension; i++) {
temp = cosX[i]*force;
(*theVector)(i) = -temp;
(*theVector)(i+numDOF2) = temp;
}
s << " \n\t unbalanced load: " << *theVector;
}
s << " \t Material: " << *theMaterial;
s << endln;
} else if (flag == 1) {
s << this->getTag() << " " << strain << " ";
s << force << endln;
}
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:34,代码来源:Truss2.cpp
示例8: e
void
TrussSection::Print(OPS_Stream &s, int flag)
{
// compute the strain and axial force in the member
double strain, force;
if (L == 0.0) {
strain = 0;
force = 0.0;
} else {
strain = this->computeCurrentStrain();
force = 0.0;
int order = theSection->getOrder();
const ID &code = theSection->getType();
Vector e (order);
int i;
for (i = 0; i < order; i++) {
if (code(i) == SECTION_RESPONSE_P)
e(i) = strain;
}
theSection->setTrialSectionDeformation(e);
const Vector &s = theSection->getStressResultant();
for (i = 0; i < order; i++) {
if (code(i) == SECTION_RESPONSE_P)
force += s(i);
}
}
double temp;
int numDOF2 = numDOF/2;
if (theVector != 0) {
for (int i=0; i<dimension; i++) {
temp = force*cosX[i];
(*theVector)(i) = -force;
(*theVector)(i+numDOF2) = force;
}
}
if (flag == 0) { // print everything
s << "Element: " << this->getTag();
s << " type: TrussSection iNode: " << connectedExternalNodes(0);
s << " jNode: " << connectedExternalNodes(1);
s << " Mass density/length: " << rho;
s << " cMass: " << cMass;
s << " \n\t strain: " << strain;
s << " axial load: " << force;
if (theVector != 0)
s << " \n\t unbalanced load: " << *theVector;
s << " \t Section: " << *theSection;
s << endln;
} else if (flag == 1) {
s << this->getTag() << " " << strain << " ";
s << force << endln;
}
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:60,代码来源:TrussSection.cpp
示例9: K
// constructor:
// responsible for allocating the necessary space needed by each object
// and storing the tags of the truss end nodes.
PY_Macro2D::PY_Macro2D(int tag,
int node1,
int node2,
double _K,
double _py,
double _a,
double _b,
double _g,
double _m1,
double _m2,
double _w1,
double _p1,
double _S1,
double _beta,
double _s1,
double _tolerance,
int _maxNumIter)
:Element(tag, ELE_TAG_PY_MACRO2D),
K(_K), py(_py), a(_a), b(_b), g(_g), m1(_m1), m2(_m2),
w1(_w1), p1(_p1), S1(_S1), beta(_beta), s1(_s1),
tolerance(_tolerance), maxNumIter(_maxNumIter),
Ttangent(0.0), Tforce(0.0), Tz(0.0), TU(0.0), TW(0.0), TS(1.0), TS0(1.0), CW(0.0), CS(1.0), CS0(1.0),
Ctangent(0.0), Cforce(0.0), Cz(0.0), CU(0.0), Tt(0.0), Ct(0.0), trans(1,4),
connectedExternalNodes(2)
{
connectedExternalNodes(0) = node1;
connectedExternalNodes(1) = node2;
// set node pointers to NULL
for (int i=0; i<2; i++)
theNodes[i] = 0;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:35,代码来源:PY_Macro2D.cpp
示例10: theMaterial
// constructor:
// responsible for allocating the necessary space needed by each object
// and storing the tags of the CorotTruss end nodes.
CorotTruss::CorotTruss(int tag, int dim,
int Nd1, int Nd2,
UniaxialMaterial &theMat,
double a, double r)
:Element(tag,ELE_TAG_CorotTruss),
theMaterial(0), connectedExternalNodes(2),
numDOF(0), numDIM(dim),
Lo(0.0), Ln(0.0),
A(a), rho(r), R(3,3),
theMatrix(0), theVector(0)
{
// get a copy of the material and check we obtained a valid copy
theMaterial = theMat.getCopy();
if (theMaterial == 0) {
opserr << "FATAL CorotTruss::CorotTruss - " << tag <<
"failed to get a copy of material with tag " << theMat.getTag() << endln;
exit(-1);
}
// ensure the connectedExternalNode ID is of correct size & set values
if (connectedExternalNodes.Size() != 2) {
opserr << "FATAL CorotTruss::CorotTruss - " << tag <<
"failed to create an ID of size 2\n";
exit(-1);
}
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
// set node pointers to NULL
theNodes[0] = 0;
theNodes[1] = 0;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:36,代码来源:CorotTruss.cpp
示例11: connectedExternalNodes
void
PY_Macro2D::Print(OPS_Stream &s, int flag)
{
s << "Element: " << this->getTag();
s << " type: PY_Macro2D iNode: " << connectedExternalNodes(0);
s << " jNode: " << connectedExternalNodes(1) << endln;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:7,代码来源:PY_Macro2D.cpp
示例12: data
int
ElasticBeam3d::recvSelf(int cTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
{
int res = 0;
static Vector data(17);
res += theChannel.recvVector(this->getDbTag(), cTag, data);
if (res < 0) {
opserr << "ElasticBeam3d::recvSelf -- could not receive data Vector\n";
return res;
}
A = data(0);
E = data(1);
G = data(2);
Jx = data(3);
Iy = data(4);
Iz = data(5);
rho = data(6);
cMass = (int)data(7);
this->setTag((int)data(8));
connectedExternalNodes(0) = (int)data(9);
connectedExternalNodes(1) = (int)data(10);
alphaM = data(13);
betaK = data(14);
betaK0 = data(15);
betaKc = data(16);
// Check if the CoordTransf is null; if so, get a new one
int crdTag = (int)data(11);
if (theCoordTransf == 0) {
theCoordTransf = theBroker.getNewCrdTransf(crdTag);
if (theCoordTransf == 0) {
opserr << "ElasticBeam3d::recvSelf -- could not get a CrdTransf3d\n";
exit(-1);
}
}
// Check that the CoordTransf is of the right type; if not, delete
// the current one and get a new one of the right type
if (theCoordTransf->getClassTag() != crdTag) {
delete theCoordTransf;
theCoordTransf = theBroker.getNewCrdTransf(crdTag);
if (theCoordTransf == 0) {
opserr << "ElasticBeam3d::recvSelf -- could not get a CrdTransf3d\n";
exit(-1);
}
}
// Now, receive the CoordTransf
theCoordTransf->setDbTag((int)data(12));
res += theCoordTransf->recvSelf(cTag, theChannel, theBroker);
if (res < 0) {
opserr << "ElasticBeam3d::recvSelf -- could not receive CoordTransf\n";
return res;
}
return res;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:60,代码来源:ElasticBeam3d.cpp
示例13: theSection
// constructor:
// responsible for allocating the necessary space needed by each object
// and storing the tags of the CorotTrussSection end nodes.
CorotTrussSection::CorotTrussSection(int tag, int dim,
int Nd1, int Nd2,
SectionForceDeformation &theSec,
double r, int damp, int cm)
:Element(tag,ELE_TAG_CorotTrussSection),
theSection(0), connectedExternalNodes(2),
numDOF(0), numDIM(dim), Lo(0.0), Ln(0.0),
rho(r), doRayleighDamping(damp), cMass(cm),
R(3,3), theLoad(0), theMatrix(0), theVector(0)
{
// get a copy of the material and check we obtained a valid copy
theSection = theSec.getCopy();
if (theSection == 0) {
opserr << "FATAL CorotTrussSection::CorotTrussSection - " << tag <<
"failed to get a copy of material with tag " << theSec.getTag() << endln;
exit(-1);
}
// ensure the connectedExternalNode ID is of correct size & set values
if (connectedExternalNodes.Size() != 2) {
opserr << "FATAL CorotTrussSection::CorotTrussSection - " << tag <<
"failed to create an ID of size 2\n";
exit(-1);
}
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
// set node pointers to NULL
for (int i=0; i<2; i++)
theNodes[i] = 0;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:35,代码来源:CorotTrussSection.cpp
示例14: A
ElasticBeam3d::ElasticBeam3d(int tag, double a, double e, double g,
double jx, double iy, double iz, int Nd1, int Nd2,
CrdTransf &coordTransf, double r, int cm, int sectTag)
:Element(tag,ELE_TAG_ElasticBeam3d),
A(a), E(e), G(g), Jx(jx), Iy(iy), Iz(iz), rho(r), cMass(cm), sectionTag(sectTag),
Q(12), q(6), connectedExternalNodes(2), theCoordTransf(0)
{
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
theCoordTransf = coordTransf.getCopy3d();
if (!theCoordTransf) {
opserr << "ElasticBeam3d::ElasticBeam3d -- failed to get copy of coordinate transformation\n";
exit(-1);
}
q0[0] = 0.0;
q0[1] = 0.0;
q0[2] = 0.0;
q0[3] = 0.0;
q0[4] = 0.0;
p0[0] = 0.0;
p0[1] = 0.0;
p0[2] = 0.0;
p0[3] = 0.0;
p0[4] = 0.0;
// set node pointers to NULL
for (int i=0; i<2; i++)
theNodes[i] = 0;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:33,代码来源:ElasticBeam3d.cpp
示例15: ExperimentalElement
// responsible for allocating the necessary space needed
// by each object and storing the tags of the end nodes.
EETrussCorot::EETrussCorot(int tag, int dim, int Nd1, int Nd2,
ExperimentalSite *site, bool iM, int addRay, double r)
: ExperimentalElement(tag, ELE_TAG_EETrussCorot, site),
numDIM(dim), numDOF(0), connectedExternalNodes(2),
iMod(iM), addRayleigh(addRay), rho(r), L(0.0), Ln(0.0), R(3,3),
theMatrix(0), theVector(0), theLoad(0),
db(0), vb(0), ab(0), t(0),
dbDaq(0), vbDaq(0), abDaq(0), qDaq(0), tDaq(0),
dbCtrl(1), vbCtrl(1), abCtrl(1),
kbInit(1,1), tLast(0.0), firstWarning(true)
{
// ensure the connectedExternalNode ID is of correct size & set values
if (connectedExternalNodes.Size() != 2) {
opserr << "EETrussCorot::EETrussCorot() - element: "
<< tag << " failed to create an ID of size 2\n";
exit(-1);
}
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
// set node pointers to NULL
theNodes[0] = 0;
theNodes[1] = 0;
// set the data size for the experimental site
sizeCtrl = new ID(OF_Resp_All);
sizeDaq = new ID(OF_Resp_All);
(*sizeCtrl)[OF_Resp_Disp] = 1;
(*sizeCtrl)[OF_Resp_Vel] = 1;
(*sizeCtrl)[OF_Resp_Accel] = 1;
(*sizeCtrl)[OF_Resp_Time] = 1;
(*sizeDaq)[OF_Resp_Disp] = 1;
(*sizeDaq)[OF_Resp_Vel] = 1;
(*sizeDaq)[OF_Resp_Accel] = 1;
(*sizeDaq)[OF_Resp_Force] = 1;
(*sizeDaq)[OF_Resp_Time] = 1;
theSite->setSize(*sizeCtrl, *sizeDaq);
// allocate memory for trial response vectors
db = new Vector(1);
vb = new Vector(1);
ab = new Vector(1);
t = new Vector(1);
// allocate memory for daq response vectors
dbDaq = new Vector(1);
vbDaq = new Vector(1);
abDaq = new Vector(1);
qDaq = new Vector(1);
tDaq = new Vector(1);
// initialize additional vectors
dbCtrl.Zero();
vbCtrl.Zero();
abCtrl.Zero();
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:62,代码来源:EETrussCorot.cpp
示例16: ConstantPressureVolumeQuad
//full constructor
ConstantPressureVolumeQuad :: ConstantPressureVolumeQuad(
int tag,
int node1,
int node2,
int node3,
int node4,
NDMaterial &theMaterial ) :
Element( tag, ELE_TAG_ConstantPressureVolumeQuad ),
connectedExternalNodes(4), load(0)
{
connectedExternalNodes(0) = node1 ;
connectedExternalNodes(1) = node2 ;
connectedExternalNodes(2) = node3 ;
connectedExternalNodes(3) = node4 ;
int i ;
for ( i = 0 ; i < 4; i++ ) {
materialPointers[i] = theMaterial.getCopy("AxiSymmetric2D") ;
if (materialPointers[i] == 0) {
opserr << "ConstantPressureVolumeQuad::constructor - failed to get a material of type: AxiSymmetric2D\n";
exit(-1);
} //end if
} //end for i
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:29,代码来源:ConstantPressureVolumeQuad.cpp
示例17: A
ElasticBeam2d::ElasticBeam2d(int tag, double a, double e, double i,
int Nd1, int Nd2, CrdTransf &coordTransf,
double Alpha, double depth, double r, int cm)
:Element(tag,ELE_TAG_ElasticBeam2d),
A(a), E(e), I(i), alpha(Alpha), d(depth), rho(r), cMass(cm),
Q(6), q(3), connectedExternalNodes(2), theCoordTransf(0)
{
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
theCoordTransf = coordTransf.getCopy2d();
if (!theCoordTransf) {
opserr << "ElasticBeam2d::ElasticBeam2d -- failed to get copy of coordinate transformation\n";
exit(01);
}
q0[0] = 0.0;
q0[1] = 0.0;
q0[2] = 0.0;
p0[0] = 0.0;
p0[1] = 0.0;
p0[2] = 0.0;
// set node pointers to NULL
theNodes[0] = 0;
theNodes[1] = 0;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:29,代码来源:ElasticBeam2d.cpp
示例18: Element
ElastomericBearing2d::ElastomericBearing2d(int tag, int Nd1, int Nd2,
double ke, double fy, double alpha, UniaxialMaterial **materials,
const Vector _y, const Vector _x, double sdI, int addRay, double m)
: Element(tag, ELE_TAG_ElastomericBearing2d),
connectedExternalNodes(2),
k0(0.0), qYield(0.0), k2(0.0), x(_x), y(_y),
shearDistI(sdI), addRayleigh(addRay), mass(m),
L(0.0), ub(3), ubPlastic(0.0), qb(3), kb(3,3), ul(6),
Tgl(6,6), Tlb(3,6), ubPlasticC(0.0), kbInit(3,3)
{
// ensure the connectedExternalNode ID is of correct size & set values
if (connectedExternalNodes.Size() != 2) {
opserr << "ElastomericBearing2d::ElastomericBearing2d() - element: "
<< this->getTag() << " - failed to create an ID of size 2.\n";
}
connectedExternalNodes(0) = Nd1;
connectedExternalNodes(1) = Nd2;
// set node pointers to NULL
for (int i=0; i<2; i++)
theNodes[i] = 0;
// initialize parameters
k0 = (1.0-alpha)*ke;
qYield = (1.0-alpha)*fy;
k2 = alpha*ke;
// check material input
if (materials == 0) {
opserr << "ElastomericBearing2d::ElastomericBearing2d() - "
<< "null material array passed.\n";
exit(-1);
}
// get copies of the uniaxial materials
for (int i=0; i<2; i++) {
if (materials[i] == 0) {
opserr << "ElastomericBearing2d::ElastomericBearing2d() - "
"null uniaxial material pointer passed.\n";
exit(-1);
}
theMaterials[i] = materials[i]->getCopy();
if (theMaterials[i] == 0) {
opserr << "ElastomericBearing2d::ElastomericBearing2d() - "
<< "failed to copy uniaxial material.\n";
exit(-1);
}
}
// initialize initial stiffness matrix
kbInit.Zero();
kbInit(0,0) = theMaterials[0]->getInitialTangent();
kbInit(1,1) = ke;
kbInit(2,2) = theMaterials[1]->getInitialTangent();
// initialize other variables
this->revertToStart();
}
开发者ID:lge88,项目名称:OpenSees,代码行数:59,代码来源:ElastomericBearing2d.cpp
示例19: idData
int
CoupledZeroLength::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
{
int res = 0;
int dataTag = this->getDbTag();
// CoupledZeroLength creates an ID, receives the ID and then sets the
// internal data with the data in the ID
static ID idData(10);
res += theChannel.recvID(dataTag, commitTag, idData);
if (res < 0) {
opserr << "CoupledZeroLength::recvSelf -- failed to receive ID data\n";
return res;
}
res += theChannel.recvMatrix(dataTag, commitTag, transformation);
if (res < 0) {
opserr << "CoupledZeroLength::recvSelf -- failed to receive transformation Matrix\n";
return res;
}
this->setTag(idData(0));
dimension = idData(1);
numDOF = idData(2);
connectedExternalNodes(0) = idData(3);
connectedExternalNodes(1) = idData(4);
useRayleighDamping = idData(5);
dirn1 = idData(6);
dirn1 = idData(7);
int matDbTag = idData(8);
int matClassTag = idData(9);
// If null, get a new one from the broker
if (theMaterial == 0 || theMaterial->getClassTag() != matClassTag) {
if (theMaterial != 0)
delete theMaterial;
theMaterial = theBroker.getNewUniaxialMaterial(matClassTag);
if (theMaterial == 0) {
opserr << "CoupledZeroLength::recvSelf -- failed to allocate new Material " << endln;
return -1;
}
}
// Receive the materials
theMaterial->setDbTag(matDbTag);
res = theMaterial->recvSelf(commitTag, theChannel, theBroker);
if (res < 0) {
opserr << "CoupledZeroLength::recvSelf -- failed to receive new Material1d " << endln;
}
return res;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:59,代码来源:CoupledZeroLength.cpp
示例20: numSections
DispBeamColumn2d::DispBeamColumn2d(int tag, int nd1, int nd2,
int numSec, SectionForceDeformation **s,
BeamIntegration& bi,
CrdTransf &coordTransf, double r, int cm)
:Element (tag, ELE_TAG_DispBeamColumn2d),
numSections(numSec), theSections(0), crdTransf(0), beamInt(0),
connectedExternalNodes(2),
Q(6), q(3), rho(r), cMass(cm), parameterID(0)
{
// Allocate arrays of pointers to SectionForceDeformations
theSections = new SectionForceDeformation *[numSections];
if (theSections == 0) {
opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to allocate section model pointer\n";
exit(-1);
}
for (int i = 0; i < numSections; i++) {
// Get copies of the material model for each integration point
theSections[i] = s[i]->getCopy();
// Check allocation
if (theSections[i] == 0) {
opserr << "DispBeamColumn2d::DispBeamColumn2d -- failed to get a copy of section model\n";
exit(-1);
}
}
beamInt = bi.getCopy();
if (beamInt == 0) {
opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to copy beam integration\n";
exit(-1);
}
crdTransf = coordTransf.getCopy2d();
if (crdTransf == 0) {
opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to copy coordinate transformation\n";
exit(-1);
}
// Set connected external node IDs
connectedExternalNodes(0) = nd1;
connectedExternalNodes(1) = nd2;
theNodes[0] = 0;
theNodes[1] = 0;
q0[0] = 0.0;
q0[1] = 0.0;
q0[2] = 0.0;
p0[0] = 0.0;
p0[1] = 0.0;
p0[2] = 0.0;
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:58,代码来源:DispBeamColumn2d.cpp
注:本文中的connectedExternalNodes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论