11 #ifndef _VCS_INTERNAL_H
12 #define _VCS_INTERNAL_H
24 #define VCS_DATA_PTR(vvv) (&(vvv[0]))
30 #define plogf Cantera::writelogf
37 #define plogendl() Cantera::writelogendl()
48 class VCS_SPECIES_THERMO;
142 int vcsUtil_mlequ(
double* c,
size_t idem,
size_t n,
double* b,
size_t m);
178 int vcsUtil_gaussj(
double* c,
size_t idem,
size_t n,
double* b,
size_t m);
186 int varID,
void* fptrPassthrough,
288 void* fptrPassthrough,
289 double FuncTargVal,
int varID,
double* xbest,
310 inline void vcs_dzero(
double*
const vec_to,
const size_t length)
312 (void) memset((
void*) vec_to, 0, length *
sizeof(double));
320 inline void vcs_izero(
int*
const vec_to,
const size_t length)
322 (void) memset((
void*) vec_to, 0, length *
sizeof(int));
332 inline void vcs_dcopy(
double*
const vec_to,
333 const double*
const vec_from,
const size_t length)
335 (void) memcpy((
void*) vec_to, (
const void*) vec_from,
336 (length) *
sizeof(double));
346 inline void vcs_icopy(
int*
const vec_to,
347 const int*
const vec_from,
const size_t length)
349 (void) memcpy((
void*) vec_to, (
const void*) vec_from,
350 (length) *
sizeof(int));
358 inline void vcs_vdzero(std::vector<double> &vec_to,
const size_t length)
360 (void) memset((
void*)
VCS_DATA_PTR(vec_to), 0, (length) *
sizeof(
double));
368 inline void vcs_vizero(std::vector<int> &vec_to,
const size_t length)
370 (void) memset((
void*)
VCS_DATA_PTR(vec_to), 0, (length) *
sizeof(
int));
384 inline void vcs_vdcopy(std::vector<double> & vec_to,
385 const std::vector<double> & vec_from,
size_t length)
387 (void) memcpy((
void*)&(vec_to[0]), (
const void*) &(vec_from[0]),
388 (length) *
sizeof(double));
401 inline void vcs_vicopy(std::vector<int> & vec_to,
402 const std::vector<int> & vec_from,
const int length)
404 (void) memcpy((
void*)&(vec_to[0]), (
const void*) &(vec_from[0]),
405 (length) *
sizeof(int));
408 extern void vcs_dzero(
double*
const,
const int);
409 extern void vcs_izero(
int*
const ,
const int);
410 extern void vcs_dcopy(
double*
const,
const double*
const,
const int);
411 extern void vcs_icopy(
int*
const,
const int*
const,
const int);
412 extern void vcs_vdzero(std::vector<double> &vvv,
const int len = -1);
413 extern void vcs_vizero(std::vector<double> &vvv,
const int len = -1);
414 void vcs_vdcopy(std::vector<double> &vec_to,
415 const std::vector<double> vec_from,
const int len = -1);
417 const std::vector<int> vec_from,
const int len = -1);
426 double vcs_l2norm(
const std::vector<double> vec);
438 size_t vcs_optMax(
const double* x,
const double* xSize,
size_t j,
size_t n);
512 void vcs_orderedUnique(std::vector<int> & xOrderedUnique,
const std::vector<int> & x);
void vcs_print_stringTrunc(const char *str, size_t space, int alignment)
Print a string within a given space limit.
int vcs_timing_print_lvl
Global hook for turning on and off time printing.
double vcsUtil_gasConstant(int mu_units)
Returns the value of the gas constant in the units specified by parameter.
double(* VCS_FUNC_PTR)(double xval, double Vtarget, int varID, void *fptrPassthrough, int *err)
Definition of the function pointer for the root finder.
int T_Calls_vcs_TP
Current number of calls to vcs_TP.
int vcsUtil_root1d(double xmin, double xmax, size_t itmax, VCS_FUNC_PTR func, void *fptrPassthrough, double FuncTargVal, int varID, double *xbest, int printLvl)
One dimensional root finder.
const size_t npos
index returned by functions to indicate "no position"
#define VCS_DATA_PTR(vvv)
Points to the data in a std::vector<> object.
const char * vcs_speciesType_string(int speciesStatus, int length)
Returns a const char string representing the type of the species given by the first argument...
int Basis_Opts
number of optimizations of the components basis set done
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
Class to keep track of time and iterations.
double vcs_second()
Returns the system wall clock time in seconds.
double Time_vcs_TP
Current time spent in vcs_TP.
int T_Basis_Opts
Total number of optimizations of the components basis set done.
Defines and definitions within the vcs package.
double T_Time_vcs
Time spent in the vcs suite of programs.
int T_Its
Total number of iterations in the main loop of vcs_TP() to solve for thermo equilibrium.
void vcs_orderedUnique(std::vector< int > &xOrderedUnique, const std::vector< int > &x)
Sorts a vector of ints and eliminates duplicates from the resulting list.
void vcs_print_line(const char *string, int num)
Prints a line consisting of multiple occurrences of the same string.
int vcsUtil_mlequ(double *c, size_t idem, size_t n, double *b, size_t m)
Invert an n x n matrix and solve m rhs's.
void vcs_heapsort(std::vector< int > &x)
Sorts a vector of ints in place from lowest to the highest values.
size_t vcs_optMax(const double *x, const double *xSize, size_t j, size_t n)
Finds the location of the maximum component in a double vector.
int Its
Current number of iterations in the main loop of vcs_TP() to solve for thermo equilibrium.
double T_Time_inest
Time spent in initial estimator.
double T_Time_vcs_TP
Current time spent in vcs_TP.
void vcs_vicopy(std::vector< int > &vec_to, const std::vector< int > &vec_from, int length)
Copy one std integer vector into another.
double Time_basopt
Current Time spent in basopt.
double vcs_l2norm(const std::vector< double > vec)
determine the l2 norm of a vector of doubles
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
int T_Calls_Inest
Current number of times the initial thermo equilibrium estimator has been called. ...
int vcsUtil_gaussj(double *c, size_t idem, size_t n, double *b, size_t m)
Invert an n x n matrix and solve m rhs's.
int vcs_max_int(const int *vector, int length)
Returns the maximum integer in a list.
double T_Time_basopt
Total Time spent in basopt.