资源简介
岩土工程的D-P模型的源代码。岩土工程的D-P模型的源代码。
代码片段和文件信息
// Body.cpp: implementation of the CBody class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “DDCMM.h“
#include “Body.h“
#include “DDCMMPDoc.h“
#include “math.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#include “ZOFiniteBlock.h“
#include “FOFiniteBlock.h“
#include “TGPFiniteElement.h“
#include “FGPFiniteElement.h“
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CBody Cobject)
CBody::CBody()
{
m_NumofBP=0;
m_NumofGP=0;
m_NumofGFE=0;
m_IsDynamic=FALSE;
}
CBody::~CBody()
{
int i;
for(i=0;i {
delete m_BPArray[i];
}
m_BPArray.RemoveAll();
for(i=0;i {
delete m_GPArray[i];
}
m_GPArray.RemoveAll();
for(i=0;i delete m_GFEArray[i];
m_GFEArray.RemoveAll();
}
void CBody::Serialize(CArchive &ar)
{
CString m_Name;
CGeneralFiniteElement* pGFElement;
int i;
if (ar.IsStoring())
{
// TODO: add storing code here
m_NumofBP=m_BPArray.GetSize();
ar << m_NumofBP;
m_NumofGP=m_GPArray.GetSize();
ar << m_NumofGP;
m_NumofGFE=m_GFEArray.GetSize();
ar << m_NumofGFE;
for(i=0;i m_BPArray[i]->Serialize(ar);
for(i=0;i m_GPArray[i]->Serialize(ar);
for(i=0;i m_BPArray[i]->m_NodeNum=i;
for(i=0;i m_GPArray[i]->m_NodeNum=i;
for(i=0;i m_GFEArray[i]->Serialize(ar);
ar << m_MaterialName;
ar << m_ConstMName;
ar << m_IsDynamic;
}
else
{
// TODO: add loading code here
ar >> m_NumofBP;
ar >> m_NumofGP;
ar >> m_NumofGFE;
m_BPArray.SetSize(m_NumofBP-1);
for(i=0;i {
m_BPArray[i]=new CBoundaryPoint;
m_BPArray[i]->Serialize(ar);
m_BPArray[i]->m_NodeNum=i;
}
m_GPArray.SetSize(m_NumofGP-1);
for(i=0;i {
m_GPArray[i]=new CGeneralPoint;
m_GPArray[i]->Serialize(ar);
m_GPArray[i]->m_NodeNum=i;
}
m_GFEArray.SetSize(m_NumofGFE-1);
for(i=0;i {
ar >> m_Name;
if(!(m_Name.Compare(_T(“CZOFiniteBlock“))))
pGFElement=(CGeneralFiniteElement*)(new CZOFiniteBlock);
else if(!(m_Name.Compare(_T(“CFOFiniteBlock“))))
pGFElement=(CGeneralFiniteElement*)(new CFOFiniteBlock);
else if(!(m_Name.Compare(_T(“CTGPFiniteElement“))))
pGFElement=(CGeneralFiniteElement*)(new CTGPFiniteElement);
else if(!(m_Name.Compare(_T(“CFGPFiniteElement“))))
pGFElement=(CGeneralFiniteElement*)(new CFGPFiniteElement);
else
{
AfxMessageBox(“This CGeneralFiniteElementName is invalid“);
return;
}
pGFElement->m_Body=this;
m_GFEArray[i]=pGFElement;
m_GFEArray[i]->Serialize(ar
- 上一篇:MFC实现计算器 vC++
- 下一篇:简易的VC++点对点文件传输
评论
共有 条评论