|
楼主 |
发表于 2004-3-6 11:11:00
|
显示全部楼层
请教有关Tecplot的问题
谢谢你们的帮助。我在VC++中是用\n进行换行回车的。代码如下
CStdioFile file;
file.Open("G:\\浓度场的坐标.plt",CFile::modeCreate+CFile::modeWrite);
CString str10;
CString str11;
CString str12;
CString str13,str14,str15,str16;
str10.Format("VARIABLES = \042X\042,\042Y\042,\042C\042\n");
str11.Format("ZONE I=%d,J=%d,F=POINT \n",(m_cellNodeX-1),(m_cellNodeY-1));
file.Write((LPCSTR)str10,str10.GetLength());
file.Write((LPCSTR)str11,str11.GetLength());
float * m_coordinate;
int * m_nodenumber;
for(int nn=0;nn<m_cellArray.GetSize();nn++)
{
m_coordinate=m_cellArray[nn]->GetCellCenter();
str14.Format("%f",m_coordinate[0]);
str15.Format("%f",m_coordinate[1]);
//str16.Format("%f\n",m_cellArray[nn]->GetConcentration());
//str16.Format("%f\n",m_cellArray[nn]->GetCellState());
if(nn==m_cellArray.GetSize()-1)
str16.Format("%f\n",m_cellArray[nn]->GetOrientation());
else
str16.Format("%f\n",m_cellArray[nn]->GetOrientation());
file.Write((LPCSTR)str14,str14.GetLength());
file.Seek(20-str14.GetLength(),CFile::current);
file.Write((LPCSTR)str15,str15.GetLength());
file.Seek(20-str15.GetLength(),CFile::current);
file.Write((LPCSTR)str16,str16.GetLength());
}
file.Close();
|
|