Cantera  2.1.2
Classes | Namespaces | Macros | Typedefs | Functions
vcs_internal.h File Reference

Internal declarations for the VCSnonideal package. More...

#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.

Classes

class  VCS_COUNTERS
 Class to keep track of time and iterations. More...
 

Namespaces

 VCSnonideal
 Contains classes and functions implementing the VCS multi-phase equilibrium solver.
 

Macros

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

Typedefs

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

Functions

double vcsUtil_gasConstant (int mu_units)
 Returns the value of the gas constant in the units specified by parameter. More...
 
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. More...
 
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. More...
 
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. More...
 
double vcs_second ()
 Returns the system wall clock time in seconds. More...
 
void vcs_dzero (double *const vec_to, const size_t length)
 Zero a double vector. More...
 
void vcs_izero (int *const vec_to, const size_t length)
 Zero an int vector. More...
 
void vcs_dcopy (double *const vec_to, const double *const vec_from, const size_t length)
 Copy a double vector. More...
 
void vcs_icopy (int *const vec_to, const int *const vec_from, const size_t length)
 Copy an int vector. More...
 
void vcs_vdzero (std::vector< double > &vec_to, const size_t length)
 Zero a std double vector. More...
 
void vcs_vizero (std::vector< int > &vec_to, const size_t length)
 Zero a std int vector. More...
 
void vcs_vdcopy (std::vector< double > &vec_to, const std::vector< double > &vec_from, size_t length)
 Copy one std double vector into another. More...
 
void vcs_vicopy (std::vector< int > &vec_to, const std::vector< int > &vec_from, const int length)
 Copy one std integer vector into another. More...
 
double vcs_l2norm (const std::vector< double > vec)
 determine the l2 norm of a vector of doubles More...
 
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. More...
 
int vcs_max_int (const int *vector, int length)
 Returns the maximum integer in a list. More...
 
void vcs_print_line (const char *str, int num)
 Prints a line consisting of multiple occurrences of the same string. More...
 
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. More...
 
void vcs_print_stringTrunc (const char *str, size_t space, int alignment)
 Print a string within a given space limit. More...
 
bool vcs_doubleEqual (double d1, double d2)
 Simple routine to check whether two doubles are equal up to roundoff error. More...
 
void vcs_heapsort (std::vector< int > &x)
 Sorts a vector of ints in place from lowest to the highest values. More...
 
void vcs_orderedUnique (std::vector< int > &xOrderedUnique, const std::vector< int > &x)
 Sorts a vector of ints and eliminates duplicates from the resulting list. More...
 

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 30 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_SPECIES_THERMO::eval_ac(), VCS_SPECIES_THERMO::G0_R_calc(), VCS_SPECIES_THERMO::GStar_R_calc(), VCSnonideal::print_char(), VCS_SOLVE::prneav(), 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(), VCSnonideal::vcs_Cantera_to_vprob(), VCSnonideal::vcs_Cantera_update_vprob(), 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_elcorr(), VCS_SOLVE::vcs_elem_rearrange(), VCS_SOLVE::vcs_evaluate_speciesType(), 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(), VCSnonideal::vcs_print_line(), VCSnonideal::vcs_print_stringTrunc(), 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_rank(), VCS_SOLVE::vcs_recheck_deleted(), VCS_SOLVE::vcs_redim_TP(), VCS_SOLVE::vcs_reinsert_deleted(), VCS_SOLVE::vcs_report(), VCS_SOLVE::vcs_rxn_adj_cg(), VCS_SOLVE::vcs_RxnStepSizes(), VCS_SOLVE::vcs_setMolesLinProg(), 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(), VCS_SOLVE::vcs_zero_species(), VCSnonideal::vcsUtil_gasConstant(), VCSnonideal::vcsUtil_gaussj(), VCSnonideal::vcsUtil_mlequ(), VCSnonideal::vcsUtil_root1d(), and VCS_SPECIES_THERMO::VolStar_calc().

#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 302 of file vcs_internal.h.