当前位置: 首页 > news >正文

建个网站需要什么南宁推广公司

建个网站需要什么,南宁推广公司,济南公司做网站的价格,html5 jq做电脑网站本系列文章致力于实现“手搓有限元,干翻Ansys的目标”,基本框架为前端显示使用QT实现交互,后端计算采用Visual Studio C。 QT软件界面 具体软件操作可查看下方视频哦。也可以点击这里直接跳转。 直接干翻Ansys?小伙自研有限元 1、…

本系列文章致力于实现“手搓有限元,干翻Ansys的目标”,基本框架为前端显示使用QT实现交互,后端计算采用Visual Studio C++。

QT软件界面

具体软件操作可查看下方视频哦。也可以点击这里直接跳转。

直接干翻Ansys?小伙自研有限元

1、Bar2D2Node类

Bar2D2Node类用来实现有限元中二维杆单元的计算。整体架构如下:

Bar2D2Node类架构图

1.1、public function

1.1.1、构造函数与析构函数

构造函数用来初始化二维杆单元基本信息,包括ID、杆单元起始点、结束点、杨氏模量、横截面积的关键数值;析构函数用来释放内存。

Bar2D2Node.h函数声明文件

//***********************构造函数析构函数***********************//
/*
函数名称:		无参构造函数
*/
Bar2D2Node();/*
函数名称:		有参构造函数
id:				ID
*p0:			起始点
*p1:			结束点
E:				弹性模量
A:				横截面积
*/
Bar2D2Node(int id, Point2D* p0, Point2D* p1, double E, double A);/*
函数名称:		析构函数
*/
~Bar2D2Node();

Bar2D2Node.cpp函数实现文件

//无参构造函数
Bar2D2Node::Bar2D2Node()
{
}//有参构造函数
Bar2D2Node::Bar2D2Node(int id, Point2D* p1, Point2D* p2, double E, double A)
{this->ID = id;this->m_Point0 = p1;this->m_Point1 = p2;this->m_E = E;this->m_A = A;
}//析构函数
Bar2D2Node::~Bar2D2Node()
{
}

1.1.2、设置数值接口函数

设置数值接口函数可以单独设置二维杆单元的ID、杆单元起始点、结束点、杨氏模量、横截面积。

Bar2D2Node.h函数声明文件

