OpenSees开发(二)源码分析
更新时间:2023-10-06 05:17:01 阅读量: 综合文库 文档下载
- opensees本构开发推荐度:
- 相关推荐
OpenSees开发(二)源码分析
这是一个平面桁架静力分析算例,代码位于
OpenSees2.3.0\\EXAMPLES\\Example1\\main.cpp这里先给出原始源代码:
[cpp] view plain copy // standard C++ includes #include <stdlib.h> #include <OPS_Globals.h> #include <StandardStream.h> #include <ArrayOfTaggedObjects.h> // includes for the domain classes #include <Domain.h> #include <Node.h> #include <Truss.h> #include
<ElasticMaterial.h> #include <SP_Constraint.h> #include <LoadPattern.h> #include
<LinearSeries.h> #include <NodalLoad.h> // includes for the analysis classes #include
<StaticAnalysis.h> #include <AnalysisModel.h> #include <Linear.h> #include
<PenaltyConstraintHandler.h> #include <DOF_Numberer.h> #include <RCM.h> #include <LoadControl.h> #include <BandSPDLinSOE.h> #include
<BandSPDLinLapackSolver.h> // init the global variabled defined in OPS_Globals.h StandardStream
sserr; OPS_Stream *opserrPtr = &sserr; double ops_Dt = 0; // Domain *ops_TheActiveDomain = 0; Element *ops_TheActiveElement = 0; // main routine int main(int argc, char **argv) { // // now create a domain and a modelbuilder // and build the model // Domain *theDomain = new Domain(); // create the nodes using constructor: // Node(tag, ndof, crd1, crd2) // and then add them to the domain Node *node1 = new Node(1, 2, 0.0, 0.0); Node *node2 = new Node(2, 2, 144.0, 0.0); Node *node3 = new Node(3, 2, 168.0, 0.0); Node *node4 = new Node(4, 2, 72.0, 96.0); theDomain->addNode(node1); theDomain->addNode(node2); theDomain->addNode(node3);
theDomain->addNode(node4); // create an elastic material using constriuctor: // ElasticMaterialModel(tag, E) UniaxialMaterial *theMaterial = new ElasticMaterial(1, 3000); //
create the truss elements using constructor: // Truss(tag, dim, nd1, nd2, Material &,A) // and then add them to the domain Truss *truss1 = new Truss(1, 2, 1, 4, *theMaterial, 10.0); Truss *truss2 = new Truss(2, 2, 2, 4, *theMaterial, 5.0);
Truss *truss3 = new Truss(3, 2, 3, 4, *theMaterial, 5.0); theDomain->addElement(truss1); theDomain->addElement(truss2);
theDomain->addElement(truss3); // create the single-point constraint objects using constructor: // SP_Constraint(tag, nodeTag, dofID, value) // and then add them to the domain
SP_Constraint *sp1 = new SP_Constraint(1, 1, 0, 0.0); SP_Constraint *sp2 = new SP_Constraint(2, 1, 1, 0.0); SP_Constraint *sp3 = new SP_Constraint(3, 2, 0, 0.0); SP_Constraint *sp4 = new SP_Constraint(4, 2, 1, 0.0); SP_Constraint *sp5 = new SP_Constraint(5, 3, 0, 0.0); SP_Constraint *sp6 = new SP_Constraint(6, 3, 1, 0.0); theDomain->addSP_Constraint(sp1); theDomain->addSP_Constraint(sp2); theDomain->addSP_Constraint(sp3); theDomain->addSP_Constraint(sp4);
theDomain->addSP_Constraint(sp5); theDomain->addSP_Constraint(sp6); // construct a linear time series object using constructor: // LinearSeries() TimeSeries *theSeries = new LinearSeries(); // construct a load
pattren using constructor: // LoadPattern(tag) // and then set it's TimeSeries and add it to the domain LoadPattern *theLoadPattern = new LoadPattern(1); theLoadPattern->setTimeSeries(theSeries);
theDomain->addLoadPattern(theLoadPattern); // construct a nodal load using constructor: // NodalLoad(tag, nodeID, Vector &) // first construct a Vector of size 2 and set the values NOTE C INDEXING // then construct the load and add it to the domain Vector theLoadValues(2); theLoadValues(0) = 100.0; theLoadValues(1) = -50.0; NodalLoad *theLoad = new NodalLoad(1, 4, theLoadValues);
theDomain->addNodalLoad(theLoad, 1); // create an Analysis object to perform a static analysis of the model // - constructs: // AnalysisModel of type AnalysisModel, // EquiSolnAlgo of type
Linear // StaticIntegrator of type LoadControl // ConstraintHandler of type Penalty // DOF_Numberer which uses RCM // LinearSOE of type Band SPD // and then the StaticAnalysis object AnalysisModel *theModel = new AnalysisModel(); EquiSolnAlgo *theSolnAlgo = new Linear(); StaticIntegrator *theIntegrator = new LoadControl(1.0, 1, 1.0, 1.0); ConstraintHandler *theHandler = new PenaltyConstraintHandler(1.0e8,1.0e8); RCM *theRCM = new RCM(); DOF_Numberer *theNumberer = new
DOF_Numberer(*theRCM); BandSPDLinSolver *theSolver = new BandSPDLinLapackSolver(); LinearSOE *theSOE = new
BandSPDLinSOE(*theSolver);
StaticAnalysis theAnalysis(*theDomain,
*theHandler, *theNumberer, *theModel, *theSolnAlgo, *theSOE, *theIntegrator); // perform the analysis & print out the results for the domain int numSteps = 1;
theAnalysis.analyze(numSteps); opserr <<
正在阅读:
OpenSees开发(二)源码分析10-06
彻底解决液压系统四缸同步的有效方法04-21
炼焦方法09-13
电梯维保人员管理制度 (1)06-02
菜谱 - 图文04-06
跨期套利和跨品种套利交易指令使用说明06-02
惠州市LED及光电子行业企业名录2018版185家01-27
2019年整理安平高速公路AP9合同段总体预案第一部分05-24
卫健局长在2022年医院新入职员工会议上的讲话范文03-23
西南大学《儿童哲学》网上作业及参考答案01-18
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 源码
- OpenSees
- 分析
- 开发
- 病例试题库选择题
- 中小学生《学会感恩 - 感恩父母》主题班会实践活动课说课稿设计
- 水上水下施工作业通航安全与防污染措施计划书
- 物业公司副总经理年度工作总结
- 高一化学必修1(人教版)新新新学案(教案和课时练习含详解)第一章从实验学化学
- 超声波液位检测电路设计-论文 - 图文
- 氨站泄漏事故应急预案
- 北师大版小学三年级下册《什么是面积》.doc
- 计算机网络作业布置-参考答案全解 - 图文
- turboc2.0使用说明
- 高中数学概率与统计解答题
- 机械原理课程设计说明书牛头刨床
- 应收账款管理的思路与方法
- 高速公路路基石灰改良土填筑施工组织设计
- 经济法概论 - 习题集(含答案)
- 2019届高考物理第一轮总复习知识点配套练习题6
- 公司安全生产责任制考核制度
- 质粒抽提详细步骤
- 2012以及2013届高考英语(第六讲 - 动词和动词短语)语法精讲
- 基于Solidworks和Adams的玩具动力学仿真 毕业论文(胡成骏) - 图文