#include <entitybocon.h>
Public Member Functions | |
long | checkvar2coord () |
function checks x, y, z and t coordinate parameters in the BC function | |
entitybocon () | |
long | getval (snode &tn, gfunct &tgf) |
function computes values of the entity BC at the given node | |
long | read (XFILE *in) |
funtion reads entity load from the opened text file | |
void | setvars (snode &tn, long i) |
function sets internal variables of func to the coordinates of the given node | |
char * | substbcstr (const char *expr, snode &tn) |
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 | |
long | var2coord (long i) |
function detects indeces of x, y, z and t coordinate parameters of the BC function for the i-th parsed expression | |
~entitybocon () | |
Public Attributes | |
long | dc |
flag for dependency of gf on coordinates (x,y,z) | |
long | dt |
flag for dependency of gf on time (t) | |
gfunct | gf |
function describing the values of BC on the given entity | |
interpoltype | it |
interpolation type in the case that BC is defined by function on the given entity | |
long | var_x |
index of x-coordinate variable in func | |
long | var_y |
index of y-coordinate variable in func | |
long | var_z |
index of z-coordinate variable in func |
This class is used for entity boundary condition (BC) in the transprep preprocessor. Entity BC can be defined either as constant, table or by parser function. The parser function may be defined with one up to four parameters for x, y, z coordinate and time (t) in order to compute BC values for given nodal coordinates. Parser expressions are evaluated for x,y,z of the given node and converted to the new gfunct object: 'stat' -> 'stat' 'tab'(t) -> 'tab'(t) 'pars'(x,y,z) -> 'stat 'pars'(x,y,z,t) -> 'pars'(t) 'pars_set'(x,y,z) -> 'tab'(t) (interpoltype has to be specified) 'pars_set'(x,y,z,t)-> 'par_set'(t)
Created by TKo, 09.2010
Definition at line 29 of file entitybocon.h.
entitybocon | ( | ) |
This constructor initializes data to the zero values
Created by TKo, 09.2010
Definition at line 16 of file entitybocon.cpp.
~entitybocon | ( | ) |
This destructor deallocates used memory
Created by TKo, 09.2010
Definition at line 30 of file entitybocon.cpp.
long checkvar2coord | ( | ) |
function checks x, y, z and t coordinate parameters in the BC function
The function detects 'x' parameter, 'y' parameter ,'z' parameter and time 't' in the gf. Performed comparison is case insesitive. In the case of time parameter 't' detection, the dc is set to nonzero value. In the case of coordinate detection, the dt is set to nonzero value.
Created by TKo, 09.2010
Definition at line 98 of file entitybocon.cpp.
References QList< type >::count(), dc, dt, gfunct::eq, gf, variable::Name, gfunct::neqs, pars, pars_set, print_err(), gfunct::tfunc, gfunct::var, var_x, var_y, var_z, and Equation::Variables.
Referenced by read().
long getval | ( | snode & | tn, | |
gfunct & | tgf | |||
) |
function computes values of the entity BC at the given node
The function approximates values of BC on the given entity to the given element node. The function requires gf.tfunc to be pars or pars_set. Corresponding expressions have to depend on one of space coordinate at least (x,y,z) or one of space coordinate(x,y,z) at least and time (t)
tn | - node where the BC should be approximated | |
tgf | - object of gfunct that is initialized by the BC function for the given node |
0 | - on success | |
1 | - in the case of wrong type of func (it can be pars or pars_set) | |
2 | - in the case of an error in parsing new function in tgf |
Definition at line 242 of file entitybocon.cpp.
References QList< type >::at(), gfunct::copy(), QList< type >::count(), dc, dt, gfunct::eq, Equation::Evaluate(), gfunct::f, gfunct::func, gf, it, tablefunct::itype, gfunct::limval, gfunct::neqs, pars, pars_set, print_err(), setvars(), stat, substbcstr(), tab, gfunct::tabf, Parser::TextToTree(), gfunct::tfunc, gfunct::var, var2coord(), Equation::Variables, tablefunct::x, and tablefunct::y.
Referenced by assemble_bnodvalt().
long read | ( | XFILE * | in | ) |
funtion reads entity load from the opened text file
This function reads data about entity load from the text file given by the parameter in
in | - pointer to the opned text file |
0 | - on succes | |
1 | - no coordinates nor time variables has been detected |
Created by TKo, 09.2010
Definition at line 46 of file entitybocon.cpp.
References checkvar2coord(), dt, gf, interpoltype_kwdset(), it, pars, pars_set, print_err(), gfunct::read(), stat, tab, gfunct::tfunc, and xfscanf().
Referenced by input_elem_edgebc(), input_elem_surfbc(), and input_elem_vertbc().
void setvars | ( | snode & | tn, | |
long | i | |||
) |
function sets internal variables of func to the coordinates of the given node
The function sets x,y and z variables of func to the coordinates of node tn. Attributes var_x, var_y and var_z have to contain indeces of coordinate variables for i-th expression of gf.
tn | - structure of node whose coordinates will be used | |
i | - index of expression of func whose variables will be set |
Created by Tomas Koudelka, 09.2010
Definition at line 368 of file entitybocon.cpp.
References gf, variable::Value, gfunct::var, var_x, var_y, and var_z.
Referenced by getval().
char * substbcstr | ( | const char * | expr, | |
snode & | tn | |||
) |
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
The function substitutes occurence of x, y and z variables in the expr by the real values of coordinates of the given node tn. A new string with substituted values is returned. Class attributes var_x, var_y and var_z have to be initialized and they have negative values in the case that the given variable is not present in the string.
expr | - string with the expression | |
tn | - node structure with coordinates |
Created by TKo, 09.2010
Definition at line 396 of file entitybocon.cpp.
Referenced by getval().
long var2coord | ( | long | i | ) |
function detects indeces of x, y, z and t coordinate parameters of the BC function for the i-th parsed expression
The function detects 'x' parameter, 'y' parameter ,'z' parameter and time 't' in the gf. Performed comparison is case insesitive.
i | - index of parser expression whose variables should be detected. It can be in range <0;f.neqs) |
Created by TKo, 09.2010
Definition at line 172 of file entitybocon.cpp.
References QList< type >::count(), gfunct::eq, gf, variable::Name, gfunct::neqs, pars, pars_set, print_err(), gfunct::tfunc, gfunct::var, var_x, var_y, var_z, and Equation::Variables.
Referenced by getval().
long dc |
flag for dependency of gf on coordinates (x,y,z)
Definition at line 55 of file entitybocon.h.
Referenced by assemble_bnodvalt(), checkvar2coord(), entitybocon(), and getval().
long dt |
flag for dependency of gf on time (t)
Definition at line 56 of file entitybocon.h.
Referenced by checkvar2coord(), entitybocon(), getval(), and read().
function describing the values of BC on the given entity
Definition at line 53 of file entitybocon.h.
Referenced by checkvar2coord(), getval(), read(), setvars(), and var2coord().
interpolation type in the case that BC is defined by function on the given entity
Definition at line 54 of file entitybocon.h.
Referenced by entitybocon(), getval(), and read().
long var_x |
index of x-coordinate variable in func
Definition at line 59 of file entitybocon.h.
Referenced by checkvar2coord(), setvars(), and var2coord().
long var_y |
index of y-coordinate variable in func
Definition at line 60 of file entitybocon.h.
Referenced by checkvar2coord(), setvars(), and var2coord().
long var_z |
index of z-coordinate variable in func
Definition at line 61 of file entitybocon.h.
Referenced by checkvar2coord(), setvars(), and var2coord().