// BemSolveDoc.h : interface of the CBemSolveDoc class
//
/////////////////////////////////////////////////////////////////////////////
class CNode;
class CElement;
class CIntPoint;
class CIntElem;
class CWell;

class CBemSolveDoc : public CDocument
{
protected: // create from serialization only
	CBemSolveDoc();
	DECLARE_DYNCREATE(CBemSolveDoc)

// Attributes
public:

// Operations
public:
	CObArray Nodes,Elems,TriElems,IntNods,Wells;
	LOGFONT lfnt,lfntw;
	int bounl,bounr,bount,bounb;
	CString name;
	float kx,ky,thick,precip;
	double *drs,*h,*g,*res;
	double tx,ty,tt,txy,rprec;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBemSolveDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual void DeleteContents();
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	//}}AFX_VIRTUAL

// Implementation
public:
	int PrintWell (CDC& td,int iy);
	void SolveEqu();
	void Assemble();
	float Flow (CElement* el);
	int PrintIntR (CDC& td,int iy);
	int PrintWellR (CDC& td,int iy);
	int PrintElemR (CDC& td,int iy);
	int PrintElem (CDC& td,int iy);
	void PointInteg (float xz,float yz, float& drwd,float& vx, float& vy);
	virtual ~CBemSolveDoc();
	CIntElem* GetIntElm(int i);
	CIntPoint* GetIntPt(int i);
	CElement* GetElement(int i);
	CNode* GetNode(int i);
	CWell* GetWell(int i);
	double Cell (double x1,double x2,double y1,double y2,double x0,double y0,double tt,double txy,double& bx,double& by);
	void Integ (double xp,double yp,double x1,double y1,double x2,double y2,double& hp,double& gp,double tt,double txy);
	void InVel (double xp,double yyp,double x1,double yy1,double x2,double yy2,double& hx,double& hy,double& gx,double& gy,double ts,double tt);
	double VnInteg (double xm,double ym,double tt,double txy,double& qx,double& qy);
	long ind (int i,int j,int nr);
	long ind2 (int i,int j,int nr);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CBemSolveDoc)
	afx_msg void OnSolveEqu();
	afx_msg void OnSolveInt();
	afx_msg void OnSolveWell();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
