Skip to content

Commit

Permalink
Merge pull request OpenSees#1323 from mhscott/send-recv
Browse files Browse the repository at this point in the history
UniaxialMaterial sendSelf/recvSelf
  • Loading branch information
mhscott authored Jan 3, 2024
2 parents 61c046f + c8bbac9 commit 3434c0a
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 17 deletions.
11 changes: 9 additions & 2 deletions SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@

// uniaxial material model header files
#include "ElasticBilin.h"
#include "BoucWenMaterial.h" //SAJalali
#include "BoucWenMaterial.h"
#include "BoucWenInfill.h"
#include "SPSW02.h" //SAJalali
#include "ElasticMaterial.h"
#include "ElasticMultiLinear.h"
Expand All @@ -71,6 +72,7 @@
#include "TensionOnlyMaterial.h"
#include "ASD_SMA_3K.h"
#include "Concrete01.h"
#include "Concrete01WithSITC.h"
#include "Concrete02.h"
#include "Concrete02IS.h"
#include "Concrete04.h"
Expand Down Expand Up @@ -1394,7 +1396,9 @@ FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag)
case MAT_TAG_SPSW02:
return new SPSW02(); // SAJalali
case MAT_TAG_BoucWen:
return new BoucWenMaterial(); // SAJalali
return new BoucWenMaterial();
case MAT_TAG_BoucWenInfill:
return new BoucWenInfill();
case MAT_TAG_ElasticMaterial:
return new ElasticMaterial();

Expand Down Expand Up @@ -1431,6 +1435,9 @@ FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag)
case MAT_TAG_Concrete01:
return new Concrete01();

case MAT_TAG_Concrete01WithSITC:
return new Concrete01WithSITC();

case MAT_TAG_Concrete02:
return new Concrete02();

Expand Down
78 changes: 70 additions & 8 deletions SRC/material/uniaxial/BoucWenInfill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ BoucWenInfill::BoucWenInfill(int tag,
double p_epsp,
double ptolerance,
int pMaxNumIter)
:UniaxialMaterial(tag, 0),
:UniaxialMaterial(tag, MAT_TAG_BoucWenInfill),
xmax(0.0), xmaxp(0.0), mass(p_mass), alpha(p_alpha), beta0(p_beta0), eta0(p_eta0), n(p_n),
k(p_k), xy(p_xy), deltak(p_deltak), deltaf(p_deltaf), psi(p_psi),
Zs(p_Zs), As(p_As), epsp(p_epsp), tolerance(ptolerance), maxNumIter(pMaxNumIter)
Expand All @@ -122,6 +122,15 @@ BoucWenInfill::BoucWenInfill(int tag,
this->revertToStart();
}

BoucWenInfill::BoucWenInfill()
:UniaxialMaterial(0, MAT_TAG_BoucWenInfill),
xmax(0.0), xmaxp(0.0), mass(0.0), alpha(0.0), beta0(0.0), eta0(0.0), n(0.0),
k(0.0), xy(0.0), deltak(0.0), deltaf(0.0), psi(0.0),
Zs(0.0), As(0.0), epsp(0.0), tolerance(0.0), maxNumIter(0)
{

}


BoucWenInfill::~BoucWenInfill()
{
Expand Down Expand Up @@ -397,25 +406,78 @@ BoucWenInfill::getCopy(void)
int
BoucWenInfill::sendSelf(int cTag, Channel &theChannel)
{
int res = 0;
static Vector data(2);
int res = 0;
static Vector data(1+15+4);
data(0) = this->getTag();
data(1) = xmaxp;

data(1) = mass;
data(2) = alpha;
data(3) = beta0;
data(4) = eta0;
data(5) = n;
data(6) = k;
data(7) = xy;
data(8) = deltak;
data(9) = deltaf;
data(10) = psi;
data(11) = Zs;
data(12) = As;
data(13) = epsp;
data(14) = tolerance;
data(15) = maxNumIter;

data(16) = xmaxp;
data(17) = Cstrain;
data(18) = Cz;
data(19) = Ce;

res = theChannel.sendVector(this->getDbTag(), cTag, data);
if (res < 0)
opserr << "BoucWenInfill::sendSelf() - failed to send data\n";
opserr << "BoucWenInfill::sendSelf() - failed to send data" << endln;

return res;
}

int
BoucWenInfill::recvSelf(int cTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
{
int res = 0;
static Vector data(2);
int res = 0;
static Vector data(20);

res = theChannel.recvVector(this->getDbTag(), cTag, data);
if (res < 0) {
opserr << "BoucWenInfill::recvSelf() - failed to receive Vector" << endln;
return res;
}

this->setTag(int(data(0)));
xmaxp = data(1);

mass = data(1);
alpha = data(2);
beta0 = data(3);
eta0 = data(4);
n = data(5);
k = data(6);
xy = data(7);
deltak = data(8);
deltaf = data(9);
psi = data(10);
Zs = data(11);
As = data(12);
epsp = data(13);
tolerance = data(14);
maxNumIter = (int)data(15);

xmaxp = data(16);
Cstrain = data(17);
Cz = data(18);
Ce = data(19);

xmax = xmaxp;
Tstrain = Cstrain;
Tz = Cz;
Te = Ce;

this->revertToLastCommit();

return res;
Expand Down
3 changes: 2 additions & 1 deletion SRC/material/uniaxial/BoucWenInfill.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class BoucWenInfill : public UniaxialMaterial
double tolerance,
int maxNumIter);

~BoucWenInfill();
BoucWenInfill();
~BoucWenInfill();

const char *getClassType(void) const {return "BoucWenMaterial";};

Expand Down
12 changes: 6 additions & 6 deletions SRC/material/uniaxial/Concrete01WithSITC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,12 +715,12 @@ int Concrete01WithSITC::recvSelf (int commitTag, Channel& theChannel,
Cstress = data(9);
Ctangent = data(10);

// variables added by WL
data(11) = CmaxStrain;
data(12) = CslopeSITC;
data(13) = CendStrainSITC;
data(14) = Cindex;
data(15) = CsmallStrainIndex;
// variables added by WL
CmaxStrain = data(11);
CslopeSITC = data(12);
CendStrainSITC = data(13);
Cindex = data(14);
CsmallStrainIndex = data(15);


// Set trial state variables
Expand Down

0 comments on commit 3434c0a

Please sign in to comment.