Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Resolve FEA materials from the standard catalog

Yuechen Li9ee3c78b6834
diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.cs
index bfe74e20..42501019 100644
--- a/Aetheris.CLI/CliRunner.cs
+++ b/Aetheris.CLI/CliRunner.cs
@@ -778,7 +778,7 @@ Model CanonicalPanel {
var report = new
{
analysis = new { compiled.Analysis.Id, kind = compiled.Analysis.Kind.ToString(), body = compiled.Analysis.Body.Id, compiled.Analysis.Body.SourceKind,
- material = compiled.Analysis.Materials.Select(item => new { item.Id, item.YoungsModulusPascal, item.PoissonRatio, item.DensityKilogramsPerCubicMeter }),
+ material = compiled.Analysis.Materials.Select(item => new { item.Id, item.StableMaterialId, item.ConstitutiveClass, item.YoungsModulusPascal, item.PoissonRatio, item.DensityKilogramsPerCubicMeter, item.YieldStrengthPascal }),
constraints = compiled.Analysis.Constraints.Select(item => new { item.Id, region = item.Region.Path, components = item.Components }),
loads = compiled.Analysis.Loads.Select(item => new { item.Id, kind = item.Kind.ToString(), region = item.Region.Path, item.VectorSi, item.PressurePascal }),
lattice = new { compiled.Analysis.Lattice.CountX, compiled.Analysis.Lattice.CountY, compiled.Analysis.Lattice.CountZ } },
diff --git a/Aetheris.FEA.Tests/MaterialCatalogFirmamentTests.cs b/Aetheris.FEA.Tests/MaterialCatalogFirmamentTests.cs
new file mode 100644
index 00000000..7c3a66b4
--- /dev/null
+++ b/Aetheris.FEA.Tests/MaterialCatalogFirmamentTests.cs
@@ -0,0 +1,75 @@
+using Aetheris.FEA.Firmament;
+using Aetheris.FEA.Mechanics;
+using Aetheris.Kernel.StandardLibrary.Materials;
+
+namespace Aetheris.FEA.Tests;
+
+public sealed class MaterialCatalogFirmamentTests
+{
+ private const string Source = """
+ model CatalogMaterialWitness {
+ units mm
+ solid coupon: Box { size: [80, 20, 2] }
+ analysis LinearElastic CouponPull {
+ body: coupon
+ material: Standard.Materials.Aluminum.5052_H32
+ fixed Clamp { region: coupon.face(-X)
+ components: [X, Y, Z] }
+ force Pull { region: coupon.face(+X)
+ vector: [1000N, 0N, 0N] }
+ lattice: [8, 2, 1]
+ }
+ }
+ """;
+
+ [Fact]
+ public void FirmamentReference_ResolvesAndSurvivesLoweringAsFeaReadyMaterial()
+ {
+ var compilation = FirmamentAnalysisCompiler.Compile(Source);
+ Assert.True(compilation.IsSuccess, string.Join("; ", compilation.Diagnostics.Select(x => x.Code + ":" + x.Message)));
+ var material = Assert.Single(compilation.Analysis!.Materials);
+ Assert.Equal("standard:aluminum/5052-h32", material.StableMaterialId);
+ Assert.Equal(MaterialConstitutiveClass.LinearElasticIsotropic, material.ConstitutiveClass);
+ Assert.Equal(70.3e9, material.YoungsModulusPascal);
+ Assert.Equal(.33, material.PoissonRatio);
+ Assert.Equal(2680, material.DensityKilogramsPerCubicMeter);
+ Assert.Equal(193e6, material.YieldStrengthPascal);
+ Assert.NotNull(material.CatalogMaterial);
+ Assert.Equal("Pa", material.CatalogMaterial!.Structural!.YoungsModulus.UnitSymbol);
+ }
+
+ [Fact]
+ public void CatalogMaterial_TravelsThroughTheRealLinearElasticSolver()
+ {
+ var analysis = FirmamentAnalysisCompiler.Compile(Source).Analysis!;
+ var result = LinearElasticSolver.Solve(analysis, new(CutCellQuadraturePerAxis: 4, RelativeResidualTolerance: 1e-8));
+ Assert.True(result.IsSuccess, string.Join("; ", result.Diagnostics.Select(x => x.Code + ":" + x.Message)));
+ Assert.True(result.Solver.Converged);
+ Assert.True(result.MaximumDisplacementMeters > 0);
+ }
+
+ [Fact]
+ public void UnknownFirmamentMaterial_ProducesDeterministicDiagnostic()
+ {
+ var compilation = FirmamentAnalysisCompiler.Compile(Source.Replace("5052_H32", "Unobtainium_X9", StringComparison.Ordinal));
+ Assert.False(compilation.IsSuccess);
+ var diagnostic = Assert.Single(compilation.Diagnostics, x => x.Code == "firmament-material-unknown");
+ Assert.Contains("Standard.Materials.Aluminum.Unobtainium_X9", diagnostic.Message);
+ }
+
+ [Theory]
+ [InlineData(MaterialResolutionError.AmbiguousMaterial, "firmament-material-ambiguous")]
+ [InlineData(MaterialResolutionError.MissingRequiredStructuralProperty, "fea-material-missing-structural-properties")]
+ [InlineData(MaterialResolutionError.InvalidMaterialData, "firmament-material-invalid")]
+ public void ProviderFailures_MapToStableFirmamentDiagnostics(MaterialResolutionError error, string expectedCode)
+ {
+ var compilation = FirmamentAnalysisCompiler.Compile(Source, materialResolver: new FailingResolver(error));
+ Assert.False(compilation.IsSuccess);
+ Assert.Contains(compilation.Diagnostics, x => x.Code == expectedCode);
+ }
+
+ private sealed class FailingResolver(MaterialResolutionError error) : IMaterialResolver
+ {
+ public MaterialResolutionResult Resolve(string reference) => MaterialResolutionResult.Failure(error, $"test failure for {reference}");
+ }
+}
diff --git a/Aetheris.FEA/Aetheris.FEA.csproj b/Aetheris.FEA/Aetheris.FEA.csproj
index e9ab0f7a..e6a91328 100644
--- a/Aetheris.FEA/Aetheris.FEA.csproj
+++ b/Aetheris.FEA/Aetheris.FEA.csproj
@@ -9,5 +9,6 @@
<ProjectReference Include="..\Aetheris.Kernel.Core\Aetheris.Kernel.Core.csproj" />
<ProjectReference Include="..\Aetheris.Semantics\Aetheris.Semantics.csproj" />
<ProjectReference Include="..\Aetheris.Kernel.Firmament\Aetheris.Kernel.Firmament.csproj" />
+ <ProjectReference Include="..\Aetheris.Kernel.StandardLibrary\Aetheris.Kernel.StandardLibrary.csproj" />
</ItemGroup>
</Project>
diff --git a/Aetheris.FEA/Analysis/AnalysisIr.cs b/Aetheris.FEA/Analysis/AnalysisIr.cs
index c446321d..4dca15bb 100644
--- a/Aetheris.FEA/Analysis/AnalysisIr.cs
+++ b/Aetheris.FEA/Analysis/AnalysisIr.cs
@@ -1,6 +1,7 @@
using Aetheris.Continuum.Cir;
using Aetheris.Continuum.Lattice;
using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.StandardLibrary.Materials;
namespace Aetheris.FEA.Analysis;
@@ -35,7 +36,11 @@ public sealed record LinearElasticMaterialIr(
double PoissonRatio,
double? DensityKilogramsPerCubicMeter,
string RegionPath,
- AnalysisProvenance Provenance);
+ AnalysisProvenance Provenance,
+ string? StableMaterialId = null,
+ MaterialConstitutiveClass? ConstitutiveClass = null,
+ double? YieldStrengthPascal = null,
+ ResolvedMaterial? CatalogMaterial = null);
public sealed record DisplacementConstraintIr(
string Id,
diff --git a/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs b/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs
index 431a7684..413c3edf 100644
--- a/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs
+++ b/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs
@@ -11,6 +11,7 @@ using Aetheris.Kernel.Firmament.FirmamentV2;
using Aetheris.Kernel.Core.Step242;
using Aetheris.Kernel.Core.Topology;
using Aetheris.Semantics;
+using Aetheris.Kernel.StandardLibrary.Materials;
namespace Aetheris.FEA.Firmament;
@@ -24,7 +25,7 @@ public sealed record FirmamentAnalysisCompilation(LinearElasticAnalysisIr? Analy
public static class FirmamentAnalysisCompiler
{
private static readonly Regex Header=new(@"\banalysis\s+LinearElastic\s+(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*\{",RegexOptions.CultureInvariant);
- public static FirmamentAnalysisCompilation Compile(string source,string? sourcePath=null,string? sourceDirectory=null,IReadOnlyDictionary<string,FirmamentAnalysisResource>? resources=null)
+ public static FirmamentAnalysisCompilation Compile(string source,string? sourcePath=null,string? sourceDirectory=null,IReadOnlyDictionary<string,FirmamentAnalysisResource>? resources=null,IMaterialResolver? materialResolver=null)
{
var started=System.Diagnostics.Stopwatch.GetTimestamp();var diagnostics=new List<AnalysisDiagnostic>();var match=Header.Match(source);
if(!match.Success)return Done(null,[Error("firmament-analysis-missing","No 'analysis LinearElastic' declaration was found.",sourcePath)],started);
@@ -83,10 +84,30 @@ public static class FirmamentAnalysisCompiler
if(!parse.IsSuccess) diagnostics.Add(new("firmament-analysis-geometry-parser-fallback",AnalysisDiagnosticSeverity.Warning,"The bounded analysis body recognizer admitted Box/through-cylinder syntax while the general geometry parser reported: "+string.Join(",",parse.Diagnostics),analysisSpan));
bodyId=bodyName;sourceKind="FirmamentNative";
}
- var materialBlock=Nested(block,"material",out var materialName,out var materialStart);if(materialBlock is null){diagnostics.Add(Error("fea-missing-material","Analysis has no material declaration.",sourcePath));return Done(null,diagnostics,started);}
- var young=Stress(Scalar(materialBlock,"youngsModulus"));var poisson=Number(Scalar(materialBlock,"poissonRatio"));var density=Density(Scalar(materialBlock,"density"));
- var materialProv=new AnalysisProvenance(sourcePath??"<memory>",open+materialStart,materialBlock.Length,"material "+materialName);
- var material=new LinearElasticMaterialIr(materialName,young,poisson,density,bodyId,materialProv);
+ var materialBlock=Nested(block,"material",out var materialName,out var materialStart);
+ var materialReference=materialBlock is null?Scalar(block,"material"):null;
+ if(materialBlock is null&&string.IsNullOrWhiteSpace(materialReference)){diagnostics.Add(Error("fea-missing-material","Analysis has no material declaration or catalog material reference.",sourcePath));return Done(null,diagnostics,started);}
+ LinearElasticMaterialIr material;
+ if(materialBlock is not null)
+ {
+ var young=Stress(Scalar(materialBlock,"youngsModulus"));var poisson=Number(Scalar(materialBlock,"poissonRatio"));var density=Density(Scalar(materialBlock,"density"));
+ var materialProv=new AnalysisProvenance(sourcePath??"<memory>",open+materialStart,materialBlock.Length,"material "+materialName);
+ material=new LinearElasticMaterialIr(materialName,young,poisson,density,bodyId,materialProv);
+ }
+ else
+ {
+ materialReference=materialReference!.Trim();
+ var referenceOffset=block.IndexOf(materialReference,StringComparison.Ordinal);var materialProv=new AnalysisProvenance(sourcePath??"<memory>",open+1+referenceOffset,materialReference.Length,"material: "+materialReference);
+ var resolution=(materialResolver??new MaterialResolver()).Resolve(materialReference);
+ if(!resolution.IsSuccess)
+ {
+ var code=resolution.Error switch{MaterialResolutionError.UnknownMaterial=>"firmament-material-unknown",MaterialResolutionError.AmbiguousMaterial=>"firmament-material-ambiguous",MaterialResolutionError.MissingRequiredStructuralProperty=>"fea-material-missing-structural-properties",_=>"firmament-material-invalid"};
+ diagnostics.Add(new(code,AnalysisDiagnosticSeverity.Error,resolution.Message??$"Material '{materialReference}' could not be resolved.",materialProv));return Done(null,diagnostics,started);
+ }
+ var resolved=resolution.Material!;var structural=resolved.Structural;
+ if(structural is null){diagnostics.Add(new("fea-material-missing-structural-properties",AnalysisDiagnosticSeverity.Error,$"Material '{materialReference}' does not provide density, Young's modulus, Poisson ratio, yield strength, and ultimate tensile strength for its reference condition.",materialProv));return Done(null,diagnostics,started);}
+ material=new LinearElasticMaterialIr(resolved.Identity.DisplayName,structural.YoungsModulus.SiValue,structural.PoissonsRatio.SiValue,structural.Density.SiValue,bodyId,materialProv,$"{resolved.Identity.CatalogId}:{resolved.Identity.StableId}",resolved.ConstitutiveClass,structural.YieldStrength.SiValue,resolved);
+ }
(SemanticRegionBinding? Region,AnalysisDiagnostic? Diagnostic) NormalizeRegion(string path,AnalysisProvenance provenance)
{
if(namedRegions.TryGetValue(path,out var semantic))
diff --git a/Aetheris.Kernel.StandardLibrary.Tests/Aetheris.Kernel.StandardLibrary.Tests.csproj b/Aetheris.Kernel.StandardLibrary.Tests/Aetheris.Kernel.StandardLibrary.Tests.csproj
new file mode 100644
index 00000000..4330806b
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary.Tests/Aetheris.Kernel.StandardLibrary.Tests.csproj
@@ -0,0 +1,6 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><IsPackable>false</IsPackable></PropertyGroup>
+ <ItemGroup><PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /><PackageReference Include="xunit" Version="2.9.2" /><PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" /></ItemGroup>
+ <ItemGroup><Using Include="Xunit" /></ItemGroup>
+ <ItemGroup><ProjectReference Include="..\Aetheris.Kernel.StandardLibrary\Aetheris.Kernel.StandardLibrary.csproj" /></ItemGroup>
+</Project>
diff --git a/Aetheris.Kernel.StandardLibrary.Tests/MaterialCatalogTests.cs b/Aetheris.Kernel.StandardLibrary.Tests/MaterialCatalogTests.cs
new file mode 100644
index 00000000..0a21c5e8
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary.Tests/MaterialCatalogTests.cs
@@ -0,0 +1,88 @@
+using Aetheris.Kernel.StandardLibrary.Materials;
+using Aetheris.Kernel.StandardLibrary.Materials.Database;
+using Microsoft.EntityFrameworkCore;
+
+namespace Aetheris.Kernel.StandardLibrary.Tests;
+
+public sealed class MaterialCatalogTests
+{
+ [Fact]
+ public void CheckedInDatabase_HasDeterministicSchemaAndRepresentativeSeedCatalog()
+ {
+ Assert.True(File.Exists(MaterialCatalogDatabase.DefaultDatabasePath), MaterialCatalogDatabase.DefaultDatabasePath);
+ using var catalog = MaterialCatalog.OpenDefault();
+ Assert.Equal(MaterialCatalogDbContext.SchemaVersion, catalog.SchemaVersion);
+ var materials = catalog.Materials.OrderBy(x => x.StableId).ToArray();
+ Assert.Equal(MaterialCatalog.ExpectedSeedMaterialCount, materials.Length);
+ Assert.Equal(materials.Length, materials.Select(x => (x.CatalogId, x.StableId)).Distinct().Count());
+ Assert.Contains(materials, x => x.StableId == "aluminum/5052-h32" && x.Temper == "H32");
+ Assert.Contains(materials, x => x.StableId == "aluminum/6061-t6" && x.Temper == "T6");
+ Assert.Contains(materials, x => x.StableId == "steel/astm-a36");
+ Assert.Contains(materials, x => x.StableId == "stainless-steel/304-annealed");
+ Assert.All(materials, x => Assert.Equal(MaterialConstitutiveClass.LinearElasticIsotropic, x.ConstitutiveClass));
+ }
+
+ [Fact]
+ public void ReproducibleGeneration_CreatesLoadableEfCoreSqliteCatalog()
+ {
+ var path = Path.Combine(Path.GetTempPath(), $"aetheris-materials-{Guid.NewGuid():N}.sqlite");
+ try
+ {
+ MaterialCatalogDatabase.Recreate(path);
+ using var catalog = new MaterialCatalog(path);
+ Assert.Equal(MaterialCatalog.ExpectedSeedMaterialCount, catalog.Materials.Count());
+ Assert.NotNull(catalog.GetById("standard", "aluminum/5052-h32"));
+ }
+ finally { if (File.Exists(path)) File.Delete(path); }
+ }
+
+ [Fact]
+ public void LinqAndResolver_PreserveAlloyTemperDistinctionsAndTypedSiProperties()
+ {
+ using var catalog = MaterialCatalog.OpenDefault();
+ var aluminum = catalog.Materials.Where(x => x.Family == "Aluminum").OrderBy(x => x.Designation).ToArray();
+ Assert.Equal(["5052", "6061"], aluminum.Select(x => x.Designation));
+ Assert.Equal(["H32", "T6"], aluminum.Select(x => x.Temper));
+
+ var resolved = new MaterialResolver().Resolve("Standard.Materials.Aluminum.5052_H32");
+ Assert.True(resolved.IsSuccess, resolved.Message);
+ Assert.Equal(2680, resolved.Material!.Structural!.Density.SiValue);
+ Assert.Equal("kg/m^3", resolved.Material.Structural.Density.UnitSymbol);
+ Assert.Equal(70.3e9, resolved.Material.Structural.YoungsModulus.SiValue);
+ Assert.NotEmpty(resolved.Material.Structural.YieldStrength.Provenance.SourceUri);
+ Assert.True(resolved.Material.Thermal.HasAny);
+ }
+
+ [Fact]
+ public void UnknownReference_FailsWithoutFallback()
+ {
+ var result = new MaterialResolver().Resolve("Standard.Materials.Aluminum.Generic");
+ Assert.False(result.IsSuccess);
+ Assert.Equal(MaterialResolutionError.UnknownMaterial, result.Error);
+ Assert.Contains("Unknown material reference", result.Message);
+ }
+
+ [Fact]
+ public void Validation_RejectsDuplicateIdentityAndImpossibleIsotropicValues()
+ {
+ var first = Invalid("duplicate", -1, .75, 300, 200);
+ var second = Invalid("duplicate", 1000, .3, 100, 200);
+ var errors = MaterialDataValidator.Validate([first, second]);
+ Assert.Contains(errors, x => x.Contains("Duplicate stable material identity", StringComparison.Ordinal));
+ Assert.Contains(errors, x => x.Contains("Density must be positive", StringComparison.Ordinal));
+ Assert.Contains(errors, x => x.Contains("PoissonsRatio must be in", StringComparison.Ordinal));
+ Assert.Contains(errors, x => x.Contains("UltimateTensileStrength must be at least", StringComparison.Ordinal));
+ }
+
+ private static MaterialEntity Invalid(string stableId, double density, double poisson, double yield, double ultimate)
+ {
+ var material = new MaterialEntity { CatalogId = "test", StableId = stableId, FirmamentPath = "Test." + Guid.NewGuid().ToString("N"), Family = "Test", Designation = stableId, DisplayName = stableId, ConstitutiveClass = MaterialConstitutiveClass.LinearElasticIsotropic, ReferenceCondition = "test" };
+ material.Properties.Add(Property(MaterialPropertyKind.Density, density));
+ material.Properties.Add(Property(MaterialPropertyKind.PoissonsRatio, poisson));
+ material.Properties.Add(Property(MaterialPropertyKind.YieldStrength, yield));
+ material.Properties.Add(Property(MaterialPropertyKind.UltimateTensileStrength, ultimate));
+ return material;
+ }
+
+ private static MaterialPropertyEntity Property(MaterialPropertyKind kind, double value) => new() { Kind = kind, ValueSi = value, UnitSymbol = "SI", SourceId = "test", SourceUri = "test://source", Authority = MaterialPropertyAuthority.IndustryReferenceNominal, Condition = "test" };
+}
diff --git a/Aetheris.Kernel.StandardLibrary/Aetheris.Kernel.StandardLibrary.csproj b/Aetheris.Kernel.StandardLibrary/Aetheris.Kernel.StandardLibrary.csproj
index cdafd07c..a2484485 100644
--- a/Aetheris.Kernel.StandardLibrary/Aetheris.Kernel.StandardLibrary.csproj
+++ b/Aetheris.Kernel.StandardLibrary/Aetheris.Kernel.StandardLibrary.csproj
@@ -7,5 +7,11 @@
<ItemGroup>
<ProjectReference Include="..\Aetheris.Forge\Aetheris.Forge.csproj" />
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
+ <PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.5" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Content Include="Materials\Database\aetheris-materials-x1.sqlite" Condition="Exists('Materials\Database\aetheris-materials-x1.sqlite')" CopyToOutputDirectory="PreserveNewest" Link="Materials\aetheris-materials-x1.sqlite" />
</ItemGroup>
</Project>
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialEntities.cs b/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialEntities.cs
new file mode 100644
index 00000000..cac7b8cf
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialEntities.cs
@@ -0,0 +1,72 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace Aetheris.Kernel.StandardLibrary.Materials.Database;
+
+public sealed class MaterialEntity
+{
+ public int Id { get; set; }
+ public required string CatalogId { get; set; }
+ public required string StableId { get; set; }
+ public required string FirmamentPath { get; set; }
+ public required string Family { get; set; }
+ public required string Designation { get; set; }
+ public string? Grade { get; set; }
+ public string? Temper { get; set; }
+ public string? Standard { get; set; }
+ public required string DisplayName { get; set; }
+ public MaterialConstitutiveClass ConstitutiveClass { get; set; }
+ public required string ReferenceCondition { get; set; }
+ public ICollection<MaterialPropertyEntity> Properties { get; } = [];
+}
+
+public sealed class MaterialPropertyEntity
+{
+ public int Id { get; set; }
+ public int MaterialId { get; set; }
+ public MaterialEntity Material { get; set; } = null!;
+ public MaterialPropertyKind Kind { get; set; }
+ public double ValueSi { get; set; }
+ public required string UnitSymbol { get; set; }
+ public required string SourceId { get; set; }
+ public required string SourceUri { get; set; }
+ public MaterialPropertyAuthority Authority { get; set; }
+ public required string Condition { get; set; }
+ public double? ReferenceTemperatureKelvin { get; set; }
+ public string? Notes { get; set; }
+}
+
+public sealed class MaterialCatalogMetadataEntity
+{
+ public int Id { get; set; }
+ public int SchemaVersion { get; set; }
+ public required string CatalogId { get; set; }
+ public required string SeedVersion { get; set; }
+}
+
+public sealed class MaterialCatalogDbContext(DbContextOptions<MaterialCatalogDbContext> options) : DbContext(options)
+{
+ public const int SchemaVersion = 1;
+ public DbSet<MaterialEntity> Materials => Set<MaterialEntity>();
+ public DbSet<MaterialPropertyEntity> MaterialProperties => Set<MaterialPropertyEntity>();
+ public DbSet<MaterialCatalogMetadataEntity> CatalogMetadata => Set<MaterialCatalogMetadataEntity>();
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ var material = modelBuilder.Entity<MaterialEntity>();
+ material.ToTable("Materials");
+ material.HasIndex(x => new { x.CatalogId, x.StableId }).IsUnique();
+ material.HasIndex(x => x.FirmamentPath).IsUnique();
+ material.Property(x => x.ConstitutiveClass).HasConversion<string>();
+
+ var property = modelBuilder.Entity<MaterialPropertyEntity>();
+ property.ToTable("MaterialProperties");
+ property.HasIndex(x => new { x.MaterialId, x.Kind }).IsUnique();
+ property.Property(x => x.Kind).HasConversion<string>();
+ property.Property(x => x.Authority).HasConversion<string>();
+ property.HasOne(x => x.Material).WithMany(x => x.Properties).HasForeignKey(x => x.MaterialId).OnDelete(DeleteBehavior.Cascade);
+
+ var metadata = modelBuilder.Entity<MaterialCatalogMetadataEntity>();
+ metadata.ToTable("CatalogMetadata");
+ metadata.HasIndex(x => x.CatalogId).IsUnique();
+ }
+}
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialSeedData.cs b/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialSeedData.cs
new file mode 100644
index 00000000..44c1cae0
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialSeedData.cs
@@ -0,0 +1,54 @@
+namespace Aetheris.Kernel.StandardLibrary.Materials.Database;
+
+internal static class MaterialSeedData
+{
+ private const string Room = "Nominal room-temperature data (approximately 20-25 °C); strength values are minimum or typical as identified per property.";
+ private const double RoomK = 293.15;
+
+ public static IReadOnlyList<MaterialEntity> Create() =>
+ [
+ Material("aluminum/5052-h32", "Standard.Materials.Aluminum.5052_H32", "Aluminum", "5052", "5052", "H32", "AA 5052", "Aluminum 5052-H32",
+ P(MaterialPropertyKind.Density, 2680, "kg/m^3", "PROTO-5052-H32", "https://www.protolabs.com/media/iw0mfa0k/datasheet-sm-aluminum5052-h32.pdf"),
+ P(MaterialPropertyKind.YoungsModulus, 70.3e9, "Pa", "PROTO-5052-H32", "https://www.protolabs.com/media/iw0mfa0k/datasheet-sm-aluminum5052-h32.pdf"),
+ P(MaterialPropertyKind.PoissonsRatio, .33, "1", "MATWEB-5052-H32", "https://www.matweb.com/search/datasheet.aspx?matguid=96d768abc51e4157a1b8f95856c49028", notes: "Industry-reference nominal."),
+ P(MaterialPropertyKind.YieldStrength, 193e6, "Pa", "PROTO-5052-H32", "https://www.protolabs.com/media/iw0mfa0k/datasheet-sm-aluminum5052-h32.pdf"),
+ P(MaterialPropertyKind.UltimateTensileStrength, 228e6, "Pa", "PROTO-5052-H32", "https://www.protolabs.com/media/iw0mfa0k/datasheet-sm-aluminum5052-h32.pdf"),
+ P(MaterialPropertyKind.ThermalConductivity, 138, "W/(m*K)", "PROTO-5052-H32", "https://www.protolabs.com/media/iw0mfa0k/datasheet-sm-aluminum5052-h32.pdf")),
+
+ Material("aluminum/6061-t6", "Standard.Materials.Aluminum.6061_T6", "Aluminum", "6061", "6061", "T6", "EN AW-6061 / AA 6061", "Aluminum 6061-T6",
+ P(MaterialPropertyKind.Density, 2700, "kg/m^3", "TK-6061-2018", "https://ucpcdn.thyssenkrupp.com/_legacy/UCPthyssenkruppBAMXUK/assets.files/material-data-sheets/aluminium/aluminium-6061.pdf"),
+ P(MaterialPropertyKind.YoungsModulus, 70e9, "Pa", "TK-6061-2018", "https://ucpcdn.thyssenkrupp.com/_legacy/UCPthyssenkruppBAMXUK/assets.files/material-data-sheets/aluminium/aluminium-6061.pdf"),
+ P(MaterialPropertyKind.PoissonsRatio, .33, "1", "MATWEB-6061-T6", "https://www.matweb.com/search/datasheet.aspx?matguid=1b8c06d0ca7c456694c7777d9e10be5b", notes: "Industry-reference nominal."),
+ P(MaterialPropertyKind.ShearModulus, 26.3e9, "Pa", "TK-6061-2018", "https://ucpcdn.thyssenkrupp.com/_legacy/UCPthyssenkruppBAMXUK/assets.files/material-data-sheets/aluminium/aluminium-6061.pdf", notes: "Independently tabulated; not derived by Aetheris."),
+ P(MaterialPropertyKind.YieldStrength, 240e6, "Pa", "HYDRO-6061", "https://www.hydro.com/Document/Index?id=560718&name=Alloy+6061.pdf", MaterialPropertyAuthority.StandardMinimum),
+ P(MaterialPropertyKind.UltimateTensileStrength, 260e6, "Pa", "HYDRO-6061", "https://www.hydro.com/Document/Index?id=560718&name=Alloy+6061.pdf", MaterialPropertyAuthority.StandardMinimum),
+ P(MaterialPropertyKind.ThermalConductivity, 180, "W/(m*K)", "HYDRO-6061", "https://www.hydro.com/Document/Index?id=560718&name=Alloy+6061.pdf")),
+
+ Material("steel/astm-a36", "Standard.Materials.Steel.ASTM_A36", "Steel", "A36", "A36", null, "ASTM A36/A36M", "ASTM A36 structural steel",
+ P(MaterialPropertyKind.Density, 7850, "kg/m^3", "MATWEB-A36", "https://www.matweb.com/search/DataSheet.aspx?MatGUID=afc003f4fb40465fa3df05129f0e88e6", notes: "Industry-reference nominal."),
+ P(MaterialPropertyKind.YoungsModulus, 200e9, "Pa", "AISC-360", "https://www.aisc.org/standards/aisc-360/", MaterialPropertyAuthority.IndustryReferenceNominal, "Structural-steel elastic constant used by AISC."),
+ P(MaterialPropertyKind.PoissonsRatio, .30, "1", "AISC-360", "https://www.aisc.org/standards/aisc-360/", MaterialPropertyAuthority.IndustryReferenceNominal, "Structural-steel elastic constant used by AISC."),
+ P(MaterialPropertyKind.YieldStrength, 250e6, "Pa", "ASTM-A36", "https://www.astm.org/a0036_a0036m-19.html", MaterialPropertyAuthority.StandardMinimum, "Minimum for common plate/shapes within the bounded X1 condition."),
+ P(MaterialPropertyKind.UltimateTensileStrength, 400e6, "Pa", "ASTM-A36", "https://www.astm.org/a0036_a0036m-19.html", MaterialPropertyAuthority.StandardMinimum, "Lower bound of specified tensile-strength range.")),
+
+ Material("stainless-steel/304-annealed", "Standard.Materials.StainlessSteel.304_Annealed", "StainlessSteel", "304", "S30400", "Annealed", "ASTM A240 / EN 1.4301", "304 stainless steel, annealed",
+ P(MaterialPropertyKind.Density, 7900, "kg/m^3", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf"),
+ P(MaterialPropertyKind.YoungsModulus, 200e9, "Pa", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf"),
+ P(MaterialPropertyKind.PoissonsRatio, .30, "1", "MATWEB-304", "https://www.matweb.com/search/datasheet.aspx?matguid=abc4415b0f8b490387e3c922237098da", notes: "Industry-reference nominal."),
+ P(MaterialPropertyKind.YieldStrength, 170e6, "Pa", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf", MaterialPropertyAuthority.StandardMinimum, "ASTM A240 0.2% proof-strength minimum for listed flat-product forms."),
+ P(MaterialPropertyKind.UltimateTensileStrength, 485e6, "Pa", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf", MaterialPropertyAuthority.StandardMinimum, "ASTM A240 minimum."),
+ P(MaterialPropertyKind.ThermalConductivity, 15, "W/(m*K)", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf"),
+ P(MaterialPropertyKind.SpecificHeat, 500, "J/(kg*K)", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf"),
+ P(MaterialPropertyKind.CoefficientOfThermalExpansion, 16e-6, "1/K", "OUTOKUMPU-CORE", "https://www.outokumpu.com/en/products/product-ranges/-/media/files/products/core/outokumpu-core-range-datasheet.pdf", notes: "Mean coefficient from 20 to 100 °C."))
+ ];
+
+ private static MaterialEntity Material(string stableId, string path, string family, string designation, string? grade, string? temper, string? standard, string displayName, params MaterialPropertyEntity[] properties)
+ {
+ var material = new MaterialEntity { CatalogId = "standard", StableId = stableId, FirmamentPath = path, Family = family, Designation = designation, Grade = grade, Temper = temper, Standard = standard, DisplayName = displayName, ConstitutiveClass = MaterialConstitutiveClass.LinearElasticIsotropic, ReferenceCondition = Room };
+ foreach (var property in properties) material.Properties.Add(property);
+ return material;
+ }
+
+ private static MaterialPropertyEntity P(MaterialPropertyKind kind, double value, string unit, string sourceId, string uri, MaterialPropertyAuthority authority = MaterialPropertyAuthority.ManufacturerTypical, string? notes = null) =>
+ new() { Kind = kind, ValueSi = value, UnitSymbol = unit, SourceId = sourceId, SourceUri = uri, Authority = authority, Condition = Room, ReferenceTemperatureKelvin = RoomK, Notes = notes };
+}
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/Database/aetheris-materials-x1.sqlite b/Aetheris.Kernel.StandardLibrary/Materials/Database/aetheris-materials-x1.sqlite
new file mode 100644
index 00000000..d0fc5c6e
Binary files /dev/null and b/Aetheris.Kernel.StandardLibrary/Materials/Database/aetheris-materials-x1.sqlite differ
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/MaterialCatalog.cs b/Aetheris.Kernel.StandardLibrary/Materials/MaterialCatalog.cs
new file mode 100644
index 00000000..790ffcdf
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/Materials/MaterialCatalog.cs
@@ -0,0 +1,120 @@
+using Aetheris.Kernel.StandardLibrary.Materials.Database;
+using Microsoft.EntityFrameworkCore;
+
+namespace Aetheris.Kernel.StandardLibrary.Materials;
+
+public interface IMaterialResolver
+{
+ MaterialResolutionResult Resolve(string reference);
+}
+
+public sealed class MaterialCatalog : IDisposable
+{
+ public const int ExpectedSeedMaterialCount = 4;
+ private readonly MaterialCatalogDbContext database;
+
+ public MaterialCatalog(string databasePath)
+ {
+ var fullPath = Path.GetFullPath(databasePath);
+ var options = new DbContextOptionsBuilder<MaterialCatalogDbContext>().UseSqlite($"Data Source={fullPath};Mode=ReadOnly;Pooling=False").Options;
+ database = new(options);
+ }
+
+ public IQueryable<MaterialCatalogItem> Materials => database.Materials.AsNoTracking().Select(x => new MaterialCatalogItem
+ {
+ CatalogId = x.CatalogId,
+ StableId = x.StableId,
+ FirmamentPath = x.FirmamentPath,
+ Family = x.Family,
+ Designation = x.Designation,
+ Grade = x.Grade,
+ Temper = x.Temper,
+ Standard = x.Standard,
+ DisplayName = x.DisplayName,
+ ConstitutiveClass = x.ConstitutiveClass,
+ ReferenceCondition = x.ReferenceCondition,
+ });
+ public int SchemaVersion => database.CatalogMetadata.AsNoTracking().Single(x => x.CatalogId == "standard").SchemaVersion;
+
+ public static MaterialCatalog OpenDefault() => new(MaterialCatalogDatabase.DefaultDatabasePath);
+
+ public ResolvedMaterial? GetById(string catalogId, string stableId)
+ {
+ var entity = database.Materials.AsNoTracking().Include(x => x.Properties).SingleOrDefault(x => x.CatalogId == catalogId && x.StableId == stableId);
+ return entity is null ? null : Map(entity);
+ }
+
+ public IReadOnlyList<ResolvedMaterial> FindByDesignation(string designation) => database.Materials.AsNoTracking().Include(x => x.Properties)
+ .Where(x => x.Designation == designation || x.Grade == designation)
+ .OrderBy(x => x.StableId).AsEnumerable().Select(Map).ToArray();
+
+ internal IReadOnlyList<ResolvedMaterial> FindByReference(string reference) => database.Materials.AsNoTracking().Include(x => x.Properties)
+ .Where(x => x.FirmamentPath == reference || x.StableId == reference || (x.CatalogId + ":" + x.StableId) == reference)
+ .OrderBy(x => x.StableId).AsEnumerable().Select(Map).ToArray();
+
+ public void Dispose() => database.Dispose();
+
+ private static ResolvedMaterial Map(MaterialEntity entity)
+ {
+ var validationErrors = MaterialDataValidator.Validate([entity]);
+ if (validationErrors.Count > 0) throw new FormatException(string.Join(Environment.NewLine, validationErrors));
+ var values = entity.Properties.ToDictionary(x => x.Kind, x => new MaterialPropertyValue(x.Kind, x.ValueSi, x.UnitSymbol, new(x.SourceId, x.SourceUri, x.Authority, x.Condition, x.ReferenceTemperatureKelvin, x.Notes)));
+ var identity = new MaterialIdentity(entity.CatalogId, entity.StableId, entity.FirmamentPath, entity.Family, entity.Designation, entity.Grade, entity.Temper, entity.Standard, entity.DisplayName);
+ StructuralMaterialProperties? structural = null;
+ if (values.TryGetValue(MaterialPropertyKind.Density, out var density)
+ && values.TryGetValue(MaterialPropertyKind.YoungsModulus, out var youngsModulus)
+ && values.TryGetValue(MaterialPropertyKind.PoissonsRatio, out var poissonsRatio)
+ && values.TryGetValue(MaterialPropertyKind.YieldStrength, out var yieldStrength)
+ && values.TryGetValue(MaterialPropertyKind.UltimateTensileStrength, out var ultimateTensileStrength))
+ structural = new(density, youngsModulus, poissonsRatio, yieldStrength, ultimateTensileStrength, values.GetValueOrDefault(MaterialPropertyKind.ShearModulus));
+ return new(identity, entity.ConstitutiveClass, entity.ReferenceCondition,
+ structural,
+ new(values.GetValueOrDefault(MaterialPropertyKind.ThermalConductivity), values.GetValueOrDefault(MaterialPropertyKind.SpecificHeat), values.GetValueOrDefault(MaterialPropertyKind.CoefficientOfThermalExpansion)), values);
+ }
+}
+
+public sealed class MaterialResolver(Func<MaterialCatalog> catalogFactory) : IMaterialResolver
+{
+ public MaterialResolver() : this(MaterialCatalog.OpenDefault) { }
+
+ public MaterialResolutionResult Resolve(string reference)
+ {
+ if (string.IsNullOrWhiteSpace(reference)) return MaterialResolutionResult.Failure(MaterialResolutionError.UnknownMaterial, "Material reference is empty.");
+ try
+ {
+ using var catalog = catalogFactory();
+ var matches = catalog.FindByReference(reference.Trim());
+ return matches.Count switch
+ {
+ 0 => MaterialResolutionResult.Failure(MaterialResolutionError.UnknownMaterial, $"Unknown material reference '{reference}'. Use a stable catalog ID or Firmament material path."),
+ > 1 => MaterialResolutionResult.Failure(MaterialResolutionError.AmbiguousMaterial, $"Material reference '{reference}' matched {matches.Count} catalog entries."),
+ _ => MaterialResolutionResult.Success(matches[0]),
+ };
+ }
+ catch (Exception exception) when (exception is FormatException or InvalidOperationException or System.Data.Common.DbException or IOException)
+ {
+ return MaterialResolutionResult.Failure(MaterialResolutionError.InvalidMaterialData, exception.Message);
+ }
+ }
+}
+
+public static class MaterialCatalogDatabase
+{
+ public static string DefaultDatabasePath => Path.Combine(AppContext.BaseDirectory, "Materials", "aetheris-materials-x1.sqlite");
+
+ public static void Recreate(string databasePath)
+ {
+ var fullPath = Path.GetFullPath(databasePath);
+ Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
+ if (File.Exists(fullPath)) File.Delete(fullPath);
+ var options = new DbContextOptionsBuilder<MaterialCatalogDbContext>().UseSqlite($"Data Source={fullPath};Pooling=False").Options;
+ using var database = new MaterialCatalogDbContext(options);
+ database.Database.EnsureCreated();
+ var seed = MaterialSeedData.Create();
+ var errors = MaterialDataValidator.Validate(seed);
+ if (errors.Count > 0) throw new InvalidDataException(string.Join(Environment.NewLine, errors));
+ database.Materials.AddRange(seed);
+ database.CatalogMetadata.Add(new MaterialCatalogMetadataEntity { Id = 1, CatalogId = "standard", SchemaVersion = MaterialCatalogDbContext.SchemaVersion, SeedVersion = "MAT-DB-X1" });
+ database.SaveChanges();
+ }
+}
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/MaterialDomain.cs b/Aetheris.Kernel.StandardLibrary/Materials/MaterialDomain.cs
new file mode 100644
index 00000000..ce2ba2bc
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/Materials/MaterialDomain.cs
@@ -0,0 +1,110 @@
+namespace Aetheris.Kernel.StandardLibrary.Materials;
+
+public enum MaterialConstitutiveClass
+{
+ LinearElasticIsotropic,
+ Orthotropic,
+ TemperatureDependent,
+ ElasticPlastic,
+}
+
+public enum MaterialPropertyKind
+{
+ Density,
+ YoungsModulus,
+ PoissonsRatio,
+ ShearModulus,
+ YieldStrength,
+ UltimateTensileStrength,
+ ThermalConductivity,
+ SpecificHeat,
+ CoefficientOfThermalExpansion,
+}
+
+public enum MaterialPropertyAuthority
+{
+ ManufacturerTypical,
+ StandardMinimum,
+ IndustryReferenceNominal,
+ SupplierCertified,
+}
+
+public sealed record MaterialIdentity(
+ string CatalogId,
+ string StableId,
+ string FirmamentPath,
+ string Family,
+ string Designation,
+ string? Grade,
+ string? Temper,
+ string? Standard,
+ string DisplayName);
+
+public sealed record MaterialPropertyProvenance(
+ string SourceId,
+ string SourceUri,
+ MaterialPropertyAuthority Authority,
+ string Condition,
+ double? ReferenceTemperatureKelvin,
+ string? Notes);
+
+/// <summary>A scalar in the canonical SI unit named by <see cref="UnitSymbol"/>.</summary>
+public sealed record MaterialPropertyValue(
+ MaterialPropertyKind Kind,
+ double SiValue,
+ string UnitSymbol,
+ MaterialPropertyProvenance Provenance);
+
+public sealed record StructuralMaterialProperties(
+ MaterialPropertyValue Density,
+ MaterialPropertyValue YoungsModulus,
+ MaterialPropertyValue PoissonsRatio,
+ MaterialPropertyValue YieldStrength,
+ MaterialPropertyValue UltimateTensileStrength,
+ MaterialPropertyValue? ShearModulus);
+
+public sealed record ThermalMaterialProperties(
+ MaterialPropertyValue? ThermalConductivity,
+ MaterialPropertyValue? SpecificHeat,
+ MaterialPropertyValue? CoefficientOfThermalExpansion)
+{
+ public bool HasAny => ThermalConductivity is not null || SpecificHeat is not null || CoefficientOfThermalExpansion is not null;
+}
+
+public sealed record ResolvedMaterial(
+ MaterialIdentity Identity,
+ MaterialConstitutiveClass ConstitutiveClass,
+ string ReferenceCondition,
+ StructuralMaterialProperties? Structural,
+ ThermalMaterialProperties Thermal,
+ IReadOnlyDictionary<MaterialPropertyKind, MaterialPropertyValue> Properties);
+
+public sealed class MaterialCatalogItem
+{
+ public required string CatalogId { get; init; }
+ public required string StableId { get; init; }
+ public required string FirmamentPath { get; init; }
+ public required string Family { get; init; }
+ public required string Designation { get; init; }
+ public string? Grade { get; init; }
+ public string? Temper { get; init; }
+ public string? Standard { get; init; }
+ public required string DisplayName { get; init; }
+ public MaterialConstitutiveClass ConstitutiveClass { get; init; }
+ public required string ReferenceCondition { get; init; }
+}
+
+public enum MaterialResolutionError
+{
+ UnknownMaterial,
+ AmbiguousMaterial,
+ MissingRequiredStructuralProperty,
+ InvalidMaterialData,
+}
+
+public sealed record MaterialResolutionResult(ResolvedMaterial? Material, MaterialResolutionError? Error, string? Message)
+{
+ public bool IsSuccess => Material is not null && Error is null;
+ public static MaterialResolutionResult Success(ResolvedMaterial material) => new(material, null, null);
+ public static MaterialResolutionResult Failure(MaterialResolutionError error, string message) => new(null, error, message);
+}
diff --git a/Aetheris.Kernel.StandardLibrary/Materials/MaterialValidation.cs b/Aetheris.Kernel.StandardLibrary/Materials/MaterialValidation.cs
new file mode 100644
index 00000000..2b92f4a1
--- /dev/null
+++ b/Aetheris.Kernel.StandardLibrary/Materials/MaterialValidation.cs
@@ -0,0 +1,45 @@
+using Aetheris.Kernel.StandardLibrary.Materials.Database;
+
+namespace Aetheris.Kernel.StandardLibrary.Materials;
+
+public static class MaterialDataValidator
+{
+ public static IReadOnlyList<string> Validate(IEnumerable<MaterialEntity> materials)
+ {
+ var entries = materials.ToArray();
+ var errors = new List<string>();
+ foreach (var duplicate in entries.GroupBy(x => (x.CatalogId, x.StableId)).Where(x => x.Count() > 1))
+ errors.Add($"Duplicate stable material identity '{duplicate.Key.CatalogId}:{duplicate.Key.StableId}'.");
+ foreach (var duplicate in entries.GroupBy(x => x.FirmamentPath, StringComparer.Ordinal).Where(x => x.Count() > 1))
+ errors.Add($"Duplicate Firmament material path '{duplicate.Key}'.");
+
+ foreach (var material in entries)
+ {
+ foreach (var duplicate in material.Properties.GroupBy(x => x.Kind).Where(x => x.Count() > 1))
+ errors.Add($"{material.StableId}:duplicate property {duplicate.Key}.");
+ var properties = material.Properties.GroupBy(x => x.Kind).ToDictionary(x => x.Key, x => x.First());
+ foreach (var property in properties.Values.Where(x => !double.IsFinite(x.ValueSi)))
+ errors.Add($"{material.StableId}:{property.Kind} must be finite.");
+ Positive(MaterialPropertyKind.Density);
+ Positive(MaterialPropertyKind.YoungsModulus);
+ Positive(MaterialPropertyKind.ShearModulus);
+ Positive(MaterialPropertyKind.YieldStrength);
+ Positive(MaterialPropertyKind.UltimateTensileStrength);
+ Positive(MaterialPropertyKind.ThermalConductivity);
+ Positive(MaterialPropertyKind.SpecificHeat);
+ if (properties.TryGetValue(MaterialPropertyKind.PoissonsRatio, out var poisson) && material.ConstitutiveClass == MaterialConstitutiveClass.LinearElasticIsotropic && (poisson.ValueSi <= -1 || poisson.ValueSi >= 0.5))
+ errors.Add($"{material.StableId}:PoissonsRatio must be in (-1, 0.5) for an isotropic material.");
+ if (properties.TryGetValue(MaterialPropertyKind.YieldStrength, out var yieldStrength) && properties.TryGetValue(MaterialPropertyKind.UltimateTensileStrength, out var ultimate) && ultimate.ValueSi < yieldStrength.ValueSi)
+ errors.Add($"{material.StableId}:UltimateTensileStrength must be at least YieldStrength.");
+ if (properties.TryGetValue(MaterialPropertyKind.CoefficientOfThermalExpansion, out var expansion) && expansion.ValueSi <= 0)
+ errors.Add($"{material.StableId}:CoefficientOfThermalExpansion must be positive where supplied.");
+
+ void Positive(MaterialPropertyKind kind)
+ {
+ if (properties.TryGetValue(kind, out var value) && value.ValueSi <= 0)
+ errors.Add($"{material.StableId}:{kind} must be positive where supplied.");
+ }
+ }
+ return errors;
+ }
+}
diff --git a/Aetheris.slnx b/Aetheris.slnx
index 906343b3..97ea5369 100644
--- a/Aetheris.slnx
+++ b/Aetheris.slnx
@@ -50,6 +50,7 @@
<Project Path="samples/Aetheris.Samples.DatabaseDrivenCad/Aetheris.Samples.DatabaseDrivenCad.csproj" />
<Project Path="samples/Aetheris.Samples.DatabaseDrivenCad.Tests/Aetheris.Samples.DatabaseDrivenCad.Tests.csproj" />
<Project Path="Aetheris.Kernel.StandardLibrary/Aetheris.Kernel.StandardLibrary.csproj" />
+ <Project Path="Aetheris.Kernel.StandardLibrary.Tests/Aetheris.Kernel.StandardLibrary.Tests.csproj" />
<Project Path="Aetheris.Kernel.Firmament/Aetheris.Kernel.Firmament.csproj" />
<Project Path="Aetheris.Kernel.Firmament.Tests/Aetheris.Kernel.Firmament.Tests.csproj" />
<Project Path="Aetheris.Firmament.FrictionLab/Aetheris.Firmament.FrictionLab.csproj" />
diff --git a/docs/milestones/MAT-DB-X1.md b/docs/milestones/MAT-DB-X1.md
new file mode 100644
index 00000000..ae6e7546
--- /dev/null
+++ b/docs/milestones/MAT-DB-X1.md
@@ -0,0 +1,110 @@
+# MAT-DB-X1 — Standard Library material catalog
+
+## Architecture
+
+```text
+checked-in SQLite catalog
+ -> EF Core entities and schema
+ -> MaterialCatalog (composable C#/LINQ query surface)
+ -> IMaterialResolver / MaterialResolver
+ -> ResolvedMaterial domain record
+ -> Firmament analysis lowering and engineering consumers
+```
+
+`Aetheris.Kernel.StandardLibrary.Materials` owns persistence, catalog queries, validation, stable identity, provenance, and domain mapping. EF entities stop at the catalog boundary. Firmament only carries a semantic material path. The FEA IR receives a complete `ResolvedMaterial` and scalar SI fields; neither the solver nor the Abaqus exporter knows about SQLite, EF Core, or query policy.
+
+The database is [`aetheris-materials-x1.sqlite`](../../Aetheris.Kernel.StandardLibrary/Materials/Database/aetheris-materials-x1.sqlite). It is copied beside packaged output under `Materials/`. `MaterialCatalogDatabase.Recreate` deterministically creates the schema and seed rows from the checked-in EF model and seed definitions. `CatalogMetadata` records schema version 1 and seed version `MAT-DB-X1`.
+
+## Schema
+
+- `CatalogMetadata`: catalog ID, schema version, and seed version.
+- `Materials`: stable semantic identity, Firmament path, family, designation, grade, temper/condition, standard, display name, constitutive class, and reference condition.
+- `MaterialProperties`: one typed property kind per material, canonical SI value/unit, source ID/URI, authority class, condition, reference temperature, and qualification notes.
+
+Unique indexes enforce `(CatalogId, StableId)`, Firmament path, property-per-material, and catalog metadata identity. The schema deliberately keeps identity and property context explicit without normalizing the initial catalog into many taxonomy tables.
+
+## Seed catalog
+
+| Stable ID | Material | Condition | Constitutive class | Structural data | Thermal data |
+| --- | --- | --- | --- | --- | --- |
+| `standard:aluminum/5052-h32` | Aluminum 5052-H32 | nominal room temperature, H32 | `LinearElasticIsotropic` | density, E, ν, yield, UTS | conductivity |
+| `standard:aluminum/6061-t6` | Aluminum 6061-T6 | nominal room temperature, T6 | `LinearElasticIsotropic` | density, E, ν, independently tabulated G, yield, UTS | conductivity |
+| `standard:steel/astm-a36` | ASTM A36 structural steel | nominal room temperature; bounded common plate/shape strength | `LinearElasticIsotropic` | density, E, ν, minimum yield, lower-bound UTS | deferred |
+| `standard:stainless-steel/304-annealed` | 304 / S30400 stainless | annealed flat product, nominal room temperature | `LinearElasticIsotropic` | density, E, ν, minimum yield, minimum UTS | conductivity, specific heat, CTE |
+
+All values are stored in canonical SI: kg/m³, Pa, dimensionless ratio, W/(m·K), J/(kg·K), and 1/K. Units remain explicit on every resolved property.
+
+## Provenance strategy
+
+Every property row records its own source ID, URI, authority (`ManufacturerTypical`, `StandardMinimum`, `IndustryReferenceNominal`, or future `SupplierCertified`), condition, optional reference temperature, and notes. This permits a future supplier-certified value or temperature-conditioned value to coexist conceptually with the bounded X1 nominal values without changing the meaning of the engineering record.
+
+Seed sources are deterministic in [`MaterialSeedData.cs`](../../Aetheris.Kernel.StandardLibrary/Materials/Database/MaterialSeedData.cs):
+
+- Hydro and thyssenkrupp 6061 alloy datasheets for mechanical/physical values and standard minima.
+- Protolabs' AA-attributed 5052-H32 technical sheet, with MatWeb only for the explicitly labeled nominal Poisson ratio.
+- ASTM A36/A36M and AISC 360 references for bounded strength minima and ordinary structural-steel elastic constants, with MatWeb only for nominal density.
+- Outokumpu Core 304/4301 datasheet for ASTM A240 strength minima and room-temperature physical/thermal properties, with MatWeb only for the explicitly labeled nominal Poisson ratio.
+
+Values are not supplier certificates. Reports should preserve the attached provenance and condition. X1 intentionally omits a property when the chosen sources do not support a defensible bounded value.
+
+## Firmament usage
+
+Firmament names one catalog material; it does not query the database:
+
+```firmament
+analysis LinearElastic CouponPull {
+ body: coupon
+ material: Standard.Materials.Aluminum.5052_H32
+ // constraints and loads...
+}
+```
+
+The complete executable witness is [`catalog-material-coupon.firmament`](../../fixtures/FirmamentV2/Materials/catalog-material-coupon.firmament). Unknown paths produce `firmament-material-unknown`; there is no fallback to a generic family.
+
+## C# and LINQ usage
+
+Database/query programming remains ordinary C#:
+
+```csharp
+using var catalog = MaterialCatalog.OpenDefault();
+
+var sheetAluminum = catalog.Materials
+ .Where(material => material.Family == "Aluminum")
+ .OrderBy(material => material.Designation)
+ .ThenBy(material => material.Temper)
+ .ToArray();
+
+var material = new MaterialResolver()
+ .Resolve("Standard.Materials.Aluminum.5052_H32")
+ .Material!;
+```
+
+The first query remains an EF-translated `IQueryable`; Firmament gains no SQL, predicates, comprehensions, ORM semantics, or selection scripting. `IMaterialResolver` is injectable at lowering time, allowing future Forge, company, or supplier federation behind the same semantic reference surface. Stable identity already consists of catalog ID plus stable material key.
+
+## Validation and diagnostics
+
+Seed generation rejects non-finite values, nonpositive supplied physical quantities, invalid isotropic Poisson ratios, UTS below yield, duplicate stable IDs, duplicate Firmament paths, and duplicate property kinds. Resolution rejects invalid entries while allowing a future thermal-only material to resolve with no structural block. The FEA lowerer explicitly rejects such an entry as missing structural data and distinguishes unknown, ambiguous, invalid, and missing-structural-data outcomes with deterministic diagnostic codes.
+
+## FEA readiness
+
+For every X1 entry, future FEA code can consume these values from `ResolvedMaterial` without database knowledge:
+
+- structured identity and stable catalog ID;
+- density;
+- explicit constitutive class;
+- Young's modulus;
+- Poisson ratio;
+- yield strength;
+- ultimate tensile strength;
+- per-property provenance and reference condition.
+
+The existing linear-elastic FEA IR also carries the complete resolved record and direct SI scalars. The catalog coupon witness compiles and runs through the real solver.
+
+## Limitations
+
+- X1 supports only `LinearElasticIsotropic`; orthotropic, temperature-dependent, and elastic-plastic classifications are reserved but not implemented.
+- Values are single bounded reference-condition observations, not temperature curves or a multidimensional materials-science model.
+- A36 thermal values are intentionally absent. Some aluminum thermal fields remain absent where the bounded seed sources were incomplete.
+- Manufacturing recommendations such as bend radii and stock thicknesses are deferred because they depend on thickness, tooling, process, grain direction, and supplier condition. X1 does not encode shop folklore as material physics.
+- Catalog federation and override precedence are not implemented. `IMaterialResolver`, catalog-qualified stable IDs, and semantic paths provide the extension seam.
+- The catalog has four deliberately useful entries; it is not a universal ontology, supplier inventory, or certification database.
diff --git a/fixtures/FirmamentV2/Materials/catalog-material-coupon.firmament b/fixtures/FirmamentV2/Materials/catalog-material-coupon.firmament
new file mode 100644
index 00000000..8a430093
--- /dev/null
+++ b/fixtures/FirmamentV2/Materials/catalog-material-coupon.firmament
@@ -0,0 +1,19 @@
+model CatalogMaterialCoupon {
+ units mm
+ solid coupon: Box { size: [80, 20, 2] }
+
+ analysis LinearElastic CouponPull {
+ body: coupon
+ material: Standard.Materials.Aluminum.5052_H32
+ fixed Clamp {
+ region: coupon.face(-X)
+ components: [X, Y, Z]
+ }
+ force Pull {
+ region: coupon.face(+X)
+ vector: [1000N, 0N, 0N]
+ }
+ results: [Displacement, Strain, Stress, ReactionForce]
+ lattice: [8, 2, 1]
+ }
+}