00001 #ifndef  _MY_GnuPlotDeal_
00002 #define _MY_GnuPlotDeal_
00003 #include "gnuplot.h"
00004 #include <dofs/dof_handler.h>
00005 #include "globals.h"
00006 #include <vector>
00007 #include "sfunctions.h"
00008 #include <fe/fe_base.h>
00009 #include "orthomesh.h"
00010 using std::vector;
00011 using std::string;
00012 
00013 
00014 
00015 
00016 class GnuPlotDeal : public GnuPlot
00017 {
00018  private:
00019   int cnt;
00020  protected:
00021 
00022  public:
00023   GnuPlotDeal(){cnt = 0;}
00024   
00025   void plotDealSolution(DoFHandler<1> &dof,const VecDouble &sol,std::string name="",std::string strComp=""); 
00026   void plotFunction1D(Function1D &f,double dStart,double dEnd,int nPoints,std::string name="",std::string strComp="",unsigned deg=0);
00027 
00028   void plotDealSolution(DoFHandler<2> &dofs,const VecDouble &sol,std::string name,std::string strComp,unsigned deg);
00029   void plotDealSolution(DoFHandler<2> &dofs,const VecDouble &sol,const VecDouble vU0,const VecDouble vU1,std::string name,std::string strComp,unsigned deg);
00030   void plotDealSolution(DoFHandler<2> &dofs,const VecDouble &sol,std::string name="",std::string strComp="");
00031   void plotDealSolutionAtVertices(Triangulation<2> &tria,const VecDouble &vSol,std::string name="",std::string strComp="");
00032   void plotDealSolutionAtVertices(Triangulation<2> &tria,const VecDouble &vSol,const VecDouble& vU0,const VecDouble &vU1,std::string name="",std::string strComp="",bool bScattered=false);
00033   void plotDealGradComponent(DoFHandler<2> &dofs,const VecDouble &sol,unsigned gradComp,std::string name="",std::string strComp="",VecDouble cVWeights=VecDouble ());
00034   void plotDealSolutionComponent(DoFHandler<2> &dofs,const VecDouble &sol,unsigned comp,std::string name="",std::string strComp="");
00035  
00036 
00037   
00038   void plotDealVectorFieldAtVertices(DoFHandler<2> &dofs,VecDouble &sol,unsigned deg1,unsigned deg2,bool bScale=true,double factor=1.0,bool bNormalize=false, std::string name="",std::string strComp=""); 
00039   void plotDealGradientField2D(DoFHandler<2> &dofs,VecDouble &sol,unsigned deg,bool bScale=true,double factor=1.0,bool bNormalize=false,std::string name="",std::string strComp="");
00040 
00041   void plotDealVectorField2D(DoFHandler<2> &dofs,VecDouble &sol1,VecDouble &sol2,std::string name="",bool bScale=true,std::string strComp=""); 
00042   void plotDealVectorField2DAtCentralPoints(Triangulation<2> &tria,VecDouble &V1,VecDouble &V2,double factor=1.0,bool bScale=true,std::string name="",std::string strComp=""); 
00043   void plotDealVectorField2DGaussPoints(DoFHandler<2> &dofs,VecDouble &sol1,VecDouble &sol2,std::string name="",bool bScale=true,double factor=1.0,std::string strComp=""); 
00044   void plotDealGrid2D(const Triangulation<2> &tri,std::string name="",std::string strComp="");
00045   void plotDealDeformationGrid2D(DoFHandler<2> &dofs,const VecDouble &sol,std::string name="",std::string strComp="");
00046   void plotDealBoundary(DoFHandler<2> &dofs,unsigned boundary_indicator,std::string name="",std::string strComp="");
00047   void plotDealPoints(vector<Point<2> > &points,string name="",string  strComp="");
00048   void plotDealSolutionDegAtVertex(DoFHandler<1> &dof,VecDouble &sol,vector<int> degOfVertex,std::string name="",std::string strComp="");
00049   void plotDealRadDeformationPoints(DoFHandler<2> &dof,VecDouble &sol,double degree,double _TOLERANCE,std::string name="",std::string strComp="");
00050   
00051   void plotDealCentralValuesSolution(const Triangulation<2> &trig,const VecDouble &cSol,std::string name="",std::string strComp="");
00052   
00053   
00054   void plotDealCentralPointsOfFlaggedCells(const Triangulation<2> &tria,const VecBool &cVFlags,std::string name=""); 
00055   void plotDealFlaggedVertices(const Triangulation<2> &tria,const VecBool &vVFlags,std::string name="",std::string strComp=""); 
00056   void plotFunction(const Triangulation<2> &tria,Function2D &f,std::string name="",std::string strComp="");
00057   void plotDealSolutionAtY(DoFHandler<2> &dofs,const VecDouble &sol,std::string name,std::string strComp,unsigned deg,double dAtY);
00058   void plotDealSolutionAtX(DoFHandler<2> &dofs,const VecDouble &sol,std::string name,std::string strComp,unsigned deg,double dAtX);
00059   void plotDealSolutionAtVerticesAtY(Triangulation<2> &tria,const VecDouble &vSol,double dAtY,std::string name="",std::string strComp="");
00060   void plotDealSolutionAtVerticesAtX(Triangulation<2> &tria,const VecDouble &vSol,double dAtX,std::string name="",std::string strComp="");
00061   void plotDealSolutionCentralPointsAtY(Triangulation<2> &tria,const VecDouble &vSol,double dAtY,std::string name="",std::string strComp="");
00062 
00063   void plotShapeFunctionsAtCell(const FiniteElement<2> &fe,DoFHandler<2>::cell_iterator &cell,unsigned nPoints); 
00064  
00065   void plotMapInVectors(const VecDouble &v1,const VecDouble &v2,std::string name="",std::string strComp="");
00066   
00067   void plotCentralValuesAtFixedZ(Triangulation<3> &tria, const VecDouble &cSol,string name, string strComp,double atZ);
00068   void plotVerticeValuesAtFixedZ(Triangulation<3> &tria, const VecDouble &vSol,string name, string strComp,double atZ);
00069   void plotVerticeValuesAtFixedZ(OrthoMesh &mesh, const VecDouble &vSol,string name, string strComp,double atZ); 
00070   void plotLineAlongZ(OrthoMesh &mesh,const VecDouble &vSol,string name, string strComp,double X1,double Y1); 
00071   void plotLineAlongX(OrthoMesh &mesh,const VecDouble &vSol,string name, string strComp,double X1,double Y1); 
00072   static void writeDataAlongX(OrthoMesh &mesh,const VecDouble &vSol,double Y,double Z,std::ostream &fout); 
00073   static void writeDataAlongZ(OrthoMesh &mesh,const VecDouble &vSol,double X,double Y,std::ostream &fout); 
00074 
00075 };
00076 
00077 #endif