From 039dd7e8742732c32c2f1c87cc72fae5a63f85c3 Mon Sep 17 00:00:00 2001 From: "Michael H. Scott" Date: Sun, 19 May 2024 16:11:34 -0700 Subject: [PATCH] Adding object broker functions for unloading rule and stiffness and strength degradation --- SRC/actor/objectBroker/FEM_ObjectBroker.cpp | 18 + SRC/actor/objectBroker/FEM_ObjectBroker.h | 7 + .../FEM_ObjectBrokerAllClasses.cpp | 166 ++++++++- .../objectBroker/FEM_ObjectBrokerAllClasses.h | 3 + .../uniaxial/OOHystereticMaterial.cpp | 330 +++++++++++++++++- 5 files changed, 520 insertions(+), 4 deletions(-) diff --git a/SRC/actor/objectBroker/FEM_ObjectBroker.cpp b/SRC/actor/objectBroker/FEM_ObjectBroker.cpp index e613ec90f2..0109337927 100644 --- a/SRC/actor/objectBroker/FEM_ObjectBroker.cpp +++ b/SRC/actor/objectBroker/FEM_ObjectBroker.cpp @@ -153,6 +153,24 @@ FEM_ObjectBroker::getNewHystereticBackbone(int classTag) return 0; } +UnloadingRule * +FEM_ObjectBroker::getNewUnloadingRule(int classTag) +{ + return 0; +} + +StiffnessDegradation * +FEM_ObjectBroker::getNewStiffnessDegradation(int classTag) +{ + return 0; +} + +StrengthDegradation * +FEM_ObjectBroker::getNewStrengthDegradation(int classTag) +{ + return 0; +} + UniaxialMaterial * FEM_ObjectBroker::getNewUniaxialMaterial(int classTag) { diff --git a/SRC/actor/objectBroker/FEM_ObjectBroker.h b/SRC/actor/objectBroker/FEM_ObjectBroker.h index 7b0c6d15bf..d859882f33 100644 --- a/SRC/actor/objectBroker/FEM_ObjectBroker.h +++ b/SRC/actor/objectBroker/FEM_ObjectBroker.h @@ -80,7 +80,11 @@ class SectionForceDeformation; class NDMaterial; class Fiber; class FrictionModel; + class HystereticBackbone; +class UnloadingRule; +class StiffnessDegradation; +class StrengthDegradation; class ConvergenceTest; class GroundMotion; @@ -128,6 +132,9 @@ class FEM_ObjectBroker virtual FrictionModel *getNewFrictionModel(int classTag); virtual HystereticBackbone *getNewHystereticBackbone(int classTag); + virtual UnloadingRule *getNewUnloadingRule(int classTag); + virtual StiffnessDegradation *getNewStiffnessDegradation(int classTag); + virtual StrengthDegradation *getNewStrengthDegradation(int classTag); virtual ConvergenceTest *getNewConvergenceTest(int classTag); virtual LoadPattern *getNewLoadPattern(int classTag); diff --git a/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp b/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp index d11a079bc0..f9bca4a4a6 100644 --- a/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp +++ b/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp @@ -103,6 +103,7 @@ #include "HardeningMaterial.h" #include "HystereticMaterial.h" #include "HystereticSMMaterial.h" +#include "OOHystereticMaterial.h" #include "EPPGapMaterial.h" #include "ViscousMaterial.h" #include "ViscousDamper.h" @@ -300,7 +301,41 @@ #include "frictionBearing/frictionModel/VelDepMultiLinear.h" #include "frictionBearing/frictionModel/VelNormalFrcDep.h" +#include "CappedBackbone.h" +#include "LinearCappedBackbone.h" +#include "MaterialBackbone.h" #include "ArctangentBackbone.h" +#include "TrilinearBackbone.h" +#include "MultilinearBackbone.h" +#include "ManderBackbone.h" +//#include "KentParkBackbone.h" +#include "RaynorBackbone.h" +#include "ReeseStiffClayBelowWS.h" +#include "ReeseStiffClayAboveWS.h" +#include "ReeseSoftClayBackbone.h" +#include "ReeseSandBackbone.h" +#include "VuggyLimestone.h" +#include "CementedSoil.h" +#include "WeakRock.h" +#include "LiquefiedSand.h" + +#include "ConstantUnloadingRule.h" +#include "TakedaUnloadingRule.h" +#include "EnergyUnloadingRule.h" +#include "KarsanUnloadingRule.h" + +#include "ConstantStiffnessDegradation.h" +#include "DuctilityStiffnessDegradation.h" +#include "EnergyStiffnessDegradation.h" +#include "PincheiraStiffnessDegradation.h" + +#include "ConstantStrengthDegradation.h" +#include "ACIStrengthDegradation.h" +#include "DuctilityStrengthDegradation.h" +#include "PetrangeliStrengthDegradation.h" +#include "EnergyStrengthDegradation.h" +#include "SectionStrengthDegradation.h" + // element header files #include "Element.h" @@ -1454,17 +1489,143 @@ HystereticBackbone * FEM_ObjectBrokerAllClasses::getNewHystereticBackbone(int classTag) { switch (classTag) { + case BACKBONE_TAG_Capped: + return new CappedBackbone(); + + case BACKBONE_TAG_LinearCapped: + return new LinearCappedBackbone(); + + case BACKBONE_TAG_Material: + return new MaterialBackbone(); + case BACKBONE_TAG_Arctangent: return new ArctangentBackbone(); + + case BACKBONE_TAG_Trilinear: + return new TrilinearBackbone(); + + case BACKBONE_TAG_Multilinear: + return new MultilinearBackbone(); + + case BACKBONE_TAG_Mander: + return new ManderBackbone(); + + // case BACKBONE_TAG_KentPark: + //return new KentParkBackbone(); + + case BACKBONE_TAG_Raynor: + return new RaynorBackbone(); + + case BACKBONE_TAG_ReeseStiffClayBelowWS: + return new ReeseStiffClayBelowWS(); + + case BACKBONE_TAG_ReeseStiffClayAboveWS: + return new ReeseStiffClayAboveWS(); + + case BACKBONE_TAG_ReeseSoftClay: + return new ReeseSoftClayBackbone(); + + case BACKBONE_TAG_ReeseSand: + return new ReeseSandBackbone(); + + case BACKBONE_TAG_VuggyLimestone: + return new VuggyLimestone(); + + case BACKBONE_TAG_CementedSoil: + return new CementedSoil(); + + case BACKBONE_TAG_WeakRock: + return new WeakRock(); + + case BACKBONE_TAG_LiquefiedSand: + return new LiquefiedSand(); default: - opserr << "FEM_ObjectBrokerAllClasses::getHystereticBackbone - "; + opserr << "FEM_ObjectBrokerAllClasses::getNewHystereticBackbone - "; opserr << " - no HystereticBackbone type exists for class tag "; opserr << classTag << endln; return 0; } } +UnloadingRule * +FEM_ObjectBrokerAllClasses::getNewUnloadingRule(int classTag) +{ + switch (classTag) { + case DEG_TAG_UNLOAD_Constant: + return new ConstantUnloadingRule(); + + case DEG_TAG_UNLOAD_Takeda: + return new TakedaUnloadingRule(); + + case DEG_TAG_UNLOAD_Energy: + return new EnergyUnloadingRule(); + + case DEG_TAG_UNLOAD_Karsan: + return new KarsanUnloadingRule(); + + default: + opserr << "FEM_ObjectBrokerAllClasses::getNewUnloadingRule - "; + opserr << " - no UnloadingRule type exists for class tag "; + opserr << classTag << endln; + return 0; + } +} + +StiffnessDegradation * +FEM_ObjectBrokerAllClasses::getNewStiffnessDegradation(int classTag) +{ + switch (classTag) { + case DEG_TAG_STIFF_Constant: + return new ConstantStiffnessDegradation(); + + case DEG_TAG_STIFF_Ductility: + return new DuctilityStiffnessDegradation(); + + case DEG_TAG_STIFF_Energy: + return new EnergyStiffnessDegradation(); + + case DEG_TAG_STIFF_Pincheira: + return new PincheiraStiffnessDegradation(); + + default: + opserr << "FEM_ObjectBrokerAllClasses::getStiffnessDegradation - "; + opserr << " - no StiffnessDegradation type exists for class tag "; + opserr << classTag << endln; + return 0; + } +} + +StrengthDegradation * +FEM_ObjectBrokerAllClasses::getNewStrengthDegradation(int classTag) +{ + switch (classTag) { + case DEG_TAG_STRENGTH_Constant: + return new ConstantStrengthDegradation(); + + case DEG_TAG_STRENGTH_Ductility: + return new DuctilityStrengthDegradation(); + + case DEG_TAG_STRENGTH_Petrangeli: + return new PetrangeliStrengthDegradation(); + + case DEG_TAG_STRENGTH_Energy: + return new EnergyStrengthDegradation(); + + case DEG_TAG_STRENGTH_Section: + return new SectionStrengthDegradation(); + + case DEG_TAG_STRENGTH_ACI: + return new ACIStrengthDegradation(); + + default: + opserr << "FEM_ObjectBrokerAllClasses::getStrengthDegradation - "; + opserr << " - no StrengthDegradation type exists for class tag "; + opserr << classTag << endln; + return 0; + } +} + UniaxialMaterial * FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag) { @@ -1632,6 +1793,9 @@ FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag) case MAT_TAG_HystereticSM: return new HystereticSMMaterial(); + case MAT_TAG_OOHysteretic: + return new OOHystereticMaterial(); + case MAT_TAG_ModIMKPeakOriented: return new ModIMKPeakOriented(); diff --git a/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.h b/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.h index 2dfe2bdd09..0742b808ac 100644 --- a/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.h +++ b/SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.h @@ -74,6 +74,9 @@ class FEM_ObjectBrokerAllClasses : public FEM_ObjectBroker FrictionModel *getNewFrictionModel(int classTag); HystereticBackbone *getNewHystereticBackbone(int classTag); + UnloadingRule *getNewUnloadingRule(int classTag); + StiffnessDegradation *getNewStiffnessDegradation(int classTag); + StrengthDegradation *getNewStrengthDegradation(int classTag); ConvergenceTest *getNewConvergenceTest(int classTag); LoadPattern *getNewLoadPattern(int classTag); diff --git a/SRC/material/uniaxial/OOHystereticMaterial.cpp b/SRC/material/uniaxial/OOHystereticMaterial.cpp index ad0764886d..b7b5320d0d 100644 --- a/SRC/material/uniaxial/OOHystereticMaterial.cpp +++ b/SRC/material/uniaxial/OOHystereticMaterial.cpp @@ -43,7 +43,8 @@ #include #include #include - +#include +#include #include #include @@ -1036,14 +1037,337 @@ OOHystereticMaterial::getVariable(int varID, Information &info) int OOHystereticMaterial::sendSelf(int commitTag, Channel &theChannel) { - return -1; + int dbTag = this->getDbTag(); + + ID idata(1 + 2*8 + 6); + idata(0) = this->getTag(); + + idata(17) = posUnlRuleID; + idata(18) = negUnlRuleID; + idata(19) = posStfDegrID; + idata(20) = negStfDegrID; + idata(21) = posStrDegrID; + idata(22) = negStrDegrID; + + int tmpdbTag; + + // Backbones + idata(1) = posEnvelope->getClassTag(); + tmpdbTag = posEnvelope->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + posEnvelope->setDbTag(tmpdbTag); + } + idata(2) = tmpdbTag; + idata(3) = negEnvelope->getClassTag(); + tmpdbTag = negEnvelope->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + negEnvelope->setDbTag(tmpdbTag); + } + idata(4) = tmpdbTag; + + // Unloading rules + idata(5) = posUnlRule->getClassTag(); + tmpdbTag = posUnlRule->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + posUnlRule->setDbTag(tmpdbTag); + } + idata(6) = tmpdbTag; + idata(7) = negUnlRule->getClassTag(); + tmpdbTag = negUnlRule->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + negUnlRule->setDbTag(tmpdbTag); + } + idata(8) = tmpdbTag; + + // Stiffness degradations + idata(9) = posStfDegr->getClassTag(); + tmpdbTag = posStfDegr->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + posStfDegr->setDbTag(tmpdbTag); + } + idata(10) = tmpdbTag; + idata(11) = negStfDegr->getClassTag(); + tmpdbTag = negStfDegr->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + negStfDegr->setDbTag(tmpdbTag); + } + idata(12) = tmpdbTag; + + // Strength degradations + idata(13) = posStrDegr->getClassTag(); + tmpdbTag = posStrDegr->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + posStrDegr->setDbTag(tmpdbTag); + } + idata(14) = tmpdbTag; + idata(15) = negStrDegr->getClassTag(); + tmpdbTag = negStrDegr->getDbTag(); + if (tmpdbTag == 0) { + tmpdbTag = theChannel.getDbTag(); + negStrDegr->setDbTag(tmpdbTag); + } + idata(16) = tmpdbTag; + + + if (theChannel.sendID(dbTag, commitTag, idata) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send ID data" << endln; + return -1; + } + + if (posEnvelope->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send positive envelope" << endln; + return -1; + } + if (negEnvelope->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send negative envelope" << endln; + return -1; + } + if (posUnlRule->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send positive unloading rule" << endln; + return -1; + } + if (negUnlRule->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send negative unloading rule" << endln; + return -1; + } + if (posStfDegr->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send positive stiffness degradation" << endln; + return -1; + } + if (negStfDegr->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send negative stiffness degradation" << endln; + return -1; + } + if (posStrDegr->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send positive strength degradation" << endln; + return -1; + } + if (negStrDegr->sendSelf(commitTag, theChannel) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send negative strength degradation" << endln; + return -1; + } + + + Vector data(7 + 10); + data(0) = pinchX; + data(1) = pinchY; + data(2) = E1p; + data(3) = E1n; + data(4) = rot1p; + data(5) = rot1n; + data(6) = firstIter ? 1.0 : -1.0; + + data(7) = CrotMax; + data(8) = CrotMin; + data(9) = CtargMax; + data(10) = CtargMin; + data(11) = CrotPu; + data(12) = CrotNu; + data(13) = CenergyD; + data(14) = CloadIndicator; + data(15) = Cstress; + data(16) = Cstrain; + + if (theChannel.sendVector(dbTag, commitTag, data) < 0) { + opserr << "OOHystereticMaterial::sendSelf() - failed to send data" << endln; + return -1; + } + + return 0; } int OOHystereticMaterial::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { - return -1; + int res = 0; + int dbTag = this->getDbTag(); + + ID idata(1 + 2*8 + 6); + res = theChannel.recvID(dbTag, commitTag, idata); + if (res < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to receive ID data" << endln; + return -1; + } + + this->setTag(idata(0)); + + posUnlRuleID = idata(17); + negUnlRuleID = idata(18); + posStfDegrID = idata(19); + negStfDegrID = idata(20); + posStrDegrID = idata(21); + negStrDegrID = idata(22); + + int tmpdbTag; + int tmpClassTag; + + // Backbones + tmpClassTag = idata(1); + if (posEnvelope == 0 || posEnvelope->getClassTag() != tmpClassTag) { + if (posEnvelope != 0) + delete posEnvelope; + posEnvelope = theBroker.getNewHystereticBackbone(tmpClassTag); + if (posEnvelope == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get positive hysteretic backbone" << endln; + return -2; + } + posEnvelope->setDbTag(idata(2)); + } + tmpClassTag = idata(3); + if (negEnvelope == 0 || negEnvelope->getClassTag() != tmpClassTag) { + if (negEnvelope != 0) + delete negEnvelope; + negEnvelope = theBroker.getNewHystereticBackbone(tmpClassTag); + if (negEnvelope == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get negative hysteretic backbone" << endln; + return -2; + } + negEnvelope->setDbTag(idata(4)); + } + + // Unloading rules + tmpClassTag = idata(5); + if (posUnlRule == 0 || posUnlRule->getClassTag() != tmpClassTag) { + if (posUnlRule != 0) + delete posUnlRule; + posUnlRule = theBroker.getNewUnloadingRule(tmpClassTag); + if (posUnlRule == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get positive unloading rule" << endln; + return -2; + } + posUnlRule->setDbTag(idata(6)); + } + tmpClassTag = idata(7); + if (negUnlRule == 0 || negUnlRule->getClassTag() != tmpClassTag) { + if (negUnlRule != 0) + delete negUnlRule; + negUnlRule = theBroker.getNewUnloadingRule(tmpClassTag); + if (negUnlRule == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get negative unloading rule" << endln; + return -2; + } + negUnlRule->setDbTag(idata(8)); + } + + // Stiffness degradations + tmpClassTag = idata(9); + if (posStfDegr == 0 || posStfDegr->getClassTag() != tmpClassTag) { + if (posStfDegr != 0) + delete posStfDegr; + posStfDegr = theBroker.getNewStiffnessDegradation(tmpClassTag); + if (posStfDegr == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get positive stiffness degradation" << endln; + return -2; + } + posStfDegr->setDbTag(idata(10)); + } + tmpClassTag = idata(11); + if (negStfDegr == 0 || negStfDegr->getClassTag() != tmpClassTag) { + if (negStfDegr != 0) + delete negStfDegr; + negStfDegr = theBroker.getNewStiffnessDegradation(tmpClassTag); + if (negStfDegr == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get negative stiffness degradation" << endln; + return -2; + } + negStfDegr->setDbTag(idata(12)); + } + + // Strength degradations + tmpClassTag = idata(13); + if (posStrDegr == 0 || posStrDegr->getClassTag() != tmpClassTag) { + if (posStrDegr != 0) + delete posStrDegr; + posStrDegr = theBroker.getNewStrengthDegradation(tmpClassTag); + if (posStrDegr == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get positive strength degradation" << endln; + return -2; + } + posStrDegr->setDbTag(idata(14)); + } + tmpClassTag = idata(15); + if (negStrDegr == 0 || negStrDegr->getClassTag() != tmpClassTag) { + if (negStrDegr != 0) + delete negStrDegr; + negStrDegr = theBroker.getNewStrengthDegradation(tmpClassTag); + if (negStrDegr == 0) { + opserr << "OOHystereticMaterial::recvSelf -- could not get negative strength degradation" << endln; + return -2; + } + negStrDegr->setDbTag(idata(16)); + } + + + if (posEnvelope->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv positive envelope" << endln; + return -1; + } + if (negEnvelope->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv negative envelope" << endln; + return -1; + } + if (posUnlRule->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv positive unloading rule" << endln; + return -1; + } + if (negUnlRule->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv negative unloading rule" << endln; + return -1; + } + if (posStfDegr->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv positive stiffness degradation" << endln; + return -1; + } + if (negStfDegr->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv negative stiffness degradation" << endln; + return -1; + } + if (posStrDegr->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv positive strength degradation" << endln; + return -1; + } + if (negStrDegr->recvSelf(commitTag, theChannel, theBroker) < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to recv negative strength degradation" << endln; + return -1; + } + + Vector data(7 + 10); + res = theChannel.recvVector(dbTag, commitTag, data); + if (res < 0) { + opserr << "OOHystereticMaterial::recvSelf() - failed to receive data" << endln; + return -1; + } + + pinchX = data(0); + pinchY = data(1); + E1p = data(2); + E1n = data(3); + rot1p = data(4); + rot1n = data(5); + firstIter = data(6) > 0.0 ? true : false; + + CrotMax = data(7); + CrotMin = data(8); + CtargMax = data(9); + CtargMin = data(10); + CrotPu = data(11); + CrotNu = data(12); + CenergyD = data(13); + CloadIndicator = int(data(14)); + Cstress = data(15); + Cstrain = data(16); + + this->revertToLastCommit(); + + return 0; } void