本文整理汇总了C++中NDMaterial::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ NDMaterial::getTag方法的具体用法?C++ NDMaterial::getTag怎么用?C++ NDMaterial::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDMaterial
的用法示例。
在下文中一共展示了NDMaterial::getTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
double
TzLiq1::getEffectiveStress(void)
{
// Default value for meanStress
double meanStress = meanConsolStress;
// if theDomain pointer is nonzero, then set pointers to attached soil elements.
//
if(theDomain != 0)
{
Element *theElement1 = theDomain->getElement(solidElem1);
Element *theElement2 = theDomain->getElement(solidElem2);
if (theElement1 == 0 || theElement2 == 0) {
opserr << "WARNING solid element not found in getEffectiveStress" << endln;
opserr << "TzLiq1: " << endln;
opserr << "Adjacent solidElems: " << solidElem1 << ", " << solidElem2 << endln;
exit(-1);
}
// Check that the class tags for the solid elements are either for a FourNodeQuad object, a FourNodeQuadUP object,
// a 9_4_QuadUP object, a SSPquadUP object, or a SSPquad object
if(theElement1->getClassTag()!=ELE_TAG_FourNodeQuad && theElement1->getClassTag()!=ELE_TAG_FourNodeQuadUP &&
theElement1->getClassTag()!=ELE_TAG_Nine_Four_Node_QuadUP && theElement1->getClassTag()!=ELE_TAG_SSPquadUP && theElement1->getClassTag()!=ELE_TAG_SSPquad)
{
opserr << "Element: " << theElement1->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
if(theElement2->getClassTag()!=ELE_TAG_FourNodeQuad && theElement2->getClassTag()!=ELE_TAG_FourNodeQuadUP &&
theElement2->getClassTag()!=ELE_TAG_Nine_Four_Node_QuadUP && theElement2->getClassTag()!=ELE_TAG_SSPquadUP && theElement2->getClassTag()!=ELE_TAG_SSPquad)
{
opserr << "Element: " << theElement2->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
double excessPorePressure = 0.0;
meanStress = 0.0;
// get mean stress from element1 if it is a FourNodeQuad object
if(theElement1->getClassTag()==ELE_TAG_FourNodeQuad)
{
// It's safe to cast *theElement1 onto the FourNodeQuad class because we already
// checked the class tags.
FourNodeQuad *theElement1 = (FourNodeQuad *)(theDomain->getElement(solidElem1));
// If the element is a quad, check that the class tag for the material at each gauss point is 100 for FluidSolidPorous object
meanStress = 0.0;
for(int i=0;i<4;i++)
{
NDMaterial *NDM = theElement1->theMaterial[i];
if(NDM->getClassTag()!=ND_TAG_FluidSolidPorousMaterial){
opserr << "Material: " << NDM->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
FluidSolidPorousMaterial *theFSPM = (FluidSolidPorousMaterial *)(NDM);
meanStress += 1.0/8.0*(2.0/3.0*(NDM->getStress())[0] + 1.0/3.0*(NDM->getStress())[1] - theFSPM->trialExcessPressure);
}
}
// get mean stress from element2 if it is a FourNodeQuad object
if(theElement2->getClassTag()==ELE_TAG_FourNodeQuad)
{
// It's safe to cast *theElement1 onto the FourNodeQuad class because we already
// checked the class tags.
FourNodeQuad *theElement2 = (FourNodeQuad *)(theDomain->getElement(solidElem2));
for(int i=0;i<4;i++)
{
NDMaterial *NDM = theElement2->theMaterial[i];
if(NDM->getClassTag()!=ND_TAG_FluidSolidPorousMaterial){
opserr << "Material: " << NDM->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
FluidSolidPorousMaterial *theFSPM = (FluidSolidPorousMaterial *)(NDM);
meanStress += 1.0/8.0*(2.0/3.0*(NDM->getStress())[0] + 1.0/3.0*(NDM->getStress())[1] - theFSPM->trialExcessPressure);
}
}
// get mean stress from element1 if it is a FourNodeQuadUP object
if(theElement1->getClassTag()==ELE_TAG_FourNodeQuadUP) {
// It's safe to cast *theElement1 onto the FourNodeQuadUP class because we already checked the class tags.
FourNodeQuadUP *theElement1 = (FourNodeQuadUP *)(theDomain->getElement(solidElem1));
meanStress=0.0;
for(int i=0;i<4;i++) {
NDMaterial *NDM = theElement1->theMaterial[i];
if(NDM->getClassTag()==ND_TAG_InitialStateAnalysisWrapper) {
InitialStateAnalysisWrapper *NDM = (InitialStateAnalysisWrapper *)(theElement1->theMaterial);
if(NDM->getMainClassTag()!=ND_TAG_PressureDependMultiYield && NDM->getMainClassTag()!=ND_TAG_PressureDependMultiYield02) {
opserr << "Material: " << NDM->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
} else if(NDM->getClassTag()!=ND_TAG_PressureDependMultiYield && NDM->getClassTag() !=ND_TAG_PressureDependMultiYield02){
opserr << "Material: " << NDM->getTag() << " cannot be used to read effective stress for a TzLiq1 material." << endln;
exit(-1);
}
meanStress += 1.0/8.0*(2.0/3.0*(NDM->getStress())[0] + 1.0/3.0*(NDM->getStress())[1]);
}
}
// get mean stress from element 2 if it is a FourNodeQuadUP object
if(theElement2->getClassTag()==ELE_TAG_FourNodeQuadUP) {
// It's safe to cast *theElement2 onto the FourNodeQuadUP class because we already checked the class tags.
FourNodeQuadUP *theElement2 = (FourNodeQuadUP *)(theDomain->getElement(solidElem2));
//.........这里部分代码省略.........