-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
20,373 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# old text editor files | ||
*~ | ||
|
||
# Qt created files | ||
moc* | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
# QT | ||
*.pro.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* ***************************************************************************** | ||
Copyright (c) 2012-2017, The Regents of the University of California (Regents). | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project. | ||
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS | ||
PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, | ||
UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | ||
*************************************************************************** */ | ||
|
||
#include "DL_Interpreter.h" | ||
|
||
DL_Interpreter *ops_TheActiveInterpreter = 0; | ||
|
||
DL_Interpreter::DL_Interpreter() { | ||
|
||
} | ||
|
||
DL_Interpreter::~DL_Interpreter() { | ||
// does nothing | ||
} | ||
|
||
int | ||
DL_Interpreter::addCommand(const char *, Command &) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::removeCommand(const char *) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::getNumRemainingInputArgs(void) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::getInt(int *, int numArgs) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::getDouble(double *, int numArgs) { | ||
return -1; | ||
} | ||
|
||
const char* | ||
DL_Interpreter::getString() { | ||
return 0; | ||
} | ||
|
||
int | ||
DL_Interpreter::getStringCopy(char **stringPtr) { | ||
return -1; | ||
} | ||
|
||
void | ||
DL_Interpreter::resetInput(int cArg) | ||
{ | ||
} | ||
|
||
int | ||
DL_Interpreter::setInt(int *, int numArgs) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::setDouble(double *, int numArgs) { | ||
return -1; | ||
} | ||
|
||
int | ||
DL_Interpreter::setString(const char*) | ||
{ | ||
return -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* ***************************************************************************** | ||
Copyright (c) 2012-2017, The Regents of the University of California (Regents). | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project. | ||
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS | ||
PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, | ||
UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | ||
*************************************************************************** */ | ||
|
||
// Description: This file contains the class definition for DL_Interpreter | ||
// DL_Interpreter is the abstract base class for dynamic language interpreters | ||
// concrete examples being TclInterpreter, PythonInterpreter, MatlabInterpreter,... | ||
// | ||
|
||
|
||
// written: fmk | ||
|
||
#ifndef DL_Interpreter_h | ||
#define DL_Interpreter_h | ||
|
||
|
||
class Command; | ||
|
||
class DL_Interpreter | ||
{ | ||
public: | ||
DL_Interpreter(); | ||
virtual ~DL_Interpreter(); | ||
|
||
// method to run once the interpreter is set up | ||
virtual int run() =0; | ||
|
||
// methods to add & remove additional commands | ||
virtual int addCommand(const char *, Command &); | ||
virtual int removeCommand(const char *); | ||
|
||
// methods for commands to parse the command line | ||
virtual int getNumRemainingInputArgs(void); | ||
virtual int getInt(int *, int numArgs); | ||
virtual int getDouble(double *, int numArgs); | ||
virtual const char* getString(); | ||
virtual int getStringCopy(char **stringPtr); | ||
virtual void resetInput(int cArg); | ||
|
||
// methods for interpreters to output results | ||
virtual int setInt(int *, int numArgs); | ||
virtual int setDouble(double *, int numArgs); | ||
virtual int setString(const char*); | ||
|
||
private: | ||
|
||
}; | ||
|
||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Copyright (c) 2012-2017, The Regents of the University of California (Regents). | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project. | ||
|
||
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS | ||
PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, | ||
UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
include $(HOME)/OpenSees/Makefile.def | ||
|
||
OBJS = DL_Interpreter.o \ | ||
TclInterpreter.o \ | ||
PythonInterpreter.o \ | ||
OpenSeesCommandsTcl.o \ | ||
OpenSeesCommandsPython.o \ | ||
OpenSeesUniaxialMaterialCommands.o \ | ||
PythonModelBuilder.o PythonAnalysisBuilder.o | ||
|
||
OBJS = DL_Interpreter.o OpenSeesCommands.o OpenSeesUniaxialMaterialCommands.o OpenSeesElementCommands.o OpenSeesTimeSeriesCommands.o OpenSeesPatternCommands.o OpenSeesSectionCommands.o OpenSeesOutputCommands.o OpenSeesCrdTransfCommands.o OpenSeesBeamIntegrationCommands.o OpenSeesNDMaterialCommands.o OpenSeesMiscCommands.o | ||
|
||
TclOBJS = tclMain.o TclInterpreter.o TclWrapper.o $(OBJS) | ||
PythonOBJS = pythonMain.o PythonInterpreter.o PythonWrapper.o $(OBJS) | ||
PythonModuleOBJS = PythonModule.o PythonWrapper.o $(OBJS) | ||
|
||
# Compilation control | ||
|
||
all: tcl python pythonmodule | ||
|
||
tcl: $(TclOBJS) | ||
$(LINKER) $(LINKFLAGS) $(TclOBJS) \ | ||
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(TCL_LIBRARY) \ | ||
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) \ | ||
-o tclInterpreter | ||
|
||
ifdef __APPLE__ | ||
PYTHON_LIBRARY = -framework python | ||
endif | ||
|
||
python: $(PythonOBJS) | ||
$(LINKER) $(LINKFLAGS) $(PythonOBJS) \ | ||
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(PYTHON_LIBRARY) \ | ||
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) \ | ||
-o pythonInterpreter | ||
|
||
# $(CC++) $(OS_FLAG) -dynamiclib $(INCLUDES) -Wl,-undefined,suppress,-flat_namespace pythonExample.cpp $(OUTSIDE_OBJS) -current_version 1.0 -compatibility_version 1.0 -fvisibility=hidden -o fmkSum.dylib | ||
|
||
OBJSm = OpenSeesCommandsPython.o OpenSeesUniaxialMaterialCommands.o PythonModelBuilder.o PythonAnalysisBuilder.o | ||
|
||
pythonmodule: $(PythonModuleOBJS) | ||
$(LINKER) $(LINKFLAGS) -shared $(PythonModuleOBJS) \ | ||
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(PYTHON_LIBRARY) \ | ||
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) \ | ||
-o opensees.so | ||
|
||
# Miscellaneous | ||
tidy: | ||
@$(RM) $(RMFLAGS) Makefile.bak *~ #*# core | ||
|
||
clean: tidy | ||
@$(RM) $(RMFLAGS) $(OBJS) *.o | ||
|
||
spotless: clean | ||
|
||
wipe: spotless | ||
|
||
# DO NOT DELETE THIS LINE -- make depend depends on it. |
Oops, something went wrong.