Skip to content

Commit

Permalink
cmp - add new elems to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioperez committed Sep 19, 2021
2 parents 381dd83 + 43054b5 commit 3dec328
Show file tree
Hide file tree
Showing 76 changed files with 3,775 additions and 185 deletions.
29 changes: 15 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,23 @@ set(OPS_BUNDLED_DIR "${PROJECT_SOURCE_DIR}/OTHER/")
set(OPS_SRC_DIR "${PROJECT_SOURCE_DIR}/SRC/")

include(OpenSeesFunctions)
# pseudo target modeling all exteral packages
add_library(OPS_External_packages INTERFACE)

#add_library(OPS_Element_libraries INTERFACE)

# include user config
include(${PROJECT_SOURCE_DIR}/Conf.cmake)

message("OPS >>> BLAS: ${BLAS_LIBRARIES}")
message("OPS >>> CBLAS: ${CBLAS_LIBRARY}\n")
message("OPS >>> LAPACK: ${LAPACK_LIBRARIES}")
message("OPS >>> ARPACK: ${ARPACK_LIBRARIES}")
message("OPS >>> SUPERLU: ${SUPERLU_LIBRARIES}")
message("OPS >>> TCL: ${TCL_LIBRARY}")
set(TCL_LIBRARIES ${TCL_LIBRARY})
message("OPS >>> AMD: ${AMD_LIBRARIES}")

# define user-selectable options for end target
set_property(CACHE OPS_FINAL_TARGET PROPERTY STRINGS
G3 OpenSeesTcl OpenSeesMP OpenSeesSP OpenSeesPy)
Expand All @@ -46,10 +61,8 @@ add_library(OPS_OS_Specific_libs INTERFACE)

if (UNIX)
include(OpenSeesDependenciesUnix)

if(APPLE)
message(STATUS ">>> MacOS")

else()
message(STATUS ">>> LINUX")
add_compile_definitions(_LINUX _UNIX _TCL85)
Expand All @@ -59,23 +72,11 @@ endif()

if(WIN32) # NOTE: this will execute for both 32-bit and 64-bit builds.
include(OpenSeesDependenciesWin)

# target_sources(OPS_OS_Specific_libs INTERFACE ${OPS_SRC_DIR}/api/win32Functions.cpp)
target_link_libraries(OPS_OS_Specific_libs INTERFACE wsock32 ws2_32)
add_compile_definitions(_WIN32)
# message("OPS >>> Including the following precompiled libs: '${ops_precompiled}'")
# target_sources(OPS_OS_Specific_libs INTERFACE ${OPS_SRC_DIR}/api/win32Functions.cpp)
message(STATUS ">>> WIN32")
endif()

message("OPS >>> BLAS: ${BLAS_LIBRARIES}")
message("OPS >>> CBLAS: ${CBLAS_LIBRARY}\n")
message("OPS >>> LAPACK: ${LAPACK_LIBRARIES}")
message("OPS >>> ARPACK: ${ARPACK_LIBRARIES}")
message("OPS >>> SUPERLU: ${SUPERLU_LIBRARIES}")
message("OPS >>> TCL: ${TCL_LIBRARY}")
set(TCL_LIBRARIES ${TCL_LIBRARY})
message("OPS >>> AMD: ${AMD_LIBRARIES}")


