space.h

Go to the documentation of this file.
00001 /* -----------------------------------------------------------------------------------------
00002   $Id: space.h 573 2006-11-20 00:25:28Z svacek $
00003   $Author: svacek $
00004    ----------------------------------------------------------------------------------------- */
00005 #ifndef __SPACE_SVH
00006 #define __SPACE_SVH
00007 /* -------------------------------------------------------------------------- */
00008 /*@{*/
00009 /** \addtogroup FEM_SPACE_DEFINITION */
00010 /* function SetElement()  - nastaveni paramatru pro ruzne typy elementu  */
00011 void SetElement();                                           /**< Set type of GLOBAL element. Global element should be only the maximal one */
00012 /* function ConstructSpace(),DestructSpace() */
00013 
00014 /** \addtogroup SPACE_IO 
00015  *   \ingroup    FEM_SPACE_DEFINITION
00016  */
00017 /*@{*/
00018 void SaveProgramState(char *FileName);                       /**< Saves all what is needed for computation for future computation restart. */
00019 void LoadProgramState(char *FileName);                       /**< Loads all what is needed for computation for computation restart. */
00020 void SaveProgramStateMin(char *FileName);                    /**< Saves minimal program state. */
00021 void LoadProgramStateMin(char *FileName);                    /**< Loads minimal program state. */
00022 void LoadNodeApproximation(const char *filename,vector *_load); /**< Load node (P1) approximation of solution */
00023 
00024 
00025 void SaveAllOutputs(const long iter,const vector pom);       /**< Save all outputs (according to INI file settings) */
00026 void GMVOutput(char filename[],vector pom);                  /**< Save approximation pom (UVP) to filename[] in GMV format*/
00027 void TecplotOutput(char filename[],int delka,char *nazvy, vector seznam[]); /**< not documented (NOT IN CURRENT USE) \todo Remove this function */
00028 void TecplotOutputR(const char fname[], vector pom,int How);                /**< Save pom(UVP) to TECPLOT format with How=0 - only P1 appr. or higher with How=1 */
00029 void ElasticOutput(const char fname[],const vector X,const vector XDOT,const vector XDOTDOT);                          /**< Save Elastic Deformation */
00030 void ElasticOutput1(const char fname[],const vector X,const vector XDOT,const vector XDOTDOT);                          /**< Save Elastic Deformation */
00031 void ResultsOutput(char filename[], vector pom);             /**< Output in columns X Y U V P ...., usable for MATLAB, ANGENER mesh refinement, etc. */
00032 
00033 void SaveBndrPressureInterpolate(const char fname[],const vector u);                 /**< Save PRESSURE on surface. */
00034 double ControlStep(const vector u1,const vector u2,const long ino,const double ctm); /**< Control step - residuals, forces control etc. */
00035 /*@}*/
00036 
00037 /** 
00038  *   \defgroup   SPACE_INITIALIZATION Space Initialization
00039  *   \ingroup    FEM_SPACE_DEFINITION
00040  *   \addtogroup SPACE_INITIALIZATION 
00041  */
00042 /*@{*/
00043 void ConstructSpace(double xvel(double,double),double yvel(double,double));    /**< Allocate and fills all data of FEM space definition (velocity space). */
00044 void DestructSpace();                                        /**< De-allocate all data of FEM space definition. */
00045 void ConstructPressureSpace();                               /**< Allocate and fills all data of FEM space definition (pressure space). */
00046 
00047 void ConstructBoundaryConditions(double xvel(double,double),double yvel(double,double)); /**< P1 approximation of boundary condition prescribed by functions */
00048 void DestructBoundaryConditions();                                                       /**< destruct boundary condition representation */
00049 
00050 /* velocity space */
00051 short GetMark(long SideIdx);                                /**< Gets Mark for a side (velocity) */
00052 void  ComputeBaseIndices();                                 /**< Maps LOCAL(element) base functions to GLOBAL(grid) - velocity */
00053 void  ComputeBaseValues();                                  /**< Computes values on reference element (at Quadrature nodes)*/
00054 void  ComputeGradBaseValues();                              /**< Computes GRADIENT values on reference element (at Quadrature nodes 2D) */
00055 void  ComputeHesBaseValues();                               /**< Computes HESSIAN values on reference element (at Quadrature nodes 2D) */
00056 void  ComputeSideBaseValues();                              /**< Computes base values on reference side (at Quadrature nodes 1D) */ 
00057 void  ComputeExportValues();                                /**< Computes values for refined output, used in ::TecplotOuputR */
00058 void  DestructExportValues();                               /**< Deallocate Export Values */
00059 /* pressure space */
00060 short GetPressureMark(long SideIdx);                        /**< Gets Mark for a side (pressure) */
00061 void  ComputePressureBaseIndices();                         /**< Maps LOCAL(element) base functions to GLOBAL(grid) - pressure */
00062 long  SelectFixedPressureIdx();                             /**< select a point where pressure should be fixed, \todo Remove this - not needed! */
00063 
00064 
00065 void InitialVelocities();                                    /**< Fills up first approximation of the solution. */
00066 void ConstructVectors();                                     /**< Constructs all vectors needed for computation. */
00067 void DestructVectors();                                      /**< Destructs all vectors needed for computation. */
00068 void ExtrapolateVelocities();                                /**< Extrapolate Fluid Velocities */
00069 /*@}*/
00070 void Project2HDIV(vector ww);                                /**< Projection of ww to H(div) space */
00071 void HDivProjection(sparse *S,vector b,const vector ww);     /**< Assembly of the linear system for H(div) projection S*ww = b */
00072 /* kvadratura */
00073 void QuadratureFormula1d(double *W,double *X,int q1);        /**< Fill Up 1D quadr. formula with degree of 2*q1-1 */                    
00074 int  QuadratureFormulae2dTriGauss(double **w,double ***L,int q); /**< Fill Up 2D quadr. formula with degree of 2*q */                    
00075 int  QuadratureFormulae2dTriangle(double **w,double ***L,int q); /**< Fill Up 2D quadr. formula with degree of q \todo Remove this function */                    
00076 void InitQuadratureFormulae();                               /**< Init Q.F */
00077 void InitQuadratureFormulaePrecise();                        /**< Init Q.F.P. */
00078 /* konverze */
00079 void Pressure2Velocity(vector out,const vector press);       /**< Convert pressure to velocity */
00080 void Velocity2Pressure(vector out,const vector vel);         /**< Convert velocity to pressure */
00081 void InitPressureInterpolate();
00082 
00083 /* ------------------------------------------------------------------------------------- */
00084 /* norms etc. */
00085 /** \addtogroup FORMS_EVALUATION
00086  *   \ingroup    FEM_SPACE_DEFINITION
00087  */
00088 /*@{*/
00089 void InitNorms();
00090 void PrepareH1norm(sparse *H1);
00091 void PrepareL2norm(sparse *L2);
00092 void PreparePressureL2norm(sparse *L2);
00093 void PrepareBoundaryForm( vector beta,double _phi(double,double));
00094 void PrepareForms(vector dzeta,double _eta(double,double));
00095 void DestructNorms();
00096 /*@}*/
00097 /* ------------------------------------------------------------------------------------- */
00098 void ControlMarks();
00099 void CheckBoundaryConditions(const char fname[]);
00100 void add2triplet(long _i,long _j,double _val);                /**< add to triplet value (_i,_j,_val) */
00101 double LinearFunctionDX(const long iELE,const double LinF[]); /**< Linear Function x-derivative */
00102 double LinearFunctionDY(const long iELE,const double LinF[]); /**< Linear Function y-derivative */
00103 double LinearFunctionValue(const double LinF[],const int m);  /**< Linear Function Value */
00104 /* ------------------------------------------------------------------------------------- */
00105 /** \addtogroup COARSE_TRIANG 
00106  *   \ingroup    FEM_SPACE_DEFINITION
00107  *   \todo Correct that.
00108  */
00109 /*@{*/
00110 void ConstructCoarse();
00111 void FillCoarseSystem(const sparse S);
00112 void DestructCoarse();
00113 void ConstructCoarsePrecond();
00114 void DestructCoarsePrecond();
00115 void PrecondCoarse(vector x);
00116 /*@}*/
00117 /*@}*/
00118 void InitOriginalCfg();
00119 double MaxLinearError(const vector _new,const vector _old);
00120 double MaxLinearErrorVelocity(const vector _new,const vector _old);
00121 double LinearError(const vector _new,const vector _old);
00122 double LinearErrorVelocity(const vector _new,const vector _old);
00123 double QuadraticError(const vector _new,const vector _old,double *out1,double *out2,double *outp);
00124 double QuadraticErrorComponent(const vector _new,const vector _old);
00125 /* ------------------------------------------------------------------------------------- */
00126 #endif
00127 /* ------------------------------------------------------------------------------------- */
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 

Generated on Sun May 27 11:59:43 2007 for FEMFLUID by  doxygen 1.4.6