We’re able to use the same basic native library name (“cantera_shared”) on all systems and copy that native library and example data files directly from the upstream SCons build output and data directory.
Separated method into a simple null check which should be inlined and a separate call to a local method which should handle the throwing (throws are never inlined in C#).
Uncaught exceptions thrown in a managed method called-backed from the Cantera library will cause the process to crash. This change provides a means of registering an exception that is caught in a call-back so it can be thrown when emerging completely from the interop layer.
Instead of using heap-allocated arrays that require garbage collection to pass the values, create a (stack-allocated) tuple on the fly and pass a pointer to it to the CLib function.
https://github.com/Cantera/cantera/pull/1331
* Ensures lines in source files are a maximum of 88 characters
* Ensures all if statements use blocks
* Trims spurious end-of-line whitespace
* Adds licensing preamble to source files
The new Application class combines the previous CanteraInfo and CanteraLogger classes and provides factory methods for creating obejcts such as ThermoPhase. This allows running any required initialization code.
The ApplicationFixture class combined with [Collection("Application")] ensure that tests which need to share state (i.e. use the Application class) do not run in parallel.
Ensures that the Cantera native libs and example data files are copied to output directories.
The Cantera project is marked not-packable. We’ll need a separate project that gathers all the native libs and managed assemblies for creating a complete nuget package for upload to NuGet.org
Double arrays that change as part of a simulation or are likely to be calculated on the fly are now returned directly by methods of the SpeciesCollection. This deviates from an ideal OO design, but provides efficient access and calculation across the array.
Scaffolds C# classes corresponding to Cantera objects based on naming convention in CLIB. The scaffolded class implements IDisposable, contains an appropriate CanteraHandle, and can contain simple properties scaffolfed from CLIB functions that follow a well-known pattern.
Uses an MSBuild task and a Python script to generate C# P/Invoke calls and SafeHandles from the Cantera CLib header files.
The script is written in Python because it's already part of the build environment.