gfunct Class Reference

#include <gfunct.h>

List of all members.

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
gfunctgfs
 function is defined by set of general functions
itablefunctitabf
 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
tablefuncttabf
 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

Detailed Description

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.


Constructor & Destructor Documentation

gfunct (  ) 

This constructor initializes attributes to zero values.

Definition at line 13 of file gfunct.cpp.

References eq, f, func, gfs, itabf, limval, neqs, ngf, stat, tabf, tfunc, and var.

gfunct ( generalfunct  tf,
long  nr 
)

second constructor

Parameters:
tf - type of general function
nr - the number of rows in the table, otherwise it is ignored

Definition at line 37 of file gfunct.cpp.

References eq, f, func, gfs, itabf, limval, neqs, ngf, print_err(), stat, tab, tab_file, tabf, tfunc, and var.

~gfunct (  ) 

Destructor deallocates memory used by the expression

Definition at line 76 of file gfunct.cpp.

References eq, func, gfs, itabf, neqs, tabf, and var.


Member Function Documentation

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:

Parameters:
gf - function whose data will be compared with the actual object

Returns:

Return values:
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:

Parameters:
gf - function whose data will be copied to the actual object

Returns:

Return values:
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:

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:

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:

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:

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:

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:

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:

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:

Parameters:
nr - number of rows

Returns:

Return values:
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:

Parameters:
gf - function whose data will be merged with the actual object

Returns:

Return values:
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:

Parameters:
out - pointer to opened text file from which data will be written.

Returns:

Return values:
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:

Parameters:
in - pointer to opened text file from which data will be read.

Returns:

Return values:
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:

Parameters:
in - pointer to opened text file from which data will be read.

Returns:

Return values:
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().


Member Data Documentation

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

strings with expressions

Definition at line 59 of file gfunct.h.

Referenced by compare(), copy(), entitybocon::getval(), gfunct(), merge(), print(), read(), read_prop(), and ~gfunct().

function is defined by set of general functions

Definition at line 71 of file gfunct.h.

Referenced by compare(), copy(), getval(), getval_long(), gfunct(), merge(), print(), read(), read_prop(), and ~gfunct().

function defined by table (x values are real numbers while y values are integers)

Definition at line 69 of file gfunct.h.

Referenced by compare(), copy(), getval_long(), gfunct(), merge(), print(), read(), read_prop(), and ~gfunct().

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
long ngf

number of general functions

Definition at line 54 of file gfunct.h.

Referenced by compare(), copy(), getval(), getval_long(), gfunct(), merge(), print(), read(), and read_prop().

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().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2