Skip to content

Commit

Permalink
Merge pull request #683 from mhscott/sectionTags
Browse files Browse the repository at this point in the history
Allowing different section tags for distributed plasticity beam integrations
  • Loading branch information
mhscott committed Oct 15, 2021
2 parents ec25ba7 + abaebb8 commit 09546da
Show file tree
Hide file tree
Showing 8 changed files with 424 additions and 144 deletions.
82 changes: 53 additions & 29 deletions SRC/element/forceBeamColumn/ChebyshevBeamIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,64 @@

void* OPS_ChebyshevBeamIntegration(int& integrationTag, ID& secTags)
{
if(OPS_GetNumRemainingInputArgs() < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N,<type>\n";
return 0;
}
int nArgs = OPS_GetNumRemainingInputArgs();

// inputs: integrationTag,secTag,N,<type>
int iData[3];
int numData = 3;
if(OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "WARNING: failed to read inputs\n";
return 0;
if (nArgs < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N -or- N,*secTagList\n";
return 0;
}

// Read tag
int iData[2];
int numData = 2;
if (OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "ChebyshevBeamIntegration - unable to read int data" << endln;
return 0;
}
integrationTag = iData[0];

if (nArgs == 3) {
// inputs: integrationTag,secTag,N
numData = 1;
int Nsections;
if (OPS_GetIntInput(&numData,&Nsections) < 0) {
opserr << "ChebyshevBeamIntegration - Unable to read number of sections" << endln;
return 0;
}

integrationTag = iData[0];
if(iData[2] > 0) {
secTags.resize(iData[2]);
if (Nsections < 0)
return 0;

if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
secTags = ID();
}
for(int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
}

if(OPS_GetNumRemainingInputArgs() > 0) {
numData = 1;
if(OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "WARNING: failed to read inputs\n";
return 0;
}
return new ChebyshevBeamIntegration(iData[0]);
} else
return new ChebyshevBeamIntegration();


}
else {
// inputs: integrationTag,N,*secTagList
int Nsections = iData[1];
if (Nsections < 0)
return 0;
int *sections = new int[Nsections];
if (OPS_GetIntInput(&Nsections,sections) < 0) {
opserr << "ChebyshevBeamIntegration - Unable to read section tags" << endln;
return 0;
}
if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
}
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = sections[i];
}
delete [] sections;
}

return new ChebyshevBeamIntegration();
}

ChebyshevBeamIntegration::ChebyshevBeamIntegration(int t):
Expand Down
69 changes: 53 additions & 16 deletions SRC/element/forceBeamColumn/CompositeSimpsonBeamIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,64 @@

void* OPS_CompositeSimpsonBeamIntegration(int& integrationTag, ID& secTags)
{
if(OPS_GetNumRemainingInputArgs() < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N\n";
return 0;
}
int nArgs = OPS_GetNumRemainingInputArgs();

if (nArgs < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N -or- N,*secTagList\n";
return 0;
}

// Read tag
int iData[2];
int numData = 2;
if (OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "CompositeSimpsonBeamIntegration - unable to read int data" << endln;
return 0;
}
integrationTag = iData[0];

if (nArgs == 3) {
// inputs: integrationTag,secTag,N
int iData[3];
int numData = 3;
if(OPS_GetIntInput(&numData,&iData[0]) < 0) return 0;

integrationTag = iData[0];
if(iData[2] > 0) {
secTags.resize(iData[2]);
numData = 1;
int Nsections;
if (OPS_GetIntInput(&numData,&Nsections) < 0) {
opserr << "CompositeSimpsonBeamIntegration - Unable to read number of sections" << endln;
return 0;
}
if (Nsections < 0)
return 0;

if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
secTags = ID();
}
for(int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
}

return new CompositeSimpsonBeamIntegration;
}
else {
// inputs: integrationTag,N,*secTagList
int Nsections = iData[1];
if (Nsections < 0)
return 0;
int *sections = new int[Nsections];
if (OPS_GetIntInput(&Nsections,sections) < 0) {
opserr << "CompositeSimpsonBeamIntegration - Unable to read section tags" << endln;
return 0;
}
if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
}
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = sections[i];
}
delete [] sections;
}

