00001
00002
00003
00004
00005
00006
00007
00008
00009 #if !defined(GUTILS_HPP)
00010 #define GUTILS_HPP
00011
00012 #include "gtypes.h"
00013 #include "gllbasis.hpp"
00014 #include "gelemlist.hpp"
00015 #include "gttlist.hpp"
00016 #include "gtlist.hpp"
00017 #include "gtbasislist.hpp"
00018 #include "mesh_reader.hpp"
00019 #include "ntree_adapt.hpp"
00020 #include "morton_keygen.hpp"
00021 #include "gbin_reader.hpp"
00022
00023 extern GBOOL bLocal_;
00024
00025 namespace GUtils {
00026
00027 GBOOL InitMesh(char *fnmesh, GSHORT rank_, GTBasisListGLL &gllpool,
00028 GElemList &gelems, GINT &gnelems, GNIDBuffer *&vnode_ids, GNODEID &vmaxid,
00029 Point *&gd, GINT &ngd, GINT ntmp, GINT nadapt);
00030 GBOOL InitPMesh2d(GINT Nx, GINT Ny, GINT xNx, GINT xNy,
00031 GTBasisListGLL &gllpool,
00032 GElemList &gelems, GINT &gnelems_, GNIDBuffer *&vnode_ids,
00033 GNODEID &vmaxid, Point *&gd, GINT &ngd, GINT ntmp, GINT nadapt);
00034
00035 GKEY RootID(GINT i_tree, GINT max_levels);
00036 GBOOL in_neighborlist(GNeighborList &elist, GSHORT iproc, GINT ielem, GINT compid);
00037 GDOUBLE ComputeGlobalArea(GElemList &gelems);
00038 GDOUBLE ComputeGlobalIntegralV(GVecList &uv, GElemList &gelems);
00039 GDOUBLE ComputeGlobalIntegralF(GFieldList &uf, GElemList &gelems);
00040 void ComputeGlobalDOFs(GElemList &gelems, GINT &gndof, GDOUBLE &minLen, GDOUBLE &maxLen);
00041 void GetGlobalPeriodicity(GIBuffer &giPeriodic, Point *&gd, GINT nvert, GElemList &elems);
00042 void GetLoadStatistics(GDBuffer &gWork, GDOUBLE &favg, GElemList &gelems);
00043
00044 GDOUBLE ComputeMinLength(GElemList &gelems);
00045 GBOOL DoDotProducts(GElemList &gelems, GVecList &a1, GVecList a2Vec[],
00046 GDOUBLE lProds[], GDOUBLE prods[], const GINT n_prods);
00047 GBOOL ComputeMasks(GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp, GVecList &ub);
00048 GBOOL ComputeGMass(GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp, GVecList &ub);
00049 GBOOL ComputeGOp (GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp, GVecList &opvec, GVecList &ub);
00050
00051 GBOOL ComputeGDiag(GVecList &vlist, GElemList &gelems, NTreeAdapt *gsop,
00052 GCHandle hDSOp, GVecList &ub);
00053 GDOUBLE ComputeMaxDerivA(GElemList &gelems, GFieldList &field, GINT idir);
00054 GDOUBLE ComputeL2Norm (GVecList &q, GElemList &gelems);
00055 GDOUBLE ComputeInfNorm (GVecList &q, GElemList &gelems);
00056 GDOUBLE ComputeEucNorm (GVecList &q, GElemList &gelems);
00057 GDOUBLE ComputeL2Norm (GFieldList &q, GINT ilev=0);
00058 GDOUBLE ComputeInfNorm (GFieldList &q, GINT ilev=0);
00059 GDOUBLE ComputeEucNorm (GFieldList &q, GINT ilev=0);
00060
00061 GBOOL Smooth (GVecList &ub, GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp);
00062
00063 GBOOL H1_Project (GVecList &ub, GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp);
00064
00065 GBOOL H1_ProjectM(GVecList &ub, GElemList &gelems, NTreeAdapt *gsop, GCHandle hDSOp);
00066
00067
00068
00069 GBOOL SetMorton(Morton_KeyGen *keygen_, GElemList *gelems_,
00070 Point *p_origin_, Point *dX_, Point *globdomain_, GINT ng, GINT max_levels_);
00071 GBOOL PointOnSeg(Point &P0, Point &P1, Point &r);
00072 GBOOL isPGlobalBdyElem(GIBuffer &iGlobalFace, GIBuffer &iElemFace, GINT &nBdy,
00073 Elem2D *elem, Point pGlobalDomain[], GINT nGlobalDomain);
00074 GBOOL GetGBinVarV(GVecList &var, char *vlabel, GBinReader &rgbin);
00075 GBOOL GetGBinVarF(GFieldList &var, char *vlabel, GINT ilevel, GINT nlevels,
00076 GINT ntmp, GElemList &gelems, GBinReader &rgbin);
00077 void RankIJ(GINT &I, GINT &J, GINT Nx, GINT Ny, GSHORT irank);
00078 void DoLocal(GBOOL blocal);
00079 GDOUBLE Rand ();
00080 void TSeedRand ();
00081 GBOOL SmoothPGrid(GVecList &pp, GVecList &utmp, GElemList &uelems,
00082 GElemList &pelems, NTreeAdapt *gsop);
00083 GBOOL InterpLL(GVecList &pto, GElemList >o, GVecList &pfrom, GElemList &gfrom);
00084 GBOOL InterpFL(GVecList &pto, GElemList >o, GFieldList &pfrom, GElemList &gfrom);
00085
00086
00087
00088
00089
00090 }
00091 #endif // !defined(CUTILS_HPP)