找回密码
 注册
Simdroid-非首页
查看: 218|回复: 2

[二次开发] 如何在VC中输出ANSYS的APDL语言

[复制链接]
发表于 2008-2-25 20:57:05 | 显示全部楼层 |阅读模式 来自 江苏苏州
程序如下
#include "stdafx.h"
#include "paper015.h"
#include "paper015Dlg.h"
#include "math.h"
#include "engine.h"
#include <string.h>
#include <malloc.h>
#include <fstream.h>
public:
      typedef struct individual
{
  double fitness;
  unsigned *chrom;
  double  varible[12];        //变量
  int      xsite;              //位置         
      int      parent[2];          //父个体        
    double  Ts,Qp,Fz;            //相关值
};
struct OptPara
{
double Fz_Optimize,Qp_Optimize,Ts_Optimize;
double I,K;
double H[10];
};
    OptPara *AllPara;
void WriteAnsysTry(CString FileName, double *p);
    void StartEngine();
void CPaper015Dlg::OnButton1()
{
for(int index=0;index<10;index++)
{
    for(int i=0;i<10;i++)
        AllPara[index].H=sin(i+2);
        WriteAnsysTry("E:\\thesis\\program\\beamtry01.txt" , AllPara[index].H);
}
}
void CPaper015Dlg::WriteAnsysTry(CString FileName, double *p)
{
fstream outfile;
outfile.open(FileName,ios:ut);
if(!outfile)
{
  MessageBox("File can't open\n");
  abort();
}
outfile<<"/COM, Structural\n\
  /PREP7\n\
  /TITLE,GET MASS AND STIFFNESS MATRIX OF FLEXIBLE BEAM\n\
  /UNITS,SI\n\
  *SET,L,0.1\n";
  *SET,B,0.002\n\
  *SET,H,0.012\n";
  //更改下面数据
outfile<<"*SET,H1,";
outfile<<p[0];
outfile<<"\n*SET,H2,";
outfile<<p[1];
outfile<<"\n*SET,H3,";
outfile<<p[2];
outfile<<"\n*SET,H4,";
outfile<<p[3];
outfile<<"\n*SET,H5,";
outfile<<p[4];
outfile<<"\n*SET,H6,";
outfile<<p[5];
outfile<<"\n*SET,H7,";
outfile<<p[6];
outfile<<"\n*SET,H8,";
outfile<<p[7];
outfile<<"\n*SET,H9,";
outfile<<p[8];
outfile<<"\n*SET,H10,";
outfile<<p[9];
我想将上面的ANSYS APDL语言写入E:\thesis\program\beamtry01.txt中,但此段程序总是编译不过去,VC不识别APDL语句,还提示无法写入,请高手帮看看问题出在哪里?几十条错误
发表于 2008-2-26 16:28:31 | 显示全部楼层 来自 广东广州
Simdroid开发平台
bu  cuo  
\

hao
回复 不支持

使用道具 举报

发表于 2012-4-1 21:59:54 | 显示全部楼层 来自 河北廊坊
不懂!!!!!!!
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-5-29 17:26 , Processed in 0.035214 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表