本文整理汇总了C++中NDMaterial::getCopy方法的典型用法代码示例。如果您正苦于以下问题:C++ NDMaterial::getCopy方法的具体用法?C++ NDMaterial::getCopy怎么用?C++ NDMaterial::getCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDMaterial
的用法示例。
在下文中一共展示了NDMaterial::getCopy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SectionForceDeformation
// constructors:
WSection2d::WSection2d(int tag, NDMaterial &theMat,
double D, double Tw, double Bf, double Tf,
int Nfdw, int Nftf, double shape, double flag):
SectionForceDeformation(tag, SEC_TAG_WSection2d),
theFibers(0), yFibers(0), AFibers(0), e(6),
d(D), tw(Tw), bf(Bf), tf(Tf), nfdw(Nfdw), nftf(Nftf), shapeFactor(shape)
{
int numFibers = nfdw + 2*nftf;
theFibers = new NDMaterial*[numFibers];
yFibers = new double[numFibers];
AFibers = new double[numFibers];
for (int i = 0; i < numFibers; i++) {
theFibers[i] = flag ? theMat.getCopy("BeamFiber") :
theMat.getCopy("TimoshenkoFiber");
if (theFibers[i] == 0)
opserr << "WSection2d::WSection2d -- failed to get copy of beam fiber" << endln;
}
double dw = d-2*tf;
double a_f = bf*tf/nftf;
double a_w = dw*tw/nfdw;
int loc = 0;
double yIncr = tf/nftf;
double yStart = 0.5*d - 0.5*yIncr;
for (loc = 0; loc < nftf; loc++) {
AFibers[loc] = AFibers[numFibers-loc-1] = a_f;
yFibers[loc] = yStart - yIncr*loc;
yFibers[numFibers-loc-1] = -yFibers[loc];
}
yIncr = dw/nfdw;
yStart = 0.5*dw - 0.5*yIncr;
int count = 0;
for ( ; loc < numFibers-nftf; loc++, count++) {
AFibers[loc] = a_w;
yFibers[loc] = yStart - yIncr*count;
}
code(0) = SECTION_RESPONSE_P;
code(1) = SECTION_RESPONSE_MZ;
code(2) = SECTION_RESPONSE_MY;
code(3) = SECTION_RESPONSE_VY;
code(4) = SECTION_RESPONSE_VZ;
code(5) = SECTION_RESPONSE_T;
}
示例2: numDOF
ZeroLengthND::ZeroLengthND(int tag, int dim, int Nd1, int Nd2,
const Vector& x, const Vector& yprime,
NDMaterial &theNDmat) :
Element(tag, ELE_TAG_ZeroLengthND),
connectedExternalNodes(2),
dimension(dim), numDOF(0),
transformation(3,3), A(0), v(0), e(0.0), K(0), P(0),
end1Ptr(0), end2Ptr(0), theNDMaterial(0), the1DMaterial(0), order(0)
{
// Obtain copy of Nd material model
theNDMaterial = theNDmat.getCopy();
if (theNDMaterial == 0) {
opserr << "ZeroLengthND::zeroLengthND-- failed to get copy of NDMaterial\n";
exit(-1);
}
// Get the material order
order = theNDMaterial->getOrder();
// Check material order
if (order < 2 || order > 3) {
opserr << "ZeroLengthND:: -- NDMaterial not of order 2 or 3\n";
exit(-1);
}
// Set up the transformation matrix of direction cosines
this->setUp(Nd1, Nd2, x, yprime);
}
示例3:
//full constructor
PlateFromPlaneStressMaterialThermal::PlateFromPlaneStressMaterialThermal(
int tag, NDMaterial &ndMat, double g ) :
NDMaterial( tag, ND_TAG_PlateFromPlaneStressMaterialThermal ),
strain(5),gmod(g)
{
theMat = ndMat.getCopy("PlaneStress") ;
}
示例4: 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
}
示例5: theModel
GenericSectionNd::GenericSectionNd(int tag, NDMaterial &m, const ID &mCode)
:SectionForceDeformation(tag,SEC_TAG_GenericNd),
otherDbTag(0), theModel(0), code(0)
{
theModel = m.getCopy();
if (theModel == 0) {
g3ErrorHandler->fatal("%s -- failed to get copy of material model",
"GenericSectionNd::GenericSectionNd");
}
order = theModel->getOrder();
code = new ID(mCode);
if (code == 0) {
g3ErrorHandler->fatal("%s -- failed to allocate section ID",
"GenericSectionNd::GenericSectionNd");
}
if (order != code->Size()) {
g3ErrorHandler->warning("%s -- code size does not match order of material model",
"GenericSectionNd::GenericSectionNd");
}
}
示例6: theMaterial
NineFourNodeQuadUP::NineFourNodeQuadUP(int tag,
int nd1, int nd2, int nd3, int nd4,int nd5, int nd6, int nd7, int nd8,int nd9,
NDMaterial &m, const char *type, double t, double bulk, double r,
double p1, double p2, double b1, double b2)
:Element (tag, ELE_TAG_Nine_Four_Node_QuadUP),
theMaterial(0), connectedExternalNodes(9),
Ki(0), Q(22), thickness(t), kc(bulk), rho(r)
{
this->shapeFunction(wu, nintu, nenu, 0);
/* for( int L = 0; L < nintu; L++) {
for( int j = 0; j < nenu; j++) {
printf("%5d %5d %15.6e %15.6e %15.6e\n", L+1, j+1,
shlu[0][j][L],shlu[1][j][L],shlu[2][j][L]);
}
}
exit(-1);
*/
this->shapeFunction(wp, nintp, nenp, 1);
this->shapeFunction(wp, nintp, nenu, 2);
// Body forces
b[0] = b1;
b[1] = b2;
// Permeabilities
perm[0] = p1;
perm[1] = p2;
// Allocate arrays of pointers to NDMaterials
theMaterial = new NDMaterial *[nintu];
if (theMaterial == 0) {
opserr << "NineFourNodeQuadUP::NineFourNodeQuadUP - failed allocate material model pointer\n";
exit(-1);
}
for (int i = 0; i < nintu; i++) {
// Get copies of the material model for each integration point
theMaterial[i] = m.getCopy(type);
// Check allocation
if (theMaterial[i] == 0) {
opserr << "NineFourNodeQuadUP::NineFourNodeQuadUP -- failed to get a copy of material model\n";
exit(-1);
}
}
// Set connected external node IDs
connectedExternalNodes(0) = nd1;
connectedExternalNodes(1) = nd2;
connectedExternalNodes(2) = nd3;
connectedExternalNodes(3) = nd4;
connectedExternalNodes(4) = nd5;
connectedExternalNodes(5) = nd6;
connectedExternalNodes(6) = nd7;
connectedExternalNodes(7) = nd8;
connectedExternalNodes(8) = nd9;
}
示例7: theMaterial
FourNodeQuadUP::FourNodeQuadUP(int tag, int nd1, int nd2, int nd3, int nd4,
NDMaterial &m, const char *type, double t, double bulk,
double r, double p1, double p2, double b1, double b2, double p)
:Element (tag, ELE_TAG_FourNodeQuadUP),
theMaterial(0), connectedExternalNodes(4),
nd1Ptr(0), nd2Ptr(0), nd3Ptr(0), nd4Ptr(0), Ki(0),
Q(12), pressureLoad(12), applyLoad(0), thickness(t), kc(bulk), rho(r), pressure(p),
end1InitDisp(0),end2InitDisp(0),end3InitDisp(0),end4InitDisp(0)
{
pts[0][0] = -0.5773502691896258;
pts[0][1] = -0.5773502691896258;
pts[1][0] = 0.5773502691896258;
pts[1][1] = -0.5773502691896258;
pts[2][0] = 0.5773502691896258;
pts[2][1] = 0.5773502691896258;
pts[3][0] = -0.5773502691896258;
pts[3][1] = 0.5773502691896258;
wts[0] = 1.0;
wts[1] = 1.0;
wts[2] = 1.0;
wts[3] = 1.0;
// Body forces
b[0] = b1;
b[1] = b2;
// Permeabilities
perm[0] = p1;
perm[1] = p2;
// Allocate arrays of pointers to NDMaterials
theMaterial = new NDMaterial *[4];
if (theMaterial == 0) {
opserr << "FourNodeQuadUP::FourNodeQuadUP - failed allocate material model pointer\n";
exit(-1);
}
for (int i = 0; i < 4; i++) {
// Get copies of the material model for each integration point
theMaterial[i] = m.getCopy(type);
// Check allocation
if (theMaterial[i] == 0) {
opserr << "FourNodeQuadUP::FourNodeQuadUP -- failed to get a copy of material model\n";
exit(-1);
}
}
// Set connected external node IDs
connectedExternalNodes(0) = nd1;
connectedExternalNodes(1) = nd2;
connectedExternalNodes(2) = nd3;
connectedExternalNodes(3) = nd4;
}
示例8: NDMaterial
PlaneStressFiberMaterial::PlaneStressFiberMaterial(int tag, NDMaterial &theMat)
: NDMaterial(tag, ND_TAG_PlaneStressFiberMaterial),
Tstrain22(0.0), Cstrain22(0.0), twoDtgLastCommit(3,3), theMaterial(0), strain(2)
{
// Get a copy of the material
theMaterial = theMat.getCopy();
if (theMaterial == 0) {
opserr << "PlaneStressFiberMaterial::PlaneStressFiberMaterial -- failed to get copy of material\n";
exit(-1);
}
}
示例9: theMaterial
Tri31::Tri31(int tag, int nd1, int nd2, int nd3,
NDMaterial &m, const char *type, double t,
double p, double r, double b1, double b2)
:Element (tag, ELE_TAG_Tri31),
theMaterial(0), connectedExternalNodes(3),
Q(6), pressureLoad(6), thickness(t), pressure(p), rho(r), Ki(0)
{
pts[0][0] = 0.333333333333333;
pts[0][1] = 0.333333333333333;
wts[0] = 0.5;
if (strcmp(type,"PlaneStrain") != 0 && strcmp(type,"PlaneStress") != 0
&& strcmp(type,"PlaneStrain2D") != 0 && strcmp(type,"PlaneStress2D") != 0) {
opserr << "Tri31::Tri31 -- improper material type: " << type << "for Tri31\n";
exit(-1);
}
// Body forces
b[0] = b1;
b[1] = b2;
numgp = 1;
numnodes = 3;
// Allocate arrays of pointers to NDMaterials
theMaterial = new NDMaterial *[numgp];
if (theMaterial == 0) {
opserr << "Tri31::Tri31 - failed allocate material model pointer\n";
exit(-1);
}
int i;
for (i = 0; i < numgp; i++) {
// Get copies of the material model for each integration point
theMaterial[i] = m.getCopy(type);
// Check allocation
if (theMaterial[i] == 0) {
opserr << "Tri31::Tri31 -- failed to get a copy of material model\n";
exit(-1);
}
}
// Set connected external node IDs
connectedExternalNodes(0) = nd1;
connectedExternalNodes(1) = nd2;
connectedExternalNodes(2) = nd3;
for (i=0; i<numnodes; i++) theNodes[i] = 0;
}
示例10: theMaterial
// full constructor
SSPquad::SSPquad(int tag, int Nd1, int Nd2, int Nd3, int Nd4, NDMaterial &theMat,
const char *type, double thick, double b1, double b2)
:Element(tag,ELE_TAG_SSPquad),
theMaterial(0),
mExternalNodes(SSPQ_NUM_NODE),
mTangentStiffness(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
mInternalForces(SSPQ_NUM_DOF),
Q(SSPQ_NUM_DOF),
mMass(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
mNodeCrd(2,4),
mStrain(3),
mStress(3),
Mmem(3,SSPQ_NUM_DOF),
Kmem(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
Kstab(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
mThickness(thick),
applyLoad(0)
{
mExternalNodes(0) = Nd1;
mExternalNodes(1) = Nd2;
mExternalNodes(2) = Nd3;
mExternalNodes(3) = Nd4;
mThickness = thick;
b[0] = b1;
b[1] = b2;
appliedB[0] = 0.0;
appliedB[1] = 0.0;
// get copy of the material object
NDMaterial *theMatCopy = theMat.getCopy(type);
if (theMatCopy != 0) {
theMaterial = (NDMaterial *)theMatCopy;
} else {
opserr << "SSPquad::SSPquad - failed to get copy of material model\n";;
}
// check material
if (theMaterial == 0) {
opserr << "SSPquad::SSPquad - failed to allocate material model pointer\n";
exit(-1);
}
// check the type
if (strcmp(type,"PlaneStrain") != 0 && strcmp(type,"PlaneStress") != 0) {
opserr << "SSPquad::SSPquad - improper material type: " << type << "for SSPquad\n";
exit(-1);
}
}
示例11:
//full constructor
MembranePlateFiberSection::MembranePlateFiberSection(
int tag,
double thickness,
NDMaterial &Afiber ) :
SectionForceDeformation( tag, SEC_TAG_MembranePlateFiberSection ),
strainResultant(8)
{
this->h = thickness ;
int i ;
for ( i = 0; i < numFibers; i++ )
theFibers[i] = Afiber.getCopy( "PlateFiber" ) ;
}
示例12: NDMaterial
BeamFiberMaterial::BeamFiberMaterial(int tag, NDMaterial &theMat)
: NDMaterial(tag, ND_TAG_BeamFiberMaterial),
Tstrain22(0.0), Tstrain33(0.0), Tgamma23(0.0),
Cstrain22(0.0), Cstrain33(0.0), Cgamma23(0.0),
theMaterial(0), strain(3)
{
// Get a copy of the material
theMaterial = theMat.getCopy("ThreeDimensional");
if (theMaterial == 0) {
opserr << "BeamFiberMaterial::BeamFiberMaterial -- failed to get copy of material\n";
exit(-1);
}
}
示例13: Fiber
// constructor:
BiaxialFiber2d::BiaxialFiber2d(int tag,
NDMaterial &theMat,
double Area, double position):
Fiber(tag, FIBER_TAG_Biaxial2d),
theMaterial(0), area(Area), y(-position)
{
theMaterial = theMat.getCopy("BeamFiber2d"); // get a copy of the MaterialModel
if (theMaterial == 0) {
opserr <<"BiaxialFiber2d::BiaxialFiber2d -- failed to get copy of NDMaterial\n";
exit(-1);
}
if (code(0) != SECTION_RESPONSE_P) {
code(0) = SECTION_RESPONSE_P;
code(1) = SECTION_RESPONSE_MZ;
code(2) = SECTION_RESPONSE_VY;
}
}
示例14: applyLoad
//*********************************************************************
//full constructor
BbarBrick::BbarBrick( int tag,
int node1,
int node2,
int node3,
int node4,
int node5,
int node6,
int node7,
int node8,
NDMaterial &theMaterial,
double b1, double b2, double b3) :
Element( tag, ELE_TAG_BbarBrick ),
connectedExternalNodes(8), applyLoad(0), load(0), Ki(0)
{
connectedExternalNodes(0) = node1 ;
connectedExternalNodes(1) = node2 ;
connectedExternalNodes(2) = node3 ;
connectedExternalNodes(3) = node4 ;
connectedExternalNodes(4) = node5 ;
connectedExternalNodes(5) = node6 ;
connectedExternalNodes(6) = node7 ;
connectedExternalNodes(7) = node8 ;
int i ;
for ( i=0; i<8; i++ ) {
materialPointers[i] = theMaterial.getCopy("ThreeDimensional") ;
if (materialPointers[i] == 0) {
opserr <<"BbarBrick::constructor - failed to get a material of type: ThreeDimensional\n";
exit(-1);
} //end if
} //end for i
// Body forces
b[0] = b1;
b[1] = b2;
b[2] = b3;
}
示例15: area
BiaxialFiber3d::BiaxialFiber3d(int tag,
NDMaterial &theMat,
double Area, const Vector &position, double perpTheta)
:Fiber(tag, FIBER_TAG_Biaxial3d),
area(Area), R(perpTheta)
{
theMaterial = theMat.getCopy("BeamFiber2d"); // get a copy of the MaterialModel
if (theMaterial == 0) {
opserr << "BiaxialFiber3d::BiaxialFiber3d -- failed to get copy of NDMaterial\n";
exit(-1);
}
if (code(0) != SECTION_RESPONSE_P) {
code(0) = SECTION_RESPONSE_P;
code(1) = SECTION_RESPONSE_MZ;
code(2) = SECTION_RESPONSE_VY;
}
as[0] = -position(0);
as[1] = position(1);
}