00001 #ifndef ENTITYBOCON_H 00002 #define ENTITYBOCON_H 00003 00004 #include "parser.h" 00005 #include "siftop.h" 00006 #include "iotools.h" 00007 #include "tablefunct.h" 00008 #include "loadelt.h" 00009 #include "aliast.h" 00010 00011 #include <stdio.h> 00012 00013 /** 00014 This class is used for entity boundary condition (BC) in the 00015 transprep preprocessor. Entity BC can be defined either as constant, table 00016 or by parser function. The parser function may be defined 00017 with one up to four parameters for x, y, z coordinate and time (t) in 00018 order to compute BC values for given nodal coordinates. Parser expressions are evaluated for x,y,z 00019 of the given node and converted to the new gfunct object: 00020 'stat' -> 'stat' 00021 'tab'(t) -> 'tab'(t) 00022 'pars'(x,y,z) -> 'stat 00023 'pars'(x,y,z,t) -> 'pars'(t) 00024 'pars_set'(x,y,z) -> 'tab'(t) (interpoltype has to be specified) 00025 'pars_set'(x,y,z,t)-> 'par_set'(t) 00026 00027 Created by TKo, 09.2010 00028 */ 00029 class entitybocon 00030 { 00031 public : 00032 entitybocon(); 00033 ~entitybocon(); 00034 00035 /// funtion reads entity load from the opened text file 00036 long read(XFILE *in); 00037 00038 /// function computes values of the entity BC at the given node 00039 long getval(snode &tn, gfunct &tgf); 00040 00041 /// function checks x, y, z and t coordinate parameters in the BC function 00042 long checkvar2coord(); 00043 00044 /// function detects indeces of x, y, z and t coordinate parameters of the BC function for the i-th parsed expression 00045 long var2coord(long i); 00046 00047 /// function sets internal variables of func to the coordinates of the given node 00048 void setvars(snode &tn, long i); 00049 00050 /// function replaces occurence of x, y and z parameter by the true values of coordinates of the given node and returns the new resulting string 00051 char *substbcstr(const char *expr, snode &tn); 00052 00053 gfunct gf; ///< function describing the values of BC on the given entity 00054 interpoltype it; ///< interpolation type in the case that BC is defined by function on the given entity 00055 long dc; ///< flag for dependency of gf on coordinates (x,y,z) 00056 long dt; ///< flag for dependency of gf on time (t) 00057 00058 00059 long var_x; ///< index of x-coordinate variable in func 00060 long var_y; ///< index of y-coordinate variable in func 00061 long var_z; ///< index of z-coordinate variable in func 00062 }; 00063 00064 #endif