#==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion Conf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ set(OPS_Extension_List
set(OPS_Element_List
#OPS_Material_StressDensity
#OPS_Uniaxial_Fedeas

OPS_Element_truss
#OPS_Element_beam2d
OPS_Element_beam3d
Expand Down Expand Up @@ -90,6 +89,7 @@ set(OPS_Element_List
OPS_Element_masonry
#OPS_Element_feap
#OPS_Element_PFEMElement
OPS_Element_CEq
)


13 changes: 8 additions & 5 deletions DEVELOPER/core/classTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@
#define MAT_TAG_QzSimple1 207
#define MAT_TAG_PyLiq1 208
#define MAT_TAG_TzLiq1 209
#define MAT_TAG_PySimple2 210
#define MAT_TAG_TzSimple2 211
#define MAT_TAG_QzSimple2 212
#define MAT_TAG_SteelBRB 213
#define MAT_TAG_PySimple3 214
#define MAT_TAG_QzLiq1 210
#define MAT_TAG_PySimple2 211
#define MAT_TAG_TzSimple2 212
#define MAT_TAG_QzSimple2 213
#define MAT_TAG_SteelBRB 214
#define MAT_TAG_PySimple3 215



Expand Down Expand Up @@ -722,6 +723,8 @@
#define ELE_TAG_EightNodeQuad 208
#define ELE_TAG_SixNodeTri 209

#define ELE_TAG_ASDEmbeddedNodeElement 217 // Massimo Petracca (ASDEA)

#define FRN_TAG_Coulomb 1
#define FRN_TAG_VelDependent 2
#define FRN_TAG_VelPressureDep 3
Expand Down
4 changes: 4 additions & 0 deletions ETC/cmake/OpenSeesDependenciesUnix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ opensees_load(HDF5 FIND)

opensees_load(MySQL FIND)

# Integrated exteral libraries
opensees_load(FEDEAS_Uniaxial
LIBRARY FALSE
)

30 changes: 23 additions & 7 deletions ETC/cmake/OpenSeesFunctions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# Claudio Perez

function (opensees_elements elemlib)
add_library(${elemlib} EXCLUDE_FROM_ALL)
set(private_sources ${ARGN})
set(public_sources ${ARGN})
list(FILTER private_sources INCLUDE REGEX ".*\.cpp")
list(FILTER public_sources INCLUDE REGEX ".*\.h")
target_sources(${elemlib} PRIVATE ${private_sources} PUBLIC ${public_sources})
set_target_properties(${elemlib} PROPERTIES LINKER_LANGUAGE CXX)
message("PRIVATE ${private_sources} PUBLIC ${public_sources}")
endfunction()

function (opensees_uniaxials unilib)
opensees_elements(${unilib} ${ARGN})
endfunction()


function (opensees_add_cxx_flag)
cmake_parse_arguments(
PARSE_ARGV 0
Expand Down Expand Up @@ -27,6 +44,9 @@ endfunction()


function (opensees_load lib_name)
#
#
#
cmake_parse_arguments(
PARSE_ARGV 1
OPS_LOAD_ARG # prefix of output variables
Expand All @@ -37,12 +57,6 @@ function (opensees_load lib_name)
set(OPS_PKG_FOUND_VAR "${lib_name}_FOUND")# PARENT_SCOPE)
set(${OPS_PKG_FOUND_VAR} FALSE)# PARENT_SCOPE)

#if(OPS_LOAD_ARG_BUILD)
# message("OPS >>> Using OpenSees bundled library '${lib_name}'")
# set(${OPS_PKG_FOUND_VAR} TRUE PARENT_SCOPE)
# opensees_build(${lib_name})
# return()

if(OPS_LOAD_ARG_LIBRARY)
if(NOT ${${OPS_PKG_FOUND_VAR}})
message("OPS >>> ${lib_name}")
Expand All @@ -64,7 +78,7 @@ function (opensees_load lib_name)
message("OPS >>> find_package(${lib_name})")
find_package(${lib_name})
message("OPS >>> status: ${OPS_PKG_FOUND_VAR}=${${OPS_PKG_FOUND_VAR}}")
endif()
endif()
endif()

if(OPS_LOAD_ARG_BUNDLED)
Expand All @@ -78,8 +92,10 @@ function (opensees_load lib_name)
set("${lib_name}_LIBRARIES" "${lib_name}")
endif()
endif()

set("${lib_name}_LIBRARIES" ${${lib_name}_LIBRARIES} PARENT_SCOPE)
set("${lib_name}_INCLUDE_DIRS" ${${lib_name}_INCLUDE_DIRS} PARENT_SCOPE)
target_compile_definitions(OPS_External_packages INTERFACE "OPSDEF_${lib_name}")
message(" status: ${lib_name}_LIBRARIES =${${lib_name}_LIBRARIES}")
message(" status: ${lib_name}_INCLUDE_DIRS =${${lib_name}_INCLUDE_DIRS}\n")
endfunction()
Expand Down
19 changes: 5 additions & 14 deletions MAKES/Makefile.def.Ubuntu20.04
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,22 @@


# Instructuction for building OpenSees on Ubuntu 20.04
# NOTE: if you plan to contribue code, fork your own github reo in the browser
# NOTE: if you plan to contribue code, fork your own github repo in the browser
# and make change to git clone below to point to your own fork. We will
# never give anyone access to repo itself.


# mkdir $HOME/lib
# mkdir $HOME/bin
# sudo apt-get update
# sudo apt-get install git
# sudo apt-get install emacs
# sudo apt-get install build-essential
# sudo apt-get install gfortran
# wget https://prdownloads.sourceforge.net/tcl/tcl8.6.10-src.tar.gz
# tar zxBf tcl8.6.tar.gz
# cd tcl8.6.10/unix
# configure --prefix=$HOME/tcl8.6 --enable-static --disable-shared --enable-64bit
# sudo apt-get install -y git emacs build-essential gfortran tcl8.6 tcl8.6-dev
# make
# make install
# cd $HOME
# git clone https://github.com/OpenSees/OpenSees.git
# cd OpenSees
# cp ./MAKES/Makefile.def.Ubuntu20.04 ./Makefile.def
# make
# make ## For faster compilation, add -j $(numberOfCores)


#INTERPRETER_LANGUAGE = PYTHON
Expand Down Expand Up @@ -115,8 +108,7 @@ UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY = $(HOME)/lib/libMetis.a
CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a

TCL_LIBRARY = $(HOME)/tcl8.6/lib/libtcl8.6.a

TCL_LIBRARY = /usr/lib/x86_64-linux-gnu/libtcl8.6.so
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
GRAPHIC_LIBRARY =

Expand Down Expand Up @@ -267,8 +259,7 @@ MACHINE_INCLUDES = -I/usr/include \
# this file contains all the OpenSees/SRC includes
include $(FE)/Makefile.incl

#TCL_INCLUDES = -I/usr/includes/tcl-private/generic
TCL_INCLUDES = -I$(HOME)/tcl8.6/include
TCL_INCLUDES = -I/usr/include/tcl8.6
PYTHON_INCLUDES = -I/usr/include/python3.5

INCLUDES = $(TCL_INCLUDES) $(FE_INCLUDES) $(MACHINE_INCLUDES) $(PYTHON_INCLUDES)
Expand Down
5 changes: 4 additions & 1 deletion SRC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ PY_SJB_RWB_BJ_LIBS = $(FE)/material/uniaxial/PY/PySimple1.o \
$(FE)/material/uniaxial/PY/ShallowFoundationGen.o \
$(FE)/material/uniaxial/PY/PyLiq1.o \
$(FE)/material/uniaxial/PY/TzLiq1.o \
$(FE)/material/uniaxial/PY/QzLiq1.o \
$(FE)/material/uniaxial/PY/PySimple1Gen.o \
$(FE)/material/uniaxial/PY/TzSimple1Gen.o

Expand Down Expand Up @@ -657,7 +658,8 @@ ELE_LIBS = $(FE)/element/Element.o \
$(FE)/element/RockingBC/RockingBC.o \
$(FE)/element/masonry/MasonPan12.o \
$(FE)/element/masonry/MasonPan3D.o \
$(FE)/element/masonry/BeamGT.o
$(FE)/element/masonry/BeamGT.o \
$(FE)/element/CEqElement/ASDEmbeddedNodeElement.o

# $(FE)/material/nD/Damage2p.o \
# $(FE)/material/nD/Damage2p3D.o \
Expand Down Expand Up @@ -860,6 +862,7 @@ MATERIAL_LIBS = $(FE)/material/Material.o \
$(FE)/material/uniaxial/Trilinwpd.o \
$(FE)/material/uniaxial/Trilinwp.o \
$(FE)/material/uniaxial/Trilinwp2.o \
$(FE)/material/uniaxial/SteelFractureDI.o \
$(FE)/material/nD/NDMaterial.o \
$(FE)/material/nD/PlaneStressLayeredMaterial.o \
$(FE)/material/nD/PlaneStressRebarMaterial.o \
Expand Down
1 change: 1 addition & 0 deletions SRC/Makefile.incl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ FE_INCLUDES = -I$(FE)/matrix \
-I$(FE)/element/twoNodeLink \
-I$(FE)/element/updatedLagrangianBeamColumn \
-I$(FE)/element/RockingBC \
-I$(FE)/element/CEqElement \
-I$(FE)/element/UWelements \
-I$(FE)/element/HUelements \
-I$(FE)/analysis \
Expand Down
11 changes: 10 additions & 1 deletion SRC/actor/objectBroker/FEM_ObjectBrokerAllClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#include "PY/QzSimple2.h"
#include "PY/PyLiq1.h"
#include "PY/TzLiq1.h"
#include "PY/QzLiq1.h"

#include "fedeas/FedeasBond1Material.h"
#include "fedeas/FedeasBond2Material.h"
Expand Down Expand Up @@ -311,6 +312,8 @@

#include "RockingBC/RockingBC.h"

#include "CEqElement/ASDEmbeddedNodeElement.h"

#include "LinearCrdTransf2d.h"
#include "LinearCrdTransf3d.h"
#include "PDeltaCrdTransf2d.h"
Expand Down Expand Up @@ -908,6 +911,9 @@ FEM_ObjectBrokerAllClasses::getNewElement(int classTag)
case ELE_TAG_RockingBC:
return new RockingBC();

case ELE_TAG_ASDEmbeddedNodeElement:
return new ASDEmbeddedNodeElement();

default:
opserr << "FEM_ObjectBrokerAllClasses::getNewElement - ";
opserr << " - no Element type exists for class tag " ;
Expand Down Expand Up @@ -1223,7 +1229,7 @@ FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag)
case MAT_TAG_Fatigue:
return new FatigueMaterial();

case MAT_TAG_TzLiq1:
case MAT_TAG_TzLiq1:
return new TzLiq1();

case MAT_TAG_QzSimple1:
Expand All @@ -1232,6 +1238,9 @@ FEM_ObjectBrokerAllClasses::getNewUniaxialMaterial(int classTag)
case MAT_TAG_QzSimple2:
return new QzSimple2();

case MAT_TAG_QzLiq1:
return new QzLiq1();

case MAT_TAG_Hysteretic:
return new HystereticMaterial();

Expand Down
29 changes: 29 additions & 0 deletions SRC/analysis/algorithm/equiSolnAlgo/ExpressNewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,35 @@
#include <elementAPI.h>
#include <string>

void *OPS_ExpressNewton()
{
int nIter = 2, factorOnce = 0, formTangent = CURRENT_TANGENT;
double kMultiplier = 1.0;

int nArgs = OPS_GetNumRemainingInputArgs();
int numData = 1;
if (nArgs > 0 && OPS_GetIntInput(&numData,&nIter) < 0) {
opserr << "WARNING ExpressNewton -- error reading nIter\n";
return 0;
}
if (nArgs > 1 && OPS_GetDoubleInput(&numData,&kMultiplier) < 0) {
opserr << "WARNING ExpressNewton -- error reading kMultiplier\n";
return 0;
}
while (OPS_GetNumRemainingInputArgs() > 0) {
const char *type = OPS_GetString();
if ((strcmp(type,"-initialTangent") == 0) || (strcmp(type,"-InitialTangent") == 0)) {
formTangent = INITIAL_TANGENT;
} else if ((strcmp(type,"-currentTangent") == 0) || (strcmp(type,"-CurrentTangent") ==0 )) {
formTangent = CURRENT_TANGENT;
} else if ((strcmp(type,"-factorOnce") == 0) || (strcmp(type,"-FactorOnce") ==0 )) {
factorOnce = 1;
}
}

return new ExpressNewton(nIter,kMultiplier,formTangent,factorOnce);
}

// Constructor
ExpressNewton::ExpressNewton(int ni, double km, int tg, int fo)
:EquiSolnAlgo(EquiALGORITHM_TAGS_ExpressNewton), nIter(ni), factorOnce(fo)
Expand Down
5 changes: 5 additions & 0 deletions SRC/analysis/integrator/Newmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ int Newmark::domainChanged()
}
}

