Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/OpenSees/OpenSees into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mhscott committed Oct 24, 2021
2 parents e334d10 + 1dbbef5 commit a7ff7a9
Show file tree
Hide file tree
Showing 11 changed files with 483 additions and 298 deletions.
121 changes: 1 addition & 120 deletions SRC/interpreter/OpenSeesSectionCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void* OPS_Bidirectional();
void* OPS_Elliptical2();
void* OPS_Isolator2spring();
void* OPS_FiberSection2dThermal();
void* OPS_HSSSection();

namespace {
static FiberSection2d* theActiveFiberSection2d = 0;
Expand Down Expand Up @@ -272,126 +273,6 @@ namespace {
return theSec;
}

static void* OPS_HSSSection()
{
if (OPS_GetNumRemainingInputArgs() < 7) {
opserr << "WARNING insufficient arguments\n";
opserr << "Want: section HSS tag? matTag? h? b? t? nfh? nfb? <-nd shape?>" << endln;
return 0;
}

int tag, matTag;
double h, b, t;
int nfh, nfb;
int nft = 1;

SectionForceDeformation* theSection = 0;

int numdata = 1;
if (OPS_GetIntInput(&numdata, &tag) < 0) {
opserr << "WARNING invalid section HSS tag" << endln;
return 0;
}

if (OPS_GetIntInput(&numdata, &matTag) < 0) {
opserr << "WARNING invalid section HSS matTag" << endln;
return 0;
}

if (OPS_GetDoubleInput(&numdata, &h) < 0) {
opserr << "WARNING invalid h" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetDoubleInput(&numdata, &b) < 0) {
opserr << "WARNING invalid b" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetDoubleInput(&numdata, &t) < 0) {
opserr << "WARNING invalid t" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetIntInput(&numdata, &nfh) < 0) {
opserr << "WARNING invalid nfh" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetIntInput(&numdata, &nfb) < 0) {
opserr << "WARNING invalid nfb" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

HSSSectionIntegration hsssect(h, b, t, nfh, nfb, nft);

int numFibers = hsssect.getNumFibers();

if (OPS_GetNumRemainingInputArgs() > 0) {

double shape = 1.0;
if (OPS_GetNumRemainingInputArgs() > 1) {
if (OPS_GetDoubleInput(&numdata, &shape) < 0) {
opserr << "WARNING invalid shape" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}
}

NDMaterial *theSteel = OPS_getNDMaterial(matTag);

if (theSteel == 0) {
opserr << "WARNING ND material does not exist\n";
opserr << "material: " << matTag;
opserr << "\nHSS section: " << tag << endln;
return 0;
}

NDMaterial **theMats = new NDMaterial *[numFibers];

hsssect.arrangeFibers(theMats, theSteel);

// Parsing was successful, allocate the section
theSection = 0;
if (OPS_GetNumRemainingInputArgs() > 0) {
const char* flag = OPS_GetString();
if (strcmp(flag,"-nd") == 0) {
theSection = new NDFiberSection3d(tag, numFibers, theMats, hsssect, shape);
} else if (strcmp(flag,"-ndWarping") == 0) {
theSection = new NDFiberSectionWarping2d(tag, numFibers, theMats, hsssect, shape);
}
}
delete [] theMats;
}
else {
UniaxialMaterial *theSteel = OPS_getUniaxialMaterial(matTag);

if (theSteel == 0) {
opserr << "WARNING uniaxial material does not exist\n";
opserr << "material: " << matTag;
opserr << "\nTube section: " << tag << endln;
return 0;
}

UniaxialMaterial **theMats = new UniaxialMaterial *[numFibers];

hsssect.arrangeFibers(theMats, theSteel);

// Parsing was successful, allocate the section
ElasticMaterial theTorsion(0,1.0);
theSection = new FiberSection3d(tag, numFibers, theMats, hsssect, theTorsion);

delete [] theMats;
}

return theSection;
}

static void* OPS_UniaxialSection()
{
int numdata = OPS_GetNumRemainingInputArgs();
Expand Down
106 changes: 68 additions & 38 deletions SRC/material/section/integration/HSSSectionIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,28 @@

#include <elementAPI.h>
#include <UniaxialMaterial.h>
#include <ElasticMaterial.h>
#include <NDMaterial.h>
#include <FiberSection2d.h>
#include <FiberSection3d.h>
#include <NDFiberSection2d.h>
#include <NDFiberSection3d.h>
#include <NDFiberSectionWarping2d.h>

void* OPS_HSSSection2d()
void* OPS_HSSSection()
{
if (OPS_GetNumRemainingInputArgs() < 8) {
if (OPS_GetNumRemainingInputArgs() < 7) {
opserr << "WARNING insufficient arguments\n";
opserr << "Want: section HSS tag? matTag? h? b? t? Nfh? Nfb? Nft? <-nd shape?>" << endln;
opserr << "Want: section HSS tag? matTag? h? b? t? nfh? nfb? <-nd> <-shape shape?> <-GJ GJ?> <-torsion tag?>" << endln;
return 0;
}

int ndm = OPS_GetNDM();

int tag, matTag;
double h, b, t;
int Nfh, Nfb, Nft;
int nfh, nfb;
int nft = 1;

SectionForceDeformation* theSection = 0;

Expand Down Expand Up @@ -80,41 +86,61 @@ void* OPS_HSSSection2d()
return 0;
}

if (OPS_GetIntInput(&numdata, &Nfh) < 0) {
opserr << "WARNING invalid Nfh" << endln;
if (OPS_GetIntInput(&numdata, &nfh) < 0) {
opserr << "WARNING invalid nfh" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetIntInput(&numdata, &Nfb) < 0) {
opserr << "WARNING invalid Nfb" << endln;
if (OPS_GetIntInput(&numdata, &nfb) < 0) {
opserr << "WARNING invalid nfb" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

if (OPS_GetIntInput(&numdata, &Nft) < 0) {
opserr << "WARNING invalid Nft" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}

HSSSectionIntegration hsssect(h, b, t, Nfh, Nfb, Nft);
HSSSectionIntegration hsssect(h, b, t, nfh, nfb, nft);

int numFibers = hsssect.getNumFibers();

if (OPS_GetNumRemainingInputArgs() > 0) {

double shape = 1.0;
if (OPS_GetNumRemainingInputArgs() > 1) {
bool isND = false; double shape = 1.0;
UniaxialMaterial *torsion = 0;
bool deleteTorsion = false;
while (OPS_GetNumRemainingInputArgs() > 0) {
const char* flag = OPS_GetString();
// read <-nd>
if (strcmp(flag,"-nd") == 0)
isND = true;
// read <-shape shape>
if (strcmp(flag,"-shape") == 0 && OPS_GetNumRemainingInputArgs() > 0) {
if (OPS_GetDoubleInput(&numdata, &shape) < 0) {
opserr << "WARNING invalid shape" << endln;
opserr << "HSS section: " << tag << endln;
return 0;
}
isND = true;
}

// read <-GJ GJ>
if (strcmp(flag,"-GJ") == 0 && OPS_GetNumRemainingInputArgs() > 0) {
double GJ;
if (OPS_GetDoubleInput(&numdata, &GJ) < 0) {
opserr << "WARNING: failed to read GJ\n";
return 0;
}
torsion = new ElasticMaterial(0,GJ);
deleteTorsion = true;
}
// read <-torsion tag>
if (strcmp(flag,"-torsion") == 0 && OPS_GetNumRemainingInputArgs() > 0) {
int torsionTag;
if (OPS_GetIntInput(&numdata, &torsionTag) < 0) {
opserr << "WARNING: failed to read torsion\n";
return 0;
}
torsion = OPS_getUniaxialMaterial(torsionTag);
}
}

if (isND) {
NDMaterial *theSteel = OPS_getNDMaterial(matTag);

if (theSteel == 0) {
opserr << "WARNING ND material does not exist\n";
opserr << "material: " << matTag;
Expand All @@ -123,42 +149,46 @@ void* OPS_HSSSection2d()
}

NDMaterial **theMats = new NDMaterial *[numFibers];

hsssect.arrangeFibers(theMats, theSteel);

if (ndm == 2)
theSection = new NDFiberSection2d(tag, numFibers, theMats, hsssect);
if (ndm == 3)
theSection = new NDFiberSection3d(tag, numFibers, theMats, hsssect, shape);

// Parsing was successful, allocate the section
theSection = 0;
if (OPS_GetNumRemainingInputArgs() > 0) {
const char* flag = OPS_GetString();
if (strcmp(flag,"-nd") == 0) {
theSection = new NDFiberSection2d(tag, numFibers, theMats, hsssect, shape);
} else if (strcmp(flag,"-ndWarping") == 0) {
theSection = new NDFiberSectionWarping2d(tag, numFibers, theMats, hsssect, shape);
}
}
delete [] theMats;
}

else {
UniaxialMaterial *theSteel = OPS_getUniaxialMaterial(matTag);

if (theSteel == 0) {
opserr << "WARNING uniaxial material does not exist\n";
opserr << "material: " << matTag;
opserr << "\nHSS section: " << tag << endln;
return 0;
}

UniaxialMaterial **theMats = new UniaxialMaterial *[numFibers];
if (torsion == 0) {
opserr << "WARNING torsion not speified for FiberSection\n";
opserr << "\nHSS section: " << tag << endln;
return 0;
}

UniaxialMaterial **theMats = new UniaxialMaterial *[numFibers];
hsssect.arrangeFibers(theMats, theSteel);

// Parsing was successful, allocate the section
theSection = new FiberSection2d(tag, numFibers, theMats, hsssect);
if (ndm == 2)
theSection = new FiberSection2d(tag, numFibers, theMats, hsssect);
if (ndm == 3)
theSection = new FiberSection3d(tag, numFibers, theMats, hsssect, *torsion);

if (deleteTorsion)
delete torsion;

delete [] theMats;
}

return theSection;
return theSection;
}

HSSSectionIntegration::HSSSectionIntegration(double H, double B, double T,
Expand Down
Loading

0 comments on commit a7ff7a9

Please sign in to comment.