首页 > 行业资讯 > 自己编译最新版的OpenSees (地震工程模拟开放系统)

自己编译最新版的OpenSees (地震工程模拟开放系统)

时间:2023-10-02 来源: 浏览:

自己编译最新版的OpenSees (地震工程模拟开放系统)

原创 GeotechWu 计算岩土力学
计算岩土力学

GeotechWu

计算岩土力学(Geomechanics)是一个综合的岩土工程(Geotechnical Engineering)信息源。

收录于合集

1. 引言

OpenSe es是地震工程模拟开放系统 ( Open System for Earthquake Engineering Simulation ) 的缩写,它是一个面向对象的软件框架, 在美国国家 科学基金会资助的太平洋地震工程研究中心 (PEER) 时期( 19 97年 - 2007 年) 创建。该软件旨在开发应用程序来模拟结构和岩土系统在地震下的性能,它允许用户创建串行和并行有限元计算机应用程序,以模拟这些系统对地震和其他灾害的响应。除了核心功能外,OpenSees 还支持教育应用程序的开发。例如,PileGroupTool 是一个使用 OpenSees 构建的应用程序,允许用户检查分层土中的桩群对横向荷载的响应。

OpenSees 还在不断开发中,并定期进行更新,当前的 最新版本为V3.5.0 ,发布于2023年5月11日。要使用OpenSees ,一种方法是从Berkeley的校园网站上下载编译好的可执行文件,但先决 条件必须是注册用户;另一种方法是根据源代码自己编译。本文描述了自己编译OpenSees的过程。

2. 准备工作

如果计划自己编译OpenSees的源代码,必须事先安装如下软件:
(1) Visual Studio 2022;
(2) Intel Fortran Compiler (oneAPI) 2023
(3) ActiveTcl V8.6
(4) Anaconda 
(5) 下载OpenSees源代码
值得说明的是,如果你的计算机从未安装过这些软件,一切从头开始,那么即使顺利的话,也得至少2个小时也能安装完毕【 安装Anura3D指南---基于物质点法(MPM)的岩土数值模拟 】。
3. 编译OpenSees

把下载下来的源代码解压到一个目录中,在Win64目录下找到OpenSees.sln,右击选择用VS 2022打开,进入到VS 2022环境下,把OpenSees设为启动项目开始,然后开始进行编译。第一次编译肯定不能通过,需要根据错误信息修改路径和环境变量,反复进行试验,直到编译不出现错误。

4. 测试

编译后的执行文件为OpenSees.exe(14.9M),位于Win64/Bin目录下。使用例子文件truss.tcl测试该程序,

source truss.tcl

# ------------------------------ # Start of model generation # ------------------------------ # Remove existing model wipe # Create ModelBuilder (with two-dimensions and 2 DOF/node) model BasicBuilder -ndm 2 -ndf 2 # Create nodes # ------------ # Create nodes & add to Domain - command: node nodeId xCrd yCrd node 1 0.0 0.0 node 2 144.0 0.0 node 3 168.0 0.0 node 4 72.0 96.0 # Set the boundary conditions - command: fix nodeID xResrnt? yRestrnt? fix 1 1 1 fix 2 1 1 fix 3 1 1 # Define materials for truss elements # ----------------------------------- # Create Elastic material prototype - command: uniaxialMaterial Elastic matID E uniaxialMaterial Elastic 1 3000 # Define elements # --------------- # Create truss elements - command: element truss trussID node1 node2 A matID element Truss 1 1 4 10.0 1 element Truss 2 2 4 5.0 1 element Truss 3 3 4 5.0 1 # Define loads # ------------ #create a Linear TimeSeries (load factor varies linearly with time): command timeSeries Linear $tag timeSeries Linear 1 # Create a Plain load pattern with a linear TimeSeries: command pattern Plain $tag $timeSeriesTag { $loads } pattern Plain 1 1 {     # Create the nodal load - command: load nodeID xForce yForce load 4 100 -50 } # ------------------------------ # Start of analysis generation # ------------------------------ # Create the system of equation, a SPD using a band storage scheme system BandSPD # Create the DOF numberer, the reverse Cuthill-McKee algorithm numberer RCM # Create the constraint handler, a Plain handler is used as homo constraints constraints Plain # Create the integration scheme, the LoadControl scheme using steps of 1.0 integrator LoadControl 1.0 # Create the solution algorithm, a Linear algorithm is created algorithm Linear # create the analysis object  analysis Static # ------------------------------ # Start of recorder generation # ------------------------------ # create a Recorder object for the nodal displacements at node 4 recorder Node -file example.out -time -node 4 -dof 1 2 disp # Create a recorder for element forces, one in global and the other local system recorder Element -file eleGlobal.out -time -ele 1 2 3 forces recorder Element -file eleLocal.out -time -ele 1 2 3 basicForces # ------------------------------ # Finally perform the analysis # ------------------------------ # Perform the analysis analyze 1 # ------------------------------ # Print Stuff to Screen # ------------------------------ # Print the current state at node 4 and at all elements puts "node 4 displacement: [nodeDisp 4]" print node 4 print ele

运行 果与官方网站上给出的结果完全相同,表明编译成功。

版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。
相关推荐