Cantera  3.1.0a1
Loading...
Searching...
No Matches
vcs_internal.h
Go to the documentation of this file.
1/**
2 * @file vcs_internal.h Internal declarations for the VCSnonideal package
3 */
4
5// This file is part of Cantera. See License.txt in the top-level directory or
6// at https://cantera.org/license.txt for license and copyright information.
7
8#ifndef _VCS_INTERNAL_H
9#define _VCS_INTERNAL_H
10
11#include "cantera/base/global.h"
12namespace Cantera
13{
14//! define this %Cantera function to replace printf
15/*!
16 * We can replace this with printf easily
17 */
18#define plogf writelogf
19
20//! Global hook for turning on and off time printing.
21/*!
22 * Default is to allow printing. But, you can assign this to zero globally to
23 * turn off all time printing. This is helpful for test suite purposes where you
24 * are interested in differences in text files.
25 */
26extern int vcs_timing_print_lvl;
27
28//! Class to keep track of time and iterations
29/*!
30 * class keeps all of the counters together.
31 */
33{
34public:
35 //! Total number of iterations in the main loop
36 //! of vcs_TP() to solve for thermo equilibrium
37 int T_Its;
38
39 //! Current number of iterations in the main loop
40 //! of vcs_TP() to solve for thermo equilibrium
41 int Its;
42
43 //! Total number of optimizations of the components basis set done
45
46 //! number of optimizations of the components basis set done
48
49 //! Current number of times the initial thermo equilibrium estimator has
50 //! been called
52
53 //! Current number of calls to vcs_TP
55
56 //! Current time spent in vcs_TP
58
59 //! Current time spent in vcs_TP
61
62 //! Total Time spent in basopt
64
65 //! Current Time spent in basopt
67
68 //! Time spent in initial estimator
70
71 //! Time spent in the vcs suite of programs
72 double T_Time_vcs;
73};
74
75//! Definition of the function pointer for the root finder
76/*!
77 * see vcsUtil_root1d for a definition of how to use this.
78 */
79typedef double(*VCS_FUNC_PTR)(double xval, double Vtarget,
80 int varID, void* fptrPassthrough,
81 int* err);
82
83//! determine the l2 norm of a vector of doubles
84/*!
85 * @param vec vector of doubles
86 * @returns the l2 norm of the vector
87 */
88double vcs_l2norm(const vector<double>& vec);
89
90//! Returns a const char string representing the type of the species given by
91//! the first argument
92/*!
93 * @param speciesStatus Species status integer representing the type
94 * of the species.
95 * @param length Maximum length of the string to be returned.
96 * Shorter values will yield abbreviated strings.
97 * Defaults to a value of 100.
98 */
99const char* vcs_speciesType_string(int speciesStatus, int length = 100);
100
101//! Simple routine to check whether two doubles are equal up to roundoff error
102/*!
103 * Currently it's set to check for 10 digits of relative accuracy.
104 *
105 * @param d1 first double
106 * @param d2 second double
107 *
108 * @returns true if the doubles are "equal" and false otherwise
109 */
110bool vcs_doubleEqual(double d1, double d2);
111}
112
113#endif
Class to keep track of time and iterations.
int Its
Current number of iterations in the main loop of vcs_TP() to solve for thermo equilibrium.
int T_Calls_Inest
Current number of times the initial thermo equilibrium estimator has been called.
double T_Time_basopt
Total Time spent in basopt.
double T_Time_inest
Time spent in initial estimator.
int T_Basis_Opts
Total number of optimizations of the components basis set done.
double T_Time_vcs_TP
Current time spent in vcs_TP.
int Basis_Opts
number of optimizations of the components basis set done
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.
int T_Calls_vcs_TP
Current number of calls to vcs_TP.
double Time_basopt
Current Time spent in basopt.
double Time_vcs_TP
Current time spent in vcs_TP.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
int vcs_timing_print_lvl
Global hook for turning on and off time printing.
Definition vcs_solve.cpp:42
double(* VCS_FUNC_PTR)(double xval, double Vtarget, int varID, void *fptrPassthrough, int *err)
Definition of the function pointer for the root finder.
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.
Definition vcs_util.cpp:31
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
Definition vcs_util.cpp:89
double vcs_l2norm(const vector< double > &vec)
determine the l2 norm of a vector of doubles
Definition vcs_util.cpp:19