Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/OpenSees/OpenSees
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed Oct 18, 2021
2 parents 4491b19 + 6d8bdc6 commit d1c50b8
Show file tree
Hide file tree
Showing 30 changed files with 1,902 additions and 157 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,17 @@ target_link_libraries(OpenSees
${MYSQL_LIBRARIES}
)

target_include_directories(OpenSees PUBLIC ${TCL_INCLUDE_PATH})

#----------------------------
# OPS_Interp_Tcl
#----------------------------
# Add sources to OPS_Interp_Tcl target

target_include_directories(OPS_Interp_Tcl PUBLIC ${TCL_INCLUDE_PATH})
target_link_libraries(OPS_Interp_Tcl PRIVATE ${TCL_LIBRARIES})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
target_include_directories(OpenSees PUBLIC ${TCL_INCLUDE_PATH})
target_include_directories(OPS_Interp_Tcl PUBLIC ${TCL_INCLUDE_PATH})
target_link_libraries(OPS_Interp_Tcl PRIVATE ${TCL_LIBRARIES})
endif()

target_compile_definitions(OPS_Interp_Tcl PUBLIC _TCL85)

Expand Down
1 change: 1 addition & 0 deletions SRC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ ELE_LIBS = $(FE)/element/Element.o \
$(FE)/element/truss/InertiaTruss.o \
$(FE)/element/zeroLength/ZeroLengthContact2D.o \
$(FE)/element/zeroLength/ZeroLengthContact3D.o \
$(FE)/element/zeroLength/ZeroLengthContactASDimplex.o \
$(FE)/element/zeroLength/ZeroLengthContactNTS2D.o \
$(FE)/element/zeroLength/ZeroLengthInterface2D.o \
$(FE)/element/zeroLength/ZeroLengthRocking.o \
Expand Down
6 changes: 5 additions & 1 deletion SRC/actor/machineBroker/MPI_MachineBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
MPI_MachineBroker::MPI_MachineBroker(FEM_ObjectBroker *theBroker, int argc, char **argv)
:MachineBroker(theBroker)
{
MPI_Init(&argc, &argv);
int flag = 0;
MPI_Initialized(&flag);
if (!flag) {
MPI_Init(&argc, &argv);
}
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);

Expand Down
5 changes: 4 additions & 1 deletion SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
#include "zeroLength/ZeroLengthContact3D.h"
#include "zeroLength/ZeroLengthContactNTS2D.h"
#include "zeroLength/ZeroLengthInterface2D.h"
#include "zeroLength/ZeroLengthContactASDimplex.h"
//#include "ZeroLengthND.h"

#include "fourNodeQuad/FourNodeQuad.h"
Expand Down Expand Up @@ -688,7 +689,9 @@ FEM_ObjectBrokerAllClasses::getNewElement(int classTag)

case ELE_TAG_ZeroLengthContactNTS2D:
return new ZeroLengthContactNTS2D();


case ELE_TAG_ZeroLengthContactASDimplex:
return new ZeroLengthContactASDimplex();

//case ELE_TAG_ZeroLengthND:
//return new ZeroLengthND();
Expand Down
1 change: 1 addition & 0 deletions SRC/classTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
#define ELE_TAG_InertiaTruss 218 //Added by Xiaodong Ji, Yuhao Cheng, Yue Yu
#define ELE_TAG_ASDAbsorbingBoundary2D 219 // Massimo Petracca (ASDEA)
#define ELE_TAG_ASDAbsorbingBoundary3D 220 // Massimo Petracca (ASDEA)
#define ELE_TAG_ZeroLengthContactASDimplex 221 // Onur Deniz Akan (IUSS), Massimo Petracca (ASDEA)
#define ELE_TAG_ExternalElement 99990


Expand Down
16 changes: 13 additions & 3 deletions SRC/element/TclElementCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ extern void *OPS_BeamGT(void);

extern void* OPS_DispBeamColumnAsym3dTcl(); //Xinlong Du
extern void* OPS_MixedBeamColumnAsym3dTcl(); //Xinlong Du
extern void* OPS_ZeroLengthContactASDimplex(void); // Onur Deniz Akan (IUSS), Massimo Petracca (ASDEA)

extern int TclModelBuilder_addFeapTruss(ClientData clientData, Tcl_Interp *interp, int argc,
TCL_Char **argv, Domain*, TclModelBuilder *, int argStart);
Expand Down Expand Up @@ -1560,7 +1561,6 @@ TclModelBuilderElementCommand(ClientData clientData, Tcl_Interp *interp,
}
//Xinlong Du


else if ((strcmp(argv[1], "InertiaTruss") == 0)) {

void* theEle = OPS_InertiaTrussElement();
Expand All @@ -1571,7 +1571,17 @@ TclModelBuilderElementCommand(ClientData clientData, Tcl_Interp *interp,
return TCL_ERROR;
}
}


else if (strcmp(argv[1], "zeroLengthContactASDimplex") == 0) {
void* theEle = OPS_ZeroLengthContactASDimplex();
if (theEle != 0)
theElement = (Element*)theEle;
else {
opserr << "TclElementCommand -- unable to create element of type : " << argv[1] << endln;
return TCL_ERROR;
}
}

// if one of the above worked
if (theElement != 0) {
if (theTclDomain->addElement(theElement) == false) {
Expand Down Expand Up @@ -1750,7 +1760,7 @@ TclModelBuilderElementCommand(ClientData clientData, Tcl_Interp *interp,
opserr << "TCL -- unable to create element of type: " << argv[1] << endln;
return TCL_ERROR;
}
}
}
else if ((strcmp(argv[1], "inelastic2dYS01")== 0) ||
(strcmp(argv[1], "inelastic2dYS02")== 0) ||
(strcmp(argv[1], "inelastic2dYS03")== 0) ||
Expand Down
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

0 comments on commit d1c50b8

Please sign in to comment.