//***********************设置数值接口函数***********************//
/*
函数名称:		设置Bar2D2Node杆单元
id:				ID
*p0:			起始点
*p1:			结束点
E:				弹性模量
A:				横截面积
*/
virtual void		SetBar(int id, Point2D* p0, Point2D* p1, double E, double /*
函数名称:		设置Bar2D2Node起始点与结束点
*p0:			起始点
*p1:			结束点
*/
virtual void		SetPoint(Point2D* p0, Point2D* p1);/*
函数名称:		设置Bar2D2Node ID
id:				ID
*/
void		SetID(int id);/*
函数名称:		设置Bar2D2Node弹性模量
E:				弹性模量
*/
void		SetE(double E);/*
函数名称:		设置Bar2D2Node截面面积
A:				横截面积
*/
void		SetA(double A);

Bar2D2Node.cpp函数实现文件

//设置Bar2D2Node杆单元
void Bar2D2Node::SetBar(int id, Point2D* p0, Point2D* p1, double E, double A)
{this->ID = id;this->m_Point0 = p0;this->m_Point1 = p1;this->m_E = E;this->m_A = A;
}//设置Bar2D2Node起始点与结束点
void Bar2D2Node::SetPoint(Point2D* p1, Point2D* p2)
{this->m_Point0 = p1;this->m_Point1 = p2;
}//设置Bar2D2Node ID
void Bar2D2Node::SetID(int id)
{this->ID = id;
}//设置Bar2D2Node弹性模量
void Bar2D2Node::SetE(double E)
{this->m_E = E;
}//设置Bar2D2Node截面面积
void Bar2D2Node::SetA(double A)
{this->m_A = A;
}

1.1.3、获取数值接口函数

获取数值接口函数不仅可以获取到二维杆单元的ID、杆单元起始点、结束点、杨氏模量、横截面积这些初始化变量。还可以获取应力、应变这些有限元计算结果变量,有的同学可能会比较疑惑,最基本的位移变量怎么没有获取呢?这是因为在二维杆单元的起始点、结束点(Point2D类)中已经包含节点位置信息。点击此处可以查看Point2D类的相关介绍。

Bar2D2Node.h函数声明文件

//***********************获取数值接口函数***********************//
/*
函数名称:		获取Bar2D2Node起始点
*/
Point2D*	GetPoint0();/*
函数名称:		获取Bar2D2Node终止点
*/
Point2D*	GetPoint1();/*
函数名称:		获取Bar2D2Node单元ID
*/
int			GetID();/*
函数名称:		获取Bar2D2Node单元弹性模量
*/
double		GetE();/*
函数名称:		获取Bar2D2Node单元面积
*/
double		GetA();/*
函数名称:		获取Bar2D2Node单元刚度矩阵
*/
Matrix		GetK();/*
函数名称:		获取Bar2D2Node单元应变
*/
double		GetEpsilon();/*
函数名称:		获取Bar2D2Node单元应力
*/
double		GetSigama();

Bar2D2Node.cpp函数实现文件

//获取Bar2D2Node起始点
Point2D* Bar2D2Node::GetPoint0()
{return this->m_Point0;
}//获取Bar2D2Node终止点
Point2D* Bar2D2Node::GetPoint1()
{return this->m_Point1;
}//获取Bar2D2Node单元ID
int Bar2D2Node::GetID()
{return this->ID;
}//获取Bar2D2Node单元弹性模量
double Bar2D2Node::GetE()
{return this->m_E;
}//获取Bar2D2Node单元面积
double Bar2D2Node::GetA()
{return this->m_A;
}//获取Bar2D2Node单元刚度矩阵
Matrix Bar2D2Node::GetK()
{return this->m_MatK;
}//获取Bar2D2Node单元应变
double Bar2D2Node::GetEpsilon()
{return this->m_Epsilon;
}//获取Bar2D2Node单元应力
double Bar2D2Node::GetSigama()
{return this->m_Sigama;
}

1.1.4、计算函数

此部分函数为有限元计算核心,可以计算二维杆单元全局刚度矩阵、应变、应力关键力学信息。关于此部分理论推导详见(《有限元基础教程》 曾攀 编著),书中详细介绍了推导过程,并且附带Matlab编程代码和Ansys实例分析。

Bar2D2Node.h函数声明文件

//***************************计算函数***************************//
/*
函数名称:		创建刚度矩阵(全局)
*/
virtual Matrix	CreateK();/*
函数名称:		计算杆单元应变
*/
virtual double	CalEpsilon();/*
函数名称:		计算杆单元应力
*/
virtual double	CalSigama();

Bar2D2Node.cpp函数实现文件

//***************************计算函数***************************//
//创建全局刚度矩阵
Matrix Bar2D2Node::CreateK()
{//计算方向正弦余弦double dealtaX = this->m_Point1->GetX() - this->m_Point0->GetX();double dealtaY = this->m_Point1->GetY() - this->m_Point0->GetY();double barLength = sqrt(pow(dealtaX ,2) + pow(dealtaY, 2));double cosTheat = dealtaX / barLength;double sinTheat = dealtaY / barLength;//构建旋转矩阵 double T[8] = {cosTheat , sinTheat, 0, 0, 0, 0, cosTheat, sinTheat};Matrix MatT(2, 4, T);//局部刚度矩阵double k[4] = {1.0, -1.0, -1.0, 1.0};Matrix Matk(2, 2, k);//刚度矩阵系数double var1 = this->m_E * this->m_A / barLength;Matk = Matk.MultNum(var1);//全局刚度矩阵this->m_MatK = MatT.Transpose().MultMat(Matk).MultMat(MatT);return this->m_MatK;
}//计算杆单元应变
double Bar2D2Node::CalEpsilon()
{//计算方向正弦余弦double dealtaX = this->m_Point1->GetX() - this->m_Point0->GetX();double dealtaY = this->m_Point1->GetY() - this->m_Point0->GetY();double barLength = sqrt(pow(dealtaX, 2) + pow(dealtaY, 2));double cosTheat = dealtaX / barLength;double sinTheat = dealtaY / barLength;//构建旋转矩阵 double T[8] = { cosTheat , sinTheat, 0, 0, 0, 0, cosTheat, sinTheat };Matrix MatT(2, 4, T);//构建B矩阵double B[2] = { -1 / barLength, 1 / barLength };Matrix MatB(1, 2, B);//构建位移矩阵double q[4] = { this->m_Point0->GetU(), this->m_Point0->GetV(), this->m_Point1->GetU(), this->m_Point1->GetV() };Matrix Matq(4, 1, q);//计算Epsilonthis->m_Epsilon = MatB.MultMat(MatT).MultMat(Matq).GetMatrixEle(0, 0);return this->m_Epsilon;
}//计算杆单元应力
double Bar2D2Node::CalSigama()
{//根据本构方程 计算sigamathis->m_Sigama = this->GetE() * this->GetEpsilon();return this->m_Sigama;
}

1.2、protected variable

保护类型变量,在后续中Bar2D2Node类会成为其他类型单元的父类,比如三维杆单元(Bar3D2Node)、二维梁单元(Beam2D2Node)等等,有些成员变量会在所派生出来的类中进行调用,此类变量都放在protected类型中。

protected:Matrix		m_MatK;					//杆单元刚度矩阵 全局double		m_Sigama;				//杆单元应力double		m_Epsilon;				//杆单元应变

1.3、private variable

私有变量,只能在类内进行调用。

private:int			ID;						//杆单元编号Point2D*	m_Point0;				//杆单元节点1号,存在顺序关系Point2D*	m_Point1;				//杆单元节点2号,存在顺序关系double		m_E;					//弹性模量double		m_A;					//杆单元横截面积

1.4、全部源码

Bar2D2Node.h函数声明文件

#ifndef _BAR_2D_H
#define _BAR_2D_H#include <iostream>
#include <list>
#include <math.h>
#include "Point.h"
#include "Matrix.h"class Bar2D2Node
{
public://***********************构造函数析构函数***********************///*函数名称:		无参构造函数*/Bar2D2Node();/*函数名称:		有参构造函数id:				ID*p0:			起始点*p1:			结束点E:				弹性模量A:				横截面积*/Bar2D2Node(int id, Point2D* p0, Point2D* p1, double E, double A);/*函数名称:		析构函数*/~Bar2D2Node();//***********************设置数值接口函数***********************///*函数名称:		设置Bar2D2Node杆单元id:				ID*p0:			起始点*p1:			结束点E:				弹性模量A:				横截面积*/virtual void		SetBar(int id, Point2D* p0, Point2D* p1, double E, double A);/*函数名称:		设置Bar2D2Node起始点与结束点*p0:			起始点*p1:			结束点*/virtual void		SetPoint(Point2D* p0, Point2D* p1);/*函数名称:		设置Bar2D2Node IDid:				ID*/void		SetID(int id);/*函数名称:		设置Bar2D2Node弹性模量E:				弹性模量*/void		SetE(double E);/*函数名称:		设置Bar2D2Node截面面积A:				横截面积*/void		SetA(double A);//***********************获取数值接口函数***********************///*函数名称:		获取Bar2D2Node起始点*/Point2D*	GetPoint0();/*函数名称:		获取Bar2D2Node终止点*/Point2D*	GetPoint1();/*函数名称:		获取Bar2D2Node单元ID*/int			GetID();/*函数名称:		获取Bar2D2Node单元弹性模量*/double		GetE();/*函数名称:		获取Bar2D2Node单元面积*/double		GetA();/*函数名称:		获取Bar2D2Node单元刚度矩阵*/Matrix		GetK();/*函数名称:		获取Bar2D2Node单元应变*/double		GetEpsilon();/*函数名称:		获取Bar2D2Node单元应力*/double		GetSigama();//***************************计算函数***************************///*函数名称:		创建刚度矩阵(全局)*/virtual Matrix	CreateK();/*函数名称:		计算杆单元应变*/virtual double	CalEpsilon();/*函数名称:		计算杆单元应力*/virtual double	CalSigama();protected:Matrix		m_MatK;					//杆单元刚度矩阵 全局double		m_Sigama;				//杆单元应力double		m_Epsilon;				//杆单元应变private:int			ID;						//杆单元编号Point2D*	m_Point0;				//杆单元节点1号,存在顺序关系Point2D*	m_Point1;				//杆单元节点2号,存在顺序关系double		m_E;					//弹性模量double		m_A;					//杆单元横截面积};#endif

Bar2D2Node.cpp函数实现文件

#include "Bar2D2Node.h"//************************************bar-2D*********************************//
//无参构造函数
Bar2D2Node::Bar2D2Node()
{
}//有参构造函数
Bar2D2Node::Bar2D2Node(int id, Point2D* p1, Point2D* p2, double E, double A)
{this->ID = id;this->m_Point0 = p1;this->m_Point1 = p2;this->m_E = E;this->m_A = A;
}//析构函数
Bar2D2Node::~Bar2D2Node()
{
}//设置Bar2D2Node杆单元
void Bar2D2Node::SetBar(int id, Point2D* p0, Point2D* p1, double E, double A)
{this->ID = id;this->m_Point0 = p0;this->m_Point1 = p1;this->m_E = E;this->m_A = A;
}//设置Bar2D2Node起始点与结束点
void Bar2D2Node::SetPoint(Point2D* p1, Point2D* p2)
{this->m_Point0 = p1;this->m_Point1 = p2;
}//设置Bar2D2Node ID
void Bar2D2Node::SetID(int id)
{this->ID = id;
}//设置Bar2D2Node弹性模量
void Bar2D2Node::SetE(double E)
{this->m_E = E;
}//设置Bar2D2Node截面面积
void Bar2D2Node::SetA(double A)
{this->m_A = A;
}//获取Bar2D2Node起始点
Point2D* Bar2D2Node::GetPoint0()
{return this->m_Point0;
}//获取Bar2D2Node终止点
Point2D* Bar2D2Node::GetPoint1()
{return this->m_Point1;
}//获取Bar2D2Node单元ID
int Bar2D2Node::GetID()
{return this->ID;
}//获取Bar2D2Node单元弹性模量
double Bar2D2Node::GetE()
{return this->m_E;
}//获取Bar2D2Node单元面积
double Bar2D2Node::GetA()
{return this->m_A;
}//获取Bar2D2Node单元刚度矩阵
Matrix Bar2D2Node::GetK()
{return this->m_MatK;
}//获取Bar2D2Node单元应变
double Bar2D2Node::GetEpsilon()
{return this->m_Epsilon;
}//获取Bar2D2Node单元应力
double Bar2D2Node::GetSigama()
{return this->m_Sigama;
}//***************************计算函数***************************//
//创建全局刚度矩阵
Matrix Bar2D2Node::CreateK()
{//计算方向正弦余弦double dealtaX = this->m_Point1->GetX() - this->m_Point0->GetX();double dealtaY = this->m_Point1->GetY() - this->m_Point0->GetY();double barLength = sqrt(pow(dealtaX ,2) + pow(dealtaY, 2));double cosTheat = dealtaX / barLength;double sinTheat = dealtaY / barLength;//构建旋转矩阵 double T[8] = {cosTheat , sinTheat, 0, 0, 0, 0, cosTheat, sinTheat};Matrix MatT(2, 4, T);//局部刚度矩阵double k[4] = {1.0, -1.0, -1.0, 1.0};Matrix Matk(2, 2, k);//刚度矩阵系数double var1 = this->m_E * this->m_A / barLength;Matk = Matk.MultNum(var1);//全局刚度矩阵this->m_MatK = MatT.Transpose().MultMat(Matk).MultMat(MatT);return this->m_MatK;
}//计算杆单元应变
double Bar2D2Node::CalEpsilon()
{//计算方向正弦余弦double dealtaX = this->m_Point1->GetX() - this->m_Point0->GetX();double dealtaY = this->m_Point1->GetY() - this->m_Point0->GetY();double barLength = sqrt(pow(dealtaX, 2) + pow(dealtaY, 2));double cosTheat = dealtaX / barLength;double sinTheat = dealtaY / barLength;//构建旋转矩阵 double T[8] = { cosTheat , sinTheat, 0, 0, 0, 0, cosTheat, sinTheat };Matrix MatT(2, 4, T);//构建B矩阵double B[2] = { -1 / barLength, 1 / barLength };Matrix MatB(1, 2, B);//构建位移矩阵double q[4] = { this->m_Point0->GetU(), this->m_Point0->GetV(), this->m_Point1->GetU(), this->m_Point1->GetV() };Matrix Matq(4, 1, q);//计算Epsilonthis->m_Epsilon = MatB.MultMat(MatT).MultMat(Matq).GetMatrixEle(0, 0);return this->m_Epsilon;
}//计算杆单元应力
double Bar2D2Node::CalSigama()
{//根据本构方程 计算sigamathis->m_Sigama = this->GetE() * this->GetEpsilon();return this->m_Sigama;
}


文章转载自:
http://dinncofascistic.bkqw.cn
http://dinncogasholder.bkqw.cn
http://dinncoohio.bkqw.cn
http://dinnconodous.bkqw.cn
http://dinncobandage.bkqw.cn
http://dinncoluddism.bkqw.cn
http://dinncomidland.bkqw.cn
http://dinncotridactylous.bkqw.cn
http://dinncolycurgan.bkqw.cn
http://dinncoskewbald.bkqw.cn
http://dinncohaze.bkqw.cn
http://dinncopaediatric.bkqw.cn
http://dinncoobverse.bkqw.cn
http://dinncounrealize.bkqw.cn
http://dinncotrunkback.bkqw.cn
http://dinncorelativity.bkqw.cn
http://dinncomaltose.bkqw.cn
http://dinncogunnar.bkqw.cn
http://dinncoremoval.bkqw.cn
http://dinncoxenoantigen.bkqw.cn
http://dinncoprivate.bkqw.cn
http://dinncohabitably.bkqw.cn
http://dinncoconsecutively.bkqw.cn
http://dinncocoalitionist.bkqw.cn
http://dinncodecarock.bkqw.cn
http://dinncolipocyte.bkqw.cn
http://dinncooverwhelming.bkqw.cn
http://dinncofairy.bkqw.cn
http://dinncohighflyer.bkqw.cn
http://dinncoomophagia.bkqw.cn
http://dinncoflickertail.bkqw.cn
http://dinncobannerol.bkqw.cn
http://dinncoarthrosis.bkqw.cn
http://dinncoingenuity.bkqw.cn
http://dinncocowling.bkqw.cn
http://dinncocounteraction.bkqw.cn
http://dinncoacronically.bkqw.cn
http://dinncowiresmith.bkqw.cn
http://dinncorelive.bkqw.cn
http://dinncoquenselite.bkqw.cn
http://dinncoprocrypsis.bkqw.cn
http://dinncoquibbler.bkqw.cn
http://dinncowrinkly.bkqw.cn
http://dinncofcia.bkqw.cn
http://dinncophilabeg.bkqw.cn
http://dinncobiographize.bkqw.cn
http://dinncothiram.bkqw.cn
http://dinncosunghua.bkqw.cn
http://dinncoguidable.bkqw.cn
http://dinncoplayroom.bkqw.cn
http://dinncoinspective.bkqw.cn
http://dinncogazania.bkqw.cn
http://dinncohoneymouthed.bkqw.cn
http://dinncosignificantly.bkqw.cn
http://dinncoundissolved.bkqw.cn
http://dinncoinquirer.bkqw.cn
http://dinncoregimen.bkqw.cn
http://dinncoappaloosa.bkqw.cn
http://dinncounnecessaries.bkqw.cn
http://dinnconapier.bkqw.cn
http://dinncodismay.bkqw.cn
http://dinncotut.bkqw.cn
http://dinncoextrados.bkqw.cn
http://dinncocamisard.bkqw.cn
http://dinncorotiferous.bkqw.cn
http://dinncometazoal.bkqw.cn
http://dinncodelir.bkqw.cn
http://dinncodistillage.bkqw.cn
http://dinncoalbumen.bkqw.cn
http://dinncothigmotropism.bkqw.cn
http://dinncobroomstick.bkqw.cn
http://dinncopolysaccharid.bkqw.cn
http://dinncoreinsert.bkqw.cn
http://dinncomerestone.bkqw.cn
http://dinncocorporally.bkqw.cn
http://dinncoblackball.bkqw.cn
http://dinncodehiscence.bkqw.cn
http://dinncogenethliacally.bkqw.cn
http://dinncopictish.bkqw.cn
http://dinncolaundrywoman.bkqw.cn
http://dinncoglobal.bkqw.cn
http://dinncodiscountenance.bkqw.cn
http://dinncosovietization.bkqw.cn
http://dinncoeffraction.bkqw.cn
http://dinncoperi.bkqw.cn
http://dinncounbreathable.bkqw.cn
http://dinncotennantite.bkqw.cn
http://dinncoagenesis.bkqw.cn
http://dinncocheckerboard.bkqw.cn
http://dinncoeagle.bkqw.cn
http://dinncogeneticist.bkqw.cn
http://dinncomoralist.bkqw.cn
http://dinncostraightness.bkqw.cn
http://dinncoprometheus.bkqw.cn
http://dinncorepave.bkqw.cn
http://dinncoindecision.bkqw.cn
http://dinncohepatocyte.bkqw.cn
http://dinncocablegram.bkqw.cn
http://dinncoassert.bkqw.cn
http://dinncoinnerve.bkqw.cn
http://www.dinnco.com/news/115654.html

相关文章:

  • 去哪里找空间做网站百度关键词优化的意思
  • 精湛的网站建设百度高级搜索引擎
  • 做网站应该拿多少提成站长工具seo
  • 嘉善县住房和城乡规划建设局网站seo谷歌外贸推广
  • 最近发生的新闻热点事件图片优化软件
  • 重庆门户网站百度网站安全检测
  • 静安网站建设北京网络营销策划公司
  • 网站建设第一品牌宁波网站建设公司
  • 微商分销平台短视频seo是什么
  • fotor网站做兼职靠谱吗佛山网站建设
  • 高端大气网络设计建设公司网站织梦模板长沙seo关键词排名
  • 舟山 做企业网站贵州seo技术培训
  • 厦门公司网站建设网站维护推广的方案
  • 哪些网站可以做微信支付河南网站建设报价
  • 做网站找模板个人推广平台
  • 有什么网站是做企业型的百度知道登录
  • 深圳做网站的公司的区域网站互联网推广
  • 做快照网站和推广 哪个效果好东莞网络公司网络推广
  • 网站建设简单恢复正常百度
  • 网站后台建设用到哪些编程语言网站seo策划方案
  • 宜黄住房和城乡建设部网站seo零基础培训
  • 网站开发工程师所需要的经验企业培训课程清单
  • 网站首页权重河南百度seo
  • 网易企业邮箱密码格式win优化大师官网
  • 网站月流量产品推广宣传方案
  • wordpress屌图床句容市网站seo优化排名
  • cpa广告联盟网站建设网络营销的专业知识
  • 怎么做代理ip网站陕西seo顾问服务
  • 教学设计代做去什么网站十五种常见的销售策略
  • 广东专业做网站排名哪家好链接转二维码