Skip to content

Commit

Permalink
Merge pull request OpenSees#861 from mhscott/warping
Browse files Browse the repository at this point in the history
Fixing Python command for 2D warping element
  • Loading branch information
mhscott authored May 31, 2022
2 parents bdd0d1a + 234d04d commit 0beed7b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
29 changes: 28 additions & 1 deletion SRC/coordTransformation/CorotCrdTransfWarping2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Journal of Structural Engineering, 133(2):155-165.
#include <Matrix.h>
#include <Node.h>
#include <Channel.h>

#include <elementAPI.h>
#include <string>
#include <CorotCrdTransfWarping2d.h>

// initialize static variables
Expand All @@ -63,6 +64,32 @@ Vector CorotCrdTransfWarping2d::dub(5);
Vector CorotCrdTransfWarping2d::Dub(5);
Matrix CorotCrdTransfWarping2d::kg(8,8);

void* OPS_CorotCrdTransfWarping2d()
{
if(OPS_GetNumRemainingInputArgs() < 1) {
opserr<<"insufficient arguments for CorotCrdTransfWarping2d\n";
return 0;
}

// get tag
int tag;
int numData = 1;
if(OPS_GetIntInput(&numData,&tag) < 0) return 0;

// get option
Vector jntOffsetI(2), jntOffsetJ(2);
double *iptr=&jntOffsetI(0), *jptr=&jntOffsetJ(0);
while(OPS_GetNumRemainingInputArgs() > 4) {
std::string type = OPS_GetString();
if(type == "-jntOffset") {
numData = 2;
if(OPS_GetDoubleInput(&numData,iptr) < 0) return 0;
if(OPS_GetDoubleInput(&numData,jptr) < 0) return 0;
}
}

return new CorotCrdTransfWarping2d(tag,jntOffsetI,jntOffsetJ);
}

// constructor:
CorotCrdTransfWarping2d::CorotCrdTransfWarping2d(int tag,
Expand Down
4 changes: 2 additions & 2 deletions SRC/element/forceBeamColumn/ForceBeamColumnWarping2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ void* OPS_ForceBeamColumnWarping2d()

int ndm = OPS_GetNDM();
int ndf = OPS_GetNDF();
if(ndm != 2 || ndf != 3) {
opserr<<"ndm must be 2 and ndf must be 3\n";
if(ndm != 2 || ndf != 4) {
opserr<<"ndm must be 2 and ndf must be 4\n";
return 0;
}

Expand Down
5 changes: 4 additions & 1 deletion SRC/interpreter/OpenSeesCrdTransfCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ void* OPS_PDeltaCrdTransf2d();
void* OPS_PDeltaCrdTransf3d();
void* OPS_CorotCrdTransf2d();
void* OPS_CorotCrdTransf3d();
void* OPS_CorotCrdTransfWarping2d();
void* OPS_CorotCrdTransfWarping3d();

namespace {
Expand Down Expand Up @@ -54,8 +55,10 @@ namespace {
int ndf = OPS_GetNDF();
if(ndm == 2 && ndf == 3) {
return OPS_CorotCrdTransf2d();
} else if(ndm == 2 && ndf == 4) {
return OPS_CorotCrdTransfWarping2d();
} else if(ndm == 3 && ndf == 6) {
return OPS_CorotCrdTransf3d();
return OPS_CorotCrdTransf3d();
} else if(ndm == 3 && ndf == 7) {
return OPS_CorotCrdTransfWarping3d();
} else {
Expand Down

0 comments on commit 0beed7b

Please sign in to comment.