46 Commits

Author SHA1 Message Date
Ingmar Schoegl
77f639df40 [sourcegen] Switch sourcegen utility to argparse 2025-01-22 22:47:30 -05:00
Ray Speth
7e7d0cc3e2 Require .NET 8.x for .NET interface 2024-12-31 11:52:42 -05:00
Ray Speth
d868fa7808 [Doc] URL updates for new website organization 2024-12-15 21:37:53 -05:00
Ray Speth
e0d9671bb0 [.NET] Update testing dependencies
Resolves CI failures due to vulnerability reports for some transitive dependencies
2024-11-19 17:52:57 -06:00
Ray Speth
ce858af164 Fix a few spelling errors/typos 2024-11-09 08:34:25 -06:00
Ingmar Schoegl
73ad29984e [clib] Select equilibrium solver using string 2024-08-18 19:56:33 -04:00
Ingmar Schoegl
75b5d233df [clib] Remove *_newFromFile
Also remove associated *_del methods as objects are managed by owning
Solution instance.
2024-08-18 19:56:33 -04:00
Ingmar Schoegl
388b0b2335 [.NET] Replace thermo_newFromFile 2024-08-18 19:56:33 -04:00
Ingmar Schoegl
2266b1a0a5 [.NET] Update README.md 2024-08-18 19:56:33 -04:00
Ingmar Schoegl
49e9ef5022 [docs] Use CLib to refer to 'clib' 2024-08-18 19:56:33 -04:00
Ingmar Schoegl
32a8d4b8fd [clib] Do not use transitional names 2024-08-06 17:55:58 -04:00
Ingmar Schoegl
e3065d83b8 [clib] Fix inconsistent string handling 2024-08-06 17:55:58 -04:00
Ingmar Schoegl
093ade858f [docs] Differentiate Doxygen from LaTeX commands 2023-08-01 19:22:18 -04:00
Ingmar Schoegl
ba76a7be0a [dotnet] Replace 'RP' by 'DP' 2023-02-10 19:27:26 -06:00
Sammo Gabay
2138987d89 [.NET] Add comments and update dependencies in Cantera.Tests.csproj
These comments illuminate the necessity of the various testing dependencies.
2022-08-17 10:39:54 -04:00
Sammo Gabay
92846455ca [.NET] Update readme with instructions for running tests and examples 2022-08-17 10:39:54 -04:00
Sammo Gabay
8859643e27 [.NET] Update Cantera.csproj to simplify setting up dev environment
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
fd29c09f8c [.NET] Update examples per review comments
* Add a solution file
* Update author in template.json
2022-08-17 10:39:54 -04:00
Sammo Gabay
2a758efbd7 [.NET] Correct formula in example 2022-08-17 10:39:54 -04:00
Sammo Gabay
0cd9e07953 [.NET] Remove all CR and BOM characters created by 'dotnet new' 2022-08-17 10:39:54 -04:00
Sammo Gabay
c797df7980 [.NET] Fix typos and add doc-comments 2022-08-17 10:39:54 -04:00
Sammo Gabay
09017bb91d [.NET] Use separate function in CLib for external logging
Restores original definition of ct_setLogWriter by introducing ct_setLogCallback.
2022-08-17 10:39:54 -04:00
Sammo Gabay
0674273f63 Correct flushing logic in ExternalLogger 2022-08-17 10:39:54 -04:00
Sammo Gabay
bb964ef00b [.NET] Optimize CallbackException.ThrowIfAny() hot path
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#).
2022-08-17 10:39:54 -04:00
Sammo Gabay
d4065ea7d9 [.NET] Update private field names and add XML doc comments
This brings the C# code in line with the standards spelled out in CONTRIBUTING.MD
2022-08-17 10:39:54 -04:00
Sammo Gabay
b4bc4c4690 [.NET] rework examples
Each example is now its own project. The projects will be packaged together as a dotnet CLI template.
2022-08-17 10:39:54 -04:00
Sammo Gabay
93540841fd [.NET] Handle callback exceptions correctly
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
d2afe36098 [.NET] Optimize setting thermo pairs
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
21c01350d6 [.NET] [sourcegen] Add readmes 2022-08-17 10:39:54 -04:00
Sammo Gabay
c8192bffd9 [.NET] Address review comments re: formatting and typos
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
2022-08-17 10:39:54 -04:00
Sammo Gabay
0ffe11fb8e [.NET] Use case-insensitive comparison for Species and SpeciesCollection 2022-08-17 10:39:54 -04:00
Sammo Gabay
53e903e8a4 [.NET] Centralize static methods and object creation
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
fbaa5d1b19 [.NET] Clean-up project files
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
2022-08-17 10:39:54 -04:00
Sammo Gabay
e2fabf939f [.NET] Flush-out ThermoPhase class and add Cantera.Examples project 2022-08-17 10:39:54 -04:00
Sammo Gabay
4cd6249890 [.NET] Add ability to plug into Cantera’s logging functionality 2022-08-17 10:39:54 -04:00
Sammo Gabay
49eef19e89 [.NET] Rethink Species and SpeciesCollection
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
5e4faa45d4 [.NET] Move test classes under src directory for consistency 2022-08-17 10:39:54 -04:00
Sammo Gabay
31f0584c50 [.NET] First pass at a ThermoPhase class
Class contains some properties scaffolded directly from CLIB and some hand-built stuff for Species. A test case is included.
2022-08-17 10:39:54 -04:00
Sammo Gabay
28672d2e4e [.NET] Add ability to scaffold higher-level C# classes from CLIB
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
5d1e64512a [.NET] Add test project and support for including native libs in build 2022-08-17 10:39:54 -04:00
Sammo Gabay
13e819da1b [.NET] Stub out platform-sniffing with compilation switches 2022-08-17 10:39:54 -04:00
Sammo Gabay
7e57b1a0f9 [.NET] Add appropriate dataclasses to sourcegen 2022-08-17 10:39:54 -04:00
Sammo Gabay
2e7d719950 [.NET] Move source generator into a pluggable python module 2022-08-17 10:39:54 -04:00
Sammo Gabay
a0e7faccd7 [.NET] Generate C# interop code automatically
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.
2022-08-17 10:39:54 -04:00
Sammo Gabay
37459a87ad [.NET] Add support for retrieving array-of-doubles properties via LibCantera 2022-08-17 10:39:54 -04:00
Sammo Gabay
6d9ef17ce6 [.NET] Stub out foundation classes for .Net interface 2022-08-17 10:39:54 -04:00