Cantera  2.0
Classes | Macros | Typedefs | Functions
vcs_internal.h File Reference

Internal declarations for the VCSnonideal package

#include <cstring>
#include "cantera/equil/vcs_defs.h"
#include "cantera/base/global.h"
Include dependency graph for vcs_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 Amount of extra printing that is done while in debug mode. More...


#define VCS_DATA_PTR(vvv)   (&(vvv[0]))
 Points to the data in a std::vector<> object.
#define plogf   Cantera::writelogf
 define this Cantera function to replace printf
#define plogendl()   Cantera::writelogendl()
 define this Cantera function to replace cout << endl;
#define USE_MEMSET
 This define turns on using memset and memcpy.


typedef double(* VCS_FUNC_PTR )(double xval, double Vtarget, int varID, void *fptrPassthrough, int *err)
 Definition of the function pointer for the root finder.


double vcsUtil_gasConstant (int mu_units)
 Returns the value of the gas constant in the units specified by parameter.
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.
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 vcsUtil_root1d (double xmin, double xmax, size_t itmax, VCS_FUNC_PTR func, void *fptrPassthrough, double FuncTargVal, int varID, double *xbest, int printLvl=0)
 One dimensional root finder.
double vcs_second ()
 Returns the system wall clock time in seconds.
void vcs_dzero (double *const vec_to, const size_t length)
 Zero a double vector.
void vcs_izero (int *const vec_to, const size_t length)
 Zero an int vector.
void vcs_dcopy (double *const vec_to, const double *const vec_from, const size_t length)
 Copy a double vector.
void vcs_icopy (int *const vec_to, const int *const vec_from, const size_t length)
 Copy an int vector.
void vcs_vdzero (std::vector< double > &vec_to, const size_t length)
 Zero a std double vector.
void vcs_vizero (std::vector< int > &vec_to, const size_t length)
 Zero a std int vector.
void vcs_vdcopy (std::vector< double > &vec_to, const std::vector< double > &vec_from, size_t length)
 Copy one std double vector into another.
void vcs_vicopy (std::vector< int > &vec_to, const std::vector< int > &vec_from, const int length)
 Copy one std integer vector into another.
double vcs_l2norm (const std::vector< double > vec)
 determine the l2 norm of a vector of doubles
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 vcs_max_int (const int *vector, int length)
 Returns the maximum integer in a list.
void vcs_print_line (const char *str, int num)
 Prints a line consisting of multiple occurrences of the same string.
const char * vcs_speciesType_string (int speciesStatus, int length=100)
 Returns a const char string representing the type of the species given by the first argument.
void vcs_print_stringTrunc (const char *str, size_t space, int alignment)
 Print a string within a given space limit.
bool vcs_doubleEqual (double d1, double d2)
 Simple routine to check whether two doubles are equal up to roundoff error.

Detailed Description

Internal declarations for the VCSnonideal package

Definition in file vcs_internal.h.

Macro Definition Documentation

#define VCS_DATA_PTR (   vvv)    (&(vvv[0]))
#define plogf   Cantera::writelogf

define this Cantera function to replace printf

We can replace this with printf easily

Definition at line 35 of file vcs_internal.h.

Referenced by VCS_PROB::addElement(), VCS_PROB::addOnePhaseSpecies(), VCS_SOLVE::delta_species(), vcs_MultiPhaseEquil::determine_PhaseStability(), vcs_MultiPhaseEquil::equilibrate_HP(), vcs_MultiPhaseEquil::equilibrate_SP(), vcs_MultiPhaseEquil::equilibrate_TP(), VCS_PROB::prob_report(), vcs_MultiPhaseEquil::reportCSV(), vcs_VolPhase::resize(), VCS_PROB::resizeSpecies(), vcs_VolPhase::setExistence(), vcs_VolPhase::setMolesFromVCSCheck(), vcs_VolPhase::setPtrThermoPhase(), VCS_SOLVE::vcs(), VCS_SOLVE::vcs_add_all_deleted(), VCS_SOLVE::vcs_basopt(), VCS_SOLVE::vcs_birthGuess(), VCS_SOLVE::vcs_chemPotPhase(), VCS_SOLVE::vcs_delete_multiphase(), VCS_SOLVE::vcs_delete_species(), VCS_SOLVE::vcs_deltag(), VCS_SOLVE::vcs_deltag_Phase(), VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_elem_rearrange(), VCS_SOLVE::vcs_globStepDamp(), VCS_SOLVE::vcs_Hessian_diag_adj(), VCS_SOLVE::vcs_inest(), VCS_SOLVE::vcs_inest_TP(), VCS_SOLVE::vcs_initSizes(), vcs_MultiPhaseEquil::vcs_MultiPhaseEquil(), VCS_SOLVE::vcs_nondim_Farad(), VCS_SOLVE::vcs_nondim_TP(), VCS_SOLVE::vcs_nondimMult_TP(), VCS_SOLVE::vcs_phaseStabilityTest(), VCS_SOLVE::vcs_popPhaseID(), VCS_SOLVE::vcs_popPhaseRxnStepSizes(), VCS_SOLVE::vcs_prep_oneTime(), VCS_SOLVE::vcs_printChemPotUnits(), VCS_PROB::VCS_PROB(), VCS_SOLVE::vcs_prob_specify(), VCS_SOLVE::vcs_prob_specifyFully(), VCS_SOLVE::vcs_prob_update(), VCS_SOLVE::vcs_recheck_deleted(), VCS_SOLVE::vcs_redim_TP(), VCS_SOLVE::vcs_report(), VCS_SOLVE::vcs_rxn_adj_cg(), VCS_SOLVE::vcs_RxnStepSizes(), VCS_SOLVE::vcs_solve_TP(), VCS_SOLVE::vcs_species_type(), VCS_SOLVE::vcs_switch_elem_pos(), VCS_SOLVE::vcs_switch_pos(), VCS_SOLVE::vcs_TCounters_report(), VCS_SOLVE::vcs_TP(), VCS_SOLVE::vcs_updateVP(), VCS_SOLVE::vcs_wellPosed(), and VCS_SOLVE::vcs_zero_species().

#define plogendl ( )    Cantera::writelogendl()
#define USE_MEMSET

This define turns on using memset and memcpy.

I have not run into any systems where this is a problem. It's the fastest way to do low lvl operations where applicable. There are alternative routines available if this ever fails.

Definition at line 331 of file vcs_internal.h.