PropStruct 0.2.0
dotnet add package PropStruct --version 0.2.0
NuGet\Install-Package PropStruct -Version 0.2.0
<PackageReference Include="PropStruct" Version="0.2.0" />
<PackageVersion Include="PropStruct" Version="0.2.0" />
<PackageReference Include="PropStruct" />
paket add PropStruct --version 0.2.0
#r "nuget: PropStruct, 0.2.0"
#:package PropStruct@0.2.0
#addin nuget:?package=PropStruct&version=0.2.0
#tool nuget:?package=PropStruct&version=0.2.0
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.dllandlibdevice.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
-
- Nizyaev; the original program is not distributed. The package includes
NOTICEwith the full attribution.
- Nizyaev; the original program is not distributed. The package includes
| Product | Versions 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. |
-
net10.0
- ILGPU (= 1.5.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.