// The remaining get**Sensitivity methods cause seg faults with Lagrange constraint
// handler in dynamic (transient) analysis even when there is no sensitivity algorithm.
// However, I don't think these methods need to be called in domainChanged -- MHS
continue;

const Vector &dispSens = dofPtr->getDispSensitivity(gradNumber);
for (i=0; i < idSize; i++) {
int loc = id(i);
Expand Down
28 changes: 15 additions & 13 deletions SRC/classTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,20 @@
#define MAT_TAG_QzSimple1 207
#define MAT_TAG_PyLiq1 208
#define MAT_TAG_TzLiq1 209
#define MAT_TAG_PySimple2 210
#define MAT_TAG_TzSimple2 211
#define MAT_TAG_QzSimple2 212
#define MAT_TAG_SteelBRB 213
#define MAT_TAG_PySimple3 214
#define MAT_TAG_PlateBearingConnectionThermal 215
#define MAT_TAG_ASD_SMA_3K 216

#define MAT_TAG_Masonry 217
#define MAT_TAG_Masonryt 218
#define MAT_TAG_Trilinwp 219
#define MAT_TAG_Trilinwp2 220
#define MAT_TAG_Trilinwpd 221
#define MAT_TAG_QzLiq1 210
#define MAT_TAG_PySimple2 211
#define MAT_TAG_TzSimple2 212
#define MAT_TAG_QzSimple2 213
#define MAT_TAG_SteelBRB 214
#define MAT_TAG_PySimple3 215
#define MAT_TAG_PlateBearingConnectionThermal 216
#define MAT_TAG_ASD_SMA_3K 217
#define MAT_TAG_SteelFractureDI 218 // galvisf
#define MAT_TAG_Masonry 219
#define MAT_TAG_Masonryt 220
#define MAT_TAG_Trilinwp 221
#define MAT_TAG_Trilinwp2 222
#define MAT_TAG_Trilinwpd 223

#define MAT_TAG_FedeasMaterial 1000
#define MAT_TAG_FedeasBond1 1001
Expand Down Expand Up @@ -788,6 +789,7 @@
#define ELE_TAG_BeamGT 214
#define ELE_TAG_MasonPan12 215
#define ELE_TAG_MasonPan3D 216
#define ELE_TAG_ASDEmbeddedNodeElement 217 // Massimo Petracca (ASDEA)
#define ELE_TAG_ExternalElement 99990


Expand Down

0 comments on commit 3dec328

Please sign in to comment.