Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"source": {
"assembly": "OutWit.Controller.Sweep.Model",
"version": "2.0.0"
"version": "2.1.0"
},
"generator": "OutWit.Cloud.Documents.Generator 1.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by OutWit.Cloud.Documents.Generator 1.0.0 from OutWit.Controller.Sweep.Model 2.0.0.
// Generated by OutWit.Cloud.Documents.Generator 1.0.0 from OutWit.Controller.Sweep.Model 2.1.0.
// Do not edit: regenerate from the model assembly.
//
// OmnibusCloud job document vocabulary: sweep
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by OutWit.Cloud.Documents.Generator 1.0.0 from OutWit.Controller.Sweep.Model 2.0.0.
# Generated by OutWit.Cloud.Documents.Generator 1.0.0 from OutWit.Controller.Sweep.Model 2.1.0.
# Do not edit: regenerate from the model assembly.
#
# OmnibusCloud job document vocabulary: sweep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<ControllerName>Sweep</ControllerName>
<Version>2.0.0</Version>
<Version>2.1.0</Version>
<Description>Shared data types of the Sweep orchestration controller: a parameter study as data for any solver family - the parameters, the variant table and exactly one family block (a CalculiX template or deck set, an OpenFOAM case) - the immutable plan with its chunk schedule, the cursor state carried across chunks, and the manifest of everything harvested so far, each row the sweep's verdict plus the node's own result. The sweep state and its result index publish a document vocabulary (sweep.state@2) for non-.NET initiators.</Description>
<PackageTags>sweep;parameter-study;doe;calculix;openfoam;witengine;witcloud;controller;data-types</PackageTags>
</PropertyGroup>
Expand Down
9 changes: 7 additions & 2 deletions Sweep/OutWit.Controller.Sweep.Model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ family:
`SweepCalculiXDeckData`), the mesh size, the thread policy, the extraction
request;
- `OpenFOAM` (`FoamCaseData` from `OutWit.Controller.OpenFOAM.Model`) - the
case every variant runs with its own token values.
- `SweepPlanData` - the validated study and its chunk schedule, immutable.
case every variant runs with its own token values, or, in a case set,
what every case shares.
- `SweepOpenFOAMSetData` - the cases of an OpenFOAM case set, a job input
beside the study: every variant's own ready case (`SweepOpenFOAMCaseData`:
its name, its tree, its recipe, its cell count and solver class).
- `SweepPlanData` - the validated study, its case set when it has one, and
its chunk schedule, immutable.
- `SweepStateData` - the cursor carried across chunks: the next chunk, the
counts by outcome, the latest manifest blob and the result index
(`SweepResultIndexEntryData`: variant, outcome, label, artifacts by kind -
Expand Down
82 changes: 82 additions & 0 deletions Sweep/OutWit.Controller.Sweep.Model/SweepOpenFOAMCaseData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using MemoryPack;
using OutWit.Common.Abstract;
using OutWit.Common.Collections;
using OutWit.Common.Values;
using OutWit.Controller.OpenFOAM.Model;

namespace OutWit.Controller.Sweep.Model;

/// <summary>
/// One variant's own complete case in an OpenFOAM case set (cases prepared
/// elsewhere - a geometry each, meshed or meshing - no tokens): its name, its
/// tree as file references, its recipe, and its mesh size and solver class
/// for work estimation. Everything a case set shares - threads, responses,
/// artifacts - stays in the study's OpenFOAM block.
/// </summary>
[MemoryPackable]
// Explicit MemoryPackOrder pins the wire layout to the declaration order - append new members at the END only (default MemoryPack mode rejects payloads with unknown members).
public sealed partial class SweepOpenFOAMCaseData : ModelBase
{
#region Model Base

public override bool Is(ModelBase modelBase, double tolerance = DEFAULT_TOLERANCE)
{
if (modelBase is not SweepOpenFOAMCaseData data)
return false;

return VariantIndex.Is(data.VariantIndex)
&& Name.Is(data.Name)
&& BaseFiles.IsSequence(data.BaseFiles, tolerance)
&& Recipe.Check(data.Recipe)
&& CellCount.Is(data.CellCount)
&& SolverClass.Is(data.SolverClass);
}

public override SweepOpenFOAMCaseData Clone()
{
return new SweepOpenFOAMCaseData
{
VariantIndex = VariantIndex,
Name = Name,
BaseFiles = BaseFiles.Select(file => file.Clone()).ToList(),
Recipe = Recipe?.Clone(),
CellCount = CellCount,
SolverClass = SolverClass
};
}

public override string ToString()
{
return $"variant #{VariantIndex}: case '{Name}', {Recipe?.Application ?? "?"}, {CellCount} cells, {BaseFiles.Count} file(s)";
}

#endregion

#region Properties

/// <summary>The variant this case is.</summary>
[MemoryPackOrder(0)]
public int VariantIndex { get; set; }

/// <summary>The case's name as the user knows it (its folder in the set); the variant's label.</summary>
[MemoryPackOrder(1)]
public string Name { get; set; } = string.Empty;

/// <summary>The case tree, one reference per file; nothing is templated.</summary>
[MemoryPackOrder(2)]
public List<FoamFileRefData> BaseFiles { get; set; } = [];

/// <summary>The case's own allow-listed recipe.</summary>
[MemoryPackOrder(3)]
public FoamRecipeData? Recipe { get; set; }

/// <summary>Cell count of the case, for work estimation; 0 falls back to the study block's.</summary>
[MemoryPackOrder(4)]
public long CellCount { get; set; }

/// <summary>Solver class of the case, for work estimation; empty falls back to the study block's.</summary>
[MemoryPackOrder(5)]
public string SolverClass { get; set; } = string.Empty;

#endregion
}
52 changes: 52 additions & 0 deletions Sweep/OutWit.Controller.Sweep.Model/SweepOpenFOAMSetData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using MemoryPack;
using OutWit.Common.Abstract;
using OutWit.Common.Collections;

namespace OutWit.Controller.Sweep.Model;

/// <summary>
/// The cases of an OpenFOAM case-set study, one per variant: the second input
/// of the <c>SweepOpenFOAMSet</c> script beside the study, whose OpenFOAM
/// block then carries only what every case shares (threads, responses,
/// artifacts) and whose variants carry no values. A separate input, not a
/// member of the study: the study's layout stays what every released host
/// reads, and a host without case sets refuses the unknown script by name
/// instead of every study.
/// </summary>
[MemoryPackable]
// Explicit MemoryPackOrder pins the wire layout to the declaration order - append new members at the END only (default MemoryPack mode rejects payloads with unknown members).
public sealed partial class SweepOpenFOAMSetData : ModelBase
{
#region Model Base

public override bool Is(ModelBase modelBase, double tolerance = DEFAULT_TOLERANCE)
{
if (modelBase is not SweepOpenFOAMSetData data)
return false;

return Cases.IsSequence(data.Cases, tolerance);
}

public override SweepOpenFOAMSetData Clone()
{
return new SweepOpenFOAMSetData
{
Cases = Cases.Select(item => item.Clone()).ToList()
};
}

public override string ToString()
{
return $"OpenFOAM case set: {Cases.Count} case(s)";
}

#endregion

#region Properties

/// <summary>Every variant's own case.</summary>
[MemoryPackOrder(0)]
public List<SweepOpenFOAMCaseData> Cases { get; set; } = [];

#endregion
}
15 changes: 11 additions & 4 deletions Sweep/OutWit.Controller.Sweep.Model/SweepPlanData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ namespace OutWit.Controller.Sweep.Model;

/// <summary>
/// The validated, immutable execution plan of one sweep: the options as
/// submitted and the chunk schedule computed up front. Mutable progress lives
/// in <see cref="SweepStateData"/>, never here.
/// submitted, the case set when the study is one, and the chunk schedule
/// computed up front. Mutable progress lives in <see cref="SweepStateData"/>,
/// never here.
/// </summary>
[MemoryPackable]
// Explicit MemoryPackOrder pins the wire layout to the declaration order - append new members at the END only (default MemoryPack mode rejects payloads with unknown members).
Expand All @@ -22,15 +23,17 @@ public override bool Is(ModelBase modelBase, double tolerance = DEFAULT_TOLERANC
return false;

return Options.Check(plan.Options)
&& ChunkSizes.Is(plan.ChunkSizes);
&& ChunkSizes.Is(plan.ChunkSizes)
&& OpenFOAMSet.Check(plan.OpenFOAMSet);
}

public override SweepPlanData Clone()
{
return new SweepPlanData
{
Options = Options?.Clone(),
ChunkSizes = [.. ChunkSizes]
ChunkSizes = [.. ChunkSizes],
OpenFOAMSet = OpenFOAMSet?.Clone()
};
}

Expand All @@ -51,5 +54,9 @@ public override string ToString()
[MemoryPackOrder(1)]
public List<int> ChunkSizes { get; set; } = [];

/// <summary>The cases of an OpenFOAM case-set study, as submitted; null for every other study.</summary>
[MemoryPackOrder(2)]
public SweepOpenFOAMSetData? OpenFOAMSet { get; set; }

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<PropertyGroup>
<ControllerName>Sweep</ControllerName>
<Version>2.0.0</Version>
<Description>Bundled .wit scripts for the OutWit.Controller.Sweep controller - one chunked parameter-study job per solver family: SweepCalculiX (Ccx.Solve) and SweepOpenFOAM (Foam.Run).</Description>
<Version>2.1.0</Version>
<Description>Bundled .wit scripts for the OutWit.Controller.Sweep controller - one chunked parameter-study job per solver family: SweepCalculiX (Ccx.Solve), SweepOpenFOAM (Foam.Run) and SweepOpenFOAMSet (Foam.Run over a case set, every variant its own case).</Description>
<PackageTags>sweep;parameter-study;scripts;calculix;openfoam;witengine;witcloud;controller</PackageTags>
</PropertyGroup>

Expand Down
Loading
Loading