These changes make it unnecessary to copy header files around during the build process, which tends to confuse IDEs and debuggers. The headers which comprise Cantera's external C++ interface are now in the 'include' directory. All of the samples and demos are now in the 'samples' subdirectory.
21 lines
444 B
C++
21 lines
444 B
C++
#include <cantera/Cantera.h>
|
|
//
|
|
// artifical example of throwing and catching a CanteraError exception.
|
|
//
|
|
void mycode()
|
|
{
|
|
ThermoPhase* gas = newPhase("h2o2.cti","ohmech");
|
|
if (gas->temperature() < 3000.0) {
|
|
throw CanteraError("mycode","test of exception throwing and catching");
|
|
}
|
|
}
|
|
|
|
int main()
|
|
{
|
|
try {
|
|
mycode();
|
|
} catch (CanteraError) {
|
|
showErrors();
|
|
error("program terminating.");
|
|
}
|
|
}
|