PropStruct 0.2.0

dotnet add package PropStruct --version 0.2.0
                    
NuGet\Install-Package PropStruct -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PropStruct" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PropStruct" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="PropStruct" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PropStruct --version 0.2.0
                    
#r "nuget: PropStruct, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PropStruct@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PropStruct&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=PropStruct&version=0.2.0
                    
Install as a Cake Tool

PropStruct

PropStruct computes the local structure of a composite solid propellant by Monte Carlo: the pockets between large oxidizer particles, the bridges between pockets, and from them the size distributions and the mass-medium size of metal agglomerates (the pocket model). It is a port of the Fortran program PropStructV3, rebuilt so that one numerical program runs on the CPU and, whole cycles of base particles at once, on an NVIDIA GPU (CUDA) in double precision.

This package is the library. The command-line tool is PropStruct.Cli (propstruct).

Install

dotnet add package PropStruct

The package targets net10.0 on Windows x64. Its one dependency is ILGPU.

Minimal example

The program reads a formulation in the original .dat format (inpt.dat is the smallest shipped), runs the simulator and writes the result as results.m in the original's layout and as JSON:

using PropStruct.Execution;
using PropStruct.Input;
using PropStruct.Output;
using PropStruct.Simulation;
var formulation = DatFile.Read("inpt.dat");

var parameters = ModelParameters.Default with { EpsDok = 0.02 };

var options = new SimulationOptions
{
    Parameters = parameters,
    Mode = ExecutionMode.Batched,          // or ExecutionMode.Reference
    Accelerator = AcceleratorKind.Auto,    // Auto, Cpu, Cuda
    BatchSize = null,                      // null: the whole cycle, capped by the record budget
    Streams = StreamLayout.Independent,    // the default; Original runs in reference mode only
    Precision = PrecisionKind.Binary64,    // the default; Original runs in reference mode only
    Seed = 0,                              // 0: the layout's initial states
};

using var simulator = Simulator.Create(options);
var result = simulator.Run(formulation);   // SimulationFailedException on a failed status

ResultsMWriter.Write(formulation, parameters, result, "results.m");
ResultsJson.Write(result, "results.json");

The defaults are the more accurate answer: arithmetic in double and six disjoint random streams. To reproduce the numbers the original program itself prints, take the three switches Mode = ExecutionMode.Reference, Streams = StreamLayout.Original and Precision = PrecisionKind.Original together; they run in one thread, as the original did. The same example runs as samples/Quickstart in the source repository, built against this package in CI.

Model = ModelKind.Corrected runs the model with the original program's explicit errors fixed and nothing else changed (each fix is a row marked fixed in the Corrected column of docs/ORIGINAL-DEFECTS.md at github.com/baryon-asymm/PropStruct); it runs under PrecisionKind.Binary64 only and labels its result (RunDiagnostics.Model, a footer line in results.m). ModelKind.Original, the default, is unchanged.

CUDA

The CPU accelerator (AcceleratorKind.Cpu) needs nothing beyond this package and ILGPU. The CUDA accelerator (AcceleratorKind.Cuda, or Auto on a machine with a usable GPU) additionally needs, at run time:

  • an NVIDIA driver with CUDA 12.8 or newer;
  • nvvm64_40_0.dll and libdevice.10.bc, both from an NVIDIA CUDA Toolkit 12.8 or newer.

AcceleratorKind.Auto falls back to the CPU accelerator when no usable CUDA device or library is found, and so does setting the environment variable PROPSTRUCT_NO_CUDA=1, which refuses CUDA.

Documentation

The contract of every namespace and the design of the model are in the source repository: README and the API.md of each directory.

License and credit

This package is MIT-licensed. PropStruct is a port of PropStructV3 by V. A. Babuk and

    1. Nizyaev; the original program is not distributed. The package includes NOTICE with the full attribution.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 77 10/21/2026
0.1.0 103 10/7/2026