return new CompositeSimpsonBeamIntegration;
}

CompositeSimpsonBeamIntegration::CompositeSimpsonBeamIntegration():
Expand Down
70 changes: 52 additions & 18 deletions SRC/element/forceBeamColumn/LegendreBeamIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,64 @@

void* OPS_LegendreBeamIntegration(int& integrationTag, ID& secTags)
{
if(OPS_GetNumRemainingInputArgs() < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N\n";
return 0;
}
int nArgs = OPS_GetNumRemainingInputArgs();

if (nArgs < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N -or- N,*secTagList\n";
return 0;
}

// Read tag
int iData[2];
int numData = 2;
if (OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "LegendreBeamIntegration - unable to read int data" << endln;
return 0;
}
integrationTag = iData[0];

if (nArgs == 3) {
// inputs: integrationTag,secTag,N
int iData[3];
int numData = 3;
if(OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "WARNING: failed to read inputs\n";
return 0;
numData = 1;
int Nsections;
if (OPS_GetIntInput(&numData,&Nsections) < 0) {
opserr << "LegendreBeamIntegration - Unable to read number of sections" << endln;
return 0;
}

integrationTag = iData[0];
if(iData[2] > 0) {
secTags.resize(iData[2]);
if (Nsections < 0)
return 0;

if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
secTags = ID();
}
for(int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
}

return new LegendreBeamIntegration;
}
else {
// inputs: integrationTag,N,*secTagList
int Nsections = iData[1];
if (Nsections < 0)
return 0;
int *sections = new int[Nsections];
if (OPS_GetIntInput(&Nsections,sections) < 0) {
opserr << "LegendreBeamIntegration - Unable to read section tags" << endln;
return 0;
}
if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
}
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = sections[i];
}
delete [] sections;
}

return new LegendreBeamIntegration;
}

LegendreBeamIntegration::LegendreBeamIntegration():
Expand Down
69 changes: 53 additions & 16 deletions SRC/element/forceBeamColumn/LobattoBeamIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,64 @@

void* OPS_LobattoBeamIntegration(int& integrationTag, ID& secTags)
{
if(OPS_GetNumRemainingInputArgs() < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N\n";
return 0;
}
int nArgs = OPS_GetNumRemainingInputArgs();

if (nArgs < 3) {
opserr<<"insufficient arguments:integrationTag,secTag,N -or- N,*secTagList\n";
return 0;
}

// Read tag
int iData[2];
int numData = 2;
if (OPS_GetIntInput(&numData,&iData[0]) < 0) {
opserr << "LobattoBeamIntegration - unable to read int data" << endln;
return 0;
}
integrationTag = iData[0];

if (nArgs == 3) {
// inputs: integrationTag,secTag,N
int iData[3];
int numData = 3;
if(OPS_GetIntInput(&numData,&iData[0]) < 0) return 0;

integrationTag = iData[0];
if(iData[2] > 0) {
secTags.resize(iData[2]);
numData = 1;
int Nsections;
if (OPS_GetIntInput(&numData,&Nsections) < 0) {
opserr << "LobattoBeamIntegration - Unable to read number of sections" << endln;
return 0;
}
if (Nsections < 0)
return 0;

if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
secTags = ID();
}
for(int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = iData[1];
}

return new LobattoBeamIntegration;
}
else {
// inputs: integrationTag,N,*secTagList
int Nsections = iData[1];
if (Nsections < 0)
return 0;
int *sections = new int[Nsections];
if (OPS_GetIntInput(&Nsections,sections) < 0) {
opserr << "LobattoBeamIntegration - Unable to read section tags" << endln;
return 0;
}
if (Nsections > 0) {
secTags.resize(Nsections);
} else {
secTags = ID();
}
for (int i=0; i<secTags.Size(); i++) {
secTags(i) = sections[i];
}
delete [] sections;
}

return new LobattoBeamIntegration;
}

LobattoBeamIntegration::LobattoBeamIntegration():
Expand Down
Loading

0 comments on commit 09546da

Please sign in to comment.