Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add explicit experimental thin-wall FEA analysis mode
Yuechen Li735e8f180b4c
diff --git a/Aetheris.CLI.Tests/FeaCliTests.cs b/Aetheris.CLI.Tests/FeaCliTests.csindex 96dec322..6de90d4a 100644--- a/Aetheris.CLI.Tests/FeaCliTests.cs+++ b/Aetheris.CLI.Tests/FeaCliTests.cs@@ -68,5 +68,26 @@ public sealed class FeaCliTestsfinally { if(Directory.Exists(temp))Directory.Delete(temp,true); }}+ [Fact]+ public void FeaCommand_ExperimentalShellIsExplicitAndWritesDiagnosticArtifacts()+ {+ var root=FindRoot();var source=Path.Combine(root,"fixtures","Canonical","FEA","ExperimentalShell","flat-cantilever.firmament");var output=Path.Combine(Path.GetTempPath(),"aetheris-fea-shell-x0-"+Guid.NewGuid().ToString("N"));+ try+ {+ var stdout=new StringWriter();var stderr=new StringWriter();+ var exit=CliRunner.Run(["fea",source,"--out-dir",output,"--json"],stdout,stderr);+ Assert.Equal(0,exit);Assert.Empty(stderr.ToString());+ using var report=JsonDocument.Parse(stdout.ToString());var rootElement=report.RootElement;+ Assert.Equal("ExperimentalShell",rootElement.GetProperty("analysis").GetProperty("mode").GetString());+ Assert.Contains("not production-qualified",rootElement.GetProperty("analysis").GetProperty("qualification").GetString(),StringComparison.Ordinal);+ Assert.Equal(3,rootElement.GetProperty("experimentalShell").GetProperty("polynomialOrder").GetInt32());+ Assert.True(File.Exists(Path.Combine(output,"experimental-shell-evidence.json")));+ Assert.NotNull(System.Xml.Linq.XDocument.Load(Path.Combine(output,"parameter-domain-grid.svg")).Root);+ Assert.NotNull(System.Xml.Linq.XDocument.Load(Path.Combine(output,"mapped-deformed-cells.svg")).Root);+ Assert.False(File.Exists(Path.Combine(output,"verification.inp")));+ }+ finally { if(Directory.Exists(output))Directory.Delete(output,true); }+ }+private static string FindRoot(){var directory=new DirectoryInfo(AppContext.BaseDirectory);while(directory is not null&&!File.Exists(Path.Combine(directory.FullName,"Aetheris.slnx")))directory=directory.Parent;return directory?.FullName??throw new DirectoryNotFoundException();}}diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex 837c3b56..07457d13 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -1116,7 +1116,8 @@ Model CanonicalPanel {// Generic imported BReps classify every intersecting site through exact kernel containment;// use the production default order while analytic domains retain the higher CLI verification order.var quadratureOrder=compiled.Analysis.Body.ContinuumRegion is Aetheris.FEA.Geometry.ImportedBrepAnalysisRegion?4:6;- var solveOptions=new MechanicsSolveOptions(CutCellQuadraturePerAxis:quadratureOrder,DomainTransform:orientation,PreserveNominalCellVolumeUnderTransform:orientation is not null,+ var isExperimentalShell=compiled.Analysis.Mode==Aetheris.FEA.Analysis.AnalysisMode.ExperimentalShell;+ var solveOptions=new MechanicsSolveOptions(CutCellQuadraturePerAxis:quadratureOrder,RelativeResidualTolerance:isExperimentalShell?1e-8:1e-9,MaximumIterations:isExperimentalShell?10000:null,DomainTransform:orientation,PreserveNominalCellVolumeUnderTransform:orientation is not null,RetryEmptyCutCells:compiled.Analysis.Body.ContinuumRegion is not Aetheris.FEA.Geometry.ImportedBrepAnalysisRegion);var result = LinearElasticSolver.Solve(compiled.Analysis,solveOptions);if (!result.IsSuccess){@@ -1133,20 +1134,28 @@ Model CanonicalPanel {foreach (var diagnostic in errors) stderr.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");return 1;}- var abaqus = AbaqusInpExporter.Export(compiled.Analysis,orientation); var validation = AbaqusInpValidator.Validate(abaqus.Text);+ var experimental=compiled.Analysis.Mode==Aetheris.FEA.Analysis.AnalysisMode.ExperimentalShell;+ string? abaqusText=null;string? abaqusHash=null;object? abaqusReport=null;var verificationValid=true;+ if(!experimental)+ {+ var abaqus=AbaqusInpExporter.Export(compiled.Analysis,orientation);var validation=AbaqusInpValidator.Validate(abaqus.Text);+ abaqusText=abaqus.Text;abaqusHash=abaqus.Sha256;verificationValid=validation.IsValid;+ abaqusReport=new{abaqus.Sha256,abaqus.NodeCount,abaqus.ElementCount,validation.IsValid,validation.Diagnostics};+ }var report = new{- analysis = new { compiled.Analysis.Id, kind = compiled.Analysis.Kind.ToString(), body = compiled.Analysis.Body.Id, compiled.Analysis.Body.SourceKind,+ analysis = new { compiled.Analysis.Id, kind = compiled.Analysis.Kind.ToString(),mode=compiled.Analysis.Mode.ToString(),qualification=experimental?"Experimental - not production-qualified":"Production", body = compiled.Analysis.Body.Id, compiled.Analysis.Body.SourceKind,geometryIdentity=compiled.Analysis.Body.ContinuumRegion.Id.Value,geometryHash=compiled.Analysis.Body.ResourceHash,brepBodyId=compiled.Analysis.Body.BrepBodyId,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(), distribution=item.Distribution.ToString(), region = item.Region.Path, item.VectorSi, item.PressurePascal }),requestedResults=compiled.Analysis.RequestedFields.Order().Select(Aetheris.FEA.Analysis.AnalysisResultContracts.Describe),- lattice = new { compiled.Analysis.Lattice.CountX, compiled.Analysis.Lattice.CountY, compiled.Analysis.Lattice.CountZ } },+ lattice = new { compiled.Analysis.Lattice.CountX, compiled.Analysis.Lattice.CountY, compiled.Analysis.Lattice.CountZ },experimentalShell=compiled.Analysis.ExperimentalShell },solverSettings=new{solveOptions.CutCellQuadraturePerAxis,solveOptions.RelativeResidualTolerance,solveOptions.MaximumIterations,solveOptions.RetryEmptyCutCells},orientationDegrees=rotationDegrees,result.System, result.Solver, result.Equilibrium, result.TinyCells, result.Performance,boundaryLoads=result.BoundaryLoads,numericalLowering=result.NumericalLowering,strainEnergy=result.StrainEnergy,stressProbes=result.StressProbes,+ experimentalShell=result.ExperimentalShell,maximumDisplacementMeters = result.MaximumDisplacementMeters, maximumVonMisesPascal = result.MaximumVonMisesPascal,- abaqus = new { abaqus.Sha256, abaqus.NodeCount, abaqus.ElementCount, validation.IsValid, validation.Diagnostics }+ abaqus = abaqusReport};if (outDir is not null){@@ -1158,10 +1167,18 @@ Model CanonicalPanel {File.WriteAllText(Path.Combine(outDir, "displacement-stress-summary.json"), JsonSerializer.Serialize(new { maximumDisplacementMeters = result.MaximumDisplacementMeters, maximumVonMisesPascal = result.MaximumVonMisesPascal, result.Equilibrium }, JsonOptions));File.WriteAllText(Path.Combine(outDir,"boundary-quadrature.json"),JsonSerializer.Serialize(result.BoundaryLoads,JsonOptions));File.WriteAllText(Path.Combine(outDir,"numerical-lowering-strategy-map.json"),JsonSerializer.Serialize(result.NumericalLowering,JsonOptions));- File.WriteAllText(Path.Combine(outDir, "verification.inp"), abaqus.Text);+ if(experimental)+ {+ File.WriteAllText(Path.Combine(outDir,"experimental-shell-evidence.json"),JsonSerializer.Serialize(result.ExperimentalShell,JsonOptions));+ File.WriteAllText(Path.Combine(outDir,"parameter-domain-grid.svg"),ThinWallDebugArtifacts.ParameterDomainSvg(compiled.Analysis));+ File.WriteAllText(Path.Combine(outDir,"mapped-deformed-cells.svg"),ThinWallDebugArtifacts.MappedAndDeformedSvg(compiled.Analysis,result));+ }+ else File.WriteAllText(Path.Combine(outDir, "verification.inp"), abaqusText!);}- stdout.WriteLine(json ? JsonSerializer.Serialize(report, JsonOptions) : $"{compiled.Analysis.Id}: converged in {result.Solver.Iterations} iterations; max |u|={result.MaximumDisplacementMeters:R} m; max von Mises={result.MaximumVonMisesPascal:R} Pa; Abaqus SHA-256={abaqus.Sha256}");- return validation.IsValid ? 0 : 1;+ stdout.WriteLine(json ? JsonSerializer.Serialize(report, JsonOptions) : experimental+ ? $"{compiled.Analysis.Id}: ExperimentalShell converged in {result.Solver.Iterations} iterations; max |u|={result.MaximumDisplacementMeters:R} m; max von Mises={result.MaximumVonMisesPascal:R} Pa"+ : $"{compiled.Analysis.Id}: converged in {result.Solver.Iterations} iterations; max |u|={result.MaximumDisplacementMeters:R} m; max von Mises={result.MaximumVonMisesPascal:R} Pa; Abaqus SHA-256={abaqusHash}");+ return verificationValid ? 0 : 1;}private static int RunMesh(string[] args, TextWriter stdout, TextWriter stderr)diff --git a/Aetheris.FEA.Tests/ExperimentalShellX0Tests.cs b/Aetheris.FEA.Tests/ExperimentalShellX0Tests.csnew file mode 100644index 00000000..24c4f7ac--- /dev/null+++ b/Aetheris.FEA.Tests/ExperimentalShellX0Tests.cs@@ -0,0 +1,154 @@+using Aetheris.FEA.Analysis;+using Aetheris.FEA.Firmament;+using Aetheris.FEA.Mechanics;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.FEA.Tests;++public sealed class ExperimentalShellX0Tests+{+ [Fact]+ public void ModeIsExplicitAndProductionDefaultIsPreserved()+ {+ var shell=CompileFixture("Canonical","FEA","ExperimentalShell","flat-cantilever.firmament");+ Assert.Equal(AnalysisMode.ExperimentalShell,shell.Mode);+ Assert.NotNull(shell.ExperimentalShell);+ Assert.Equal(3,shell.ExperimentalShell.PolynomialOrder);+ Assert.Equal(1e-12,shell.ExperimentalShell.FictitiousStiffnessFactor);++ var production=FirmamentAnalysisCompiler.Compile(FlatSource.Replace("Mode: ExperimentalShell",string.Empty,StringComparison.Ordinal)+ .Replace("Thickness: 2mm",string.Empty,StringComparison.Ordinal)+ .Replace("MasterGrid: [4, 1]",string.Empty,StringComparison.Ordinal)+ .Replace("Order: 3",string.Empty,StringComparison.Ordinal)+ .Replace("AlphaFictitious: 1e-12",string.Empty,StringComparison.Ordinal)+ .Replace("MaxSubdivisionDepth: 4",string.Empty,StringComparison.Ordinal));+ Assert.True(production.IsSuccess,Describe(production));+ Assert.Equal(AnalysisMode.ProductionSolid,production.Analysis!.Mode);+ Assert.Null(production.Analysis.ExperimentalShell);+ }++ [Fact]+ public void InvalidSettingsHaveStableDiagnostics()+ {+ var missing=CompileFixtureResult("Invalid","FEA","ExperimentalShell","missing-thickness.firmament");+ Assert.Contains(missing.Diagnostics,item=>item.Code=="thinwall-thickness-missing");+ var order=CompileFixtureResult("Invalid","FEA","ExperimentalShell","invalid-order.firmament");+ Assert.Contains(order.Diagnostics,item=>item.Code=="thinwall-basis-order-invalid");+ var zero=CompileFixtureResult("Invalid","FEA","ExperimentalShell","zero-thickness.firmament");+ Assert.Contains(zero.Diagnostics,item=>item.Code=="thinwall-thickness-invalid");+ var rigid=CompileFixtureResult("Invalid","FEA","ExperimentalShell","rigid-body.firmament");+ Assert.Contains(rigid.Diagnostics,item=>item.Code=="fea-rigid-body-mode");+ var singular=CompileFixture("Invalid","FEA","ExperimentalShell","singular-map.firmament");+ var singularResult=LinearElasticSolver.Solve(singular);+ Assert.False(singularResult.IsSuccess);+ Assert.Contains(singularResult.Diagnostics,item=>item.Code=="thinwall-map-singular");+ }++ [Fact]+ public void FlatCantileverPRefinementApproachesBeamReference()+ {+ var baseline=FirmamentAnalysisCompiler.Compile(FlatSource).Analysis!;+ var studies=new[]{1,2,3}.Select(order=>Solve(baseline with{ExperimentalShell=baseline.ExperimentalShell! with{PolynomialOrder=order}})).ToArray();+ const double reference=0.00125; // F L^3 / (3 E I), I=b h^3/12.+ var errors=studies.Select(result=>double.Abs(result.MaximumDisplacementMeters-reference)/reference).ToArray();+ Assert.True(errors[2]<errors[1]&&errors[1]<errors[0],string.Join(", ",errors.Select(value=>value.ToString("R"))));+ Assert.InRange(errors[2],0,.05);+ Assert.All(studies,result=>Assert.InRange(result.Equilibrium.ResidualNewton.Length,0,1e-5));+ Assert.All(studies,result=>Assert.InRange(result.StrainEnergy!.RelativeResidual,0,1e-8));+ }++ [Fact]+ public void PerforatedPlateUsesCutSubcellsAndIsDeterministic()+ {+ var analysis=CompileFixture("Canonical","FEA","ExperimentalShell","cut-boundary-plate.firmament");+ var first=Solve(analysis);var second=Solve(analysis);+ Assert.Equal(4,first.ExperimentalShell!.CutCells);+ Assert.True(first.ExperimentalShell.CutSubcellCount>0);+ Assert.InRange(first.ExperimentalShell.MinimumPhysicalCutFraction,.75,.9);+ Assert.Equal(first.ExperimentalShell.DeterministicDiscretizationHash,second.ExperimentalShell!.DeterministicDiscretizationHash);+ Assert.Equal(first.MaximumDisplacementMeters,second.MaximumDisplacementMeters,14);+ Assert.InRange(first.Equilibrium.ResidualNewton.Length,0,1e-6);+ Assert.InRange(first.StrainEnergy!.RelativeResidual,0,1e-8);+ }++ [Fact]+ public void CutIntegrationAndAlphaStudiesRemainSeparated()+ {+ var baseline=CompileFixture("Canonical","FEA","ExperimentalShell","cut-boundary-plate.firmament");+ var alphaStudies=new[]{1e-8,1e-10,1e-12}.Select(alpha=>Solve(baseline with{ExperimentalShell=baseline.ExperimentalShell! with{FictitiousStiffnessFactor=alpha}})).ToArray();+ Assert.All(alphaStudies,result=>Assert.True(result.ExperimentalShell!.CutSubcellCount>0));+ var alphaSpread=(alphaStudies.Max(result=>result.StrainEnergy!.AlgebraicJoule)-alphaStudies.Min(result=>result.StrainEnergy!.AlgebraicJoule))/alphaStudies[^1].StrainEnergy!.AlgebraicJoule;+ Assert.InRange(alphaSpread,0,1e-6);++ var depth3=Solve(baseline with{ExperimentalShell=baseline.ExperimentalShell! with{MaxSubdivisionDepth=3}});+ var order4=Solve(baseline with{ExperimentalShell=baseline.ExperimentalShell! with{QuadratureOrder=4}});+ Assert.True(depth3.ExperimentalShell!.CutSubcellCount<alphaStudies[^1].ExperimentalShell!.CutSubcellCount);+ Assert.InRange(RelativeDifference(depth3.StrainEnergy!.AlgebraicJoule,alphaStudies[^1].StrainEnergy!.AlgebraicJoule),0,.02);+ Assert.InRange(RelativeDifference(order4.StrainEnergy!.AlgebraicJoule,alphaStudies[^1].StrainEnergy!.AlgebraicJoule),0,.002);+ }++ [Fact]+ public void ThinnessSweepKeepsCellAndDofCountsFixed()+ {+ var studies=new[]{10,50,100}.Select(ratio=>+ {+ var thickness=100d/ratio;var token=thickness.ToString("0.###",System.Globalization.CultureInfo.InvariantCulture)+"mm";+ var source=FlatSource.Replace("2mm]",token+"]",StringComparison.Ordinal).Replace("Thickness: 2mm","Thickness: "+token,StringComparison.Ordinal);+ var compilation=FirmamentAnalysisCompiler.Compile(source);Assert.True(compilation.IsSuccess,Describe(compilation));+ return(ratio,thickness,result:Solve(compilation.Analysis!));+ }).ToArray();+ Assert.Single(studies.Select(item=>item.result.System.DegreesOfFreedom).Distinct());+ foreach(var study in studies)+ {+ var h=study.thickness/1000;var reference=10*.1*.1*.1/(3*200e9*(.02*h*h*h/12));+ Assert.InRange(RelativeDifference(study.result.MaximumDisplacementMeters,reference),0,.05);+ Assert.InRange(study.result.Equilibrium.ResidualNewton.Length,0,1e-6);+ }+ }++ [Fact]+ public void NonfiniteExperimentalInputIsRejectedBeforeAssembly()+ {+ var analysis=FirmamentAnalysisCompiler.Compile(FlatSource).Analysis!;+ var invalid=analysis with{Loads=analysis.Loads.Select(load=>load with{VectorSi=new(double.NaN,0,0)}).ToArray()};+ var result=LinearElasticSolver.Solve(invalid);+ Assert.False(result.IsSuccess);+ Assert.Contains(result.Diagnostics,item=>item.Code=="fea-invalid-load");+ Assert.Equal(0,result.System.DegreesOfFreedom);+ }++ [Fact]+ public void CylindricalMapHasPositiveAnalyticJacobianAndRejectsInconsistentSpan()+ {+ var bounds=new BoundingBox3D(new(0,0,0),new(.1,.1*double.Pi/2,.002));+ var settings=new ExperimentalShellSettings(.002,2,2,2,GeometryMap:ThinWallGeometryMapKind.Cylindrical,CylinderRadiusMeters:.1,CylinderAngleRadians:double.Pi/2);+ var map=new ThinWallGeometryMap(settings,bounds);+ foreach(var t in new[]{-1d,0d,1d})+ Assert.True(ThinWallGeometryMap.ElementJacobianDeterminant(map.Evaluate(.05,.05,t),.05,bounds.Max.Y/2)>0);+ var exception=Assert.Throws<ThinWallMapException>(()=>new ThinWallGeometryMap(settings,new(new(0,0,0),new(.1,.2,.002))));+ Assert.Equal("thinwall-map-singular",exception.Code);+ }++ private static LinearElasticAnalysisResult Solve(LinearElasticAnalysisIr analysis)+ {+ var result=LinearElasticSolver.Solve(analysis,new(RelativeResidualTolerance:1e-8,MaximumIterations:10000));+ Assert.True(result.IsSuccess,Describe(result));return result;+ }++ private static LinearElasticAnalysisIr CompileFixture(params string[] parts)+ {+ var result=CompileFixtureResult(parts);Assert.True(result.IsSuccess,Describe(result));return result.Analysis!;+ }++ private static FirmamentAnalysisCompilation CompileFixtureResult(params string[] parts)+ {+ var path=Path.Combine([FindRoot(),"fixtures",..parts]);+ return FirmamentAnalysisCompiler.Compile(File.ReadAllText(path),path,Path.GetDirectoryName(path));+ }++ private static string FlatSource=>File.ReadAllText(Path.Combine(FindRoot(),"fixtures","Canonical","FEA","ExperimentalShell","flat-cantilever.firmament"));+ private static double RelativeDifference(double a,double b)=>double.Abs(a-b)/double.Max(double.Abs(b),1e-30);+ private static string Describe(FirmamentAnalysisCompilation value)=>string.Join("; ",value.Diagnostics.Select(item=>item.Code+":"+item.Message));+ private static string Describe(LinearElasticAnalysisResult value)=>string.Join("; ",value.Diagnostics.Select(item=>item.Code+":"+item.Message));+ private static string FindRoot(){var directory=new DirectoryInfo(AppContext.BaseDirectory);while(directory is not null&&!File.Exists(Path.Combine(directory.FullName,"Aetheris.slnx")))directory=directory.Parent;return directory?.FullName??throw new DirectoryNotFoundException();}+}diff --git a/Aetheris.FEA/Analysis/AnalysisIr.cs b/Aetheris.FEA/Analysis/AnalysisIr.csindex e0d832af..6d0f9a6d 100644--- a/Aetheris.FEA/Analysis/AnalysisIr.cs+++ b/Aetheris.FEA/Analysis/AnalysisIr.cs@@ -6,7 +6,9 @@ using Aetheris.Kernel.StandardLibrary.Materials;namespace Aetheris.FEA.Analysis;public enum AnalysisKind { LinearStaticElasticity }-public enum AnalysisResultField { Displacement, Strain, Stress, ReactionForce }+public enum AnalysisMode { ProductionSolid, ExperimentalShell }+public enum ThinWallGeometryMapKind { Flat, Cylindrical }+public enum AnalysisResultField { Displacement, Strain, Stress, ReactionForce, StrainEnergy }public enum BoundaryLoadKind { Traction, ResultantForce, Pressure }public enum LoadDistributionPolicy { TotalResultantOverSelectedArea, TractionPerUnitArea, PressureNormalToSurface }public enum AnalysisGeometrySourceKind { FirmamentNative, InlineStep }@@ -77,13 +79,27 @@ public static class AnalysisResultContractspublic static AnalysisResultSemantics Describe(AnalysisResultField field)=>field switch{AnalysisResultField.Displacement=>new(field,"Vector3","m","admitted lattice node","primary solved degrees of freedom; aggregated nodes are affine extensions"),- AnalysisResultField.Strain=>new(field,"symmetric tensor","1","occupied cell center","small-strain tensor recovered from the Q1 displacement gradient"),+ AnalysisResultField.Strain=>new(field,"symmetric tensor","1","occupied cell center","small-strain tensor recovered from the displacement gradient"),AnalysisResultField.Stress=>new(field,"Cauchy symmetric tensor plus von Mises scalar","Pa","occupied cell center","linear isotropic constitutive recovery; no nodal interpolation"),AnalysisResultField.ReactionForce=>new(field,"Vector3 per constraint","N","selected boundary condition","assembled constrained residual or consistent Nitsche boundary reaction"),+ AnalysisResultField.StrainEnergy=>new(field,"Scalar","J","analysis domain","one half of displacement transpose times assembled elastic stiffness times displacement"),_=>throw new ArgumentOutOfRangeException(nameof(field)),};}+/// <summary>Explicit settings for the experimental full-3D thin-wall finite-cell discretization.</summary>+public sealed record ExperimentalShellSettings(+ double ThicknessMeters,+ int PolynomialOrder,+ int MasterCellsR,+ int MasterCellsS,+ double FictitiousStiffnessFactor = 1e-12,+ int MaxSubdivisionDepth = 4,+ int? QuadratureOrder = null,+ ThinWallGeometryMapKind GeometryMap = ThinWallGeometryMapKind.Flat,+ double? CylinderRadiusMeters = null,+ double? CylinderAngleRadians = null);+public sealed record LinearElasticAnalysisIr(string Id,AnalysisKind Kind,@@ -93,7 +109,9 @@ public sealed record LinearElasticAnalysisIr(IReadOnlyList<BoundaryLoadIr> Loads,IReadOnlySet<AnalysisResultField> RequestedFields,LatticeSpec Lattice,- AnalysisProvenance Provenance);+ AnalysisProvenance Provenance,+ AnalysisMode Mode = AnalysisMode.ProductionSolid,+ ExperimentalShellSettings? ExperimentalShell = null);public enum AnalysisDiagnosticSeverity { Info, Warning, Error }public sealed record AnalysisDiagnostic(string Code, AnalysisDiagnosticSeverity Severity, string Message, AnalysisProvenance? Provenance = null);@@ -124,6 +142,26 @@ public static class AnalysisIrValidatordiagnostics.Add(Error("fea-empty-region-selection", $"Load '{load.Id}' has no semantic region.", load.Provenance));foreach(var load in analysis.Loads.Where(load=>!double.IsFinite(load.VectorSi.X)||!double.IsFinite(load.VectorSi.Y)||!double.IsFinite(load.VectorSi.Z)||!double.IsFinite(load.PressurePascal)))diagnostics.Add(Error("fea-invalid-load",$"Load '{load.Id}' contains a non-finite or unit-incompatible value.",load.Provenance));+ if(analysis.Mode==AnalysisMode.ExperimentalShell)+ {+ var shell=analysis.ExperimentalShell;+ if(shell is null)diagnostics.Add(Error("thinwall-settings-missing","ExperimentalShell requires thin-wall discretization settings.",analysis.Provenance));+ else+ {+ if(!double.IsFinite(shell.ThicknessMeters)||shell.ThicknessMeters<=0)diagnostics.Add(Error("thinwall-thickness-invalid","ExperimentalShell thickness must be finite and positive.",analysis.Provenance));+ if(shell.PolynomialOrder is <1 or >6)diagnostics.Add(Error("thinwall-basis-order-invalid","ExperimentalShell X0 supports polynomial orders 1 through 6.",analysis.Provenance));+ if(shell.MasterCellsR<1||shell.MasterCellsS<1)diagnostics.Add(Error("thinwall-master-grid-invalid","ExperimentalShell master-grid dimensions must be positive.",analysis.Provenance));+ if(!double.IsFinite(shell.FictitiousStiffnessFactor)||shell.FictitiousStiffnessFactor<=0||shell.FictitiousStiffnessFactor>=1)diagnostics.Add(Error("thinwall-alpha-invalid","ExperimentalShell fictitious stiffness factor must be finite and strictly between zero and one.",analysis.Provenance));+ if(shell.MaxSubdivisionDepth is <0 or >8)diagnostics.Add(Error("thinwall-subdivision-depth-invalid","ExperimentalShell X0 supports subdivision depths 0 through 8.",analysis.Provenance));+ if(shell.QuadratureOrder is <2 or >12)diagnostics.Add(Error("thinwall-quadrature-order-invalid","ExperimentalShell quadrature order must be between 2 and 12.",analysis.Provenance));+ if(shell.GeometryMap==ThinWallGeometryMapKind.Cylindrical&&+ (shell.CylinderRadiusMeters is null||!double.IsFinite(shell.CylinderRadiusMeters.Value)||shell.CylinderRadiusMeters<=shell.ThicknessMeters/2||+ shell.CylinderAngleRadians is null||!double.IsFinite(shell.CylinderAngleRadians.Value)||shell.CylinderAngleRadians<=0))+ diagnostics.Add(Error("thinwall-map-singular","Cylindrical ExperimentalShell geometry requires a finite positive angle and a radius greater than half-thickness.",analysis.Provenance));+ }+ if(analysis.Body.GeometrySource==AnalysisGeometrySourceKind.InlineStep)+ diagnostics.Add(Error("thinwall-geometry-unsupported","ExperimentalShell X0 does not infer midsurfaces or thickness from imported STEP.",analysis.Body.Provenance));+ }return diagnostics;}diff --git a/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs b/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.csindex 323b6778..dab88f49 100644--- a/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs+++ b/Aetheris.FEA/Firmament/FirmamentAnalysisCompiler.cs@@ -199,9 +199,32 @@ public static class FirmamentAnalysisCompilervar latticeValues=Numbers(Scalar(block,"lattice"));if(latticeValues.Length is not (0 or 3)||latticeValues.Any(value=>!double.IsInteger(value)||value<1)){diagnostics.Add(Error("fea-invalid-lattice-dimensions","Lattice must contain exactly three positive integer dimensions.",sourcePath));return Done(null,diagnostics,started);}var lattice=latticeValues.Length==3?new LatticeSpec(region.Bounds,(int)latticeValues[0],(int)latticeValues[1],(int)latticeValues[2]):new LatticeSpec(region.Bounds,12,6,2);+ var modeText=Scalar(block,"mode")??nameof(AnalysisMode.ProductionSolid);+ if(!Enum.TryParse<AnalysisMode>(modeText,true,out var mode)){diagnostics.Add(Error("fea-analysis-mode-invalid",$"Analysis mode '{modeText}' is unsupported.",sourcePath));return Done(null,diagnostics,started);}+ ExperimentalShellSettings? shellSettings=null;+ if(mode==AnalysisMode.ExperimentalShell)+ {+ var thicknessText=Scalar(block,"thickness");+ if(string.IsNullOrWhiteSpace(thicknessText)){diagnostics.Add(Error("thinwall-thickness-missing","ExperimentalShell requires an explicit Thickness for synthetic/native Box geometry in X0.",sourcePath));return Done(null,diagnostics,started);}+ var masterValues=Numbers(Scalar(block,"masterGrid"));+ if(masterValues.Length!=2||masterValues.Any(value=>!double.IsInteger(value)||value<1)){diagnostics.Add(Error("thinwall-master-grid-invalid","ExperimentalShell MasterGrid must contain exactly two positive integer dimensions.",sourcePath));return Done(null,diagnostics,started);}+ var orderText=Scalar(block,"order");var order=OptionalInteger(orderText,3);+ var alphaText=Scalar(block,"alphaFictitious");var alpha=string.IsNullOrWhiteSpace(alphaText)?1e-12:ScalarNumber(alphaText);+ var depthText=Scalar(block,"maxSubdivisionDepth");var depth=OptionalInteger(depthText,4);+ var quadratureText=Scalar(block,"quadratureOrder");int? quadrature=string.IsNullOrWhiteSpace(quadratureText)?null:OptionalInteger(quadratureText,int.MinValue);+ var mapText=Scalar(block,"geometryMap")??nameof(ThinWallGeometryMapKind.Flat);+ if(!Enum.TryParse<ThinWallGeometryMapKind>(mapText,true,out var map)){diagnostics.Add(Error("thinwall-geometry-unsupported",$"ExperimentalShell geometry map '{mapText}' is unsupported.",sourcePath));return Done(null,diagnostics,started);}+ var radiusText=Scalar(block,"cylinderRadius");var angleText=Scalar(block,"cylinderAngle");+ shellSettings=new ExperimentalShellSettings(Length(thicknessText),order,(int)masterValues[0],(int)masterValues[1],alpha,depth,quadrature,map,+ string.IsNullOrWhiteSpace(radiusText)?null:Length(radiusText),string.IsNullOrWhiteSpace(angleText)?null:Angle(angleText));+ lattice=new LatticeSpec(region.Bounds,shellSettings.MasterCellsR,shellSettings.MasterCellsS,1);+ var sourceThickness=region.Bounds.Max.Z-region.Bounds.Min.Z;+ if(double.IsFinite(shellSettings.ThicknessMeters)&&double.Abs(sourceThickness-shellSettings.ThicknessMeters)>double.Max(1e-12,sourceThickness*1e-9))+ diagnostics.Add(Error("thinwall-thickness-source-mismatch",$"ExperimentalShell Thickness ({shellSettings.ThicknessMeters:R} m) must match the native/synthetic body's semantic thickness ({sourceThickness:R} m) in X0.",sourcePath));+ }var requested=new HashSet<AnalysisResultField>();foreach(var item in (Scalar(block,"results")??"Displacement,Strain,Stress,ReactionForce").Trim('[',']').Split(',',StringSplitOptions.RemoveEmptyEntries|StringSplitOptions.TrimEntries)){if(Enum.TryParse<AnalysisResultField>(item,true,out var field))requested.Add(field);else diagnostics.Add(Error("fea-invalid-result-request",$"Analysis result '{item}' is unsupported.",sourcePath));}if(requested.Count==0){diagnostics.Add(Error("fea-invalid-result-request","Analysis must request at least one supported result field.",sourcePath));return Done(null,diagnostics,started);}- var bodyProv=new AnalysisProvenance(sourcePath??"<memory>",match.Index,match.Length,"body "+bodyId,ExactBrepFaceId:brepBodyId);var ir=new LinearElasticAnalysisIr(match.Groups["name"].Value,AnalysisKind.LinearStaticElasticity,new(bodyId,sourceKind,region,brepBodyId,resourceHash,bodyProv),[material],constraints,loads,requested,lattice,analysisSpan);+ var bodyProv=new AnalysisProvenance(sourcePath??"<memory>",match.Index,match.Length,"body "+bodyId,ExactBrepFaceId:brepBodyId);var ir=new LinearElasticAnalysisIr(match.Groups["name"].Value,AnalysisKind.LinearStaticElasticity,new(bodyId,sourceKind,region,brepBodyId,resourceHash,bodyProv),[material],constraints,loads,requested,lattice,analysisSpan,mode,shellSettings);diagnostics.AddRange(AnalysisIrValidator.Validate(ir));return Done(ir,diagnostics,started);}@@ -212,6 +235,10 @@ public static class FirmamentAnalysisCompilerprivate static int MatchingBrace(string source,int open){var depth=0;for(var i=open;i<source.Length;i++){if(source[i]=='{')depth++;else if(source[i]=='}'&&--depth==0)return i;}return-1;}private static double? UnitScale(string unit)=>unit.ToLowerInvariant() switch{"m"=>1,"cm"=>.01,"mm"=>.001,_=>null};private static double Number(string? text)=>double.Parse(text??"NaN",NumberStyles.Float,CultureInfo.InvariantCulture);+ private static double ScalarNumber(string? text)=>double.TryParse(text,NumberStyles.Float,CultureInfo.InvariantCulture,out var value)?value:double.NaN;+ private static int OptionalInteger(string? text,int defaultValue){if(string.IsNullOrWhiteSpace(text))return defaultValue;var value=ScalarNumber(text);return double.IsInteger(value)&&value>=int.MinValue&&value<=int.MaxValue?(int)value:int.MinValue;}+ private static double Length(string? text){if(text is null)return double.NaN;var m=Regex.Match(text,@"^(?<v>[-+0-9.eE]+)\s*(?<u>mm|cm|m)$",RegexOptions.IgnoreCase);if(!m.Success)return double.NaN;return Number(m.Groups["v"].Value)*(UnitScale(m.Groups["u"].Value)??double.NaN);}+ private static double Angle(string? text){if(text is null)return double.NaN;var m=Regex.Match(text,@"^(?<v>[-+0-9.eE]+)\s*(?<u>deg|rad)$",RegexOptions.IgnoreCase);if(!m.Success)return double.NaN;var value=Number(m.Groups["v"].Value);return m.Groups["u"].Value.Equals("deg",StringComparison.OrdinalIgnoreCase)?value*double.Pi/180:value;}private static double Stress(string? text){if(text is null)return double.NaN;var m=Regex.Match(text,@"^(?<v>[-+0-9.eE]+)\s*(?<u>GPa|MPa|kPa|Pa)$",RegexOptions.IgnoreCase);if(!m.Success)return double.NaN;var v=Number(m.Groups["v"].Value);return v*(m.Groups["u"].Value.ToLowerInvariant() switch{"gpa"=>1e9,"mpa"=>1e6,"kpa"=>1e3,_=>1});}private static double? Density(string? text){if(string.IsNullOrWhiteSpace(text))return null;var m=Regex.Match(text,@"^(?<v>[-+0-9.eE]+)\s*kg/m3$",RegexOptions.IgnoreCase);return m.Success?Number(m.Groups["v"].Value):double.NaN;}private static double[] Numbers(string? text)=>Regex.Matches(text??"",@"[-+0-9.eE]+").Select(m=>Number(m.Value)).ToArray();diff --git a/Aetheris.FEA/Mechanics/LinearElasticSolver.cs b/Aetheris.FEA/Mechanics/LinearElasticSolver.csindex 0828fdc5..02ddc15f 100644--- a/Aetheris.FEA/Mechanics/LinearElasticSolver.cs+++ b/Aetheris.FEA/Mechanics/LinearElasticSolver.cs@@ -30,6 +30,7 @@ public static class LinearElasticSolverpublic static LinearElasticAnalysisResult Solve(LinearElasticAnalysisIr analysis, MechanicsSolveOptions? options = null){+ if(analysis.Mode==AnalysisMode.ExperimentalShell)return ThinWallFiniteCellSolver.Solve(analysis,options);options ??= new MechanicsSolveOptions();var diagnostics = AnalysisIrValidator.Validate(analysis).ToList();if (diagnostics.Any(item => item.Severity == AnalysisDiagnosticSeverity.Error)) return Failure(analysis, diagnostics);diff --git a/Aetheris.FEA/Mechanics/MechanicsModels.cs b/Aetheris.FEA/Mechanics/MechanicsModels.csindex a2876559..3479b147 100644--- a/Aetheris.FEA/Mechanics/MechanicsModels.cs+++ b/Aetheris.FEA/Mechanics/MechanicsModels.cs@@ -37,6 +37,27 @@ public sealed record SparseSystemMetrics(int DegreesOfFreedom, int Nonzeros, doupublic sealed record EquilibriumResult(Vector3D AppliedForceNewton, Vector3D ReactionForceNewton, Vector3D ResidualNewton);public sealed record StrainEnergyConsistency(double AlgebraicJoule,double IntegratedContinuumJoule,double AbsoluteResidualJoule,double RelativeResidual);public sealed record ExactStressProbe(string Label,Point3D Position,SymmetricTensor StressPascal,double HoopStressPascal,double KirschReferencePascal,double AbsoluteErrorPascal,string ReferenceAssumptions);+public sealed record ExperimentalShellEvidence(+ string Qualification,+ string GeometryMapType,+ BoundingBox3D MasterDomain,+ int MasterCellsR,+ int MasterCellsS,+ int PolynomialOrder,+ string Basis,+ double ThicknessMeters,+ double FictitiousStiffnessFactor,+ int QuadratureOrder,+ int MaxSubdivisionDepth,+ int InteriorCells,+ int CutCells,+ int FictitiousCells,+ int CutSubcellCount,+ double MinimumPhysicalCutFraction,+ double MinimumJacobianDeterminant,+ double MaximumJacobianDeterminant,+ IReadOnlyList<double> StressEvaluationThroughThicknessCoordinates,+ string DeterministicDiscretizationHash);public enum ImmersedBasisTreatmentKind { Ordinary, Aggregated }public enum BoundaryEnforcementKind { StrongNearestNode, SymmetricNitsche }@@ -64,7 +85,8 @@ public sealed record LinearElasticAnalysisResult(StrainEnergyConsistency? StrainEnergy=null,IReadOnlyList<ExactStressProbe>? StressProbes=null,IReadOnlyList<CellStrainResult>? StrainFields=null,- IReadOnlyList<CellStressResult>? StressFields=null)+ IReadOnlyList<CellStressResult>? StressFields=null,+ ExperimentalShellEvidence? ExperimentalShell=null){public double MaximumDisplacementMeters => Displacements.Count == 0 ? 0 : Displacements.Max(item => item.DisplacementMeters.Length);public double MaximumVonMisesPascal => StressFields is { Count: >0 }?StressFields.Max(item=>item.VonMisesPascal):CellFields.Count == 0 ? 0 : CellFields.Max(item => item.VonMisesPascal);diff --git a/Aetheris.FEA/Mechanics/ThinWallDebugArtifacts.cs b/Aetheris.FEA/Mechanics/ThinWallDebugArtifacts.csnew file mode 100644index 00000000..5a1e2bee--- /dev/null+++ b/Aetheris.FEA/Mechanics/ThinWallDebugArtifacts.cs@@ -0,0 +1,63 @@+using System.Globalization;+using System.Text;+using Aetheris.Continuum.Cir;+using Aetheris.Continuum.Regions.Analytic;+using Aetheris.FEA.Analysis;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.FEA.Mechanics;++/// <summary>Deterministic diagnostic views for the experimental parameter grid and mapped solution.</summary>+public static class ThinWallDebugArtifacts+{+ public static string ParameterDomainSvg(LinearElasticAnalysisIr analysis)+ {+ var settings=analysis.ExperimentalShell??throw new ArgumentException("ExperimentalShell settings are required.",nameof(analysis));+ var bounds=analysis.Body.ContinuumRegion.Bounds;var classifier=(IBoundsClassificationCapability)analysis.Body.ContinuumRegion;+ const double ox=50,oy=35,w=520,h=340;var dx=(bounds.Max.X-bounds.Min.X)/settings.MasterCellsR;var dy=(bounds.Max.Y-bounds.Min.Y)/settings.MasterCellsS;+ double X(double value)=>ox+(value-bounds.Min.X)/(bounds.Max.X-bounds.Min.X)*w;+ double Y(double value)=>oy+h-(value-bounds.Min.Y)/(bounds.Max.Y-bounds.Min.Y)*h;+ var svg=Start("ExperimentalShell parameter domain",640,420);+ for(var j=0;j<settings.MasterCellsS;j++)for(var i=0;i<settings.MasterCellsR;i++)+ {+ var cell=new BoundingBox3D(new(bounds.Min.X+i*dx,bounds.Min.Y+j*dy,bounds.Min.Z),new(bounds.Min.X+(i+1)*dx,bounds.Min.Y+(j+1)*dy,bounds.Max.Z));+ var kind=classifier.ClassifyBounds(cell);var fill=kind switch{ContinuumBoundsClassification.Inside=>"#b7e4c7",ContinuumBoundsClassification.Outside=>"#e5e7eb",_=>"#ffd166"};+ svg.Append(Invariant($"<rect x='{X(cell.Min.X)}' y='{Y(cell.Max.Y)}' width='{w/settings.MasterCellsR}' height='{h/settings.MasterCellsS}' fill='{fill}' stroke='#334155' stroke-width='2'/><text x='{X(cell.Min.X)+8}' y='{Y(cell.Max.Y)+20}' font-size='12'>{i},{j} {kind}</text>"));+ }+ if(analysis.Body.ContinuumRegion is BlockWithCylindricalHoleRegion hole)+ svg.Append(Invariant($"<circle cx='{X(hole.HoleCenter.X)}' cy='{Y(hole.HoleCenter.Y)}' r='{hole.HoleRadius/(bounds.Max.X-bounds.Min.X)*w}' fill='white' stroke='#dc2626' stroke-width='3'/>") );+ svg.Append(Invariant($"<text x='{ox}' y='400' font-size='13'>grid {settings.MasterCellsR}x{settings.MasterCellsS}; p={settings.PolynomialOrder}; alpha={settings.FictitiousStiffnessFactor:R}; depth={settings.MaxSubdivisionDepth}</text></g></svg>"));+ return svg.ToString();+ }++ public static string MappedAndDeformedSvg(LinearElasticAnalysisIr analysis,LinearElasticAnalysisResult result)+ {+ var settings=analysis.ExperimentalShell??throw new ArgumentException("ExperimentalShell settings are required.",nameof(analysis));var bounds=analysis.Body.ContinuumRegion.Bounds;+ var map=new ThinWallGeometryMap(settings,bounds);const double ox=55,oy=330,w=760,h=255;var maxU=double.Max(result.MaximumDisplacementMeters,1e-30);var span=double.Max(bounds.Max.X-bounds.Min.X,bounds.Max.Y-bounds.Min.Y);var scale=.12*span/maxU;+ (double X,double Y) Project(Point3D p)=>(ox+(p.X+.25*p.Y-bounds.Min.X)/span*w,oy-p.Z/span*h*8);+ var displacements=result.Displacements.ToDictionary(item=>Round(item.Position),item=>item.DisplacementMeters);var svg=Start("Mapped cells and amplified deformation",880,390);+ for(var j=0;j<=settings.MasterCellsS;j++)for(var i=0;i<settings.MasterCellsR;i++)Line(i,j,i+1,j);+ for(var i=0;i<=settings.MasterCellsR;i++)for(var j=0;j<settings.MasterCellsS;j++)Line(i,j,i,j+1);+ svg.Append(Invariant($"<text x='55' y='370' font-size='13'>blue: mapped midsurface; red: deformation amplified {scale:R}x (diagnostic only)</text></g></svg>"));return svg.ToString();++ void Line(int i0,int j0,int i1,int j1)+ {+ var r0=bounds.Min.X+(bounds.Max.X-bounds.Min.X)*i0/settings.MasterCellsR;var s0=bounds.Min.Y+(bounds.Max.Y-bounds.Min.Y)*j0/settings.MasterCellsS;+ var r1=bounds.Min.X+(bounds.Max.X-bounds.Min.X)*i1/settings.MasterCellsR;var s1=bounds.Min.Y+(bounds.Max.Y-bounds.Min.Y)*j1/settings.MasterCellsS;+ var p0=map.Evaluate(r0,s0,0).Position;var p1=map.Evaluate(r1,s1,0).Position;var a=Project(p0);var b=Project(p1);+ svg.Append(Invariant($"<line x1='{a.X}' y1='{a.Y}' x2='{b.X}' y2='{b.Y}' stroke='#2563eb' stroke-width='2'/>") );+ var d0=Displacement(r0,s0,p0);var d1=Displacement(r1,s1,p1);var da=Project(p0+d0*scale);var db=Project(p1+d1*scale);+ svg.Append(Invariant($"<line x1='{da.X}' y1='{da.Y}' x2='{db.X}' y2='{db.Y}' stroke='#dc2626' stroke-width='2'/>") );+ }+ Vector3D Displacement(double r,double s,Point3D p)+ {+ var top=map.Evaluate(r,s,1).Position;+ if(displacements.TryGetValue(Round(top),out var value))return value;+ return result.Displacements.OrderBy(item=>(item.Position-p).LengthSquared).FirstOrDefault()?.DisplacementMeters??Vector3D.Zero;+ }+ }++ private static string Round(Point3D p)=>Invariant($"{p.X:F12}|{p.Y:F12}|{p.Z:F12}");+ private static StringBuilder Start(string title,int width,int height)=>new StringBuilder(Invariant($"<svg xmlns='http://www.w3.org/2000/svg' width='{width}' height='{height}' viewBox='0 0 {width} {height}'><rect width='100%' height='100%' fill='white'/><text x='24' y='24' font-family='sans-serif' font-size='17' font-weight='bold'>{title}</text><g font-family='sans-serif'>"));+ private static string Invariant(FormattableString value)=>value.ToString(CultureInfo.InvariantCulture);+}diff --git a/Aetheris.FEA/Mechanics/ThinWallFiniteCellSolver.cs b/Aetheris.FEA/Mechanics/ThinWallFiniteCellSolver.csnew file mode 100644index 00000000..83e40e41--- /dev/null+++ b/Aetheris.FEA/Mechanics/ThinWallFiniteCellSolver.cs@@ -0,0 +1,302 @@+using System.Diagnostics;+using System.Globalization;+using System.Security.Cryptography;+using System.Text;+using Aetheris.Continuum.Cir;+using Aetheris.Kernel.Core.Math;+using Aetheris.FEA.Analysis;++namespace Aetheris.FEA.Mechanics;++/// <summary>+/// Experimental shell-aligned finite cells with three translational unknowns and the+/// ordinary three-dimensional small-strain constitutive law. This is not a shell element.+/// </summary>+public static class ThinWallFiniteCellSolver+{+ private readonly record struct AxisKey(bool IsVertex,int Location,int Mode);+ private readonly record struct BasisKey(AxisKey R,AxisKey S,AxisKey T);+ private readonly record struct LocalMode(int R,int S,int T);+ private readonly record struct QuadraturePoint(double Xi,double Eta,double Zeta,Point3D Position,double Weight,Vector3D GradXi,Vector3D GradEta,Vector3D GradZeta,bool Physical,double ElementDeterminant);+ private sealed record CellPlan(int I,int J,double R0,double R1,double S0,double S1,int[] Global,IReadOnlyList<QuadraturePoint> Points,ContinuumBoundsClassification Classification,double PhysicalFraction,int CutLeaves);+ private readonly record struct BoundaryFace(int Axis,bool Maximum,string Token);++ public static LinearElasticAnalysisResult Solve(LinearElasticAnalysisIr analysis,MechanicsSolveOptions? options=null)+ {+ options??=new MechanicsSolveOptions(RelativeResidualTolerance:1e-8,MaximumIterations:10000);var diagnostics=AnalysisIrValidator.Validate(analysis).ToList();+ if(analysis.Mode!=AnalysisMode.ExperimentalShell||analysis.ExperimentalShell is null)+ {+ diagnostics.Add(new("thinwall-mode-required",AnalysisDiagnosticSeverity.Error,"ThinWallFiniteCellSolver requires explicit ExperimentalShell mode.",analysis.Provenance));+ return Failure(analysis,diagnostics);+ }+ if(diagnostics.Any(x=>x.Severity==AnalysisDiagnosticSeverity.Error))return Failure(analysis,diagnostics);+ if(options.DomainTransform is not null)+ {+ diagnostics.Add(new("thinwall-geometry-unsupported",AnalysisDiagnosticSeverity.Error,"ExperimentalShell X0 does not apply the production world-space lattice rotation option.",analysis.Provenance));+ return Failure(analysis,diagnostics);+ }+ if(analysis.Body.ContinuumRegion is not IBoundsClassificationCapability classifier)+ {+ diagnostics.Add(new("thinwall-boundary-invalid",AnalysisDiagnosticSeverity.Error,"ExperimentalShell X0 requires exact parameter-space bounds classification.",analysis.Body.Provenance));+ return Failure(analysis,diagnostics);+ }++ var settings=analysis.ExperimentalShell;var bounds=analysis.Body.ContinuumRegion.Bounds;+ ThinWallGeometryMap geometry;+ try{geometry=new(settings,bounds);}catch(ThinWallMapException ex){diagnostics.Add(new(ex.Code,AnalysisDiagnosticSeverity.Error,ex.Message,analysis.Provenance));return Failure(analysis,diagnostics);}+ var p=settings.PolynomialOrder;var qOrder=settings.QuadratureOrder??p+1;var modes=LocalModesFor(p);var nx=settings.MasterCellsR;var ny=settings.MasterCellsS;+ var dr=(bounds.Max.X-bounds.Min.X)/nx;var ds=(bounds.Max.Y-bounds.Min.Y)/ny;+ var allKeys=new List<BasisKey>();+ for(var j=0;j<ny;j++)for(var i=0;i<nx;i++)foreach(var mode in modes)allKeys.Add(Key(i,j,mode));+ var orderedKeys=allKeys.Distinct().OrderBy(k=>AxisSort(k.T)).ThenBy(k=>AxisSort(k.S)).ThenBy(k=>AxisSort(k.R)).ToArray();+ var globalId=orderedKeys.Select((key,index)=>(key,index)).ToDictionary(x=>x.key,x=>x.index);++ var domainStart=Stopwatch.GetTimestamp();var plans=new List<CellPlan>();var minDet=double.PositiveInfinity;var maxDet=double.NegativeInfinity;+ for(var j=0;j<ny;j++)for(var i=0;i<nx;i++)+ {+ var r0=bounds.Min.X+i*dr;var r1=r0+dr;var s0=bounds.Min.Y+j*ds;var s1=s0+ds;+ var classification=classifier.ClassifyBounds(new(new(r0,s0,bounds.Min.Z),new(r1,s1,bounds.Max.Z)));+ var points=new List<QuadraturePoint>();var physicalVolume=0d;var totalVolume=0d;var cutLeaves=0;+ try{IntegrateRectangle(r0,r1,s0,s1,0,classification==ContinuumBoundsClassification.Cut?null:classification==ContinuumBoundsClassification.Inside,points,ref physicalVolume,ref totalVolume,ref cutLeaves);}+ catch(ThinWallMapException ex){diagnostics.Add(new(ex.Code,AnalysisDiagnosticSeverity.Error,ex.Message,analysis.Provenance));return Failure(analysis,diagnostics);}+ foreach(var point in points){minDet=double.Min(minDet,point.ElementDeterminant);maxDet=double.Max(maxDet,point.ElementDeterminant);}+ var globals=modes.Select(mode=>globalId[Key(i,j,mode)]).ToArray();+ plans.Add(new(i,j,r0,r1,s0,s1,globals,points,classification,totalVolume==0?0:physicalVolume/totalVolume,cutLeaves));++ void IntegrateRectangle(double ar0,double ar1,double as0,double as1,int depth,bool? allPhysical,List<QuadraturePoint> target,ref double physical,ref double total,ref int leaves)+ {+ bool? state=allPhysical;+ if(state is null&&depth<settings.MaxSubdivisionDepth)+ {+ var rm=(ar0+ar1)/2;var sm=(as0+as1)/2;+ foreach(var child in new[]{(ar0,rm,as0,sm),(rm,ar1,as0,sm),(ar0,rm,sm,as1),(rm,ar1,sm,as1)})+ {+ var c=classifier.ClassifyBounds(new(new(child.Item1,child.Item3,bounds.Min.Z),new(child.Item2,child.Item4,bounds.Max.Z)));+ IntegrateRectangle(child.Item1,child.Item2,child.Item3,child.Item4,depth+1,c==ContinuumBoundsClassification.Cut?null:c==ContinuumBoundsClassification.Inside,target,ref physical,ref total,ref leaves);+ }+ return;+ }+ if(state is null)leaves++;+ var gauss=Gauss(qOrder);+ foreach(var gr in gauss)foreach(var gs in gauss)foreach(var gt in gauss)+ {+ var r=(ar0+ar1)/2+gr.X*(ar1-ar0)/2;var s=(as0+as1)/2+gs.X*(as1-as0)/2;var t=gt.X;+ var isPhysical=state??analysis.Body.ContinuumRegion.Classify(new(r,s,(bounds.Min.Z+bounds.Max.Z)/2))!=ContinuumPointClassification.Outside;+ var mapped=geometry.Evaluate(r,s,t);var a=mapped.DerivativeR*(dr/2);var b=mapped.DerivativeS*(ds/2);var c=mapped.DerivativeT;var det=a.Dot(b.Cross(c));+ if(!double.IsFinite(det)||det==0)throw new ThinWallMapException("thinwall-map-singular",$"Thin-wall map Jacobian is singular or nonfinite at ({r:R},{s:R},{t:R}).");+ if(det<0)throw new ThinWallMapException("thinwall-map-inverted",$"Thin-wall map Jacobian is inverted at ({r:R},{s:R},{t:R}); det(J)={det:R}.");+ var gradXi=b.Cross(c)*(1/det);var gradEta=c.Cross(a)*(1/det);var gradZeta=a.Cross(b)*(1/det);+ var rawWeight=gr.W*gs.W*gt.W*(ar1-ar0)/2*(as1-as0)/2*mapped.DerivativeR.Dot(mapped.DerivativeS.Cross(mapped.DerivativeT));+ if(!double.IsFinite(rawWeight)||rawWeight<=0)throw new ThinWallMapException("thinwall-cut-integration-failed","Thin-wall quadrature produced a nonpositive or nonfinite physical weight.");+ total+=rawWeight;if(isPhysical)physical+=rawWeight;+ target.Add(new(2*(r-r0)/dr-1,2*(s-s0)/ds-1,t,mapped.Position,rawWeight*(isPhysical?1:settings.FictitiousStiffnessFactor),gradXi,gradEta,gradZeta,isPhysical,det));+ }+ }+ }+ var domainTime=Stopwatch.GetElapsedTime(domainStart);+ if(diagnostics.Any(x=>x.Severity==AnalysisDiagnosticSeverity.Error)||plans.Count==0)return Failure(analysis,diagnostics);++ var dofs=checked(orderedKeys.Length*3);var matrix=new SparseSymmetricMatrix(dofs);var load=new double[dofs];var constitutive=Constitutive(analysis.Materials.Single().YoungsModulusPascal,analysis.Materials.Single().PoissonRatio);+ var assemblyStart=Stopwatch.GetTimestamp();+ try+ {+ foreach(var cell in plans)+ {+ var localDofs=modes.Count*3;var local=new double[localDofs,localDofs];+ foreach(var point in cell.Points)+ {+ var b=BMatrix(p,modes,point);var db=new double[6,localDofs];+ for(var row=0;row<6;row++)for(var column=0;column<localDofs;column++)for(var k=0;k<6;k++)db[row,column]+=constitutive[row,k]*b[k,column];+ for(var row=0;row<localDofs;row++)for(var column=0;column<localDofs;column++)+ {+ var value=0d;for(var k=0;k<6;k++)value+=b[k,row]*db[k,column];local[row,column]+=value*point.Weight;+ }+ }+ for(var a=0;a<modes.Count;a++)for(var ca=0;ca<3;ca++)for(var b=0;b<modes.Count;b++)for(var cb=0;cb<3;cb++)matrix.Add(3*cell.Global[a]+ca,3*cell.Global[b]+cb,local[3*a+ca,3*b+cb]);+ }+ }+ catch(ArithmeticException ex){diagnostics.Add(new("thinwall-cut-integration-failed",AnalysisDiagnosticSeverity.Error,ex.Message,analysis.Provenance));return Failure(analysis,diagnostics);}+ var assemblyTime=Stopwatch.GetElapsedTime(assemblyStart);var volumeMatrix=matrix.Copy();++ var boundaryStart=Stopwatch.GetTimestamp();var loadEvidence=new List<BoundaryLoadEvidence>();var applied=Vector3D.Zero;+ foreach(var item in analysis.Loads)+ {+ if(!TryFace(item.Region.Path,out var face)){diagnostics.Add(new("thinwall-boundary-condition-unsupported",AnalysisDiagnosticSeverity.Error,$"ExperimentalShell X0 boundary '{item.Region.Path}' is not an exact master-domain face.",item.Provenance));continue;}+ var weights=new Dictionary<int,double>();var pressureForces=new Dictionary<int,Vector3D>();var area=0d;var firstMoment=Vector3D.Zero;var pressureResultant=Vector3D.Zero;var pressureMoment=Vector3D.Zero;+ foreach(var cell in BoundaryCells(plans,face,nx,ny))+ {+ foreach(var sample in BoundarySamples(cell,face,qOrder,geometry,bounds))+ {+ if(analysis.Body.ContinuumRegion.Classify(new(sample.R,sample.S,(bounds.Min.Z+bounds.Max.Z)/2))==ContinuumPointClassification.Outside)continue;+ area+=sample.Weight;firstMoment+=new Vector3D(sample.Position.X,sample.Position.Y,sample.Position.Z)*sample.Weight;+ var values=BasisValues(p,modes,sample.Xi,sample.Eta,sample.Zeta);+ for(var n=0;n<modes.Count;n++)+ {+ var shape=values[n];if(double.Abs(shape)<1e-15)continue;var id=cell.Global[n];weights[id]=weights.GetValueOrDefault(id)+shape*sample.Weight;+ if(item.Kind==BoundaryLoadKind.Pressure)+ {+ var f=sample.Normal*(-item.PressurePascal*shape*sample.Weight);pressureForces[id]=pressureForces.GetValueOrDefault(id)+f;+ }+ }+ if(item.Kind==BoundaryLoadKind.Pressure){var f=sample.Normal*(-item.PressurePascal*sample.Weight);pressureResultant+=f;pressureMoment+=new Vector3D(sample.Position.X,sample.Position.Y,sample.Position.Z).Cross(f);}+ }+ }+ if(area<=0){diagnostics.Add(new("thinwall-boundary-invalid",AnalysisDiagnosticSeverity.Error,$"Boundary '{item.Region.Path}' selected no physical area.",item.Provenance));continue;}+ Vector3D resultant;Vector3D moment;+ if(item.Kind==BoundaryLoadKind.Pressure)+ {+ foreach(var pair in pressureForces){load[3*pair.Key]+=pair.Value.X;load[3*pair.Key+1]+=pair.Value.Y;load[3*pair.Key+2]+=pair.Value.Z;}+ resultant=pressureResultant;moment=pressureMoment;+ }+ else+ {+ var traction=item.Kind==BoundaryLoadKind.ResultantForce?item.VectorSi*(1/area):item.VectorSi;+ foreach(var pair in weights){var f=traction*pair.Value;load[3*pair.Key]+=f.X;load[3*pair.Key+1]+=f.Y;load[3*pair.Key+2]+=f.Z;}+ resultant=traction*area;var centroid=firstMoment/area;moment=centroid.Cross(resultant);+ }+ applied+=resultant;+ loadEvidence.Add(new(item.Id,item.Region.Path,face.Token,null,area,area,resultant,resultant,moment,moment,0,0,BoundaryCells(plans,face,nx,ny).Count,qOrder*qOrder*BoundaryCells(plans,face,nx,ny).Count,"Exact master-face quadrature with semantic parameter-space trimming"));+ }+ var prescribed=new Dictionary<int,double>();var constrainedById=new Dictionary<string,HashSet<int>>(StringComparer.Ordinal);+ foreach(var constraint in analysis.Constraints)+ {+ if(!TryFace(constraint.Region.Path,out var face)){diagnostics.Add(new("thinwall-boundary-condition-unsupported",AnalysisDiagnosticSeverity.Error,$"ExperimentalShell X0 constraint '{constraint.Region.Path}' is not an exact master-domain face.",constraint.Provenance));continue;}+ var selected=orderedKeys.Select((key,id)=>(key,id)).Where(x=>OnFace(x.key,face,nx,ny)).Select(x=>x.id).ToHashSet();+ if(selected.Count==0){diagnostics.Add(new("thinwall-boundary-invalid",AnalysisDiagnosticSeverity.Error,$"Constraint '{constraint.Id}' selected no basis trace.",constraint.Provenance));continue;}+ constrainedById[constraint.Id]=selected;+ foreach(var id in selected)foreach(var component in constraint.Components)+ prescribed[3*id+(int)component]=orderedKeys[id].R.IsVertex&&orderedKeys[id].S.IsVertex&&orderedKeys[id].T.IsVertex?Component(constraint.ValueMeters,component):0;+ }+ var boundaryTime=Stopwatch.GetElapsedTime(boundaryStart);+ if(diagnostics.Any(x=>x.Severity==AnalysisDiagnosticSeverity.Error))return Failure(analysis,diagnostics);++ var rawMatrix=matrix.Copy();var rawLoad=(double[])load.Clone();matrix.ApplyDirichlet(prescribed,load);var solveStart=Stopwatch.GetTimestamp();+ var (solution,convergence)=PreconditionedConjugateGradient.Solve(matrix,load,options.RelativeResidualTolerance,options.MaximumIterations);var solveTime=Stopwatch.GetElapsedTime(solveStart);+ if(!convergence.Converged){diagnostics.Add(new("thinwall-linear-solve-failed",AnalysisDiagnosticSeverity.Error,$"ExperimentalShell PCG did not converge after {convergence.Iterations} iterations; residual {convergence.FinalResidual:R}.",analysis.Provenance));return Failure(analysis,diagnostics,convergence);}+ if(solution.Any(x=>!double.IsFinite(x))){diagnostics.Add(new("thinwall-result-nonfinite",AnalysisDiagnosticSeverity.Error,"ExperimentalShell solve produced a nonfinite displacement coefficient.",analysis.Provenance));return Failure(analysis,diagnostics,convergence);}++ var recoveryStart=Stopwatch.GetTimestamp();var displacements=new List<NodalDisplacement>();+ foreach(var pair in orderedKeys.Select((key,id)=>(key,id)).Where(x=>x.key.R.IsVertex&&x.key.S.IsVertex&&x.key.T.IsVertex))+ {+ var r=bounds.Min.X+pair.key.R.Location*dr;var s=bounds.Min.Y+pair.key.S.Location*ds;var t=pair.key.T.Location==0?-1d:1d;var position=geometry.Evaluate(r,s,t).Position;+ displacements.Add(new(pair.id,position,new(solution[3*pair.id],solution[3*pair.id+1],solution[3*pair.id+2])));+ }+ var fields=new List<CellFieldResult>();+ foreach(var cell in plans.Where(x=>x.PhysicalFraction>0))foreach(var t in new[]{-1d,0d,1d})+ {+ var r=(cell.R0+cell.R1)/2;var s=(cell.S0+cell.S1)/2;if(analysis.Body.ContinuumRegion.Classify(new(r,s,(bounds.Min.Z+bounds.Max.Z)/2))==ContinuumPointClassification.Outside)continue;+ var mapped=geometry.Evaluate(r,s,t);var a=mapped.DerivativeR*(dr/2);var b=mapped.DerivativeS*(ds/2);var c=mapped.DerivativeT;var det=a.Dot(b.Cross(c));+ if(det<=0||!double.IsFinite(det)){diagnostics.Add(new(det<0?"thinwall-map-inverted":"thinwall-map-singular",AnalysisDiagnosticSeverity.Error,"Thin-wall recovery encountered an invalid Jacobian.",analysis.Provenance));return Failure(analysis,diagnostics,convergence);}+ var point=new QuadraturePoint(0,0,t,mapped.Position,0,b.Cross(c)*(1/det),c.Cross(a)*(1/det),a.Cross(b)*(1/det),true,det);var bm=BMatrix(p,modes,point);var strain=new double[6];+ for(var row=0;row<6;row++)for(var n=0;n<modes.Count;n++)for(var component=0;component<3;component++)strain[row]+=bm[row,3*n+component]*solution[3*cell.Global[n]+component];+ var stress=Multiply(constitutive,strain);var st=new SymmetricTensor(stress[0],stress[1],stress[2],stress[3],stress[4],stress[5]);var et=new SymmetricTensor(strain[0],strain[1],strain[2],strain[3],strain[4],strain[5]);+ fields.Add(new(cell.I,cell.J,t<0?-1:t>0?1:0,mapped.Position,et,st,VonMises(st)));+ }+ var rawResidual=rawMatrix.Multiply(solution);for(var i=0;i<rawResidual.Length;i++)rawResidual[i]-=rawLoad[i];var reactions=new List<ReactionResult>();+ foreach(var constraint in analysis.Constraints)+ {+ var ids=constrainedById.GetValueOrDefault(constraint.Id,[]);var reaction=Vector3D.Zero;+ foreach(var id in ids.Where(id=>orderedKeys[id].R.IsVertex&&orderedKeys[id].S.IsVertex&&orderedKeys[id].T.IsVertex))+ {+ if(constraint.Components.Contains(DisplacementComponent.X))reaction+=new Vector3D(rawResidual[3*id],0,0);+ if(constraint.Components.Contains(DisplacementComponent.Y))reaction+=new Vector3D(0,rawResidual[3*id+1],0);+ if(constraint.Components.Contains(DisplacementComponent.Z))reaction+=new Vector3D(0,0,rawResidual[3*id+2]);+ }+ reactions.Add(new(constraint.Id,reaction));+ }+ var reactionTotal=reactions.Aggregate(Vector3D.Zero,(sum,x)=>sum+x.ForceNewton);var equilibrium=new EquilibriumResult(applied,reactionTotal,applied+reactionTotal);+ var energyValue=.5*Dot(solution,volumeMatrix.Multiply(solution));var integratedEnergy=0d;+ foreach(var cell in plans)foreach(var point in cell.Points)+ {+ var bm=BMatrix(p,modes,point);var strain=new double[6];+ for(var row=0;row<6;row++)for(var n=0;n<modes.Count;n++)for(var component=0;component<3;component++)strain[row]+=bm[row,3*n+component]*solution[3*cell.Global[n]+component];+ var stress=Multiply(constitutive,strain);integratedEnergy+=.5*Dot(strain,stress)*point.Weight;+ }+ var energyAbsolute=double.Abs(energyValue-integratedEnergy);var energyRelative=energyAbsolute/double.Max(double.Abs(energyValue),1e-30);+ var energy=new StrainEnergyConsistency(energyValue,integratedEnergy,energyAbsolute,energyRelative);var recoveryTime=Stopwatch.GetElapsedTime(recoveryStart);+ var conditioning=rawMatrix.ConditioningProxy();var cut=plans.Where(x=>x.Classification==ContinuumBoundsClassification.Cut).ToArray();var fractions=plans.Select(x=>x.PhysicalFraction).Order().ToArray();+ var system=new SparseSystemMetrics(dofs,rawMatrix.Nonzeros,rawMatrix.MaximumAsymmetry(),rawMatrix.IsFinite(),true,applied.Length,0,cut.Length,null,dofs,prescribed.Count,0,conditioning.MinimumDiagonal,conditioning.MaximumDiagonal,conditioning.DiagonalRatio,conditioning.MinimumRowNorm,conditioning.MaximumRowNorm,conditioning.RowNormRatio);+ var integrationFingerprint=string.Join(";",plans.Select(cell=>$"{cell.I},{cell.J},{cell.Classification},{cell.PhysicalFraction:R},{cell.Points.Count},{cell.Points.Count(point=>point.Physical)}"));+ var hash=Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(string.Join("|",orderedKeys)+$"|{nx}|{ny}|{p}|{qOrder}|{settings.FictitiousStiffnessFactor:R}|{settings.MaxSubdivisionDepth}|{settings.GeometryMap}|{integrationFingerprint}"))).ToLowerInvariant();+ var evidence=new ExperimentalShellEvidence("Experimental - not production-qualified",settings.GeometryMap.ToString(),bounds,nx,ny,p,"Tensor hierarchical integrated-Legendre p-space",settings.ThicknessMeters,settings.FictitiousStiffnessFactor,qOrder,settings.MaxSubdivisionDepth,+ plans.Count(x=>x.Classification==ContinuumBoundsClassification.Inside),cut.Length,plans.Count(x=>x.Classification==ContinuumBoundsClassification.Outside),plans.Sum(x=>x.CutLeaves),cut.Length==0?1:cut.Min(x=>x.PhysicalFraction),minDet,maxDet,[-1,0,1],hash);+ diagnostics.Add(new("thinwall-experimental",AnalysisDiagnosticSeverity.Warning,"ExperimentalShell is a research discretization and is not production-qualified FEA.",analysis.Provenance));+ var reportedDisplacements=analysis.RequestedFields.Contains(AnalysisResultField.Displacement)?displacements:[];var wantsStrain=analysis.RequestedFields.Contains(AnalysisResultField.Strain);var wantsStress=analysis.RequestedFields.Contains(AnalysisResultField.Stress);+ var reportedFields=wantsStrain&&wantsStress?fields:[];var strainFields=wantsStrain?fields.Select(x=>new CellStrainResult(x.I,x.J,x.K,x.Position,x.Strain)).ToArray():[];var stressFields=wantsStress?fields.Select(x=>new CellStressResult(x.I,x.J,x.K,x.Position,x.StressPascal,x.VonMisesPascal)).ToArray():[];+ return new(analysis.Id,true,convergence,reportedDisplacements,reportedFields,analysis.RequestedFields.Contains(AnalysisResultField.ReactionForce)?reactions:[],equilibrium,system,+ new(fractions.Length==0?0:fractions[0],fractions.Count(x=>x<.01),fractions.Count(x=>x<.05),fractions.Count(x=>x<.1),fractions),+ new(domainTime,TimeSpan.Zero,assemblyTime,boundaryTime,solveTime,recoveryTime,(long)rawMatrix.Nonzeros*(sizeof(double)+sizeof(int)),(long)(displacements.Count+fields.Count)*64),diagnostics,loadEvidence,null,energy,[],strainFields,stressFields,evidence);+ }++ private static IReadOnlyList<LocalMode> LocalModesFor(int p){var result=new List<LocalMode>();for(var t=0;t<=p;t++)for(var s=0;s<=p;s++)for(var r=0;r<=p;r++)result.Add(new(r,s,t));return result;}+ private static BasisKey Key(int i,int j,LocalMode m)=>new(Axis(i,m.R),Axis(j,m.S),Axis(0,m.T));+ private static AxisKey Axis(int cell,int mode)=>mode switch{0=>new(true,cell,0),1=>new(true,cell+1,0),_=>new(false,cell,mode)};+ private static string AxisSort(AxisKey key)=>$"{key.Location:D6}:{(key.IsVertex?0:1)}:{key.Mode:D3}";+ private static double Component(Vector3D value,DisplacementComponent component)=>component switch{DisplacementComponent.X=>value.X,DisplacementComponent.Y=>value.Y,_=>value.Z};++ private static double[,] BMatrix(int p,IReadOnlyList<LocalMode> modes,QuadraturePoint point)+ {+ var xr=OneDimensional(p,point.Xi);var xs=OneDimensional(p,point.Eta);var xt=OneDimensional(p,point.Zeta);var b=new double[6,modes.Count*3];+ for(var n=0;n<modes.Count;n++)+ {+ var m=modes[n];var dXi=xr.D[m.R]*xs.N[m.S]*xt.N[m.T];var dEta=xr.N[m.R]*xs.D[m.S]*xt.N[m.T];var dZeta=xr.N[m.R]*xs.N[m.S]*xt.D[m.T];var g=point.GradXi*dXi+point.GradEta*dEta+point.GradZeta*dZeta;var c=3*n;+ b[0,c]=g.X;b[1,c+1]=g.Y;b[2,c+2]=g.Z;b[3,c]=g.Y;b[3,c+1]=g.X;b[4,c+1]=g.Z;b[4,c+2]=g.Y;b[5,c]=g.Z;b[5,c+2]=g.X;+ }+ return b;+ }+ private static double[] BasisValues(int p,IReadOnlyList<LocalMode> modes,double xi,double eta,double zeta){var x=OneDimensional(p,xi).N;var y=OneDimensional(p,eta).N;var z=OneDimensional(p,zeta).N;return modes.Select(m=>x[m.R]*y[m.S]*z[m.T]).ToArray();}+ private static (double[] N,double[] D) OneDimensional(int p,double x)+ {+ var legendre=new double[p+1];var derivative=new double[p+1];legendre[0]=1;if(p>0){legendre[1]=x;derivative[1]=1;}+ for(var n=2;n<=p;n++){legendre[n]=((2*n-1)*x*legendre[n-1]-(n-1)*legendre[n-2])/n;derivative[n]=((2*n-1)*(legendre[n-1]+x*derivative[n-1])-(n-1)*derivative[n-2])/n;}+ var values=new double[p+1];var derivatives=new double[p+1];values[0]=(1-x)/2;values[1]=(1+x)/2;derivatives[0]=-.5;derivatives[1]=.5;+ for(var n=2;n<=p;n++){var scale=double.Sqrt(4*n-2);values[n]=(legendre[n]-legendre[n-2])/scale;derivatives[n]=(derivative[n]-derivative[n-2])/scale;}+ return(values,derivatives);+ }++ private static IReadOnlyList<(double X,double W)> Gauss(int order)+ {+ var result=new (double X,double W)[order];var half=(order+1)/2;+ for(var i=0;i<half;i++)+ {+ var z=double.Cos(double.Pi*(i+.75)/(order+.5));double derivative;+ for(var iteration=0;iteration<30;iteration++){var (pn,pnm1)=Legendre(order,z);derivative=order*(z*pn-pnm1)/(z*z-1);var next=z-pn/derivative;if(double.Abs(next-z)<1e-15){z=next;break;}z=next;}+ var final=Legendre(order,z);derivative=order*(z*final.Pn-final.Pnm1)/(z*z-1);var w=2/((1-z*z)*derivative*derivative);result[i]=(-z,w);result[order-1-i]=(z,w);+ }+ return result;+ }+ private static (double Pn,double Pnm1) Legendre(int n,double x){var p0=1d;if(n==0)return(1,1);var p1=x;for(var k=2;k<=n;k++){var p=((2*k-1)*x*p1-(k-1)*p0)/k;p0=p1;p1=p;}return(p1,p0);}+ private static double[,] Constitutive(double e,double nu){var d=new double[6,6];var factor=e/((1+nu)*(1-2*nu));var a=(1-nu)*factor;var b=nu*factor;var g=e/(2*(1+nu));d[0,0]=d[1,1]=d[2,2]=a;d[0,1]=d[0,2]=d[1,0]=d[1,2]=d[2,0]=d[2,1]=b;d[3,3]=d[4,4]=d[5,5]=g;return d;}+ private static double[] Multiply(double[,] matrix,IReadOnlyList<double> vector){var result=new double[matrix.GetLength(0)];for(var i=0;i<result.Length;i++)for(var j=0;j<vector.Count;j++)result[i]+=matrix[i,j]*vector[j];return result;}+ private static double Dot(IReadOnlyList<double> a,IReadOnlyList<double> b){var result=0d;for(var i=0;i<a.Count;i++)result+=a[i]*b[i];return result;}+ private static double VonMises(SymmetricTensor s)=>double.Sqrt(.5*(double.Pow(s.XX-s.YY,2)+double.Pow(s.YY-s.ZZ,2)+double.Pow(s.ZZ-s.XX,2))+3*(s.XY*s.XY+s.YZ*s.YZ+s.XZ*s.XZ));++ private static bool TryFace(string path,out BoundaryFace face)+ {+ if(path.Contains("-X",StringComparison.OrdinalIgnoreCase)||path.Contains("x-min",StringComparison.OrdinalIgnoreCase)){face=new(0,false,"r-min");return true;}+ if(path.Contains("+X",StringComparison.OrdinalIgnoreCase)||path.Contains("x-max",StringComparison.OrdinalIgnoreCase)){face=new(0,true,"r-max");return true;}+ if(path.Contains("-Y",StringComparison.OrdinalIgnoreCase)||path.Contains("y-min",StringComparison.OrdinalIgnoreCase)){face=new(1,false,"s-min");return true;}+ if(path.Contains("+Y",StringComparison.OrdinalIgnoreCase)||path.Contains("y-max",StringComparison.OrdinalIgnoreCase)){face=new(1,true,"s-max");return true;}+ if(path.Contains("-Z",StringComparison.OrdinalIgnoreCase)||path.Contains("z-min",StringComparison.OrdinalIgnoreCase)){face=new(2,false,"t-min");return true;}+ if(path.Contains("+Z",StringComparison.OrdinalIgnoreCase)||path.Contains("z-max",StringComparison.OrdinalIgnoreCase)){face=new(2,true,"t-max");return true;}+ face=default;return false;+ }+ private static bool OnFace(BasisKey key,BoundaryFace face,int nx,int ny){var axis=face.Axis switch{0=>key.R,1=>key.S,_=>key.T};var max=face.Axis switch{0=>nx,1=>ny,_=>1};return axis.IsVertex&&axis.Location==(face.Maximum?max:0);}+ private static IReadOnlyList<CellPlan> BoundaryCells(IReadOnlyList<CellPlan> plans,BoundaryFace face,int nx,int ny)=>plans.Where(x=>face.Axis switch{0=>x.I==(face.Maximum?nx-1:0),1=>x.J==(face.Maximum?ny-1:0),_=>true}).ToArray();+ private readonly record struct BoundarySample(double R,double S,double Xi,double Eta,double Zeta,Point3D Position,Vector3D Normal,double Weight);+ private static IEnumerable<BoundarySample> BoundarySamples(CellPlan cell,BoundaryFace face,int order,ThinWallGeometryMap map,BoundingBox3D bounds)+ {+ var gauss=Gauss(order);+ foreach(var a in gauss)foreach(var b in gauss)+ {+ double r,s,t,xi,eta,zeta,scale;Vector3D tangentA,tangentB;+ if(face.Axis==0){r=face.Maximum?cell.R1:cell.R0;s=(cell.S0+cell.S1)/2+a.X*(cell.S1-cell.S0)/2;t=b.X;xi=face.Maximum?1:-1;eta=a.X;zeta=b.X;var e=map.Evaluate(r,s,t);tangentA=e.DerivativeS;tangentB=e.DerivativeT;scale=(cell.S1-cell.S0)/2;var cross=tangentA.Cross(tangentB);var normal=Normalize(cross);if(!face.Maximum)normal=-normal;yield return new(r,s,xi,eta,zeta,e.Position,normal,a.W*b.W*scale*cross.Length);}+ else if(face.Axis==1){r=(cell.R0+cell.R1)/2+a.X*(cell.R1-cell.R0)/2;s=face.Maximum?cell.S1:cell.S0;t=b.X;xi=a.X;eta=face.Maximum?1:-1;zeta=b.X;var e=map.Evaluate(r,s,t);tangentA=e.DerivativeT;tangentB=e.DerivativeR;scale=(cell.R1-cell.R0)/2;var cross=tangentA.Cross(tangentB);var normal=Normalize(cross);if(!face.Maximum)normal=-normal;yield return new(r,s,xi,eta,zeta,e.Position,normal,a.W*b.W*scale*cross.Length);}+ else{r=(cell.R0+cell.R1)/2+a.X*(cell.R1-cell.R0)/2;s=(cell.S0+cell.S1)/2+b.X*(cell.S1-cell.S0)/2;t=face.Maximum?1:-1;xi=a.X;eta=b.X;zeta=t;var e=map.Evaluate(r,s,t);tangentA=e.DerivativeR;tangentB=e.DerivativeS;scale=(cell.R1-cell.R0)*(cell.S1-cell.S0)/4;var cross=tangentA.Cross(tangentB);var normal=Normalize(cross);if(!face.Maximum)normal=-normal;yield return new(r,s,xi,eta,zeta,e.Position,normal,a.W*b.W*scale*cross.Length);}+ }+ }++ private static Vector3D Normalize(Vector3D value){var length=value.Length;if(!double.IsFinite(length)||length<=0)throw new ThinWallMapException("thinwall-map-singular","Thin-wall boundary map produced a singular surface Jacobian.");return value*(1/length);}++ private static LinearElasticAnalysisResult Failure(LinearElasticAnalysisIr analysis,IReadOnlyList<AnalysisDiagnostic> diagnostics,SolverConvergence? convergence=null)=>new(analysis.Id,false,convergence??new(false,0,0,0,[],TimeSpan.Zero),[],[],[],new(Vector3D.Zero,Vector3D.Zero,Vector3D.Zero),new(0,0,0,true,true,0,0),new(0,0,0,0,[]),new(TimeSpan.Zero,TimeSpan.Zero,TimeSpan.Zero,TimeSpan.Zero,TimeSpan.Zero,TimeSpan.Zero,0,0),diagnostics);+}diff --git a/Aetheris.FEA/Mechanics/ThinWallGeometryMap.cs b/Aetheris.FEA/Mechanics/ThinWallGeometryMap.csnew file mode 100644index 00000000..90d21fc3--- /dev/null+++ b/Aetheris.FEA/Mechanics/ThinWallGeometryMap.cs@@ -0,0 +1,57 @@+using Aetheris.FEA.Analysis;+using Aetheris.Kernel.Core.Math;++namespace Aetheris.FEA.Mechanics;++public readonly record struct ThinWallMapEvaluation(+ Point3D Position,+ Vector3D DerivativeR,+ Vector3D DerivativeS,+ Vector3D DerivativeT);++/// <summary>M(r,s,t) = m(r,s) + t k n(r,s), with t in [-1,1].</summary>+public sealed class ThinWallGeometryMap+{+ private readonly ExperimentalShellSettings settings;+ private readonly BoundingBox3D masterDomain;+ private readonly double midZ;++ public ThinWallGeometryMap(ExperimentalShellSettings settings,BoundingBox3D masterDomain)+ {+ this.settings=settings;this.masterDomain=masterDomain;midZ=(masterDomain.Min.Z+masterDomain.Max.Z)/2;+ if(settings.GeometryMap==ThinWallGeometryMapKind.Cylindrical)+ {+ var expected=settings.CylinderRadiusMeters!.Value*settings.CylinderAngleRadians!.Value;+ var actual=masterDomain.Max.Y-masterDomain.Min.Y;+ if(double.Abs(expected-actual)>double.Max(1e-12,expected*1e-9))+ throw new ThinWallMapException("thinwall-map-singular",$"Cylindrical master S span must equal radius times angle ({expected:R} m); got {actual:R} m.");+ }+ }++ public ThinWallMapEvaluation Evaluate(double r,double s,double t)+ {+ var half=settings.ThicknessMeters/2;+ if(settings.GeometryMap==ThinWallGeometryMapKind.Flat)+ return new(new(r,s,midZ+t*half),new(1,0,0),new(0,1,0),new(0,0,half));++ var radius=settings.CylinderRadiusMeters!.Value;+ var theta=(s-masterDomain.Min.Y)/radius;+ var sin=double.Sin(theta);var cos=double.Cos(theta);var current=radius+t*half;+ return new(+ new(r,current*sin,current*cos),+ new(1,0,0),+ new(0,current*cos/radius,-current*sin/radius),+ new(0,half*sin,half*cos));+ }++ public static double ElementJacobianDeterminant(ThinWallMapEvaluation value,double cellSpanR,double cellSpanS)+ {+ var dr=value.DerivativeR*(cellSpanR/2);var ds=value.DerivativeS*(cellSpanS/2);var dt=value.DerivativeT;+ return dr.Dot(ds.Cross(dt));+ }+}++public sealed class ThinWallMapException(string code,string message):Exception(message)+{+ public string Code { get; }=code;+}diff --git a/Aetheris.Forge.Host/ForgeHost.cs b/Aetheris.Forge.Host/ForgeHost.csindex ea27b436..d0d12aba 100644--- a/Aetheris.Forge.Host/ForgeHost.cs+++ b/Aetheris.Forge.Host/ForgeHost.cs@@ -243,6 +243,8 @@ public sealed class ForgeHostdiagnostics.AddRange(native.Diagnostics.Where(item => item.Severity == Aetheris.FEA.Analysis.AnalysisDiagnosticSeverity.Error).Select(item =>new ForgeDiagnostic(item.Code, ForgeDiagnosticSeverity.Error, item.Message, item.Provenance?.Source)));if (!native.IsSuccess) return new(compiled.Analysis, native, null, diagnostics, invocationTime, compiled.CompilationTime);+ if(compiled.Analysis.Mode==Aetheris.FEA.Analysis.AnalysisMode.ExperimentalShell)+ return new(compiled.Analysis,native,null,diagnostics,invocationTime,compiled.CompilationTime);var abaqus = AbaqusInpExporter.Export(compiled.Analysis,options?.DomainTransform);var validation = AbaqusInpValidator.Validate(abaqus.Text);if (!validation.IsValid) diagnostics.Add(Error("forge-analysis-abaqus-validation-failed", string.Join("; ", validation.Diagnostics), invocation.Module.SourcePath));diff --git a/docs/development/fea/FEA-SHELL-X0-PAPER-NOTES.md b/docs/development/fea/FEA-SHELL-X0-PAPER-NOTES.mdnew file mode 100644index 00000000..82644ddf--- /dev/null+++ b/docs/development/fea/FEA-SHELL-X0-PAPER-NOTES.md@@ -0,0 +1,55 @@+# FEA-SHELL-X0 source and implementation notes++## Source record++The cited source is E. Rank, S. Kollmannsberger, Ch. Sorger, and A. Düster, “Shell Finite Cell Method: A high order fictitious domain approach for thin-walled structures,” *Computer Methods in Applied Mechanics and Engineering* 200 (45–46), 3200–3209 (2011), [DOI 10.1016/j.cma.2011.06.005](https://doi.org/10.1016/j.cma.2011.06.005). The [TUM publication record](https://portal.fis.tum.de/en/publications/shell-finite-cell-method-a-high-order-fictitious-domain-approach-/) confirms the authors, bibliographic data, and abstract.++The full publisher text was not available in the implementation environment. Consequently, no equation numbers, exact trunk-space definition, or benchmark details are represented here as independently paper-verified. The revised FEA-SHELL-X0 directive supplies the governing full-3D formulation and benchmark parameters used by this implementation.++## PAPER — independently verified++The abstract establishes three claims:++- the method extends the Finite Cell Method to thin-walled structures;+- it combines a fictitious-domain method with high-order hierarchical Ansatz spaces from p-FEM;+- the finite cells occupy a two-dimensional master domain in the geometry parameter plane rather than a three-dimensional Cartesian embedding grid.++The abstract also mentions numerical benchmarks and potential application to trimmed NURBS surfaces. It does not expose enough detail to verify the paper's exact basis, integration algorithm, boundary enforcement, or benchmark numbers.++## SOURCE DIRECTIVE — governing X0 formulation++The revised directive defines a three-displacement, full-3D small-strain formulation. For a midsurface `m(r,s)`, unit normal `n(r,s)`, and half-thickness `k(r,s)`, the physical point is++`M(r,s,t) = m(r,s) + t k(r,s) n(r,s)`, for `-1 <= t <= 1`.++Each rectangular master cell in `(r,s)` spans the single normalized thickness interval. The reference-to-master affine Jacobian and the full derivatives `dM/dr`, `dM/ds`, and `dM/dt` form the physical Jacobian. Physical basis gradients produce the ordinary three-dimensional small-strain `B` operator; the existing isotropic constitutive relation remains `sigma = C epsilon`.++The extended material uses `alpha=1` in the physical region and an explicit default `alpha=1e-12` in the fictitious region. Cut cells are recursively divided in `(r,s)`, then integrated using tensor Gauss quadrature and semantic point containment. X0 strongly enforces only stable master-boundary Dirichlet data.++## AETHERIS ADAPTATION++| Topic | Source-derived method | Aetheris X0 implementation | Status |+|---|---|---|---|+| 3D displacement | Full continuum `ux,uy,uz` | Three translational coefficients per basis function; ordinary 3D strain and stress | Implemented |+| Thin-wall map | Parameter-plane cells mapped into a thin 3D body | Flat affine map and analytic cylindrical map | Implemented, constant thickness |+| 2D grid | Regular parameter/master domain | `MasterGrid: [r,s]`, with one `t` span | Implemented |+| Indicator | Physical/fictitious weighting | `1` / explicit `AlphaFictitious`, default `1e-12` | Implemented |+| Basis | High-order hierarchical p-space | Tensor hexahedral integrated-Legendre modal space, bounded to `1 <= p <= 6` | Adaptation; exact paper trunk space unverified |+| Interior quadrature | Tensor Gaussian integration | `(p+1)^3` by default | Implemented |+| Cut integration | Accurate discontinuous-indicator integration | Recursive quadtree subdivision in `(r,s)` plus tensor Gauss integration | Adaptation |+| Classification | Trimmed parameter domain | Exact `IBoundsClassificationCapability` and point containment; native through-hole is analytic | Implemented for box and one Z through-hole |+| Fictitious cells | Retain small stiffness | Points outside the physical trim remain assembled with alpha | Implemented |+| Dirichlet data | Embedded treatment is method-dependent | Strong elimination only on exact master-domain faces | X0 simplification |+| Sparse solution | Linear system | Existing deterministic sparse symmetric matrix and diagonal-PCG path | Adaptation |+| Energy | Continuum strain energy | Both `0.5 u^T K u` and independently reintegrated `0.5 epsilon^T C epsilon` | Implemented |++The integrated-Legendre internal mode of degree `n` is `(P_n-P_(n-2))/sqrt(4n-2)`; the two endpoint modes are linear. Shared entity keys provide conformity and deterministic ordering. This is an ordinary tensor p-space, not a claim of exact paper basis fidelity.++## DEFERRED / UNKNOWN++- Exact paper equation mapping, trunk-space pruning, stabilization, and weak essential-boundary procedure remain unknown without the full text.+- Native `Aetheris.SheetMetal` midsurface/thickness extraction is not connected to the analysis compiler. X0 accepts explicit native/synthetic box semantics and rejects imported STEP shell inference.+- Variable thickness, multiple surface patches, bend coupling, arbitrary embedded Dirichlet boundaries, and NURBS maps are deferred.+- The modified Scordelis–Lo case needs body-force loading, curved trim coordinates, and carefully verified symmetry axes. It was not approximated with invented data.+- The screenshot-derived perforated-plate energy `0.7021812127` has no verified unit convention. The release report compares it only to explicitly labeled `10^6 U_SI`; no solver parameter was tuned to match it.+diff --git a/docs/release/FEA-SHELL-X0.md b/docs/release/FEA-SHELL-X0.mdnew file mode 100644index 00000000..d64a5247--- /dev/null+++ b/docs/release/FEA-SHELL-X0.md@@ -0,0 +1,115 @@+# FEA-SHELL-X0 — experimental full-3D thin-wall finite cells++## Executive verdict++**Meaningful progression.** Aetheris can now solve flat thin bodies through an explicit shell-aligned, high-order finite-cell discretization while retaining full three-dimensional elasticity and a cell count independent of thickness. The real CLI path passes a flat cantilever through `L/t=100`, shows p-convergence on a trimmed plate, preserves equilibrium, and emits deterministic JSON/SVG evidence. It is not accepted for production: `L/t=200` exposes PCG conditioning, native SheetMetal authority is not connected, and the modified Scordelis–Lo benchmark is deferred.++This is always labeled `ExperimentalShell`; it neither replaces nor silently falls back to the production solid solver.++## Implemented path++`Analysis -> ExperimentalShell -> ThinWallGeometryMap -> 2D master grid x t -> hierarchical tensor p-basis -> FCM quadrature/alpha -> existing sparse solve -> continuum results`++The mode exposes thickness, flat/cylindrical map, grid, p order, alpha, quadrature order, subdivision depth, cell classification, Jacobian extrema, DOFs, nonzeros, residual, equilibrium, through-thickness stress locations, and a deterministic discretization hash. Imported STEP shell inference fails closed. Abaqus export is deliberately omitted because its existing Q1 export does not represent this basis.++## Basic perforated finite-cell benchmark++The committed fixture is a 4 m x 4 m x 1 m solid with a central 1 m-radius through-hole, `E=206.9 GPa`, `nu=0.29`, 100 Pa top traction, a 2 x 2 master grid, depth 5, and default alpha. The supplied reference `0.7021812127` is screenshot-derived without a verified unit convention. The table therefore compares the explicitly labeled display normalization `10^6 U_SI`; the raw SI energy is that value times `10^-6 J`.++| p | cells | DOFs | `10^6 U_SI` | reference error | PCG residual | equilibrium residual (N) |+|---:|---:|---:|---:|---:|---:|---:|+| 1 | 4 | 54 | 0.479279 | 31.74% | 3.96e-9 | 1.44e-9 |+| 2 | 4 | 225 | 0.585525 | 16.61% | 1.13e-6 | 1.94e-7 |+| 3 | 4 | 588 | 0.659484 | 6.08% | 1.65e-6 | 2.68e-7 |+| 4 | 4 | 1215 | 0.689749 | 1.77% | 2.19e-6 | 3.68e-7 |++The fixed grid exhibits strong measured p-convergence; no exponential-rate claim is made. All four master cells are cut. At depth 5 they produce 124 terminal cut subcells and an estimated minimum physical fraction of 0.8034.++## Flat thin-wall cantilever and thinness sweep++The cantilever is 100 mm x 20 mm, steel (`E=200 GPa`, `nu=0.3`), fixed at `-X`, and loaded by a 10 N `-Z` resultant at `+X`. The reference is Euler–Bernoulli tip displacement `F L^3/(3 E I)`, with `I=b t^3/12`. The predeclared acceptance is less than 5% through the successful sweep.++| L/t | cells | p | DOFs | displacement (m) | reference (m) | error | equilibrium residual (N) |+|---:|---:|---:|---:|---:|---:|---:|---:|+| 10 | 4 | 3 | 624 | 9.89163e-6 | 1.00000e-5 | 1.08% | 6.01e-9 |+| 50 | 4 | 3 | 624 | 1.21026e-3 | 1.25000e-3 | 3.18% | 4.60e-8 |+| 100 | 4 | 3 | 624 | 9.64360e-3 | 1.00000e-2 | 3.56% | 2.12e-7 |+| 200 | 4 | 3 | 624 | no result | 8.00000e-2 | — | PCG stopped at 10,000 iterations, residual 5.24e-5 |++The number of cells and DOFs does not grow with thinness. The `L/t=200` failure is a conditioning limit in the current diagonal-preconditioned iterative solve, not geometric thickness under-resolution. It remains a typed `thinwall-linear-solve-failed` result.++For the default 2 mm case, p=2 gives 1.18185 mm (5.45% low) and p=3 gives 1.21026 mm (3.18% low), establishing refinement toward the 1.25 mm reference.++## Numerical integration studies++At p=2 on the perforated plate:++| alpha | depth | Gauss order | cut leaves | strain energy (J) | iterations |+|---:|---:|---:|---:|---:|---:|+| 1e-8 | 5 | 3 | 124 | 5.85525480e-7 | 169 |+| 1e-10 | 5 | 3 | 124 | 5.85525486e-7 | 168 |+| 1e-12 | 5 | 3 | 124 | 5.85525486e-7 | 169 |+| 1e-12 | 3 | 3 | 28 | 5.90202802e-7 | 168 |+| 1e-12 | 4 | 3 | 60 | 5.84874884e-7 | 169 |+| 1e-12 | 5 | 4 | 124 | 5.84963716e-7 | 169 |++Alpha sensitivity is below `1.1e-8` relative across the requested range. Depth 3 versus 5 changes energy by 0.80%; Gauss order 3 versus 4 at depth 5 changes it by 0.096%. The default remains 1e-12 without post-hoc tuning.++## Geometry, results, and failure boundaries++- The flat and analytic cylindrical maps have independent positive-Jacobian tests at `t=-1,0,+1`. Zero, negative, inconsistent, or nonfinite mappings have typed failures.+- Stress and von Mises are ordinary continuum results evaluated at `t=-1,0,+1`; they are not membrane or bending resultants.+- Algebraic strain energy is checked against independent continuum reintegration. The flat p=3 relative discrepancy is 3.69e-9.+- Only exact master faces support strong constraints and surface loads. No node snapping or whole-edge expansion is performed.+- Debug output includes `parameter-domain-grid.svg`, `mapped-deformed-cells.svg`, and structured JSON under caller-selected output directories.++## Paper-derived method versus Aetheris adaptation++| Topic | Source-derived method | Aetheris X0 implementation | Status |+|---|---|---|---|+| 3D displacement formulation | Revised directive: full 3D displacement elasticity | Existing isotropic `C`, physical-gradient 3D `B`, three displacement components | Implemented |+| Alpha method | Fictitious-domain constitutive scaling | Pointwise `alpha C` | Implemented |+| `alpha=1e-12` | Revised directive default | Explicit setting and evidence; never auto-tuned | Implemented |+| Hierarchical integrated-Legendre basis | High-order hierarchical p-space | Conforming tensor hexahedral space, p=1..6 | Aetheris adaptation |+| p-refinement | Increase order on a fixed grid | Deterministic shared entity keys and fixed ordering | Implemented |+| `M(r,s,t)` | Thin-wall coordinate map | Flat and analytic cylindrical constant-thickness maps | Implemented subset |+| 2D parameter grid | Cells in the geometry parameter plane | Regular rectangular grid, one normalized thickness span | Implemented |+| Interior quadrature | Tensor Gaussian | Default `(p+1)^3` | Implemented |+| Cut integration | Resolve indicator discontinuity | Recursive `(r,s)` subcells plus tensor Gauss points | Aetheris adaptation |+| Geometric classification | Trimmed parameter domain | Exact analytic bounds and point containment | Implemented subset |+| Dirichlet enforcement | Paper details unverified | Strong elimination on exact master faces | X0 simplification |+| Sparse solver | Not source-prescriptive | Existing sparse symmetric matrix and diagonal PCG | Aetheris adaptation |++The bibliographic and abstract-level claims are supported by the [TUM publication record](https://portal.fis.tum.de/en/publications/shell-finite-cell-method-a-high-order-fictitious-domain-approach-/) and [DOI record](https://doi.org/10.1016/j.cma.2011.06.005). Full-text equation fidelity is not claimed; see the development notes.++## Deferred qualification++| Requested case | Status | Evidence / next blocker |+|---|---|---|+| Modified Scordelis–Lo | Deferred | Body-force loading and curved parameter-space hole classification are not present; symmetry coordinates require full benchmark verification |+| Native planar SheetMetal panel | Deferred | Current analysis compiler has no semantic midsurface/thickness adapter from `Aetheris.SheetMetal` |+| Simple bend / patch coupling | Out of X0 core | Requires explicit multipatch continuity; no smoothing approximation was introduced |+| Investor bracket | Not attempted | Benchmark qualification is incomplete, and arbitrary STEP midsurface inference remains forbidden |+| Grid-offset/tiny-cut sweep | Deferred | Current native through-hole fixture is centered; tiny-cut conditioning needs a dedicated semantic-offset fixture |++## Reproduction and validation++Run:++```powershell+dotnet build Aetheris.slnx -c Release -m:1+dotnet test Aetheris.FEA.Tests/Aetheris.FEA.Tests.csproj -c Release+dotnet run --project Aetheris.CLI -c Release -- fea fixtures/Canonical/FEA/ExperimentalShell/flat-cantilever.firmament --out-dir artifacts/local/fea-shell-x0/flat+dotnet run --project Aetheris.CLI -c Release -- fea fixtures/Canonical/FEA/ExperimentalShell/cut-boundary-plate.firmament --out-dir artifacts/local/fea-shell-x0/cut+```++Raw per-run evidence belongs in ignored `artifacts/local/fea-shell-x0/`; this document is the compact durable record.++Validation completed on 2026-09-12:++- Release solution build: passed with zero warnings and zero errors.+- Broad solution tests excluding the tagged slow corpus: passed; focused FEA suite passed 35/35 and focused FEA CLI tests passed 4/4.+- Canonical qualification: passed 163/163 fixtures, including both ExperimentalShell fixtures and the production cantilever.+- Production cantilever CLI witness: `ProductionSolid`, 56 iterations, 5.39309699e-5 m maximum displacement, 3.22e-9 N equilibrium residual, valid Abaqus package.+- Packaged CLI: `artifacts/local/fea-shell-x0/package/Aetheris.CLI.2.0.0-preview.3.nupkg`.+- Repository layout guard and `git diff --check`: passed.diff --git a/fixtures/Canonical/FEA/ExperimentalShell/cut-boundary-plate.firmament b/fixtures/Canonical/FEA/ExperimentalShell/cut-boundary-plate.firmamentnew file mode 100644index 00000000..e2645b7a--- /dev/null+++ b/fixtures/Canonical/FEA/ExperimentalShell/cut-boundary-plate.firmament@@ -0,0 +1,40 @@+Model ExperimentalPerforatedPlate {+ Units: mm+ Box Plate { Size: [4000mm, 4000mm, 1000mm] }+ Modify Plate {+ Hole<Shaft> Opening {+ On: +Z+ Center: Point2(0mm, 0mm)+ Diameter: 2000mm+ End: ThroughAll+ }+ }++ Analysis LinearElastic PerforatedPlatePull {+ Mode: ExperimentalShell+ Body: Plate+ Material BenchmarkSteel {+ YoungsModulus: 206.9GPa+ PoissonRatio: 0.29+ }+ Thickness: 1000mm+ MasterGrid: [2, 2]+ Order: 2+ AlphaFictitious: 1e-12+ MaxSubdivisionDepth: 5++ Fixed SymmetryLeft {+ Region: Plate.face(-X)+ Components: [X]+ }+ Fixed SymmetryBottom {+ Region: Plate.face(-Y)+ Components: [Y, Z]+ }+ Traction Pull {+ Region: Plate.face(+Y)+ Vector: [0Pa, 100Pa, 0Pa]+ }+ Results: [Displacement, Strain, Stress, ReactionForce, StrainEnergy]+ }+}diff --git a/fixtures/Canonical/FEA/ExperimentalShell/flat-cantilever.firmament b/fixtures/Canonical/FEA/ExperimentalShell/flat-cantilever.firmamentnew file mode 100644index 00000000..ec79224e--- /dev/null+++ b/fixtures/Canonical/FEA/ExperimentalShell/flat-cantilever.firmament@@ -0,0 +1,25 @@+Model ExperimentalThinPlate {+ Units: mm+ Box Plate { Size: [100mm, 20mm, 2mm] }++ Analysis LinearElastic ThinPlateCantilever {+ Mode: ExperimentalShell+ Body: Plate+ Material: Standard.Materials.Steel.ASTM_A36+ Thickness: 2mm+ MasterGrid: [4, 1]+ Order: 3+ AlphaFictitious: 1e-12+ MaxSubdivisionDepth: 4++ Fixed Root {+ Region: Plate.face(-X)+ Components: [X, Y, Z]+ }+ Force Tip {+ Region: Plate.face(+X)+ Vector: [0N, 0N, -10N]+ }+ Results: [Displacement, Strain, Stress, ReactionForce, StrainEnergy]+ }+}diff --git a/fixtures/Invalid/FEA/ExperimentalShell/invalid-order.firmament b/fixtures/Invalid/FEA/ExperimentalShell/invalid-order.firmamentnew file mode 100644index 00000000..a59da20e--- /dev/null+++ b/fixtures/Invalid/FEA/ExperimentalShell/invalid-order.firmament@@ -0,0 +1,13 @@+Model InvalidThinWallOrder {+ Units: mm+ Box Plate { Size: [100mm, 20mm, 2mm] }+ Analysis LinearElastic InvalidOrder {+ Mode: ExperimentalShell+ Body: Plate+ Material: Standard.Materials.Steel.ASTM_A36+ Thickness: 2mm+ MasterGrid: [2, 1]+ Order: 7+ Fixed Root { Region: Plate.face(-X) }+ }+}diff --git a/fixtures/Invalid/FEA/ExperimentalShell/missing-thickness.firmament b/fixtures/Invalid/FEA/ExperimentalShell/missing-thickness.firmamentnew file mode 100644index 00000000..c6a65ef6--- /dev/null+++ b/fixtures/Invalid/FEA/ExperimentalShell/missing-thickness.firmament@@ -0,0 +1,12 @@+Model InvalidThinWall {+ Units: mm+ Box Plate { Size: [100mm, 20mm, 2mm] }+ Analysis LinearElastic MissingThickness {+ Mode: ExperimentalShell+ Body: Plate+ Material: Standard.Materials.Steel.ASTM_A36+ MasterGrid: [2, 1]+ Order: 2+ Fixed Root { Region: Plate.face(-X) }+ }+}diff --git a/fixtures/Invalid/FEA/ExperimentalShell/rigid-body.firmament b/fixtures/Invalid/FEA/ExperimentalShell/rigid-body.firmamentnew file mode 100644index 00000000..611780c8--- /dev/null+++ b/fixtures/Invalid/FEA/ExperimentalShell/rigid-body.firmament@@ -0,0 +1,12 @@+Model InvalidUnsupportedShell {+ Units: mm+ Box Plate { Size: [100mm, 20mm, 2mm] }+ Analysis LinearElastic UnconstrainedShell {+ Mode: ExperimentalShell+ Body: Plate+ Material: Standard.Materials.Steel.ASTM_A36+ Thickness: 2mm+ MasterGrid: [2, 1]+ Force Tip { Region: Plate.face(+X) Vector: [0N, 0N, -10N] }+ }+}diff --git a/fixtures/Invalid/FEA/ExperimentalShell/singular-map.firmament b/fixtures/Invalid/FEA/ExperimentalShell/singular-map.firmamentnew file mode 100644index 00000000..e362deff--- /dev/null+++ b/fixtures/Invalid/FEA/ExperimentalShell/singular-map.firmament@@ -0,0 +1,16 @@+Model InvalidCylindricalMap {+ Units: mm+ Box PatchParameters { Size: [100mm, 160mm, 2mm] }+ Analysis LinearElastic InconsistentCylinderSpan {+ Mode: ExperimentalShell+ Body: PatchParameters+ Material: Standard.Materials.Steel.ASTM_A36+ Thickness: 2mm+ MasterGrid: [2, 2]+ Order: 2+ GeometryMap: Cylindrical+ CylinderRadius: 100mm+ CylinderAngle: 90deg+ Fixed Root { Region: PatchParameters.face(-X) }+ }+}diff --git a/fixtures/Invalid/FEA/ExperimentalShell/zero-thickness.firmament b/fixtures/Invalid/FEA/ExperimentalShell/zero-thickness.firmamentnew file mode 100644index 00000000..629fe3de--- /dev/null+++ b/fixtures/Invalid/FEA/ExperimentalShell/zero-thickness.firmament@@ -0,0 +1,12 @@+Model InvalidZeroThickness {+ Units: mm+ Box Plate { Size: [100mm, 20mm, 2mm] }+ Analysis LinearElastic ZeroThickness {+ Mode: ExperimentalShell+ Body: Plate+ Material: Standard.Materials.Steel.ASTM_A36+ Thickness: 0mm+ MasterGrid: [2, 1]+ Fixed Root { Region: Plate.face(-X) }+ }+}diff --git a/fixtures/InvestorPitch/sheet-metal-bracket-analysis.firmament b/fixtures/InvestorPitch/sheet-metal-bracket-analysis.firmamentnew file mode 100644index 00000000..76b4471e--- /dev/null+++ b/fixtures/InvestorPitch/sheet-metal-bracket-analysis.firmament@@ -0,0 +1,24 @@+Model InvestorBracketAnalysis {+ Analysis LinearElastic ServiceLoad {+ Body: inlineSTEP("../../artifacts/local/sheet-metal-bracket-demo/engineering/investor-bracket-formed.step")+ Material: Standard.Materials.Aluminum.5052_H32++ Fixed BaseMountLeft {+ Region: body.face(#574)+ Components: [X, Y, Z]+ }++ Fixed BaseMountRight {+ Region: body.face(#586)+ Components: [X, Y, Z]+ }++ Force UprightServiceLoad {+ Region: body.face(#206)+ Vector: [0N, -250N, 0N]+ }++ Results: [Displacement, Strain, Stress, ReactionForce]+ Lattice: [16, 12, 12]+ }+}diff --git a/fixtures/InvestorPitch/sheet-metal-bracket.firmament b/fixtures/InvestorPitch/sheet-metal-bracket.firmamentnew file mode 100644index 00000000..ee9d8ea3--- /dev/null+++ b/fixtures/InvestorPitch/sheet-metal-bracket.firmament@@ -0,0 +1,76 @@+// Investor demonstration: manufacturing-authoritative 5052-H32 formed bracket.+// The prompt is intentionally terse; the assumptions below remain explicit review items.++Concept Struct InvestorBracketLayout {+ Datum BaseMountCenter { On: BasePlate; At: (50mm, 25mm); }+ Datum UprightMountCenter { On: Upright; At: (50mm, 25mm); }++ Pattern BaseMountPattern {+ On: BasePlate;+ Feature: Circle { Diameter: 6.6mm; };+ Center: BaseMountCenter;+ Count: 2;+ Pitch: (50mm, 0mm);+ }++ Pattern UprightMountPattern {+ On: Upright;+ Feature: Circle { Diameter: 6.6mm; };+ Center: UprightMountCenter;+ Count: 2;+ Pitch: (50mm, 0mm);+ }+}++Manufacturing InvestorBracketRelease {+ MaterialSpecification: "ASTM B209 5052-H32 aluminium sheet, mill finish";+ ThicknessTolerance: PlusMinus(0.12mm, 0.12mm);+ BlankProcess: "CNC laser cut or CNC punch; cut all holes before forming";+ FormingProcess: "CNC press brake; 3 mm inside radius tooling; K-factor 0.42";+ GeneralCutTolerance: 0.25mm;+ GeneralFormedTolerance: 0.5mm;+ GeneralAngularTolerance: 1deg;+}++Pmi InvestorBracketPmi {+ DatumFeature A { Target: BasePlate; }+ DatumFeature B { Target: Upright; }++ Dimension SheetThickness { Kind: Thickness; Target: InvestorBracket; Value: 2mm; Tolerance: PlusMinus(0.12mm, 0.12mm); }+ Dimension BaseWidth { Kind: Linear; Target: BasePlate; Value: 100mm; Tolerance: PlusMinus(0.25mm, 0.25mm); }+ Dimension BaseDepth { Kind: Linear; Target: BasePlate; Value: 70mm; Tolerance: PlusMinus(0.25mm, 0.25mm); }+ Dimension BaseMountDiameter { Kind: Diameter; Target: InvestorBracketLayout.BaseMountPattern; Value: 6.6mm; Tolerance: PlusMinus(0.10mm, 0.10mm); Quantity: 2; }+ Dimension UprightMountDiameter { Kind: Diameter; Target: InvestorBracketLayout.UprightMountPattern; Value: 6.6mm; Tolerance: PlusMinus(0.10mm, 0.10mm); Quantity: 2; }++ Position BaseMountPosition { Target: InvestorBracketLayout.BaseMountPattern; Tolerance: 0.30mm; DatumRefs: [A, B]; Quantity: 2; }+ Position UprightMountPosition { Target: InvestorBracketLayout.UprightMountPattern; Tolerance: 0.40mm; DatumRefs: [A, B]; Quantity: 2; }++ Annotation MaterialAndFinish { Target: InvestorBracket; Text: "ASTM B209 5052-H32 aluminium sheet, 2.0 +/-0.12 mm, mill finish."; }+ Annotation CutAndDeburr { Target: InvestorBracket; Text: "Cut before forming. Remove burrs and sharp edges; break edges 0.2-0.5 mm."; }+ Annotation Forming { Target: UprightBend; Text: "Form to 90 +/-1 degree with 3 mm inside radius; reject visible cracking."; }+ Annotation CounterboreReview { Target: InvestorBracketLayout.UprightMountPattern; Text: "Counterbores are intentionally not applied to 2 mm sheet. Confirm fastener head strategy; use washers, countersink-qualified tooling, or captive hardware as appropriate."; }+}++SheetMetal InvestorBracket {+ Intent: Manufacturing;+ Thickness: 2mm;+ KFactor: 0.42;+ Material: "ASTM B209 5052-H32 aluminium sheet";++ Base BasePlate {+ Profile: Rectangle { Width: 100mm; Height: 70mm; };+ }++ Flange Upright {+ From: BasePlate.Rear;+ Height: 60mm;+ Angle: 90deg;+ Radius: 3mm;+ Direction: Up;+ StartTermination: Rounded;+ StartTerminationRadius: 2mm;+ EndTermination: Rounded;+ EndTerminationRadius: 2mm;+ }++}diff --git a/scripts/build-sheet-metal-bracket-demo.ps1 b/scripts/build-sheet-metal-bracket-demo.ps1new file mode 100644index 00000000..0c30832d--- /dev/null+++ b/scripts/build-sheet-metal-bracket-demo.ps1@@ -0,0 +1,72 @@+[CmdletBinding()]+param(+ [string]$OutputRoot = "artifacts/local/sheet-metal-bracket-demo"+)++$ErrorActionPreference = "Stop"+$repoRoot = Split-Path -Parent $PSScriptRoot+$outputPath = [IO.Path]::GetFullPath((Join-Path $repoRoot $OutputRoot))+$engineeringPath = Join-Path $outputPath "engineering"+$evidencePath = Join-Path $outputPath "evidence"+$sourcePath = Join-Path $repoRoot "fixtures/InvestorPitch/sheet-metal-bracket.firmament"+$analysisPath = Join-Path $repoRoot "fixtures/InvestorPitch/sheet-metal-bracket-analysis.firmament"+$counterboreSource = Join-Path $repoRoot "fixtures/Canonical/PMI/counterbore-shaft-diameter.firmament"+$cliProject = Join-Path $repoRoot "Aetheris.CLI"++New-Item -ItemType Directory -Force -Path $engineeringPath, $evidencePath | Out-Null++function Invoke-AetherisJson {+ param(+ [Parameter(Mandatory)] [string]$Name,+ [Parameter(Mandatory)] [string[]]$CliArguments,+ [switch]$AllowFailure+ )++ $priorLocation = Get-Location+ try {+ Set-Location $repoRoot+ $jsonText = (& dotnet run --project $cliProject -- @CliArguments 2>&1 | Out-String).Trim()+ $exitCode = $LASTEXITCODE+ }+ finally {+ Set-Location $priorLocation+ }+ $jsonFile = Join-Path $evidencePath "$Name.json"+ [IO.File]::WriteAllText($jsonFile, $jsonText + [Environment]::NewLine, [Text.UTF8Encoding]::new($false))+ if ($exitCode -ne 0 -and -not $AllowFailure) {+ throw "Aetheris command '$Name' failed with exit code $exitCode. See $jsonFile."+ }+ return $jsonFile+}++$formedStep = Join-Path $engineeringPath "investor-bracket-formed.step"+$flatStep = Join-Path $engineeringPath "investor-bracket-flat.step"+$flatSvg = Join-Path $engineeringPath "investor-bracket-flat.svg"+$isoSvg = Join-Path $engineeringPath "investor-bracket-iso.svg"+$rightSvg = Join-Path $engineeringPath "investor-bracket-right.svg"+$counterboreStep = Join-Path $engineeringPath "counterbore-semantic-witness.step"+$counterboreSvg = Join-Path $engineeringPath "counterbore-semantic-witness.svg"++Invoke-AetherisJson -Name "validate" -CliArguments @("validate", $sourcePath, "--json") | Out-Null+Invoke-AetherisJson -Name "build-formed" -CliArguments @("build", $sourcePath, "--output", $formedStep, "--json") | Out-Null+Invoke-AetherisJson -Name "flatten" -CliArguments @("sheetmetal", "flatten", $sourcePath, "--step", $flatStep, "--svg", $flatSvg, "--json") | Out-Null+Invoke-AetherisJson -Name "analyze-formed" -CliArguments @("analyze", $formedStep, "--json") | Out-Null+Invoke-AetherisJson -Name "analyze-flat" -CliArguments @("analyze", $flatStep, "--json") | Out-Null+Invoke-AetherisJson -Name "wireframe-iso" -CliArguments @("wireframe", $formedStep, "--out", $isoSvg, "--view", "iso", "--density", "12", "--samples", "96", "--json") | Out-Null+Invoke-AetherisJson -Name "wireframe-right" -CliArguments @("wireframe", $formedStep, "--out", $rightSvg, "--view", "right", "--density", "12", "--samples", "96", "--json") | Out-Null+Invoke-AetherisJson -Name "counterbore-build" -CliArguments @("build", $counterboreSource, "--output", $counterboreStep, "--json") | Out-Null+Invoke-AetherisJson -Name "counterbore-wireframe" -CliArguments @("wireframe", $counterboreStep, "--out", $counterboreSvg, "--view", "iso", "--density", "10", "--samples", "96", "--json") | Out-Null+Invoke-AetherisJson -Name "counterbore-analyze" -CliArguments @("analyze", $counterboreStep, "--json") | Out-Null+Invoke-AetherisJson -Name "fea-attempt" -CliArguments @("fea", $analysisPath, "--out-dir", (Join-Path $engineeringPath "fea"), "--json") -AllowFailure | Out-Null++$hashes = Get-ChildItem -LiteralPath $engineeringPath -File | Sort-Object Name | ForEach-Object {+ [ordered]@{+ file = $_.Name+ bytes = $_.Length+ sha256 = (Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()+ }+}+$hashJson = $hashes | ConvertTo-Json -Depth 4+[IO.File]::WriteAllText((Join-Path $evidencePath "artifact-hashes.json"), $hashJson + [Environment]::NewLine, [Text.UTF8Encoding]::new($false))++Write-Host "Aetheris sheet-metal bracket evidence written to $outputPath"