#include <gfunct.h>
Public Member Functions | |
long | compare (gfunct &gf) |
compares function from the parameter to the actual object | |
void | copy (gfunct &gf) |
copies function from the parameter to the actual object | |
double | getderiv (double t) |
double | getinvderiv (double t) |
double | getinvval (double t) |
double | getval (double t, double t0) |
double | getval (vector &p, char *namevar[]) |
double | getval (double t) |
long | getval_long (double t) |
gfunct (generalfunct tf, long nr) | |
gfunct () | |
void | init_tab (long nr) |
void | initiate (gfunct &gf) |
void | merge (gfunct &gf) |
merges function from the parameter with the actual object | |
long | print (FILE *out) |
long | read (XFILE *in) |
long | read_prop (FILE *in) |
~gfunct () | |
Public Attributes | |
Equation ** | eq |
binary tree parser for an expressions | |
double | f |
constant value | |
char ** | func |
strings with expressions | |
gfunct * | gfs |
function is defined by set of general functions | |
itablefunct * | itabf |
function defined by table (x values are real numbers while y values are integers) | |
double * | limval |
array with limit values for pars_set | |
long | neqs |
number of expression sets | |
long | ngf |
number of general functions | |
tablefunct * | tabf |
function defined by table (all values are real numbers) | |
generalfunct | tfunc |
type of general function | |
variable *** | var |
array with pointers arrays with pointers to expression variables |
This class represents general type of function which can be described by general string expression or by table with function values. String expression is processed by the Parser and table is processed by the tablefunct. In case of string expression, there is allowed to have several expressions for different ranges of the variable.
Definition at line 21 of file gfunct.h.
gfunct | ( | ) |
gfunct | ( | generalfunct | tf, | |
long | nr | |||
) |
~gfunct | ( | ) |
long compare | ( | gfunct & | gf | ) |
compares function from the parameter to the actual object
The function compares all data from subroutine argument with the actual object.
Parameters:
gf | - function whose data will be compared with the actual object |
Returns:
0 | - in case that objects represents the same general function | |
1 | - in case that objects are different or unknown type of general function |
TKo, 09.2010
Definition at line 1014 of file gfunct.cpp.
References itablefunct::compare(), tablefunct::compare(), f, func, gfs, gfunc_set, itab, itabf, limval, neqs, ngf, pars, pars_set, print_err(), stat, tab, tab_file, tabf, and tfunc.
Referenced by sourcet::compare(), bocont::compare(), and input_elem_eigstr().
void copy | ( | gfunct & | gf | ) |
copies function from the parameter to the actual object
The function copies all data from subroutine argument to the actual object.
Parameters:
gf | - function whose data will be copied to the actual object |
Returns:
The | function does not return anything. |
JK, 15.11.2008 TKo, 6.2009
Definition at line 808 of file gfunct.cpp.
References copy(), itablefunct::copy(), tablefunct::copy(), QList< type >::count(), eq, f, func, gfs, gfunc_set, itab, itabf, neqs, ngf, pars, pars_set, print_err(), stat, tab, tab_file, tabf, Parser::TextToTree(), tfunc, var, and Equation::Variables.
Referenced by copy(), entitybocon::getval(), and merge().
double getderiv | ( | double | t | ) |
This function computes derivative of given funtion expression for variable whose value is given by the t parameter.
Parameters:
t | - given value of function variable |
Returns: derivative of the function at parameter t.
JK, 7.10.2011
Definition at line 516 of file gfunct.cpp.
References tablefunct::getderiv(), print_err(), stat, tab, tab_file, tabf, and tfunc.
Referenced by kunmat::derivation_sorption_izoterm_data(), isotherm::derivative_isotherm_value(), kunmat::derivative_sorption_izoterm_data(), kunmat::hystereze(), and shrinkmat::nlstressesincr().
double getinvderiv | ( | double | t | ) |
This function computes derivative of given funtion expression for variable whose value is given by the t parameter.
Parameters:
t | - given value of function variable |
Returns: derivative of the function at parameter t.
JK, 7.10.2011
Definition at line 550 of file gfunct.cpp.
References tablefunct::inv_derivative(), print_err(), stat, tab, tab_file, tabf, and tfunc.
Referenced by isotherm::derivative_inverse_isotherm_value().
double getinvval | ( | double | t | ) |
This function computes value x of given funtion expression for variable y whose value is given by the t parameter.
Parameters:
t | - given value of function variable |
Returns: Function value at parameter t.
Definition at line 300 of file gfunct.cpp.
References tablefunct::getinvval(), print_err(), tab, tabf, and tfunc.
Referenced by isotherm::inverse_isotherm_value().
double getval | ( | double | t, | |
double | t0 | |||
) |
This function computes value of given funtion expression for variables whose values are given by the t and t0 parameter.
Parameters:
t | - given value of the first variable of function | |
t0 | - given value of the second auxiliar variable of function |
Returns: Function value at parameter t.
Definition at line 381 of file gfunct.cpp.
References eq, Equation::Evaluate(), f, tablefunct::getval(), getval(), gfs, gfunc_set, limval, neqs, ngf, pars, pars_set, print_err(), stat, tab, tab_file, tabf, tfunc, variable::Value, and var.
double getval | ( | vector & | p, | |
char * | namevar[] | |||
) |
This function computes value of given funtion expression for variable vector p. If number p components is greater than 1 only stat and pars types can be handled properly.
Parameters:
p | - vector of variable values | |
namevar | - array of strings with variable names for the each p component namevar[i] = pointer to the string with the name of the i-th variable |
Returns: Function value at parameter p.
Definition at line 331 of file gfunct.cpp.
References QList< type >::count(), eq, Equation::Evaluate(), f, getval(), vector::n, p, pars, print_err(), stat, tfunc, variable::Value, var, and Equation::Variables.
double getval | ( | double | t | ) |
This function computes value y of given funtion expression for variable x whose value is given by the t parameter.
Parameters:
t | - given value of function variable |
Returns: Function value at parameter t.
Definition at line 234 of file gfunct.cpp.
References eq, Equation::Evaluate(), f, getval(), tablefunct::getval(), gfs, gfunc_set, limval, neqs, ngf, pars, pars_set, print_err(), stat, tab, tab_file, tabf, tfunc, variable::Value, and var.
Referenced by seismtool::assemble(), dloadcase::assemble(), saltmat4::aux_values(), moistheatmat::aux_values(), kunmat::aux_values(), saltmat4::c11(), saltmat4::c44(), kunmat::cmm(), climatcond2::compute_values(), climatcond::compute_values(), climatcond::condit_vapour_diffusion_moisture_flux(), climatcond::condit_vapour_diffusion_moisture_flux_salt(), kunmat::CorD(), moistheatmat::derivative_of_the_enthalpy_density(), kunmat::derivative_of_the_enthalpy_density(), mechbclc::eigstrain_computation(), gfmatrix::evaluate(), gfmatrix::evaluate_t(), nlisotrmat::get_k(), moistheatmat::get_othervalue(), kunmat::get_othervalue(), dloadcase::get_pd(), kunmat::get_transmission_flux_hh(), moistheatmat::get_transmission_nodval_hh(), kunmat::get_transmission_nodval_hh(), dloadpd::getval(), dloadn::getval(), getval(), moistheatmat::give_rel_hum(), bnodvalt::give_val(), hypoplast::givestressincr(), sourcet::giveval(), kunmat::hystereze(), timecontr::initialtimeincr(), hypoplast::initval(), shrinkmat::initvalues(), isotherm::isotherm_value(), saltmat4::k11(), saltmat1::k11(), saltmat4::k21(), saltmat1::k21(), saltmat4::k22(), saltmat1::k22(), saltmat4::k44(), moistheatmat::khm(), kunmat::khm(), moistheatmat::kht(), kunmat::kht(), moistheatmat::kmm(), kunmat::kmm(), dampermeability::matcond(), hypoplast::matstiff(), timecontr::newtime(), hypoplast::nlstresses(), shrinkmat::nlstressesincr(), saltmat4::permeabilitavodnipary(), dloadcase::tempercontrib(), and kunmat::water_vapour_permeability().
long getval_long | ( | double | t | ) |
This function computes value of given funtion expression for variable whose value is given by the t parameter.
Parameters:
t | - given value of function variable |
Returns: Function integer value at parameter t.
Definition at line 477 of file gfunct.cpp.
References itablefunct::getval(), getval_long(), gfs, gfunc_set, itab, itabf, ngf, print_err(), and tfunc.
Referenced by getval_long(), mechtop::save_node_inidispl(), gnode::search_changed_dofs(), gtopology::search_changed_elem(), gtopology::search_newelem(), gnode::update_dofs(), and gtopology::update_elem().
void init_tab | ( | long | nr | ) |
The function initiates general function of table type.
Parameters:
nr | - number of rows |
Returns:
The | function does not return anything. |
JK, 13.6.2005
Definition at line 784 of file gfunct.cpp.
References tablefunct::asize, tablefunct::itype, piecewiselin, tab, tabf, tfunc, tablefunct::x, and tablefunct::y.
Referenced by stochdriver::diagpostproc().
void initiate | ( | gfunct & | gf | ) |
function initiates general function from gf
JK
Definition at line 741 of file gfunct.cpp.
References tablefunct::asize, f, tablefunct::itype, print_err(), stat, tab, tab_file, tabf, tfunc, tablefunct::x, and tablefunct::y.
Referenced by timecontr::initiate().
void merge | ( | gfunct & | gf | ) |
merges function from the parameter with the actual object
Function merges all data from subroutine argument gf with the actual object.
Parameters:
gf | - function whose data will be merged with the actual object |
Returns:
The | function does not return anything. |
TKo, 6.2009
Definition at line 925 of file gfunct.cpp.
References copy(), eq, func, gfs, gfunc_set, itab, itabf, neqs, ngf, pars, pars_set, print_err(), stat, tab, tab_file, tabf, tfunc, and var.
long print | ( | FILE * | out | ) |
This function writes data to the text file given by the parameter in. It is used in the mechprep preprocessor.
Parameters:
out | - pointer to opened text file from which data will be written. |
Returns:
0 | - on succes | |
1 | - unknown type of function |
Definition at line 683 of file gfunct.cpp.
References f, func, gfs, gfunc_set, itab, itabf, neqs, ngf, pars, pars_set, print(), itablefunct::print(), tablefunct::print(), tablefunct::print_data_file(), print_err(), stat, tab, tab_file, tabf, and tfunc.
Referenced by sourcet::print(), saltmat4::print(), saltmat1::print(), moistheatmat::print(), loadelt::print(), kunmat::print(), isotherm::print(), climatcond2::print(), climatcond::print(), bnodvalt::print(), bocont::print(), shrinkmat::print(), dloadpd::print(), dloadcase::print(), timecontr::print(), print(), mechbclc::print_eigenstrains(), gtopology::print_gf(), wr_dloadn(), wr_eigenstrains(), and wr_load().
long read | ( | XFILE * | in | ) |
This function reads data from the text file given by the parameter in. The first it reads type of function see galias.h - timefunct. Then it depending on the function type it reads data about function.
Parameters:
in | - pointer to opened text file from which data will be read. |
Returns:
0 | - on succes | |
1 | - error parsing expression in case pars function type | |
2 | - number of expressions in case pars_set function type is <= 0 | |
3 | - error parsing expression in case pars_set function type | |
4 | - number of functions in case gfunc_set function type is <= 0 | |
5 | - unknown type of function |
Definition at line 111 of file gfunct.cpp.
References QList< type >::count(), eq, f, func, generalfunct_kwdset(), gfs, gfunc_set, itab, itabf, limval, neqs, ngf, pars, pars_set, print_err(), read(), itablefunct::read(), tablefunct::read(), tablefunct::read_data_file(), stat, tab, tab_file, tabf, Parser::TextToTree(), tfunc, var, Equation::Variables, and xfscanf().
Referenced by input_elem_eigstr(), input_lc(), sourcet::read(), saltmat4::read(), saltmat1::read(), nlisotrmat::read(), moistheatmat::read(), loadelt::read(), kunmat::read(), isotherm::read(), climatcond2::read(), climatcond::read(), bnodvalt::read(), entitybocon::read(), bocont::read(), tloadcase::read(), timeswmat::read(), shrinkmat::read(), seismtool::read(), hypoplast::read(), dloadpd::read(), dloadcase::read(), timecontr::read(), read(), mechbclc::read_eigenstrains(), and gtopology::read_gf().
long read_prop | ( | FILE * | in | ) |
This function reads data from the text file given by the parameter in. It is used in the mechprep preprocessor.
Parameters:
in | - pointer to opened text file from which data will be read. |
Returns:
0 | - on succes | |
1 | - error parsing expression in case pars function type | |
2 | - number of expression in case pars_set function type is <= 0 | |
3 | - error parsing expression in case pars_set function type | |
4 | - number of functions in case gfunc_set function type is <= 0 | |
5 | - unknown type of function |
Definition at line 589 of file gfunct.cpp.
References eq, f, func, getdouble(), getint(), getlong(), getstring(), gfs, gfunc_set, itab, itabf, limval, neqs, ngf, pars, pars_set, print_err(), read_prop(), itablefunct::read_prop(), tablefunct::read_prop(), stat, tab, tab_file, tabf, Parser::TextToTree(), and tfunc.
Referenced by read_prop().
binary tree parser for an expressions
Definition at line 61 of file gfunct.h.
Referenced by entitybocon::checkvar2coord(), copy(), entitybocon::getval(), getval(), gfunct(), merge(), read(), read_prop(), entitybocon::var2coord(), and ~gfunct().
double f |
constant value
Definition at line 56 of file gfunct.h.
Referenced by allocim(), compare(), copy(), entitybocon::getval(), getval(), gfunct(), initiate(), print(), read(), and read_prop().
char** func |
double* limval |
array with limit values for pars_set
Definition at line 65 of file gfunct.h.
Referenced by compare(), entitybocon::getval(), getval(), gfunct(), read(), and read_prop().
long neqs |
number of expression sets
Definition at line 52 of file gfunct.h.
Referenced by entitybocon::checkvar2coord(), compare(), copy(), entitybocon::getval(), getval(), gfunct(), merge(), print(), read(), read_prop(), entitybocon::var2coord(), and ~gfunct().
long ngf |
function defined by table (all values are real numbers)
Definition at line 67 of file gfunct.h.
Referenced by compare(), climatcond2::compute_values(), climatcond::compute_values(), copy(), kunmat::CorD(), dampermeability::dampermeability(), stochdriver::diagpostproc(), getderiv(), getinvderiv(), getinvval(), entitybocon::getval(), getval(), gfunct(), init_tab(), initiate(), merge(), print(), climatcond2::read(), climatcond::read(), read(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), read_prop(), and ~gfunct().
type of general function
Definition at line 50 of file gfunct.h.
Referenced by entitybocon::checkvar2coord(), compare(), copy(), getderiv(), getinvderiv(), getinvval(), entitybocon::getval(), getval(), getval_long(), gfunct(), init_tab(), initiate(), merge(), nonstat_solv_dform_comp(), nonstat_solv_vform_comp(), par_newton_raphson_parcoupl_comp(), par_nonstat_solv_vform_comp(), par_solve_timemech_prob2(), print(), climatcond2::read(), climatcond::read(), entitybocon::read(), read(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), read_prop(), and entitybocon::var2coord().
array with pointers arrays with pointers to expression variables
Definition at line 63 of file gfunct.h.
Referenced by entitybocon::checkvar2coord(), copy(), entitybocon::getval(), getval(), gfunct(), merge(), read(), entitybocon::setvars(), entitybocon::var2coord(), and ~gfunct().